Files
lan-clipboard/docker/entrypoint.sh
T
dbildhauerandClaude Opus 5.5 0d89399090 feat: live-sync per websocket im backend
- /api/ws authentifiziert über das Session-Cookie, Origin-Pflicht gegen CSWSH
- Hub im Prozess verteilt clip.created/updated/deleted an alle Geräte des Benutzers
- Ereignisse erst nach erfolgreichem Commit (BackgroundTasks), keine bei Konflikt
- Logout, Session-Widerruf, Passwortänderung und Admin-Aktionen schließen
  betroffene Verbindungen (4401); Session wird alle 5 Minuten neu geprüft
- Heartbeat alle 30 s, höchstens 20 Verbindungen pro Benutzer
- CSP erlaubt wss:// zur eigenen Domain, eingehende WS-Nachrichten max. 64 KiB

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 11:15:43 +01:00

25 lines
644 B
Bash
Executable File

#!/bin/sh
set -eu
# Starts as root only to fix ownership of the bind-mounted data directory,
# then drops to the unprivileged "app" user for migrations and the server.
if [ "$(id -u)" = "0" ]; then
mkdir -p /data/files
if [ "$(stat -c %u /data)" != "1000" ]; then
chown -R app:app /data
fi
exec setpriv --reuid=app --regid=app --init-groups "$0" "$@"
fi
cd /app
alembic upgrade head
exec uvicorn app.main:app \
--host 0.0.0.0 \
--port 8000 \
--workers 1 \
--ws-max-size 65536 \
--proxy-headers \
--forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-127.0.0.1}" \
--log-level "${LOG_LEVEL:-info}"