From 6199051aefe3384501a5acde6ca24877ca7256e0 Mon Sep 17 00:00:00 2001 From: Tine Jozelj Date: Mon, 1 Jan 2024 23:53:34 +0100 Subject: [PATCH] feat: more well known and nginx config --- Dockerfile | 2 ++ nginx.conf | 22 ++++++++++++++++++++++ static/.well-known/matrix/client | 6 ++++++ static/.well-known/matrix/server | 2 +- static/.well-known/matrix/support | 10 ++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 nginx.conf create mode 100644 static/.well-known/matrix/client create mode 100644 static/.well-known/matrix/support diff --git a/Dockerfile b/Dockerfile index 3f7ac48..5ecd55d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ RUN npm run build FROM nginx:stable as production WORKDIR /home/node/app +# Copy nginx config +COPY --chown=nobody:nogroup nginx.conf /etc/nginx/conf.d/default.conf # Copy what we've installed/built from production COPY --chown=nobody:nogroup --from=build /home/node/app/build /usr/share/nginx/html/ diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..843b472 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,22 @@ +server { + listen 80 default_server; + server_name _; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /.well-known { + root /usr/share/nginx/html/.well-known; + default_type application/json; + add_header Access-Control-Allow-Origin *; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/static/.well-known/matrix/client b/static/.well-known/matrix/client new file mode 100644 index 0000000..04e62e6 --- /dev/null +++ b/static/.well-known/matrix/client @@ -0,0 +1,6 @@ +{ + "m.homeserver": { + "base_url": "https://chat.tjo.space" + } +} + diff --git a/static/.well-known/matrix/server b/static/.well-known/matrix/server index 9331c78..d3e11f6 100644 --- a/static/.well-known/matrix/server +++ b/static/.well-known/matrix/server @@ -1,3 +1,3 @@ { - "m.server": "matrix.tjo.space:443" + "m.server": "matrix.chat.tjo.space:443" } diff --git a/static/.well-known/matrix/support b/static/.well-known/matrix/support new file mode 100644 index 0000000..3e91187 --- /dev/null +++ b/static/.well-known/matrix/support @@ -0,0 +1,10 @@ +{ + "contacts": [ + { + "matrix_id": "@tine:tjo.space", + "email_address": "tine@tjo.space", + "role": "m.role.admin" + }, + ], + "support_page": "https://tjo.space" +}