Fixes and nginx config update

- The Android app can connect, although not directly with QR
This commit is contained in:
Norbi Peti 2024-06-11 01:51:59 +02:00
parent 28d41d79c4
commit bf4580154e
4 changed files with 100 additions and 33 deletions

View file

@ -1,14 +1,87 @@
# snikket-web-proxy/nginx/snikket-common.template
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
try_files $uri /static/$uri @portal;
}
client_max_body_size 1M; # default is 1M
location /admin_api {
try_files none @prosody;
}
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
send_timeout 10m;
location /invites_api {
try_files none @prosody;
}
proxy_pass http://127.0.0.1:__PORT__;
}
location /invites_bootstrap {
try_files none @prosody;
}
location /share {
alias /usr/share/javascript;
}
location /upload {
client_max_body_size 104857616; # 100MB + 16 bytes (see Prosody config)
proxy_request_buffering off;
proxy_http_version 1.1;
try_files none @prosody;
}
location /http-bind {
try_files none @prosodyws;
}
location /xmpp-websocket {
try_files none @prosodyws;
}
location = /.well-known/host-meta {
try_files none @prosody;
}
location = /.well-known/host-meta.json {
try_files none @prosody;
}
location @portal {
proxy_pass http://localhost:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location @prosody {
proxy_pass http://localhost:__PORT_HTTP__;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location @prosodyws {
proxy_pass http://localhost:__PORT_HTTP__;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_read_timeout 900s;
}
location /_health/portal {
proxy_pass http://localhost:__PORT__/_health;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location /_health/xmpp {
proxy_pass http://localhost:__PORT_HTTP__/host_status_check;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
error_page 502 /_errors/502.html;
error_page 503 /_errors/503.html;
error_page 504 /_errors/504.html;

View file

@ -1,14 +1,5 @@
location / { # TODO
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
root /var/www/snikket/snikket_web;
client_max_body_size 1M; # default is 1M
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
send_timeout 10m;
proxy_pass http://127.0.0.1:__PORT__;
location / {
return 301 https://__DOMAIN__/;
}

View file

@ -1,14 +1,15 @@
location / { # TODO
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
root /var/www/snikket/snikket_web;
client_max_body_size 1M; # default is 1M
location / {
return 301 https://__DOMAIN__/;
}
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
send_timeout 10m;
proxy_pass http://127.0.0.1:__PORT__;
location /upload/ {
client_max_body_size 104857616; # 100MB + 16 bytes (see Prosody config)
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_pass http://localhost:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}

View file

@ -112,8 +112,10 @@ pushd "$install_dir/snikket_web"
python -m venv .venv
cp -r "$portaldir"/usr/lib/python3/dist-packages/* .venv/lib/python*/site-packages/
cp -r "$portaldir"/usr/local/lib/python3.11/dist-packages/* .venv/lib/python*/site-packages/
.venv/bin/pip3 install --force babel # TODO: This is not ideal
popd
# TODO: Install the create-invite script (with env setting)
#=================================================
# CLEAN TEMPORARY FILES
#=================================================