mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-04-04 21:35:44 +00:00
* add .pre-commit-config.yaml Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> * .editorconfig: decrease indent size for text * .pre-commit-config.yaml: remove prettier Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> * .editorconfig consistency. * .pre-commit-config.yaml: restore sample hooks * .editorconfig: disable indent_size for LICENSE & NOTICE * pre-commit run --all-files * tsconfig.json: tabs to spaces * .pre-commit-config.yaml: update editorconfig-checker to 2.7.2 * .editorconfig: disable indent_size for markdown * mjolnir-entrypoint.sh: retab * .editorconfig: also exclude json from indent checking * test/nginx.conf: retab * test/integration/commands/redactCommandTest.ts: remove leading space * retab or remove leading whitespaces for the rest of the files * src/appservice/datastore.ts remove newlines * test/integration/commands/roomTest.ts: remove leading space. --------- Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info> Co-authored-by: gnuxie <Gnuxie@protonmail.com>
33 lines
1.4 KiB
Nginx Configuration File
33 lines
1.4 KiB
Nginx Configuration File
events {
|
|
|
|
}
|
|
|
|
http {
|
|
server {
|
|
listen [::]:8081 ipv6only=off;
|
|
|
|
location ~ ^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$ {
|
|
# Abuse reports should be sent to Mjölnir.
|
|
# The r0 endpoint is deprecated but still used by many clients.
|
|
# As of this writing, the v3 endpoint is the up-to-date version.
|
|
|
|
# Add CORS, otherwise a browser will refuse this request.
|
|
add_header 'Access-Control-Allow-Origin' '*' always; # Note: '*' is for testing purposes. For your own server, you probably want to tighten this.
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since' always;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
add_header 'Access-Control-Max-Age' 1728000; # cache preflight value for 20 days
|
|
|
|
# Alias the regexps, to ensure that they're not rewritten.
|
|
set $room_id $2;
|
|
set $event_id $3;
|
|
proxy_pass http://127.0.0.1:8082/api/1/report/$room_id/$event_id;
|
|
}
|
|
location / {
|
|
# Everything else should be sent to Synapse.
|
|
proxy_pass http://127.0.0.1:9999;
|
|
}
|
|
}
|
|
}
|