Commit Graph

35 Commits

Author SHA1 Message Date
JasonFraser 7e089edb49 Regenerate docker-compose.dokploy.yml
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-04 17:57:04 -04:00
JasonFraser c8be366015 Fix marketing container staleness for real: recreate on every deploy, not just HTML edits
Found live: box.bettersight.io's hero image 404'd again after a deploy
that touched zero marketing-related files (a dev.sh/prod.sh/tests-only
commit). Root cause was deeper than the original content-hash fix
assumed — Dokploy re-clones the ENTIRE git checkout on every deploy, not
just ones that change bettersightbox-index.html, which orphans
marketing's assets/ directory bind mount (the container's mount still
points at the old, now-deleted directory inode) whenever the container
itself isn't also recreated in that same deploy. A hash of one file's
content only caught deploys that touched that file.

Fix: generate-dokploy-compose.sh now bakes in the current git commit SHA
instead, so the content-hash label (and the recreate it forces) changes
on every single deploy, unconditionally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:56:39 -04:00
JasonFraser d22b628945 Bring website/ into the dev/prod workflow: local bring-up + a real test suite
dev.sh now also brings up website/'s own stack (bi.bettersight.io,
bettersight.io, shared backend) via its own docker compose up -d --build,
and force-recreates marketing locally too — its content-hash label never
changes on a plain local `up -d` the way generate-dokploy-compose.sh
makes it change for Dokploy, so local edits to bettersightbox-index.html
were silently not picked up either without this.

website/backend gets a real test suite (17 tests: contact form
validation/success/failure, both calculator endpoints, and build_pdf()
exercised for real since it's pure/offline) — previously completely
untested. prod.sh now gates the ship on both test suites passing, since
one git push now triggers both Dokploy apps' AutoDeploy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:49:48 -04:00
JasonFraser 363f9ec134 Add node-network visual to bettersight.io's hero
Pure SVG/CSS, no external assets — an ambient, low-opacity connected-node
pattern behind the nav/hero copy (z-index 0 vs. 1), deliberately
content-agnostic since this page fans out to both BettersightBox and the
Assistant rather than depicting either product specifically.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:38:41 -04:00
JasonFraser 1856699460 Group box.bettersight.io's footer Product/Company columns together
footer-inner's justify-content:space-between was spreading the two link
columns across the full footer width instead of keeping them as a
cluster — wraps them in the same .footer-cols pattern bettersight.io's
own footer already uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:36:12 -04:00
JasonFraser 9810a68217 Match bettersight.io's header/hero to bi.bettersight.io's exact design
Replaces the separate white sticky header + hamburger-menu mobile nav
with bi.'s own pattern: nav embedded inside the hero section (pill-
shaped, dark, floating), same logo image, nav links simply hidden below
760px rather than collapsed into a menu. CSS rules (.mkt-nav*, .mkt-hero*)
are a direct port from bi.'s assets/css/marketing.css, not a reimplementation,
so the two sites now share one actual design, not just matching tokens.

Also links the Products section's two placeholder links to the real
sites: "See BettersightBox" -> box.bettersight.io, "See the Assistant" ->
bi.bettersight.io.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:12:04 -04:00
JasonFraser 30fbff883f Rename website/backend's sender name default to "Bettersight"
It now sends notifications for both bi.bettersight.io and
bettersight.io's contact forms, so "Bettersight Intelligence" (naming
just one of the two products) was no longer accurate as the From name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 16:38:26 -04:00
JasonFraser f6983d13d7 Fix INSTALLATION_PLAYBOOK.md: backend-billing pull_policy must be always, not missing
Found live: BACKEND_BILLING_PULL_POLICY=missing only re-pulls an image if
the tag isn't already cached on the VPS, so a scripts/prod.sh push under
the same :latest tag was silently never picked up on redeploy — the
container kept running stale code with no error anywhere. Every other
image in this project already defaults to "always"; this one should too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 16:17:29 -04:00
JasonFraser c35003c2fa Add Resend contact-form wiring, hero image, mobile-nav fix; add website/ (bi.bettersight.io + bettersight.io)
Sightbox marketing page (box.bettersight.io):
- Mobile nav now closes when a menu link is clicked
- Contact form posts to a new backend/billing/contact_lead.py route,
  proxied same-origin through the marketing nginx container to
  backend-billing, which notifies via Resend
