Files
BetterDesk/docker/wait-panel-auth-db.sh
T
UNITRONIX 47f4aa680c fix(docker): share console auth.db with Go for panel folder sync (#138)
Mount console-data read-only into the server container and set AUTH_DB_PATH
so RustDesk clients receive panel folders/groups in SQLite deployments.
Wait for auth.db on first boot and start console before Go in single-container
layouts to avoid empty /api/device-group/accessible responses.

Refs #138
2026-06-06 13:58:44 +02:00

33 lines
790 B
Bash

#!/bin/sh
# Waits for console auth.db before starting the Go server (SQLite Docker).
# PostgreSQL deployments skip this — panel sync uses DATABASE_URL instead.
set -e
case "${DB_URL:-}" in
postgres://*|postgresql://*)
exec "$@"
;;
esac
auth_path="${AUTH_DB_PATH:-}"
if [ -z "$auth_path" ]; then
exec "$@"
fi
if [ ! -f "$auth_path" ]; then
echo "Waiting for panel auth.db at $auth_path..."
retries=0
max_retries=90
while [ ! -f "$auth_path" ] && [ "$retries" -lt "$max_retries" ]; do
sleep 2
retries=$((retries + 1))
done
if [ ! -f "$auth_path" ]; then
echo "WARN: panel auth.db not found — RustDesk folders/groups may be unavailable"
else
echo "Panel auth.db ready: $auth_path"
fi
fi
exec "$@"