Files
api/deploy/replicas.env.example
T
mohmdsdgandCursor 1cc5e09b5f fix(replicas): parse Prisma DATABASE_URL and dump tables by name
Passwords with @ broke libpq URIs; convert to keyword conninfo.
pg_dump -t public."table" produced empty dumps so replicas stayed at 0.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 12:55:39 +03:30

16 lines
878 B
Bash

# Copy to deploy/replicas.env on the publisher host (gitignored — holds passwords).
#
# One DSN per line (or comma). Do not put spaces between URLs.
# Prefer URI form. Password must not contain @ : / # ? — or URL-encode it.
# Keyword form (host=...) is OK only because the script splits on newlines, not spaces.
# The user must be able to run ALTER TABLE + ALTER SUBSCRIPTION + TRUNCATE on each replica.
REPLICA_DSNS="postgresql://USER:PASSWORD@SLAVE_1_IP:5433/superadmin
postgresql://USER:PASSWORD@SLAVE_2_IP:5432/superadmin"
# Read-only app user on replicas (program-settings API). Grants re-applied after data repair.
# REPLICA_APP_DB_USER=montime
# Publisher DB. Prefer this if DATABASE_URL password contains @ (must be URL-encoded here).
# Master on montech-01 listens on 15432:
# PUBLISHER_DSN="postgresql://montime:09128081392%40Montime@127.0.0.1:15432/superadmin"