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
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
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
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
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
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
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
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
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
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
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
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
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