Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b39c60d594 | ||
|
|
4830b0596c | ||
|
|
43d68aefb4 | ||
|
|
91efd92d31 | ||
|
|
3fab725957 | ||
|
|
8a7978b388
|
||
|
|
d0d5cfb1bc | ||
|
|
3d13505330
|
||
|
|
68fd515297 | ||
|
|
01e3feb1cf
|
||
|
|
c51120c41a
|
||
|
|
b81fecdd23
|
||
|
|
18b658c452 | ||
|
|
553fee0e9d | ||
|
|
61f357b49e | ||
|
|
0e55594727 | ||
|
|
460f5a969c | ||
|
|
8640abbe79
|
||
|
|
3e0c9063c4 | ||
|
|
db6440b317 | ||
|
|
24f7e0cb35 | ||
|
|
6d1397562b | ||
|
|
e0c0861c16 | ||
|
|
41fdcafaa0 | ||
|
|
730dbc4569 | ||
|
|
809055dadb | ||
|
|
7703bbbce7 | ||
|
|
e3df032bda | ||
|
|
0cf9d0a244 | ||
|
|
86a44afd19 |
@@ -199,6 +199,14 @@ RETENTION_MAX_LIFETIME=4w
|
||||
#WEB_CLIENT_LOCATION=https://element-web.example.com
|
||||
|
||||
|
||||
## State compression (reduces database bloat from federation)
|
||||
## Runs synapse_auto_compressor daily, built from source on first start
|
||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.compress-state.yml"
|
||||
# See https://github.com/matrix-org/rust-synapse-compress-state#running-options
|
||||
#STATE_COMPRESS_CHUNK_SIZE=500
|
||||
#STATE_COMPRESS_CHUNKS=100
|
||||
#STATE_COMPRESS_SCHEDULE=0 3 * * *
|
||||
|
||||
## Admin interface at /admin
|
||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.admin.yml"
|
||||
#ADMIN_INTERFACE_ENABLED=1
|
||||
|
||||
@@ -52,6 +52,9 @@ For all Bridges:
|
||||
- include the registration in synapse, e.g. `APP_SERVICE_CONFIGS="[\"/telegram-data/registration.yaml\"]"`
|
||||
- and set yourself as admin, e.g.: `TELEGRAM_BRIDGE_PERMISSIONS="{ \"*\": \"relaybot\", \"@akadmin:example.com\": \"admin\"}"`
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The shared secret authenticator may break when matrix-synapse uses a newer python version with an error stating something like "module not found". You have to fix the path in the compose.shared_secret_auth.yml like [here](https://git.coopcloud.tech/coop-cloud/matrix-synapse/commit/3d1350533079ce1ad3bea92039fe003684589b95)
|
||||
|
||||
### Telegram bridging
|
||||
|
||||
You need to get your bot setup on the telegram side first by creating a [telegram app](https://my.telegram.org/apps) and a [telegram bot](https://docs.mau.fi/bridges/python/telegram/relay-bot.html#setup) and have these values:
|
||||
|
||||
@@ -1,15 +1,188 @@
|
||||
export DISCORD_BRIDGE_YAML_VERSION=v2
|
||||
export ENTRYPOINT_CONF_VERSION=v3
|
||||
export HOMESERVER_YAML_VERSION=v32
|
||||
export HOMESERVER_YAML_VERSION=v35
|
||||
export LOG_CONFIG_VERSION=v2
|
||||
export SHARED_SECRET_AUTH_VERSION=v2
|
||||
export SIGNAL_BRIDGE_YAML_VERSION=v6
|
||||
export TELEGRAM_BRIDGE_YAML_VERSION=v6
|
||||
export NGINX_CONFIG_VERSION=v8
|
||||
export NGINX_CONFIG_VERSION=v12
|
||||
export WK_SERVER_VERSION=v1
|
||||
export WK_CLIENT_VERSION=v1
|
||||
export PG_BACKUP_VERSION=v1
|
||||
export PG_BACKUP_VERSION=v2
|
||||
export ADMIN_CONFIG_VERSION=v1
|
||||
export COMPRESS_STATE_ENTRYPOINT_VERSION=v5
|
||||
|
||||
# See https://levans.fr/shrink-synapse-database.html
|
||||
db_size() {
|
||||
echo "=== Database size ==="
|
||||
psql -U synapse -d synapse -c "SELECT pg_size_pretty(pg_database_size('synapse')) AS db_size;"
|
||||
echo ""
|
||||
echo "=== Top 10 largest tables ==="
|
||||
psql -U synapse -d synapse -c "
|
||||
SELECT nspname || '.' || relname AS table,
|
||||
pg_size_pretty(pg_total_relation_size(C.oid)) AS total_size
|
||||
FROM pg_class C
|
||||
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
||||
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
|
||||
ORDER BY pg_total_relation_size(C.oid) DESC
|
||||
LIMIT 10;"
|
||||
}
|
||||
|
||||
state_bloat() {
|
||||
echo "=== Rooms with most state bloat ==="
|
||||
psql -U synapse -d synapse -c "
|
||||
SELECT room_id, count(*) AS state_entries
|
||||
FROM state_groups_state
|
||||
GROUP BY room_id
|
||||
ORDER BY state_entries DESC
|
||||
LIMIT 20;"
|
||||
}
|
||||
|
||||
empty_rooms() {
|
||||
echo "=== Rooms with no local members ==="
|
||||
psql -U synapse -d synapse -c "
|
||||
SELECT room_id, room_version
|
||||
FROM rooms
|
||||
WHERE room_id NOT IN (
|
||||
SELECT room_id FROM local_current_membership WHERE membership = 'join'
|
||||
);"
|
||||
}
|
||||
|
||||
reindex() {
|
||||
echo "WARNING: REINDEX locks tables. Synapse should be stopped before running this."
|
||||
echo "Running REINDEX on synapse database..."
|
||||
psql -U synapse -d synapse -c "REINDEX (VERBOSE) DATABASE synapse;"
|
||||
echo "REINDEX complete."
|
||||
psql -U synapse -d synapse -c "SELECT pg_size_pretty(pg_database_size('synapse')) AS db_size;"
|
||||
}
|
||||
|
||||
# Run via: abra app cmd <domain> compress-state run_compressor
|
||||
run_compressor() {
|
||||
CHUNK_SIZE="${1:-${STATE_COMPRESS_CHUNK_SIZE:-500}}"
|
||||
CHUNKS="${2:-${STATE_COMPRESS_CHUNKS:-100}}"
|
||||
DB_PASS=$(cat /run/secrets/db_password)
|
||||
echo "Running synapse_auto_compressor (chunk_size=$CHUNK_SIZE, chunks=$CHUNKS)..."
|
||||
/build/synapse_auto_compressor \
|
||||
-p "postgresql://synapse:${DB_PASS}@db:5432/synapse" \
|
||||
-c "$CHUNK_SIZE" -n "$CHUNKS"
|
||||
}
|
||||
|
||||
vacuum_full() {
|
||||
echo "WARNING: VACUUM FULL locks tables and requires temporary disk space."
|
||||
echo "Synapse should be stopped before running this."
|
||||
echo "Running VACUUM FULL on synapse database..."
|
||||
psql -U synapse -d synapse -c "VACUUM FULL;"
|
||||
echo "VACUUM FULL complete."
|
||||
psql -U synapse -d synapse -c "SELECT pg_size_pretty(pg_database_size('synapse')) AS db_size;"
|
||||
}
|
||||
|
||||
# Purge commands — run via: abra app cmd <domain> app <command>
|
||||
# These use the Synapse admin API and require an admin access token.
|
||||
|
||||
register_admin() {
|
||||
USER="${1}"
|
||||
PASS="${2}"
|
||||
if [ -z "$USER" ] || [ -z "$PASS" ]; then
|
||||
echo "Usage: register_admin <username> <password>"
|
||||
return 1
|
||||
fi
|
||||
register_new_matrix_user -u "$USER" -p "$PASS" -a -c /data/homeserver.yaml http://localhost:8008
|
||||
}
|
||||
|
||||
get_token() {
|
||||
USER="${1}"
|
||||
PASS="${2}"
|
||||
if [ -z "$USER" ] || [ -z "$PASS" ]; then
|
||||
echo "Usage: get_token <username> <password>"
|
||||
echo "Returns an admin access token for use with purge commands."
|
||||
return 1
|
||||
fi
|
||||
curl -s -X POST "http://localhost:8008/_matrix/client/r0/login" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"type\":\"m.login.password\",\"user\":\"$USER\",\"password\":\"$PASS\"}" \
|
||||
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('access_token', d.get('error', 'unknown error')))"
|
||||
}
|
||||
|
||||
purge_remote_media() {
|
||||
DAYS="${1:-30}"
|
||||
TOKEN="${2}"
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "Usage: purge_remote_media <days> <admin_token>"
|
||||
return 1
|
||||
fi
|
||||
BEFORE_TS=$(( $(date +%s) * 1000 - DAYS * 86400000 ))
|
||||
echo "Purging remote media older than $DAYS days..."
|
||||
curl -s -X POST "http://localhost:8008/_synapse/admin/v1/purge_media_cache?before_ts=$BEFORE_TS" \
|
||||
-H "Authorization: Bearer $TOKEN"
|
||||
echo ""
|
||||
}
|
||||
|
||||
purge_room() {
|
||||
ROOM_ID="${1}"
|
||||
TOKEN="${2}"
|
||||
if [ -z "$ROOM_ID" ] || [ -z "$TOKEN" ]; then
|
||||
echo "Usage: purge_room <room_id> <admin_token>"
|
||||
return 1
|
||||
fi
|
||||
echo "Purging room $ROOM_ID..."
|
||||
curl -s -X DELETE "http://localhost:8008/_synapse/admin/v1/rooms/$ROOM_ID" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"purge": true}'
|
||||
echo ""
|
||||
}
|
||||
|
||||
purge_history() {
|
||||
ROOM_ID="${1}"
|
||||
DAYS="${2:-90}"
|
||||
TOKEN="${3}"
|
||||
if [ -z "$ROOM_ID" ] || [ -z "$TOKEN" ]; then
|
||||
echo "Usage: purge_history <room_id> <days> <admin_token>"
|
||||
return 1
|
||||
fi
|
||||
BEFORE_TS=$(( $(date +%s) * 1000 - DAYS * 86400000 ))
|
||||
echo "Purging history older than $DAYS days from $ROOM_ID..."
|
||||
curl -s -X POST "http://localhost:8008/_synapse/admin/v1/purge_history/$ROOM_ID" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"purge_up_to_ts\": $BEFORE_TS}"
|
||||
echo ""
|
||||
}
|
||||
|
||||
purge_empty_rooms() {
|
||||
TOKEN="${1}"
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "Usage: purge_empty_rooms <admin_token>"
|
||||
return 1
|
||||
fi
|
||||
echo "Fetching rooms with no local members..."
|
||||
ROOMS=$(curl -s "http://localhost:8008/_synapse/admin/v1/rooms?limit=1000" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
| python3 -c "
|
||||
import sys, json
|
||||
data = json.load(sys.stdin)
|
||||
for r in data.get('rooms', []):
|
||||
if r.get('joined_local_members', 0) == 0:
|
||||
print(r['room_id'])
|
||||
")
|
||||
COUNT=$(echo "$ROOMS" | grep -c '.' || true)
|
||||
echo "Found $COUNT empty rooms."
|
||||
if [ "$COUNT" -eq 0 ]; then
|
||||
echo "Nothing to purge."
|
||||
return 0
|
||||
fi
|
||||
echo "$ROOMS"
|
||||
echo ""
|
||||
echo "Purging..."
|
||||
for ROOM_ID in $ROOMS; do
|
||||
echo " Purging $ROOM_ID"
|
||||
curl -s -X DELETE "http://localhost:8008/_synapse/admin/v1/rooms/$ROOM_ID" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"purge": true}' > /dev/null
|
||||
done
|
||||
echo "Done."
|
||||
}
|
||||
|
||||
set_admin () {
|
||||
admin=akadmin
|
||||
|
||||
+2
-2
@@ -3,13 +3,13 @@ version: "3.8"
|
||||
|
||||
services:
|
||||
admin:
|
||||
image: awesometechnologies/synapse-admin:0.11.1
|
||||
image: awesometechnologies/synapse-admin:0.11.4
|
||||
networks:
|
||||
- proxy
|
||||
deploy:
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=proxy"
|
||||
- "traefik.swarm.network=proxy"
|
||||
- "traefik.http.services.${STACK_NAME}_admin.loadbalancer.server.port=80"
|
||||
- "traefik.http.routers.${STACK_NAME}_admin.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})&&PathPrefix(`/admin`)"
|
||||
- "traefik.http.routers.${STACK_NAME}_admin.entrypoints=web-secure"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
compress-state:
|
||||
image: rust:1-alpine
|
||||
entrypoint: /compress_state_entrypoint.sh
|
||||
environment:
|
||||
- STATE_COMPRESS_CHUNK_SIZE=${STATE_COMPRESS_CHUNK_SIZE:-500}
|
||||
- STATE_COMPRESS_CHUNKS=${STATE_COMPRESS_CHUNKS:-100}
|
||||
- STATE_COMPRESS_SCHEDULE=${STATE_COMPRESS_SCHEDULE:-0 3 * * *}
|
||||
secrets:
|
||||
- db_password
|
||||
configs:
|
||||
- source: compress_entrypoint
|
||||
target: /compress_state_entrypoint.sh
|
||||
mode: 0555
|
||||
volumes:
|
||||
- compress_state_build:/build
|
||||
networks:
|
||||
- internal
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
||||
volumes:
|
||||
compress_state_build:
|
||||
|
||||
configs:
|
||||
compress_entrypoint:
|
||||
name: ${STACK_NAME}_compress_ep_${COMPRESS_STATE_ENTRYPOINT_VERSION}
|
||||
file: compress_state_entrypoint.sh
|
||||
@@ -9,7 +9,7 @@ services:
|
||||
- shared_secret_auth
|
||||
configs:
|
||||
- source: shared_secret_auth
|
||||
target: /usr/local/lib/python3.12/site-packages/shared_secret_authenticator.py
|
||||
target: /usr/local/lib/python3.13/site-packages/shared_secret_authenticator.py
|
||||
|
||||
configs:
|
||||
shared_secret_auth:
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ services:
|
||||
- signal-data:/signal-data
|
||||
|
||||
signalbridge:
|
||||
image: dock.mau.dev/mautrix/signal:v0.8.4
|
||||
image: dock.mau.dev/mautrix/signal:v0.8.7
|
||||
depends_on:
|
||||
- signaldb
|
||||
configs:
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
- telegram-data:/telegram-data
|
||||
|
||||
telegrambridge:
|
||||
image: dock.mau.dev/mautrix/telegram:v0.15.2
|
||||
image: dock.mau.dev/mautrix/telegram:v0.15.3
|
||||
depends_on:
|
||||
- telegramdb
|
||||
configs:
|
||||
|
||||
+17
-16
@@ -3,7 +3,7 @@ version: "3.8"
|
||||
|
||||
services:
|
||||
web:
|
||||
image: nginx:1.29.0
|
||||
image: nginx:1.29.6
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
@@ -12,6 +12,7 @@ services:
|
||||
- STACK_NAME
|
||||
- NGINX_ACCESS_LOG_LOCATION
|
||||
- NGINX_ERROR_LOG_LOCATION
|
||||
- MAX_UPLOAD_SIZE
|
||||
configs:
|
||||
- source: nginx_config
|
||||
target: /etc/nginx/nginx.conf
|
||||
@@ -21,7 +22,7 @@ services:
|
||||
target: /var/www/.well-known/matrix/client
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
condition: any
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
||||
@@ -30,12 +31,13 @@ services:
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
healthcheck:
|
||||
test: curl -f http://${STACK_NAME}_app:8008/health || exit 1
|
||||
interval: 20s
|
||||
interval: 30s
|
||||
timeout: 15s
|
||||
retries: 20
|
||||
retries: 90
|
||||
start_period: 2m
|
||||
|
||||
app:
|
||||
image: "matrixdotorg/synapse:v1.133.0"
|
||||
image: "matrixdotorg/synapse:v1.149.1"
|
||||
volumes:
|
||||
- "data:/data"
|
||||
secrets:
|
||||
@@ -104,34 +106,33 @@ services:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
labels:
|
||||
- "coop-cloud.${STACK_NAME}.version=6.7.0+v1.133.0"
|
||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
||||
- "coop-cloud.${STACK_NAME}.version=7.0.2+v1.149.1"
|
||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT}"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
retries: 30
|
||||
start_period: 1m
|
||||
|
||||
db:
|
||||
image: postgres:13-alpine
|
||||
image: pgautoupgrade/pgautoupgrade:17-alpine
|
||||
secrets:
|
||||
- db_password
|
||||
environment:
|
||||
- LC_COLLATE=C
|
||||
- LC_CTYPE=C
|
||||
- POSTGRES_DB=synapse
|
||||
- POSTGRES_INITDB_ARGS="-E \"UTF8\""
|
||||
- POSTGRES_INITDB_ARGS=-E UTF8
|
||||
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||
- POSTGRES_USER=synapse
|
||||
- DOMAIN
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "synapse"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
retries: 20
|
||||
start_period: 1m
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
@@ -140,11 +141,11 @@ services:
|
||||
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
||||
backupbot.backup.pre-hook: "/pg_backup.sh backup"
|
||||
backupbot.backup.volumes.postgres.path: "backup.sql"
|
||||
backupbot.restore.post-hook: '/pg_backup.sh restore'
|
||||
backupbot.restore.post-hook: "/pg_backup.sh restore"
|
||||
configs:
|
||||
- source: pg_backup
|
||||
target: /pg_backup.sh
|
||||
mode: 0555
|
||||
- source: pg_backup
|
||||
target: /pg_backup.sh
|
||||
mode: 0555
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
BINARY="/build/synapse_auto_compressor"
|
||||
REPO_DIR="/build/rust-synapse-compress-state"
|
||||
DB_PASS=$(cat /run/secrets/db_password)
|
||||
CONN="postgresql://synapse:${DB_PASS}@db:5432/synapse"
|
||||
CHUNK_SIZE="${STATE_COMPRESS_CHUNK_SIZE:-500}"
|
||||
CHUNKS="${STATE_COMPRESS_CHUNKS:-100}"
|
||||
SCHEDULE="${STATE_COMPRESS_SCHEDULE:-0 3 * * *}"
|
||||
|
||||
# Build from source if binary doesn't exist
|
||||
if [ ! -f "$BINARY" ]; then
|
||||
echo "[compress-state] Binary not found, building from source..."
|
||||
apk add --no-cache git openssl-dev openssl-libs-static perl make musl-dev jemalloc-dev
|
||||
rm -rf "$REPO_DIR"
|
||||
git clone https://github.com/matrix-org/rust-synapse-compress-state "$REPO_DIR"
|
||||
cd "$REPO_DIR"
|
||||
cargo build --release -p synapse_auto_compressor
|
||||
cp target/release/synapse_auto_compressor "$BINARY"
|
||||
echo "[compress-state] Build complete"
|
||||
# Clean up source to save space
|
||||
rm -rf "$REPO_DIR"
|
||||
else
|
||||
echo "[compress-state] Using cached binary"
|
||||
fi
|
||||
|
||||
# Run once at startup
|
||||
echo "[compress-state] Running initial compression at $(date)"
|
||||
"$BINARY" -p "$CONN" -c "$CHUNK_SIZE" -n "$CHUNKS" || echo "[compress-state] Error: $?"
|
||||
|
||||
# Set up cron job
|
||||
CRON_SCRIPT="/build/run_compressor.sh"
|
||||
cat > "$CRON_SCRIPT" <<EOF
|
||||
#!/bin/sh
|
||||
echo "[compress-state] Running at \$(date)"
|
||||
$BINARY -p "$CONN" -c $CHUNK_SIZE -n $CHUNKS || echo "[compress-state] Error: \$?"
|
||||
echo "[compress-state] Done at \$(date)"
|
||||
EOF
|
||||
chmod +x "$CRON_SCRIPT"
|
||||
|
||||
echo "$SCHEDULE $CRON_SCRIPT" | crontab -
|
||||
echo "[compress-state] Cron scheduled: $SCHEDULE"
|
||||
|
||||
# Run crond in the foreground
|
||||
exec crond -f -l 2
|
||||
@@ -157,8 +157,15 @@ registration_shared_secret: {{ secret "registration" }}
|
||||
|
||||
{{ if eq (env "AUTO_JOIN_ROOM_ENABLED") "1" }}
|
||||
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#auto_join_rooms
|
||||
|
||||
# AUTO_JOIN_ROOM only for backwards compatibility
|
||||
{{ if (env "AUTO_JOIN_ROOM") }}
|
||||
auto_join_rooms:
|
||||
- "{{ env "AUTO_JOIN_ROOM" }}"
|
||||
{{ else }}
|
||||
auto_join_rooms: {{ env "AUTO_JOIN_ROOM_LIST" }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
# https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#session_lifetime
|
||||
|
||||
+13
-3
@@ -5,6 +5,16 @@ events {
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
resolver 127.0.0.11 valid=30s ipv6=off;
|
||||
resolver_timeout 5s;
|
||||
|
||||
upstream matrix_upstream {
|
||||
zone matrix_upstream 64k;
|
||||
server {{ env "STACK_NAME"}}_app:8008 resolve;
|
||||
keepalive 16;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
@@ -14,7 +24,7 @@ http {
|
||||
server_name {{ env "DOMAIN" }};
|
||||
|
||||
location = / {
|
||||
proxy_pass http://{{ env "STACK_NAME"}}_app:8008;
|
||||
proxy_pass http://matrix_upstream;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Host $host;
|
||||
@@ -23,7 +33,7 @@ http {
|
||||
}
|
||||
|
||||
location ~* ^(\/_matrix|\/_synapse\/client) {
|
||||
proxy_pass http://{{ env "STACK_NAME"}}_app:8008;
|
||||
proxy_pass http://matrix_upstream;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Host $host;
|
||||
@@ -42,7 +52,7 @@ http {
|
||||
if ($http_referer !~ "^https://{{ env "DOMAIN" }}/admin/") {
|
||||
return 403;
|
||||
}
|
||||
proxy_pass http://{{ env "STACK_NAME"}}_app:8008;
|
||||
proxy_pass http://matrix_upstream;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
|
||||
|
||||
function backup {
|
||||
export PGPASSWORD=$(cat $POSTGRES_PASSWORD_FILE)
|
||||
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
|
||||
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} | gzip > $BACKUP_FILE
|
||||
}
|
||||
|
||||
function restore {
|
||||
@@ -25,7 +25,7 @@ function restore {
|
||||
# Recreate Database
|
||||
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
|
||||
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
|
||||
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
|
||||
gunzip -c $BACKUP_FILE | psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f -
|
||||
|
||||
trap - EXIT INT TERM
|
||||
restore_config
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
This patch contains a critical nginx fix, to allow resolving docker internal hosts.
|
||||
@@ -0,0 +1 @@
|
||||
this patch is a reset to the state of the last known deploying version 6.8.0 – so better skip 6.8.1
|
||||
@@ -0,0 +1,2 @@
|
||||
WARNING: Backup your database!
|
||||
This upgrade switches the database image from postgres to pgautoupgrade and performs an in-place database upgrades from version 13 to 17.
|
||||
Reference in New Issue
Block a user