From db197fe49957f29099ffa11ee44bca8a2e5b9f14 Mon Sep 17 00:00:00 2001 From: Kamil118 Date: Fri, 2 Oct 2026 16:24:18 +0000 Subject: [PATCH] Added element call for Matrix server; Added picoshare --- .gitignore | 4 ++ backup.sh | 3 +- docker/synapse/compose.yaml | 90 +++++++++++++++++++++++++ docker/synapse/element-call/config.json | 7 ++ docker/synapse/livekit/livekit.yaml | 12 ++++ picoshare/compose.yaml | 15 +++++ 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 docker/synapse/element-call/config.json create mode 100644 docker/synapse/livekit/livekit.yaml create mode 100644 picoshare/compose.yaml diff --git a/.gitignore b/.gitignore index cd5e3e6..32f2af3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,9 @@ !start_everything.sh !backup.sh +!docker/synapse/element-call/* +!docker/synapse/livekit/livekit.yaml + + #unused service admin-homepage \ No newline at end of file diff --git a/backup.sh b/backup.sh index e4ce0be..c3a2d05 100755 --- a/backup.sh +++ b/backup.sh @@ -59,7 +59,7 @@ mkdir "${BASE_NAME}_tmp" sudo rsync -avR --numeric-ids palworld/{compose.yaml,.env,palworld/Pal/Saved/SaveGames,adminPage} \ synapse-data2/{homeserver.yaml,homeserver.db,foxgirls.date.log.config,foxgirls.date.signing.key,media_store/local_content,media_store/local_thumbnails} \ - docker/synapse/{.env,compose.yaml} \ + docker/synapse/{.env,compose.yaml,element-call,livekit,redis_data,turn} \ uptime-kuma \ reverse_proxy \ nextcloud/{compose.yaml,Dockerfile,.env,nextcloud_data/config} \ @@ -69,6 +69,7 @@ sudo rsync -avR --numeric-ids palworld/{compose.yaml,.env,palworld/Pal/Saved/Sav postgres_backup \ diun/compose.yaml \ wireguard \ + picoshare \ "${BASE_NAME}_tmp/" #backup has been created, remove the cleanup trap, restore services before uploading backup diff --git a/docker/synapse/compose.yaml b/docker/synapse/compose.yaml index a1d19f5..8cda07a 100644 --- a/docker/synapse/compose.yaml +++ b/docker/synapse/compose.yaml @@ -47,6 +47,96 @@ services: options: max-size: "50m" max-file: "3" + + synapse-livekit: + container_name: synapse-livekit + image: livekit/livekit-server + command: --config /etc/livekit.yaml + restart: unless-stopped + ports: + - "7881:7881" # TCP Signaling + - "7882:7882/udp" # Initial UDP + - "50000-50200:50000-50200/udp" # Media range + #forward in reverse proxy + #expose: + #- 7880 + volumes: + - ./livekit/livekit.yaml:/etc/livekit.yaml + - ./livekit/turnsecret:/etc/turnsecret + environment: + - VIRTUAL_HOST=livekit.foxgirls.date + - LETSENCRYPT_HOST=livekit.foxgirls.date + - VIRTUAL_PORT=7880 + - "LIVEKIT_KEYS=api: ${LIVEKIT_SECRET}" + - LIVEKIT_REDIS_ADDRESS=synapse-redis:6379 + depends_on: + - synapse-redis + networks: + - synapse-net + - reverse_proxy_default + + synapse-coturn: + container_name: synapse-coturn + image: coturn/coturn + network_mode: host + volumes: + - ./turn/certs:/etc/coturn/certs:ro + command: + - turnserver + - --listening-port=3478 + - --tls-listening-port=5349 + - --min-port=49152 + - --max-port=50000 + - --external-ip=51.68.130.237 + - --realm=turn.foxgirls.date + - --lt-cred-mech + - --fingerprint + - --use-auth-secret + - --static-auth-secret=${TURN_SECRET} + - --no-multicast-peers + - --no-cli + + lk-jwt-service: + container_name: synapse-lkjwt + image: ghcr.io/element-hq/lk-jwt-service:latest + environment: + - LIVEKIT_URL=wss://livekit.foxgirls.date + - LIVEKIT_KEY=api + - LIVEKIT_SECRET=${LIVEKIT_SECRET} + - VIRTUAL_HOST=lk-jwt.foxgirls.date + - LETSENCRYPT_HOST=lk-jwt.foxgirls.date + - VIRTUAL_PORT=8080 + - LIVEKIT_FULL_ACCESS_HOMESERVERS=foxgirls.date + - LIVEKIT_REDIS_URL=redis://synapse-redis:6379/0 + # CRITICAL: Allow the container to loop back to the public domain via the proxy + #extra_hosts: + # - "livekit.foxgirls.date:host-gateway" + networks: + - synapse-net + - reverse_proxy_default + + element-call: + container_name: synapse-element-call + image: ghcr.io/element-hq/element-call:latest + environment: + - VIRTUAL_HOST=elementcall.foxgirls.date + - LETSENCRYPT_HOST=elementcall.foxgirls.date + - VIRTUAL_PORT=8080 + volumes: + - ./element-call/config.json:/app/config.json + networks: + - synapse-net + - reverse_proxy_default + + synapse-redis: + container_name: synapse-redis + image: redis:alpine + command: redis-server --save 60 1 --loglevel warning + volumes: + - ./redis_data:/data + networks: + - synapse-net + volumes: synapse-pg-data: diff --git a/docker/synapse/element-call/config.json b/docker/synapse/element-call/config.json new file mode 100644 index 0000000..b15956f --- /dev/null +++ b/docker/synapse/element-call/config.json @@ -0,0 +1,7 @@ +{ + "default_server_config": { + "m.homeserver": { "base_url": "https://matrix.foxgirls.date", "server_name": "foxgirls.date" } + }, + "livekit": { "livekit_service_url": "https://lk-jwt.foxgirls.date" }, + "features": { "feature_group_calls": true, "feature_spa": true } +} \ No newline at end of file diff --git a/docker/synapse/livekit/livekit.yaml b/docker/synapse/livekit/livekit.yaml new file mode 100644 index 0000000..ad8d98f --- /dev/null +++ b/docker/synapse/livekit/livekit.yaml @@ -0,0 +1,12 @@ +port: 7880 +rtc: + udp_port: 7882 + tcp_port: 7881 + port_range_start: 50000 + port_range_end: 50200 + use_external_ip: true # CRITICAL for Docker + turn_servers: + - host: turn.foxgirls.date + port: 3478 + protocol: udp + secret_file: /etc/turnsecret \ No newline at end of file diff --git a/picoshare/compose.yaml b/picoshare/compose.yaml new file mode 100644 index 0000000..52c09ce --- /dev/null +++ b/picoshare/compose.yaml @@ -0,0 +1,15 @@ +services: + picoshare: + image: mtlynch/picoshare + environment: + - PORT=3001 + - PS_SHARED_SECRET=${password} + volumes: + - ./data:/data + container_name: picoshare + networks: + - reverse_proxy_default +networks: + reverse_proxy_default: + external: true + \ No newline at end of file