Auto-PR: feat(anythingllm): cloudflare_proxied mode β Origin CA cert instead of ACME#124
Merged
Merged
Conversation
β¦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.
Contributor
There was a problem hiding this comment.
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(defaultfalse) to toggle Cloudflare-proxied behavior. - When enabled, updates the Caddy container to use the Infisical entrypoint wrapper and materialize
CF_ORIGIN_CERT/CF_ORIGIN_KEYinto/certs/*before starting Caddy. - Adds conditional
tls /certs/origin.crt /certs/origin.keyin 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. |
|
|
||
| ### 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π€ Automated Pull Request β authored by
weown-bot(ecosystem service account)Opened by: @ncimino
Last pushed by: @ncimino
Branch:
feature/nik-cloudflare-originβmainContributors 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)
.github/CODEOWNERS)π Identify (ID)
.github/SECURITY_ASSESSMENT.md)π‘οΈ Protect (PR)
--from-literal, never/tmp, always$(mktemp)β ISO A.8.24)restricted(NIST PR.IP, CIS 4)π΅οΈ Detect (DE)
livenessProbe+readinessProbe) configuredπ¨ Respond (RS)
.github/INCIDENT_RESPONSE.md)β»οΈ Recover (RC)
π Documentation & Versioning
CHANGELOG.mdupdated (per-directory or repo-level/CHANGELOG.md)#WeOwnVerversion bumped perdocs/VERSIONING_WEOWNVER.mdπ 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.
@nciminorequested automatically.π Review Guidelines:
.github/copilot-instructions.md(phase-aware compliance directives)π οΈ Workflow Operations:
.github/workflows/README.mdAuto-generated by
.github/workflows/auto-pr-to-main.yml