- Hero section now uses assets/building.jpg as its background

Reorganize: bettersightbox-index.html + its nginx config + assets move to
website/website-bettersightbox/, colocated with two new sibling sites:
- website/ (root) — bi.bettersight.io (Bettersight Intelligence)
- website/website-bettersight.io/ — bettersight.io (parent company apex
  page), given the same mobile-nav/contact-form treatment as box's page,
  sharing website/backend's existing Resend-based /api/contact endpoint
- website/docker-compose.yml's backend service moved off env_file (never
  survives Dokploy's AutoDeploy re-clone) onto plain environment: vars,
  same fix already proven for backend-billing

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 16:06:56 -04:00
JasonFraser 667e6227fd dev.sh: regenerate docker-compose.dokploy.yml too, no commit
Keeps the marketing content-hash in sync locally as bettersightbox-
index.html gets edited during normal iteration, so there's nothing new
for prod.sh to auto-commit at ship time. Doesn't commit anything here --
dev.sh stays git-free by design; prod.sh remains the only script that
touches git history, gated behind its own clean-tree/test checks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 14:12:34 -04:00
JasonFraser e8070f73d6 prod.sh: regenerate and auto-commit docker-compose.dokploy.yml automatically
Folds the step the user would otherwise have to remember to run by hand
(./generate-dokploy-compose.sh, after any bettersightbox-index.html
change) directly into the ship flow -- runs after the clean-tree check
(so this auto-commit never mixes with unrelated uncommitted work) and
before the test gate, auto-committing only if the regenerated file
actually differs (i.e. the marketing content-hash changed, or
docker-compose.yml itself did). dev.sh doesn't need the equivalent,
since local dev never reads docker-compose.dokploy.yml at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 14:10:53 -04:00
JasonFraser 219af05c74 Fix marketing container never recreating on AutoDeploy
Confirmed the hard way, live in production: Docker Compose only
recreates a container when its own service definition changes (image,
env, labels...), never from a bind-mounted file's content changing on
disk by itself. marketing's service definition never changes between
deploys, so Dokploy's AutoDeploy -- which wipes and re-clones the whole
git checkout, including bettersightbox-index.html, on every push -- had
never once recreated that container. It kept serving a September-dated,
weeks-stale copy of the page indefinitely, orphaned from the fresh file
sitting right next to it on disk, through every single deploy since
Stage 1.

generate-dokploy-compose.sh now computes a real sha256-based hash of
bettersightbox-index.html and bakes it into the marketing service as a
literal content-hash label -- the one value in the whole generated file
that's deliberately NOT left as a live ${VAR} reference, since its only
job is to actually change when the file's content changes, giving
Compose's own diffing a real reason to recreate the container. Local
dev (where this bug doesn't apply, no AutoDeploy wipe-and-reclone cycle)
keeps the ${MARKETING_HTML_HASH:-dev} default.

Documented in CLAUDE.md and CICD_PLAYBOOK.md: regenerate
docker-compose.dokploy.yml any time bettersightbox-index.html changes,
not just when docker-compose.yml itself changes -- skipping it silently
leaves the marketing page stale with no error anywhere.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 14:05:40 -04:00
JasonFraser f75cb61d08 Make the marketing site actually mobile-friendly
The only responsive rule in the whole file was a single @media(max-width:
900px) block that stacked the 2-column grids -- no mobile nav at all
(logo + 3 links + Sign in + CTA button all competing for one flex row,
no wrap, no hamburger), and nothing tuned for real phone widths.

Adds a mobile nav using the file's own established pattern (the FAQ
accordion already uses a native <details>/<summary> disclosure, no JS)
-- a hamburger toggle that collapses into a dropdown menu below 900px,
alongside the existing nav collapsing there too. Adds a second,
tighter breakpoint at 560px for actual phone widths: reduced section
padding, hero padding, price-card sizing, contact form stacking to a
single column, tighter footer spacing.

Fixed one real bug caught during verification: .nav-toggle-menu a's
color rule had higher specificity than .nav-cta's own color:#fff and
silently overrode it, making the mobile menu's CTA button nearly
illegible (dark text on dark background) -- confirmed via
getComputedStyle, not just visual inspection, before and after.

