Skip to content

fix(cloudflare): remove OpenCode Access gate - #25

Merged
xnoto merged 1 commit into
mainfrom
fix/remove-opencode-access
Aug 26, 2026
Merged

fix(cloudflare): remove OpenCode Access gate#25
xnoto merged 1 commit into
mainfrom
fix/remove-opencode-access

Conversation

@xnoto

Copy link
Copy Markdown
Contributor

Summary

  • remove the Cloudflare Access application that prevents native opencode attach from reaching the OpenCode server
  • retain the proxied Tunnel CNAME; authentication is now enforced by the server via the SOPS-encrypted password

Validation

  • make test

@xnoto
xnoto requested a review from a team as a code ownerAugust 26, 2026 01:47
@github-actions

Copy link
Copy Markdown

OpenTofu Plan

OpenTofu will perform the following actions:
# cloudflare_zero_trust_access_application.opencode will be destroyed
# (because cloudflare_zero_trust_access_application.opencode is not in configuration)
- resource "cloudflare_zero_trust_access_application" "opencode" {
- account_id = (sensitive value) -> null
- allowed_idps = [
- "e584ea47-1251-4939-95f4-4daf4a58cd31",
] -> null
- app_launcher_visible = true -> null
- aud = "e06d181b827240bd60d422b762d292bf4e0ea00c6a001e50a8938ec7fda0ba63" -> null
- destinations = [
- {
- type = "public" -> null
- uri = "opencode.makeitwork.cloud" -> null
},
] -> null
- domain = "opencode.makeitwork.cloud" -> null
- http_only_cookie_attribute = true -> null
- id = "d444f7bc-6679-4ff8-b692-f01e5c4a56d3" -> null
- name = "OpenCode" -> null
- policies = [
- {
- decision = "allow" -> null
- include = [
- {
- group = {
- id = "e0d9e873-31d7-4536-9234-3dad8a99d84d" -> null
} -> null
},
] -> null
- name = "makeitworkcloud-admins" -> null
- precedence = 1 -> null
},
] -> null
- self_hosted_domains = [
- "opencode.makeitwork.cloud",
] -> null
- session_duration = "24h" -> null
- type = "self_hosted" -> null
}
Plan: 0 to add, 0 to change, 1 to destroy.

@xnoto
xnoto merged commit 46125e8 into mainAug 26, 2026
4 checks passed
@xnoto
xnoto deleted the fix/remove-opencode-access branch August 26, 2026 01:49
xnoto added a commit that referenced this pull request Aug 26, 2026
Add the mcp.makeitwork.cloud CNAME for the cluster-apps tunnel and a
dedicated Access service token plus self_hosted application for the
ToolHive MCP gateway (non_identity machine access for headless agent
clients, admins group for interactive debug). Service-token client
credentials are exposed as outputs (secret marked sensitive).
opencode.makeitwork.cloud stays on server-password auth per #25: an
Access gate breaks opencode attach. Revisit with an attach-compatible
design before re-gating it.
xnoto added a commit that referenced this pull request Aug 26, 2026
## Summary
Edge authentication for the new cluster MCP gateway (paired with
makeitworkcloud/kustomize-cluster#62).
- **`cf-tunnels.tf`** — adds `mcp` to the cluster-apps CNAME list.
**This must be applied before the TunnelBinding lands in
kustomize-cluster** (documented DNS race, error `81053`); the
TunnelBinding PR follows this apply.
- **`cf-access-mcp.tf`** — dedicated `mcp-gateway` Access service token
(`duration = "forever"`, rotate via `client_secret_version`) +
`self_hosted` application on `mcp.makeitwork.cloud`: `non_identity`
service-token policy for headless agent clients (opencode, Claude Code,
etc. send `CF-Access-Client-*` headers) and an admins GitHub-SSO policy
for interactive debug.
- **`outputs.tf`** — exposes the service-token `client_id` and
`client_secret` (sensitive) so agent clients can be configured after
apply.
**Scope change during review:** the `cf-access-opencode.tf` gate was
dropped — #25 deliberately removed the opencode Access gate because it
breaks `opencode attach`; opencode web stays on the SOPS-managed server
password. Re-gating needs an attach-compatible design first.
## Validation
- `tofu fmt` ✅, `tofu init -backend=false` + `tofu validate` ✅
- `make test` ✅ (canonical pre-commit: validate, tflint, checkov, fmt,
terraform-docs README regenerated)
## Not run
- `tofu plan` / `tofu apply` — CI posts the plan here and applies on
merge per the shared workflow.
## Post-apply
1. `tofu output mcp_gateway_service_token_client_id` / `tofu output -raw
mcp_gateway_service_token_client_secret` → local agent sessions as
`CF_ACCESS_CLIENT_ID` / `CF_ACCESS_CLIENT_SECRET` (keyring/env only).
2. Then the follow-up TunnelBinding PR in kustomize-cluster is safe to
merge.
Sign up for freeto 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.

1 participant

@xnoto