From 8e024579e9ba7eff476612cab0519aedaa855aa2 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 15 Aug 2021 14:00:27 -0500 Subject: [PATCH] Move .well-known to files, and add /.well-known/matrix/support --- Caddyfile | 14 ++++---------- matrix_well_known/client.json | 5 +++++ matrix_well_known/server.json | 3 +++ matrix_well_known/support.json | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 matrix_well_known/client.json create mode 100644 matrix_well_known/server.json create mode 100644 matrix_well_known/support.json diff --git a/Caddyfile b/Caddyfile index b0773fc..60ed10b 100644 --- a/Caddyfile +++ b/Caddyfile @@ -24,20 +24,14 @@ } (matrix-well-known) { - handle /.well-known/matrix/* { + handle_path /.well-known/matrix/* { header Access-Control-Allow-Origin "*" header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization" - header Content-Type "application/json" - respond /.well-known/matrix/client 200 { - body `{"m.homeserver": {"base_url": "https://matrix.boba.best"}}` - close - } - respond /.well-known/matrix/server 200 { - body `{"m.server": "matrix.boba.best:443"}` - close - } + rewrite * {path}.json + root * /etc/caddy/matrix_well_known + file_server } } diff --git a/matrix_well_known/client.json b/matrix_well_known/client.json new file mode 100644 index 0000000..9a98e60 --- /dev/null +++ b/matrix_well_known/client.json @@ -0,0 +1,5 @@ +{ + "m.homeserver": { + "base_url": "https://matrix.boba.best" + } +} diff --git a/matrix_well_known/server.json b/matrix_well_known/server.json new file mode 100644 index 0000000..db99e31 --- /dev/null +++ b/matrix_well_known/server.json @@ -0,0 +1,3 @@ +{ + "m.server": "matrix.boba.best:443" +} diff --git a/matrix_well_known/support.json b/matrix_well_known/support.json new file mode 100644 index 0000000..e472c36 --- /dev/null +++ b/matrix_well_known/support.json @@ -0,0 +1,14 @@ +{ + "admins": [ + { + "matrix_id": "@bbaovanc:boba.best", + "email_address": "abuse@boba.best", + "role": "admin" + }, + { + "matrix_id": "@bbaovanc:matrix.org", + "role": "backup" + } + ], + "support_page": "https://matrix.to/#/#support:boba.best" +}