Verified live in a real narrow viewport (confirmed via
window.innerWidth, not just a resized window that may not reflect the
actual page viewport): nav collapses and reopens correctly, no
horizontal overflow at any width, every section (hero, flows, features,
pricing, why, FAQ, contact, footer) stacks cleanly with no overlap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 13:52:59 -04:00
JasonFraser f208783596 Point the marketing page's Sign in link at the sample demo site
Placeholder until a real client launches -- was still the local-dev
sightbox.localhost:8083 link.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:56:16 -04:00
JasonFraser e569f38e29 Fix rclone self-install: pipe to bash, not sh
Confirmed the hard way, live: "curl ... | sh" failed outright with a
bare "Syntax error: ( unexpected" on the actual Ubuntu VPS, since
/bin/sh there is dash (POSIX-only) and rclone's install script relies
on bash-specific syntax. Same bug existed in both backup.sh (just added
this session) and restore.sh (pre-existing, never actually exercised
live until now) -- piping to bash instead fixes both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:47:10 -04:00
JasonFraser 8ac5f12acd Make backup/.env durable under Dokploy via BACKUP_ENV_FILE override
Confirmed the hard way, live, on the migrated deployment: backup.sh
stopped every writer container, archived everything, restarted
containers -- all successfully -- and only failed on "rclone: command
not found" that run. Re-running after the rclone self-install fix then
hit a second, deeper problem: backup/.env itself had been wiped by the
Dokploy redeploy in between, since it lived next to backup.sh inside the
git checkout. This is the exact backup/restore-vs-AutoDeploy
architectural tension flagged earlier in this project but never
resolved until now -- same category of bug as backend/.env and
tenants.json before it.

BACKUP_ENV_FILE (new, defaults to the old next-to-the-script path for
local dev / a traditional non-Dokploy VPS, where the checkout is
stable) lets a Dokploy deployment's cron entry point backup.sh at
$SIGHTBOX_DATA_DIR/backup.env instead -- durable, survives every
redeploy, same pattern as TENANTS_JSON_PATH. Documented in both
INSTALLATION_PLAYBOOK.md Stage 10 and BACKUP_RESTORE.md, including the
corrected cron entry (the Dokploy-managed checkout path, not the
traditional /opt/sightbox/app assumption the original cron example
baked in).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:42:03 -04:00
JasonFraser 9faeeb7ee0 backup.sh: self-install rclone if missing, matching restore.sh
Confirmed the hard way on a fresh VPS: backup.sh stopped every writer
container, archived everything, then failed outright on "rclone:
command not found" during the upload step -- restore.sh already
self-installs rclone (same rclone.org/install.sh) for exactly this
scenario, backup.sh just never got the same treatment. Checked up front
now, before anything stateful (stopping containers) happens.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:39:14 -04:00
JasonFraser e863fcdb5b Document manual billing restore when a client isn't on real Stripe yet
reenable_users() is only ever called from the signed /webhook/stripe/
<slug> route -- there's no separate restore endpoint -- so a trial-timer
test or a client paying by some other means for now has no way to clear
a lockout without calling it directly. billing.py is deliberately built
for exactly this ("No Flask/HTTP objects imported here by design...
testable without a running Flask app"), so this is the documented entry
point with its HTTP wrapper removed, not a workaround.

Verified live against sample: restored every User the lockout snapshot
recorded (dispatcher, store manager, the Setup Wizard admin account, the
Stock Viewer demo account), zero failures.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:31:12 -04:00
JasonFraser 20c0fd0d45 Drop Technician system accounts; document Stock Viewer across the personas
Propagates this session's permissions-review decision through every doc
that described the old three-persona model: Technician's own Stock User
login is removed entirely (full create/submit/cancel rights with no
restriction tying a transaction to who it's "for" meant nothing stopped
a technician from issuing stock to themselves) in favor of phone-based
reporting through the Dispatcher, who now also raises Material Requests
on a technician's behalf (CLIENT_DEMO_GUIDE.md Stage 4, previously
scripted as the technician logging in and raising it themselves).

