bundles/matrix-synapse: add script to reset the federation timeout
This commit is contained in:
parent
b1b8df7dd8
commit
cc49d34475
3 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from os import environ
|
||||||
|
from sys import argv, exit
|
||||||
|
|
||||||
|
from requests import post
|
||||||
|
|
||||||
|
SYNAPSE_HOST = "http://[::1]:20080/"
|
||||||
|
|
||||||
|
if "MATRIX_AUTH_TOKEN" in environ:
|
||||||
|
SYNAPSE_AUTH_TOKEN = environ["MATRIX_AUTH_TOKEN"]
|
||||||
|
else:
|
||||||
|
print("Usage: MATRIX_AUTH_TOKEN='your_token_here' {}".format(argv[0]))
|
||||||
|
exit(255)
|
||||||
|
|
||||||
|
if len(argv) != 2:
|
||||||
|
print(f"Usage: {argv[0]} <domain>")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
r = post(
|
||||||
|
SYNAPSE_HOST
|
||||||
|
+ "_synapse/admin/v1/federation/destinations/{}/reset_connection".format(argv[1]),
|
||||||
|
headers={
|
||||||
|
"Authorization": "Bearer {}".format(SYNAPSE_AUTH_TOKEN),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
r.raise_for_status()
|
||||||
|
print(r.json())
|
|
@ -12,6 +12,9 @@ files = {
|
||||||
'/etc/matrix-synapse/scripts/synapse-purge-unused-rooms': {
|
'/etc/matrix-synapse/scripts/synapse-purge-unused-rooms': {
|
||||||
'mode': '0755',
|
'mode': '0755',
|
||||||
},
|
},
|
||||||
|
'/etc/matrix-synapse/scripts/synapse-reset-federation-timeout': {
|
||||||
|
'mode': '0755',
|
||||||
|
},
|
||||||
'/etc/systemd/system/matrix-synapse.service.d/override.conf': {
|
'/etc/systemd/system/matrix-synapse.service.d/override.conf': {
|
||||||
'needs': {
|
'needs': {
|
||||||
'pkg_apt:matrix-synapse-py3',
|
'pkg_apt:matrix-synapse-py3',
|
||||||
|
|
|
@ -119,6 +119,7 @@ def nginx(metadata):
|
||||||
locations = {
|
locations = {
|
||||||
'/_matrix': {
|
'/_matrix': {
|
||||||
'target': 'http://[::1]:20080',
|
'target': 'http://[::1]:20080',
|
||||||
|
'max_body_size': '50M',
|
||||||
},
|
},
|
||||||
'/_synapse': {
|
'/_synapse': {
|
||||||
'target': 'http://[::1]:20080',
|
'target': 'http://[::1]:20080',
|
||||||
|
|
Loading…
Reference in a new issue