Whoa boy rust is a problem child
This commit is contained in:
19
testdata/matrix-sandbox/build.sh
vendored
19
testdata/matrix-sandbox/build.sh
vendored
@@ -1,7 +1,10 @@
|
||||
#! /bin/bash
|
||||
|
||||
if ! ps aux | grep -v grep | grep homeserver; then
|
||||
homeserver -c config.yaml &
|
||||
cp synapse-test.key /tmp/
|
||||
cp synapse-test-log.yaml /tmp/
|
||||
homeserver -c config.yaml &> /tmp/synapse-test.log &
|
||||
disown
|
||||
fi
|
||||
|
||||
# pick a username
|
||||
@@ -9,7 +12,7 @@ username="$(cat /proc/sys/kernel/random/uuid)"
|
||||
|
||||
# register
|
||||
out="$(
|
||||
curl -sS http://192.168.0.86:39487/_matrix/client/r0/register \
|
||||
curl -sS http://localhost:39487/_matrix/client/r0/register \
|
||||
-X POST \
|
||||
-H 'content-type: application/json' \
|
||||
-d "$(
|
||||
@@ -31,7 +34,7 @@ home_server="$(echo "$out" | jq -r .home_server)"
|
||||
room="$(cat /proc/sys/kernel/random/uuid)"
|
||||
|
||||
out="$(
|
||||
curl -sS http://192.168.0.86:39487/_matrix/client/r0/createRoom\
|
||||
curl -sS http://localhost:39487/_matrix/client/r0/createRoom\
|
||||
-X POST \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
@@ -46,7 +49,7 @@ room_id="$(echo "$out" | jq -r .room_id)"
|
||||
|
||||
# join a room by name
|
||||
# curl -XPOST -d '{}' "https://localhost:8448/_matrix/client/r0/join/%21asfLdzLnOdGRkdPZWu:localhost?access_token=YOUR_ACCESS_TOKEN"
|
||||
curl -sS "http://192.168.0.86:39487/_matrix/client/r0/join/$room_id" \
|
||||
curl -sS "http://localhost:39487/_matrix/client/r0/join/$room_id" \
|
||||
-X POST \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
-d '{}'
|
||||
@@ -58,7 +61,7 @@ txid="$(cat /proc/sys/kernel/random/uuid)"
|
||||
message="hello wurl"
|
||||
|
||||
out="$(
|
||||
curl -sS "http://192.168.0.86:39487/_matrix/client/r0/rooms/$room_id/send/m.room.message/$txid" \
|
||||
curl -sS "http://localhost:39487/_matrix/client/r0/rooms/$room_id/send/m.room.message/$txid" \
|
||||
-X PUT \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
@@ -74,7 +77,7 @@ printf "%s\n" "$out"
|
||||
# get recent messages
|
||||
# curl --globoff -XGET 'https://localhost:8448/_matrix/client/r0/sync?filter={"room":{"timeline":{"limit":1}}}&access_token=YOUR_ACCESS_TOKEN'
|
||||
out="$(
|
||||
curl -sS "http://192.168.0.86:39487/_matrix/client/r0/sync" \
|
||||
curl -sS "http://localhost:39487/_matrix/client/r0/sync" \
|
||||
-X GET \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
@@ -89,7 +92,7 @@ txid="$(cat /proc/sys/kernel/random/uuid)"
|
||||
message="hello wurl2"
|
||||
|
||||
out="$(
|
||||
curl -sS "http://192.168.0.86:39487/_matrix/client/r0/rooms/$room_id/send/m.room.message/$txid" \
|
||||
curl -sS "http://localhost:39487/_matrix/client/r0/rooms/$room_id/send/m.room.message/$txid" \
|
||||
-X PUT \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
@@ -104,7 +107,7 @@ printf "%s\n" "$out"
|
||||
|
||||
# get second recent messages
|
||||
# curl --globoff -XGET 'https://localhost:8448/_matrix/client/r0/sync?filter={"room":{"timeline":{"limit":1}}}&access_token=YOUR_ACCESS_TOKEN'
|
||||
curl -sS "http://192.168.0.86:39487/_matrix/client/r0/sync?since=$since" \
|
||||
curl -sS "http://localhost:39487/_matrix/client/r0/sync?since=$since" \
|
||||
-X GET \
|
||||
-H 'content-type: application/json' \
|
||||
-H 'Authorization: Bearer '"$access_token" \
|
||||
|
||||
43
testdata/matrix-sandbox/synapse-test-log.yaml
vendored
Normal file
43
testdata/matrix-sandbox/synapse-test-log.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# Log configuration for Synapse.
|
||||
#
|
||||
# This is a YAML file containing a standard Python logging configuration
|
||||
# dictionary. See [1] for details on the valid settings.
|
||||
#
|
||||
# [1]: https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
|
||||
|
||||
version: 1
|
||||
|
||||
formatters:
|
||||
precise:
|
||||
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
|
||||
|
||||
filters:
|
||||
context:
|
||||
(): synapse.logging.context.LoggingContextFilter
|
||||
request: ""
|
||||
|
||||
handlers:
|
||||
file:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
formatter: precise
|
||||
filename: /home/bel/Go/src/local/containers/secret-hitler-via-matrix/testdata/matrix-sandbox/homeserver.log
|
||||
maxBytes: 104857600
|
||||
backupCount: 10
|
||||
filters: [context]
|
||||
encoding: utf8
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
formatter: precise
|
||||
filters: [context]
|
||||
|
||||
loggers:
|
||||
synapse.storage.SQL:
|
||||
# beware: increasing this to DEBUG will make synapse log sensitive
|
||||
# information such as access tokens.
|
||||
level: INFO
|
||||
|
||||
root:
|
||||
level: INFO
|
||||
handlers: [file, console]
|
||||
|
||||
disable_existing_loggers: false
|
||||
1
testdata/matrix-sandbox/synapse-test.key
vendored
Normal file
1
testdata/matrix-sandbox/synapse-test.key
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ed25519 a_RcOc CohEFmFuSDY+kHBbY//SMIUZp+hIuyOMEphT2NLEsDc
|
||||
Reference in New Issue
Block a user