This commit is contained in:
admin
2025-12-22 08:24:52 +01:00
parent 4b6f071349
commit d623200d5d
50 changed files with 3941 additions and 147 deletions

View File

@@ -70,3 +70,59 @@ nc -zv coturn-lp.allarddcs.nl 5349
#checken certificaat:
kubectl describe secret coturn-cert -n matrix
#HOOKSHOT
#passkey genereren en in secret zetten. Passkey wordt gebruikt om andere sleutels versleuteld op te slaan.
openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096
kubectl -n matrix create secret generic hookshot-passkey --from-file=passkey.pem
#opvragen access token:
curl -X POST "https://matrix-lp.allarddcs.nl/_matrix/client/v3/login" -H "Content-Type: application/json" -d '{
"type": "m.login.password",
"user": "admin",
"password": "Matrix01@"
}'
syt_YWRtaW4_laSGClQJFMQNKKjqyfVj_1XLp4x
#room aanmaken:
curl -k -X POST \
-H "Authorization: Bearer syt_YWRtaW4_bUqQKyFkonSgjkghnuxY_4IsleV" \
-H "Content-Type: application/json" \
-d '{"name":"harbor","preset":"private_chat"}' \
"https://matrix-lp.allarddcs.nl/_matrix/client/v3/createRoom"
{"room_id":"!AmeLKsUWrKBIkosFbY:matrix-lp.allarddcs.nl"}
#toevoegen hookshot bot aan room:
curl -X POST \
-H "Authorization: Bearer syt_YWRtaW4_bUqQKyFkonSgjkghnuxY_4IsleV" \
-H "Content-Type: application/json" \
"https://matrix-lp.allarddcs.nl/_synapse/admin/v1/join/AmeLKsUWrKBIkosFbY:matrix-lp.allarddcs.nl" \
-d '{
"user_id": "@hookshot:matrix-lp.allarddcs.nl"
}'
Opmerking: doordat de bot is toegevoegd wordt de status van de room veranderd in: gemanaged door de appservice.
Daardoor kun je de room niet publiceren en ook geen leden uitnodigen.
#toevoegen allardhook aan room:
curl -k -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://matrix-lp.allarddcs.nl/_synapse/admin/v1/join/!BPcyrRUfYdBJrFVdlV:matrix-lp.allarddcs.nl" \
-d '{
"user_id": "@allard:matrix-lp.allarddcs.nl"
}'
#herstarten hookshot
#transformationFunction in state-event schrijven:
curl -k -X PUT -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" "https://matrix-lp.allarddcs.nl/_matrix/client/r0/rooms/!BPcyrRUfYdBJrFVdlV:matrix-lp.allarddcs.nl/state/uk.half-shot.matrix-hookshot.generic.hook/generic-1" -d @harbor-webhook.json