Skip to content

Auto-PR: feat(anythingllm): cloudflare_proxied mode β€” Origin CA cert instead of ACME#124

Merged
ncimino merged 1 commit into
mainfrom
feature/nik-cloudflare-origin
Jul 23, 2026
Merged

Auto-PR: feat(anythingllm): cloudflare_proxied mode β€” Origin CA cert instead of ACME#124
ncimino merged 1 commit into
mainfrom
feature/nik-cloudflare-origin

Conversation

@weown-bot

Copy link
Copy Markdown
Contributor

πŸ€– Automated Pull Request β€” authored by weown-bot (ecosystem service account)

Opened by: @ncimino
Last pushed by: @ncimino
Branch: feature/nik-cloudflare-origin β†’ main

Contributors on this branch:


πŸ“‹ Human Review Checklist β€” NIST CSF 2.0 Functions

Review per the 6 NIST CSF Functions. Frameworks referenced: NIST CSF 2.0, CIS Controls v8 IG1, CSA CCM v4, ISO/IEC 27001:2022, SOC 2, ISO/IEC 42001:2023. See docs/COMPLIANCE_ROADMAP.md.

πŸ›οΈ Govern (GV)

  • CODEOWNERS correct for affected paths (.github/CODEOWNERS)
  • ADR required/updated if an architectural decision is introduced
  • Policy impact considered and documented
  • All Copilot AI review comments addressed or explicitly deferred with rationale

πŸ” Identify (ID)

  • New assets inventoried (Helm values, container images, dependencies)
  • SBOM regenerated if dependencies changed
  • Risk register / threat model touched if threat surface changed (.github/SECURITY_ASSESSMENT.md)

πŸ›‘οΈ Protect (PR)

  • Least privilege: RBAC, ServiceAccounts, scoped PATs (NIST PR.AC, CIS 5/6, ISO A.5.15-A.5.18)
  • Secrets managed via Infisical (never --from-literal, never /tmp, always $(mktemp) β€” ISO A.8.24)
  • NetworkPolicy present for new deployments (NIST PR.AC-5, CIS 12, CSA IVS)
  • TLS 1.3 with strong cipher suites where applicable (NIST PR.DS-1, CIS 3)
  • Container security: non-root UID 1000+, Pod Security restricted (NIST PR.IP, CIS 4)

πŸ•΅οΈ Detect (DE)

  • Logs / metrics added for new components (NIST DE.CM, CIS 8/13)
  • Alert rules updated if thresholds change
  • Health checks (livenessProbe + readinessProbe) configured

🚨 Respond (RS)

  • Runbook updated if operational behavior changes (.github/INCIDENT_RESPONSE.md)
  • Incident response impact considered (escalation paths, on-call)

♻️ Recover (RC)

  • Backup strategy covers new persistent data (NIST RC.RP, CIS 11, ISO A.8.13)
  • Rollback procedure tested or documented
  • DR impact assessed for new critical components

πŸ“š Documentation & Versioning

  • Relevant CHANGELOG.md updated (per-directory or repo-level /CHANGELOG.md)
  • #WeOwnVer version bumped per docs/VERSIONING_WEOWNVER.md
  • READMEs / ADRs / inline comments updated

πŸ“ Recent Commits (full bodies for Copilot context)

9349b58 feat(anythingllm): cloudflare_proxied mode β€” Origin CA cert instead of ACME

Author: Nik
Date: Thu Jul 23 16:53:07 2026 -0600

The per-brand .weown.chat hosting model (Jason 2026-07-21) puts tenants
behind Cloudflare Pro's proxy, where ACME HTTP-01 cannot complete β€” exactly the
525 f1visa.weown.chat throws today. New copier bool cloudflare_proxied
(default false; existing direct-DNS sites render identically): Caddy serves the
Cloudflare Origin CA certificate, with the PEMs arriving as CF_ORIGIN_CERT /
CF_ORIGIN_KEY through the same ADR-006 Infisical entrypoint wrapper as every
other secret and materialised as 0600 files inside the container at start β€”
never on host disk, re-fetched on every restart.

Origin-CA over DNS-01 was deliberate: no custom Caddy build, and no DNS-edit
API token sitting on customer droplets. One wildcard cert covers *.weown.chat;
it lives at the initiative-project ROOT (operator-readable only β€” droplet MIs
are path-scoped and cannot read it), and weown-fleet provisioning copies it
into each proxied tenant's folder.

Verification: copier renders clean in both modes and the rendered compose
parses; the cert-materialise command proven against a multi-line PEM in env
(content intact, 0600); registry flag -> render/provision wiring in weown-fleet.



πŸ” Copilot AI Review: Copilot is configured to auto-request review for bot-authored PRs. If an auto-created PR opens without an initial Copilot review, push a follow-up commit to the same open PR (review_on_push: true) to trigger review automatically.

πŸ‘₯ Required Reviewers: human approval enforced by branch protection + CODEOWNERS. @ncimino requested automatically.

πŸ“š Review Guidelines: .github/copilot-instructions.md (phase-aware compliance directives)

πŸ› οΈ Workflow Operations: .github/workflows/README.md

Auto-generated by .github/workflows/auto-pr-to-main.yml

…f ACME

The per-brand <brand>.weown.chat hosting model (Jason 2026-07-21) puts tenants
behind Cloudflare Pro's proxy, where ACME HTTP-01 cannot complete β€” exactly the
525 f1visa.weown.chat throws today. New copier bool `cloudflare_proxied`
(default false; existing direct-DNS sites render identically): Caddy serves the
Cloudflare Origin CA certificate, with the PEMs arriving as CF_ORIGIN_CERT /
CF_ORIGIN_KEY through the same ADR-006 Infisical entrypoint wrapper as every
other secret and materialised as 0600 files inside the container at start β€”
never on host disk, re-fetched on every restart.

Origin-CA over DNS-01 was deliberate: no custom Caddy build, and no DNS-edit
API token sitting on customer droplets. One wildcard cert covers *.weown.chat;
it lives at the initiative-project ROOT (operator-readable only β€” droplet MIs
are path-scoped and cannot read it), and weown-fleet provisioning copies it
into each proxied tenant's folder.

Verification: copier renders clean in both modes and the rendered compose
parses; the cert-materialise command proven against a multi-line PEM in env
(content intact, 0600); registry flag -> render/provision wiring in weown-fleet.
@weown-bot
weown-bot requested a review from ncimino as a code owner July 23, 2026 22:53
Copilot AI review requested due to automatic review settings July 23, 2026 22:53
@ncimino
ncimino merged commit fb40834 into main Jul 23, 2026
18 of 19 checks passed
@ncimino
ncimino deleted the feature/nik-cloudflare-origin branch July 23, 2026 22:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional cloudflare_proxied deployment mode for the anythingllm-docker/ copier template so Caddy serves a Cloudflare Origin CA certificate (instead of ACME HTTP-01) when a tenant domain is behind Cloudflare’s proxy.

Changes:

  • Introduces a new copier boolean cloudflare_proxied (default false) to toggle Cloudflare-proxied behavior.
  • When enabled, updates the Caddy container to use the Infisical entrypoint wrapper and materialize CF_ORIGIN_CERT / CF_ORIGIN_KEY into /certs/* before starting Caddy.
  • Adds conditional tls /certs/origin.crt /certs/origin.key in the Caddyfile for proxied domains and documents the feature in the root CHANGELOG.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
CHANGELOG.md Documents the new cloudflare_proxied mode for anythingllm-docker.
anythingllm-docker/template/docker/compose.prod.yaml.jinja Conditionally injects Infisical wrapper + cert/key materialization for Caddy when cloudflare_proxied is enabled.
anythingllm-docker/template/docker/Caddyfile.jinja Conditionally configures Caddy to use Cloudflare Origin CA TLS assets.
anythingllm-docker/copier.yaml Adds the cloudflare_proxied copier variable and its help text.

Comment thread CHANGELOG.md

### Added

- **anythingllm-docker β€” `cloudflare_proxied` mode: tenants can live behind Cloudflare's proxy (2026-07-23)** β€” the per-brand `<brand>.weown.chat` hosting model (Jason 2026-07-21) puts customer instances behind Cloudflare Pro (orange cloud), where the template's ACME HTTP-01 cannot complete β€” exactly the 525 `f1visa.weown.chat` shows today. New copier bool `cloudflare_proxied` (default false β€” existing direct-DNS sites render identically): Caddy serves a **Cloudflare Origin CA certificate** instead of running ACME (`tls /certs/origin.crt /certs/origin.key`; zone SSL = Full (strict)). The PEMs arrive as `CF_ORIGIN_CERT`/`CF_ORIGIN_KEY` through the same ADR-006 Infisical entrypoint wrapper as every other secret β€” the caddy container gains the wrapper, and its command materialises them as 0600 files inside the container at start (never on host disk; re-fetched on restart). Origin-CA over DNS-01 was deliberate: no custom Caddy build and no DNS-edit API token sitting on customer droplets β€” one wildcard cert for `*.weown.chat`, readable only by operators at the initiative-project root, copied per-tenant-folder at provision time (droplet MIs stay path-scoped). **Verification**: copier renders clean in both modes and the rendered compose parses; the cert-materialise command proven against a multi-line PEM in env (content byte-identical, 0600 perms); fleet wiring (registry flag β†’ render-deploy/provision) landed in weown-fleet.
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.

3 participants