Skip to content

chore(prod): codify cluster DB + move /data to NAS#73

Closed
braedonsaunders wants to merge 2 commits into
mainfrom
chore/prod-db-cluster-files-nas
Closed

chore(prod): codify cluster DB + move /data to NAS#73
braedonsaunders wants to merge 2 commits into
mainfrom
chore/prod-db-cluster-files-nas

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

What

Brings docker-compose.prod-registry.yml in line with the already-live production stack on Dokploy (bidwright.rassaun.com). The actual prod migration was applied directly to the Dokploy raw compose + redeployed; this PR updates the repo mirror so the documented source-of-truth matches.

Changes

  • DB → Postgres HA cluster: remove the internal postgres service and its depends_on in db-migrate/api/worker; drop the unused bidwright-pgdata volume. The database already lives on the Patroni cluster, reached via the floating leader VIP 10.0.0.85 (vip-manager moves it to the current primary on failover — verified pg-1/.86 leader, pg-2/.87 replica). DATABASE_URL default now points at the VIP (real creds stay in the Dokploy env).
  • /data → Synology NAS: bidwright-data is now an NFSv4 volume backed by 10.0.1.106:/volume1/dokploy-storage/bidwright, matching the other Dokploy apps. 18,226 files (2.3 GB) rsync'd; secrets/integrations.key md5-verified identical.
  • Unchanged on local volumes: agent-home (per-user CLI auth + bubblewrap homes) and redis — NFS is a poor fit for bwrap mount/locking and redis AOF.

Why CI is unaffected

Dokploy is sourceType=raw, so future deploys use the stored compose + env (already updated), not this file. The CI deploy job only bumps BIDWRIGHT_TAG. This file is the manual mirror; updating it keeps the two in sync.

Verification (prod, post-cutover)

  • Deploy reached done; api/worker/web/redis healthy.
  • /data confirmed NFS-backed inside the container; write-through OK.
  • api /health{"status":"ok","dataRoot":"/data"}; web / → 200.

🤖 Generated with Claude Code

Braedon Saunders and others added 2 commits June 12, 2026 10:23
The Notes section escaped data.notes, so the rich-text editor's HTML showed as
literal tags (<p>, <br>, …) in the PDF. Scope of Work and Lead Letter — the same
kind of rich-text content — already render raw HTML; Notes now matches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Production (bidwright.rassaun.com) no longer runs an internal postgres.
The database lives on the Rassaun Postgres HA cluster (Patroni), reached
via the floating leader VIP 10.0.0.85 (vip-manager follows the primary on
failover). The /data volume (uploads, projects, knowledge) now lives on
the Synology NAS over NFSv4, matching the other Dokploy apps.

Brings docker-compose.prod-registry.yml in line with the live Dokploy
stack (sourceType=raw, migrated out-of-band):
- remove the internal `postgres` service + its depends_on in
  db-migrate/api/worker
- drop the unused `bidwright-pgdata` volume
- switch `bidwright-data` to an NFS volume backed by
  10.0.1.106:/volume1/dokploy-storage/bidwright
- point the DATABASE_URL default at the cluster VIP (real creds stay in
  the Dokploy env)

agent-home and redis stay on local volumes — NFS is a poor fit for
bubblewrap mount/locking and for redis AOF.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bidwright-demo Ready Ready Preview, Comment Jun 12, 2026 10:16pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13243c805a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return `<h2>Notes</h2><div class="section-body">${escapeHtml(data.notes)}</div>`;
// Notes are rich text (HTML) from the editor — render as HTML like Scope of
// Work and Lead Letter, not escaped (which showed the raw tags).
return `<h2>Notes</h2><div class="section-body">${data.notes}</div>`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Sanitize rich-text notes before rendering

When a quote note contains raw HTML from the rich-text editor or API, this now injects it directly into the Playwright-rendered PDF HTML. Because /projects/:projectId/revisions/:revisionId accepts notes as an arbitrary string and generatePdfBuffer calls page.setContent, a pasted payload such as an event handler or script in the Notes field can execute during PDF generation instead of being displayed as content. Preserve rich text by allowing only safe tags/attributes rather than inserting the stored string verbatim.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant