feat(erp): erpsetup for live ERPNext, reserved tenant slugs
cmd/erpsetup applies what the registry expects in a live ERPNext: tenant_id/tenant_slug custom fields on Customer and Lead, the Usage Record doctype, and Frappe Webhooks (Sales Order submit, Sales Invoice overdue, Payment Entry submit, Subscription cancelled) signed with the registry's webhook secret. It checks before it creates, so it can run again at any time, and -dry-run only reports. It ships in the image as /erpsetup. Tenant creation refuses slugs the portal serves itself (admin, start, install, docs, …), mirroring the portal's signup check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
1 parent
13da983d1e
commit
bcb0895480
8 files changed
+587
-2
No files matched your search
+3
-1
@@ -11,13 +11,15 @@ RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/tenant-registry ./cmd/server && \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/migrate ./cmd/migrate && \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/erpmock ./cmd/erpmock
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/erpmock ./cmd/erpmock && \
|
||||
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/erpsetup ./cmd/erpsetup
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
WORKDIR /
|
||||
COPY --from=build /out/tenant-registry /tenant-registry
|
||||
COPY --from=build /out/migrate /migrate
|
||||
COPY --from=build /out/erpmock /erpmock
|
||||
COPY --from=build /out/erpsetup /erpsetup
|
||||
USER nonroot:nonroot
|
||||
EXPOSE 8090
|
||||
# CMD (not ENTRYPOINT) so orca's `cmd` can select /erpmock or /migrate in the
|
||||
|
||||
Reference in new issue
Block a user