diff --git a/bundles/matrix-synapse/metadata.py b/bundles/matrix-synapse/metadata.py index 33ff576..20a6e04 100644 --- a/bundles/matrix-synapse/metadata.py +++ b/bundles/matrix-synapse/metadata.py @@ -67,19 +67,13 @@ defaults = { @metadata_reactor.provides( - 'nginx/vhosts/matrix-synapse', + 'nginx/vhosts', ) def nginx(metadata): if not node.has_bundle('nginx'): raise DoNotRunAgain - locations = { - '/_matrix': { - 'target': 'http://[::1]:20080', - }, - '/_synapse': { - 'target': 'http://[::1]:20080', - }, + wellknown = { '/.well-known/matrix/client': { 'return': dumps({ 'm.homeserver': { @@ -106,6 +100,16 @@ def nginx(metadata): }, } + locations = { + '/_matrix': { + 'target': 'http://[::1]:20080', + }, + '/_synapse': { + 'target': 'http://[::1]:20080', + }, + **wellknown, + } + if node.has_bundle('matrix-media-repo'): locations['/_matrix/media'] = { 'target': 'http://localhost:20090', @@ -115,15 +119,22 @@ def nginx(metadata): 'x_forwarded_host': metadata.get('matrix-synapse/server_name'), } - return { - 'nginx': { - 'vhosts': { - 'matrix-synapse': { - 'domain': metadata.get('matrix-synapse/baseurl'), - 'locations': locations, - 'website_check_path': '/_matrix/static/', - 'website_check_string': 'Synapse is running', - }, - }, + vhosts = { + 'matrix-synapse': { + 'domain': metadata.get('matrix-synapse/baseurl'), + 'locations': locations, + 'website_check_path': '/_matrix/static/', + 'website_check_string': 'Synapse is running', + }, + } + + for vname in metadata.get('matrix-synapse/wellknown_also_on_vhosts', set()): + vhosts[vname] = { + 'locations': wellknown, + } + + return { + 'nginx': { + 'vhosts': vhosts }, } diff --git a/nodes/rx300.py b/nodes/rx300.py index e4b9a99..41cb635 100644 --- a/nodes/rx300.py +++ b/nodes/rx300.py @@ -104,7 +104,7 @@ nodes['rx300'] = { }, }, 'cron': { - 'cleanup-paste.franzi.business': '0 0 * * * kunsi /usr/bin/find /var/www/paste.franzi.business/ -maxdepth 1 -type d -mtime +60 -exec rm -r {} \;', + 'cleanup-paste.franzi.business': '0 0 * * * kunsi /usr/bin/find /var/www/paste.franzi.business/ -maxdepth 1 -type d -mtime +60 -exec rm -r {} \;', }, 'check-mail-received': { 't-online': { @@ -224,6 +224,9 @@ nodes['rx300'] = { 'preferredDomain': 'meet.ffmuc.net', }, }, + 'wellknown_also_on_vhosts': { + 'franzi.business', + }, }, 'mautrix-telegram': { 'version': 'v0.10.0', @@ -306,34 +309,6 @@ nodes['rx300'] = { 'franzi.business': { 'webroot': '/var/www/franzi.business/_site/', 'ssl': '_.franzi.business', - 'locations': { - '/.well-known/matrix/client': { - 'return': json_dumps({ - 'm.homeserver': { - 'base_url': 'https://matrix.franzi.business', - }, - 'm.identity_server': { - 'base_url': 'https://matrix.org', - }, - 'im.vector.riot.jitsi': { - 'preferredDomain': 'meet.ffmuc.net', - }, - }, sort_keys=True), - 'additional_config': { - 'default_type application/json', - 'add_header Access-Control-Allow-Origin *', - }, - }, - '/.well-known/matrix/server': { - 'return': json_dumps({ - 'm.server': 'matrix.franzi.business:443', - }, sort_keys=True), - 'additional_config': { - 'default_type application/json', - 'add_header Access-Control-Allow-Origin *', - }, - }, - }, }, 'kunbox.net': {}, 'kunsmann.eu': {