Files
Draupnir/test/nginx.conf
Gnuxie fa5ce9ad9c Fix report poller (#662)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/258
Fixes https://github.com/the-draupnir-project/Draupnir/issues/408
Fixes https://github.com/the-draupnir-project/Draupnir/issues/409

* Create a way to only forward reports in WebAPIs.

Honestly, I'm going to revert this because I think I have found a
better way of testing the report poller.

* Begin improving and fixing the report poller.

We need to change the ReportManager so that we can interface it out
for testing. The reason being that the report poller is inactive
in the harness and so we can't use that with a protection handle
to test. Instead I want to instantiate a report poller with
a mocked report manager.

* Update integration test nginx to mirror reports to synapse.

We need this so that we can test the report poller without needing to
do gymnastics to selectively forward reports.

* Interface out ReportManager.

Needed so we can test the report poller without doing gymnastics with
setting up fake protections.

* Fix report poller from paginating over the same reports.

https://github.com/the-draupnir-project/planning/issues/38.

* Revert "Create a way to only forward reports in WebAPIs."

This reverts commit 59b335f658.
We don't need this anymore.

* Update for MPS v2.4.0

Gives us the synapse admin client, updates schema, and gives us the fix for https://github.com/the-draupnir-project/Draupnir/issues/560
2025-01-10 17:06:54 +00:00

42 lines
1.6 KiB
Nginx Configuration File

# SPDX-FileCopyrightText: 2024 Gnuxie <Gnuxie@protonmail.com>
#
# SPDX-License-Identifier: CC0-1.0
events {
}
http {
server {
listen [::]:8081 ipv6only=off;
location ~ ^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$ {
mirror /report_mirror;
# 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;
}
location /report_mirror {
internal;
proxy_pass http://127.0.0.1:9999$request_uri;
}
}
}