Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
43b89a05
Verified
Commit
43b89a05
authored
Nov 18, 2021
by
Jan Alexander Steffens (heftig)
Browse files
matrix: Route event reports to mjolnir
parent
be5399db
Pipeline
#13182
passed with stage
in 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/matrix/defaults/main.yml
View file @
43b89a05
...
...
@@ -2,6 +2,12 @@
matrix_max_upload_size
:
50M
matrix_nginx_config
:
-
name
:
mjolnir
port
:
8010
locations
:
-
path
:
"
~
^/_matrix/client/r0/rooms/([^/]*)/report/(.*)$"
pass
:
"
/api/1/report/$1/$2"
add_cors
:
true
-
name
:
federation_reader
port
:
8011
locations
:
...
...
roles/matrix/templates/mjolnir.yaml.j2
View file @
43b89a05
...
...
@@ -167,7 +167,7 @@ health:
# Options for exposing web APIs.
web
:
# Whether to enable web APIs.
enabled
:
fals
e
enabled
:
tru
e
# The port to expose the webserver on. Defaults to 8080.
port
:
8010
...
...
roles/matrix/templates/nginx.d.conf.j2
View file @
43b89a05
...
...
@@ -37,10 +37,18 @@ server {
{% for config in matrix_nginx_config %}
# {{ config.name }}
{% for location in config.locations %}
location {{ location }} {
{% if location is string %}
{% set location = { 'path': location } %}
{% endif %}
location {{ location.path }} {
access_log /var/log/nginx/{{ matrix_domain }}/access.log main;
access_log /var/log/nginx/{{ matrix_domain }}/access.log.json json_main;
proxy_pass http://matrix_{{ config.name }};
{% if location.add_cors | default(false) %}
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, HEAD, POST, PUT, DELETE, OPTIONS";
add_header Access-Control-Allow-Headers "X-Requested-With, Content-Type, Authorization, Date";
{% endif %}
proxy_pass http://matrix_{{ config.name }}{{ location.pass | default('') }};
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment