60e5ef6844
All-in-One docker-compose-Stack (Muster von RAPPORT-SERVER gespiegelt): db/auth/rest/kong + cms-Service (Node-API + Hugo-Binary 0.161.1 + Admin-SPA). - DB-backed: posts-Tabelle kanonisch, MD ist generiertes Artefakt - echte Hugo-Vorschau via draft:true + --buildDrafts → /_preview - Publish: DB → content/library/<section>/<slug>.md → hugo build → live - Bild-Upload nach static/images/, Supabase-Auth schützt /api/* - Proxmox-LXC-Script: legt Container an, generiert Secrets, startet Stack Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.8 KiB
Bash
Executable File
38 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Läuft als LETZTES File in /docker-entrypoint-initdb.d/ — nach den
|
|
# supabase-internen Init-Scripts (auth-schema, postgrest-roles, …).
|
|
# (Muster gespiegelt von RAPPORT-SERVER.)
|
|
#
|
|
# 1. Gleicht die Service-Rollen-Passwörter an POSTGRES_PASSWORD an
|
|
# (sonst SASL/MD5-Auth-Fehler bei GoTrue/PostgREST).
|
|
# 2. Spielt das OPENBUREAU-Schema (posts-Tabelle) ein.
|
|
|
|
set -euo pipefail
|
|
|
|
echo "→ Setze Passwörter für Supabase-Service-Rollen auf POSTGRES_PASSWORD…"
|
|
psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -d "${POSTGRES_DB:-postgres}" <<EOF
|
|
alter user authenticator with password '${POSTGRES_PASSWORD}';
|
|
alter user supabase_auth_admin with password '${POSTGRES_PASSWORD}';
|
|
alter user supabase_storage_admin with password '${POSTGRES_PASSWORD}';
|
|
alter user supabase_replication_admin with password '${POSTGRES_PASSWORD}';
|
|
alter user supabase_read_only_user with password '${POSTGRES_PASSWORD}';
|
|
EOF
|
|
echo "✓ Service-Rollen-Passwörter aktualisiert."
|
|
|
|
SCHEMA=/openbureau-schema.sql
|
|
if [ -f "$SCHEMA" ]; then
|
|
echo "→ Spiele OPENBUREAU-Schema ein ($SCHEMA)…"
|
|
psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -d "${POSTGRES_DB:-postgres}" -f "$SCHEMA"
|
|
# PostgREST braucht Leserechte für die anon/authenticated-Rollen.
|
|
psql -v ON_ERROR_STOP=1 --no-password --no-psqlrc -U supabase_admin -d "${POSTGRES_DB:-postgres}" <<'EOF'
|
|
grant usage on schema public to anon, authenticated, service_role;
|
|
grant all on all tables in schema public to anon, authenticated, service_role;
|
|
grant all on all sequences in schema public to anon, authenticated, service_role;
|
|
alter default privileges in schema public
|
|
grant all on tables to anon, authenticated, service_role;
|
|
EOF
|
|
echo "✓ OPENBUREAU-Schema bereit."
|
|
else
|
|
echo "→ $SCHEMA fehlt — Schema NICHT eingespielt."
|
|
fi
|