Also documents the new Stock Viewer role everywhere the old personas
were: CLAUDE.md's persona table, INSTALLATION_PLAYBOOK.md Stage 8 (now
optional, alongside Dispatcher/Store Manager), and CLIENT_DEMO_GUIDE.md
Stage 7, which no longer demos a Technician "look don't touch" login
(there's no such login anymore) and instead demos the real Stock Viewer
account against the Damage & Cost Report / Serial No Ledger / a
read-only Stock Entry form.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 23:03:00 -04:00
JasonFraser 1fc08dd9ec Add Stock Viewer role: read-only access including cost/value figures
For stakeholders who need visibility (a board member, an investor) but
should never be able to alter stock records -- confirmed the hard way
this was a real gap when reviewing Technician's default Stock User
access: nothing in that role actually prevented self-issuing stock,
which led to dropping Technician system accounts entirely in favor of
phone-based reporting through the Dispatcher instead.

Grants read/report/export/print (never create/write/submit/cancel/
delete/amend) on Stock Entry, Material Request, Serial No, Item,
Warehouse, and Stock Ledger Entry, plus adds the role to both the
Damage & Cost Report and Serial No Ledger report's own role lists --
cost/value figures included, not redacted, per explicit request.

Verified idempotent (two full provisioning runs against local dev) and
confirmed the exact permission flags directly against the live Custom
DocPerm records, not just the script's own print statements.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 22:55:19 -04:00
JasonFraser dc763613c7 Document two Stage 6 CSV import gotchas, confirmed live on the sample site
Both found running the actual import against a real site, not guessed:
1. Warehouse's Company column must match the Company record's stored
   name exactly, including punctuation -- "Sample Co" vs the actual
   "Sample Co." (trailing period) failed the whole import with a
   misleading "value missing for Company" error.
2. Item's Reorder Level "Request for" column needs the warehouse's
   stored name AFTER ERPNext appends the company abbreviation on
   creation (Main Store -> Main Store - SC), not the plain name typed
   into the warehouse CSV -- using the plain name fails with "value
   missing for Warehouse."

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 22:17:03 -04:00
JasonFraser 3224e5f2fa Add Stage 6 CSV templates for Frappe's native Data Import tool
Replaces fully-manual Desk UI click-through for Item Groups/Warehouses/
Items with three fillable CSV templates imported via Frappe's own Data
Import tool (New Data Import -> Insert New Records -> upload -> Start
Import) -- no code, no custom app, consistent with this project's
native-only philosophy.

Headers are not hand-typed or guessed: generated directly from this
exact ERPNext version's own Exporter class (the same code
download_template uses) via bench console against the running instance,
including the Item Reorder child table's "Field Label (Parent Table
Label)" column convention for Reorder Level/Qty -- confirmed by
inspecting Exporter.get_all_exportable_fields' source, since a
child-table key must be the parent's fieldname (reorder_levels), not the
child doctype name (Item Reorder), which silently produces zero columns
if gotten wrong.

Followed up from a user question about cloning a site as a template to
skip reprovisioning -- assessed as unclean (Setup Wizard's company data
can't be cleanly redone on a clone, template would need to stay
permanently free of demo/real data) and recommended templating Stage 6
instead, since it's just data entry, not Frappe system state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 22:00:28 -04:00
JasonFraser cde7dbd4c6 Make tenants.json durable: move its bind-mount source into SIGHTBOX_DATA_DIR
Confirmed the hard way on a fresh second deployment: the default bind
source (./backend/tenants.json, relative to the repo checkout) gets wiped
on every Dokploy AutoDeploy same as backend/.env used to — except worse,
Docker silently creates an empty DIRECTORY at a missing bind-mount source
instead of failing, which crashes backend-billing with a confusing
IsADirectoryError instead of an obvious missing-file error.

TENANTS_JSON_PATH (new, defaults to the old relative path for local dev)
lets production point this at an absolute path inside $SIGHTBOX_DATA_DIR
instead — survives every redeploy, and is already covered by backup.sh's
nightly snapshot for free, resolving the tenants.json backup-fidelity gap
flagged earlier but never addressed.

