mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-18 14:49:08 -04:00
28 lines
936 B
Plaintext
28 lines
936 B
Plaintext
#!/command/with-contenv bash
|
|
|
|
cd /app/admin
|
|
|
|
# Read PostgreSQL password from file
|
|
POSTGRES_PASSWORD=$(cat /secrets/postgres_password)
|
|
|
|
# Wait for PostgreSQL to be ready
|
|
echo "[admin] Waiting for PostgreSQL to be ready..."
|
|
for i in {1..30}; do
|
|
if PGPASSWORD="$POSTGRES_PASSWORD" /usr/lib/postgresql/16/bin/psql -h localhost -U aliasvault -d aliasvault -c "SELECT 1;" >/dev/null 2>&1; then
|
|
echo "[admin] PostgreSQL ready, starting Admin..."
|
|
break
|
|
fi
|
|
if [ $i -eq 30 ]; then
|
|
echo "[admin] Timeout waiting for PostgreSQL"
|
|
exit 1
|
|
fi
|
|
sleep 2
|
|
done
|
|
|
|
export ConnectionStrings__AliasServerDbContext="Host=localhost;Database=aliasvault;Username=aliasvault;Password=$POSTGRES_PASSWORD"
|
|
export ASPNETCORE_URLS="http://0.0.0.0:3002"
|
|
export ASPNETCORE_PATHBASE="/admin"
|
|
export IP_LOGGING_ENABLED="${IP_LOGGING_ENABLED:-true}"
|
|
|
|
echo "[admin] Starting Admin service..."
|
|
exec dotnet AliasVault.Admin.dll |