Also fixes a second bug this surfaced: generate-dokploy-compose.sh's
--no-interpolate flag leaves a variable-based bind source as a literal
unresolved string, which `docker compose config` can't recognize as a
path and silently mis-normalizes to type: volume instead of type: bind —
Dokploy then rejects it as "refers to undefined volume". Declaring
type: bind explicitly in docker-compose.yml's long-form volume entry
removes the guesswork regardless of interpolation.

Stage 1 now seeds the file empty (valid, zero-tenant config) before the
first docker compose up. Stage 9, BACKUP_RESTORE.md, and both backup
scripts updated to match where the file actually lives now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 20:51:29 -04:00
JasonFraser 3ab0e1e2a0 Document dokploy-traefik's missing dokploy-network attachment (Stage 2a)
Confirmed the hard way on a real second-domain setup: TLS issuance
succeeded, the domain's Traefik labels were correctly applied to
frontend, and curl still got a clean 504 the entire time — because
dokploy-traefik (auto-provisioned once per VPS by Dokploy itself, not by
this project) had come back attached only to the default bridge network,
not dokploy-network, so it had no path to the container it was routing
to. Every other symptom pointed at a labels/DNS problem; it wasn't.

Documents the check (docker inspect dokploy-traefik's NetworkSettings)
and fix (docker network connect dokploy-network dokploy-traefik), plus
the caveat that the fix isn't persistent — it would need reapplying if
Dokploy ever recreates its own Traefik container.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 18:28:28 -04:00
JasonFraser 9c7db8580d Document exact step-by-step execution order in dev.sh/prod.sh headers
Spells out what actually happens on each run, in order, including the
hard-stop-at-any-step behavior in prod.sh's gates — so reading the header
is enough to know the full sequence without tracing through the script.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 14:14:31 -04:00
JasonFraser e28715ba34 Add scripts/dev.sh and scripts/prod.sh for the local build-and-ship workflow
Formalizes the flow now that images are pre-built and pushed rather than
built on the VPS: dev.sh is the fast local iteration loop (build both
custom images for this machine's own architecture, recreate the affected
services, no git/registry involved); prod.sh is the gate before anything
ships (backend test suite must pass, requires a clean main checkout,
rebuilds both images for linux/amd64 and pushes them, then `git push
origin main` to trigger Dokploy's existing AutoDeploy).

Fixes a real bug exposed while wiring prod.sh: erpnext-image/build.sh and
backend/build.sh unconditionally `source` the root .env, whose own active
CUSTOM_IMAGE/CUSTOM_TAG/PULL_POLICY lines would silently clobber any
registry-path override a caller (like prod.sh) exports beforehand —
confirmed the hard way earlier today when a manual override was ignored.
Both scripts now preserve and restore a caller's pre-set values around
that sourcing. Can't fix this by changing .env itself to conditional
defaults, since docker compose reads that same file as plain dotenv, not
bash.

Verified end-to-end: dev.sh built both images and recreated every
affected local service cleanly; prod.sh's guards correctly refused to run
against a dirty working tree; backend's full test suite (98 tests) passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 14:02:54 -04:00
JasonFraser d33281a8e4 Document per-client domain routing: wildcard DNS + Dokploy Domain + site name
Adds the previously-undocumented step between bringing up the stack and
creating a site: how a real client actually gets a reachable domain.
Decision (discussed with the user): subdomains of box.bettersight.io,
dot-hierarchy (client1.box.bettersight.io, not client1-box.bettersight.io)
specifically so one wildcard DNS record covers every future client
forever, no DNS touched again per onboarding.

Folded into Stage 1 (one-time wildcard A record at Namecheap, skipped for
local dev and for every client after the first) and Stage 2, split into
2a (Dokploy Domain entry routing the subdomain to frontend:8080 with
Let's Encrypt) and 2b (bench new-site using that exact domain, since
FRAPPE_SITE_NAME_HEADER=$host means the site folder name must match the
Host header verbatim). Deliberately did not renumber Stage 2 onward —
too many other files cross-reference exact stage numbers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 07:54:16 -04:00
JasonFraser b0805a0434 Fix cross-platform build: push linux/amd64, keep local builds on host arch
Confirmed the hard way on a real Dokploy deploy: a plain `docker build` on
this Apple Silicon Mac produces an arm64-only image, so the amd64 Dokploy
VPS failed to pull either custom image ("no matching manifest for
linux/amd64") for configurator/backend/frontend (erpnext-image) and
backend-billing alike.

Both build.sh scripts now branch on whether BACKEND_BILLING_IMAGE/
CUSTOM_IMAGE is a registry path: a bare local tag still builds for this
machine's own architecture (so it runs immediately for local dev), while
a registry path builds specifically for linux/amd64 via buildx (with
--push, since a cross-platform result can't be loaded into the local
image store) — matching the actual Dokploy VPS target regardless of what
architecture the build machine is.

erpnext-image/build.sh previously had no push step at all; added one
following the same pattern.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 07:20:35 -04:00
JasonFraser 76f43abad0 Retire backend/.env for durable Dokploy env vars; pre-build backend-billing image
Confirmed the hard way against a live Dokploy AutoDeploy: the code/
checkout is deleted and re-cloned on every deploy, so backend/.env (an
env_file: mount) never survived to the next deploy. Moved its four values
to plain environment: vars sourced from Dokploy's own Environment tab,
which persists across deploys independent of the git-clone wipe.

Also switches backend-billing to the same build-locally-push-to-registry-
pull pattern already used for erpnext-image, so the Dokploy VPS never
builds anything itself (backend/build.sh) — the user's explicit goal of
making this resilient to future frappe_docker/dependency changes, not
just today's deploy error.

Propagated through docker-compose.yml/.dokploy.yml, .env + .env.example,
CLAUDE.md, INSTALLATION_PLAYBOOK.md, CICD_PLAYBOOK.md, BACKUP_RESTORE.md,
backup.sh/restore.sh, and .gitignore's comments.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 06:07:57 -04:00
JasonFraser 6e4b1302fa Drop depends_on's required: sub-key for Dokploy too
Confirmed on a real deploy: services.configurator.depends_on.db
Additional property required is not allowed. Same pattern as the
previous two Dokploy validator rejections (include:, long-form
env_file) -- its schema doesn't know about depends_on's newer
required: sub-key, only the long-established condition:. Dropping
required: is safe: the omitted default is already required: true
(a hard dependency), which is what every entry here actually uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 05:24:26 -04:00
JasonFraser 8b50774ce3 Collapse long-form env_file back to plain strings for Dokploy
Confirmed on a real deploy: Dokploy's validator also rejects Compose's
long-form env_file entries (services.backend-billing.env_file.0 must
be a string). docker compose config always expands env_file to the
long form with no flag to suppress it (--no-normalize doesn't affect
this). Added a targeted post-processing filter to generate-dokploy-compose.sh
that collapses it back — semantically identical, since the short form
already implies the file must exist.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 05:21:56 -04:00
JasonFraser 0c1b8d7dc3 Add docker-compose.dokploy.yml — Dokploy rejects docker-compose.yml's include:
Confirmed on a real deploy: Dokploy's own compose validator fails with
"Additional property include is not allowed" before docker compose ever
runs, since it doesn't support the include: directive (open upstream
issues Dokploy/dokploy#3116 and #1727, neither implemented). Added
generate-dokploy-compose.sh to produce a flattened equivalent via
`docker compose config --no-interpolate --no-path-resolution` — both
flags load-bearing, not incidental (see the script's own header comment).
Submodule fetch for frappe_docker (via Dokploy's Enable Submodules toggle)
was confirmed working in the same deploy attempt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-02 05:15:40 -04:00
JasonFraser 016de0a78d Document backend/.env as a Stage 1 requirement, not Stage 9 2026-10-02 05:07:01 -04:00
JasonFraser a21eb69751 Repoint frappe_docker submodule to a self-hosted mirror
Mirrors github.com/frappe/frappe_docker (full history, tags, branches)
to git.bettertend.net so deploys don't depend on GitHub's availability
or frappe/frappe_docker continuing to exist there. Pinned commit is
unchanged (380b9d0); only the fetch URL moved.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-01 20:23:16 -04:00
JasonFraser 677201bd8d Initial commit: Sightbox Phase 0 — native ERPNext deployment
Native ERPNext/Frappe configuration (provisioning script, playbooks,
demo guides), the backend/ billing service (the one piece of custom
code), erpnext-image branding, backup/restore tooling, and
frappe_docker as a pinned submodule.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-01 20:10:06 -04:00