WIP: hermes: restore legacy chat/triage hosts alongside the renamed ones #40
Closed
hermes-automation
wants to merge 1 commits from
fix/hermes-restore-legacy-chat-triage-hosts-v3 into main
pull from: fix/hermes-restore-legacy-chat-triage-hosts-v3
merge into: titan:main
titan:main
titan:feature/hermes-agent-build-mirrors
titan:feature/hermes-agent-multiarch
titan:feature/hermes-next-hux
titan:feature/hermes-hux-contracts
titan:feature/t_39cf1905-webui-build-token
titan:feature/t_26da4c88-titan-capacity-guardrails-v4
titan:feature/t_26da4c88-titan-capacity-guardrails-v3
titan:feature/t_26da4c88-titan-capacity-guardrails-v2
titan:feature/t_26da4c88-titan-capacity-guardrails
titan:fix/t_39cf1905-jenkins-controller-priority
titan:feature/t_8cbe6a55-hermes-webui-release-v2
titan:feature/t_8cbe6a55-hermes-webui-release
titan:feature/hermes-domain-rename-agent-worker-v2
titan:hermes/t_65356568-multiuser-capacity-assessment
titan:fix/cli-auto-failover-effort
titan:feature/hermes-pr44-after-pr43
titan:fix/hermes-heartbeat-dead-reclaim-replacement
titan:handoff/t_1a2c627b
titan:feature/hermes-combined-multilingual-voice-v2
titan:fix/hermes-handsfree-stt-webm
titan:fix/hermes-restore-legacy-chat-triage-hosts-v2
titan:feature/hermes-domain-rename-agent-worker-bstein
titan:hermes/tts-voice-multilingual-prerequisite
titan:fix/hermes-restore-legacy-chat-triage-hosts
titan:fix/hermes-oidc-ensure-rerun-hostname-rollout
titan:feature/hermes-direct-cli-lane-concurrency-2-replacement
titan:feature/hermes-domain-rename-chat-bstein-triage
titan:feature/hermes-kanban-profile-concurrency-2
titan:feature/hermes-zombie-lane-heartbeat-reclaim
titan:hermes/repair-pr26-voice-split
titan:feature/hermes-durable-two-worker-cli-concurrency
titan:hermes/chat-voice-conversation-instrument
titan:feature/hermes-domain-rename-chat-triage
titan:hermes/voice-stt-tts-language-routing
titan:hermes/voice-stt-language-routing
titan:hermes/tts-voice-multilingual
titan:fix/hermes-chat-session-continuity-contract
titan:hermes/tts-voice-hfc-female
titan:hermes/fix-grafana-no-data-vm-storage
titan:feature/ci-gitops
titan:fix/jenkins-quality-gate-discovery
titan:feature/hermes-inpod-supervisor
titan:feature/hermes-chat-smoothness
titan:wt/t_1e95ea6d
titan:feature/hermes-full-handoff-acceptance
titan:feature/hermes-distributed-worker-pool
titan:feature/hermes-review-goal-semantics
titan:feature/hermes-cli-auto-quota-routing
titan:fix/hermes-result-decomposition-reliability
titan:feature/hermes-safe-gitea-pr-client
titan:feature/hermes-unprivileged-image-builder
titan:feature/hermes-cli-process-reaping
titan:feature/hermes-three-lane-placement
titan:wt/t_cca008de
titan:codex/cassandra-generator-08105
titan:cassandra-0851-rollout
titan:cassandra-0821-deploy
titan:codex/testing-dashboard-health-20260604
titan:feature/ariadne
titan:feature/pi-usb-scratch-rollout
titan:feature/sso-hardening
titan:codex/titan-iac-work-quality-gate
titan:codex/titan-iac-main-platform-metrics
titan:codex/titan-iac-platform-metrics
titan:feature/atlas-jobs-schedule-observability
titan:lane2/jenkins-cleanup-activate
titan:lane2/jenkins-cleanup-wiring-split
titan:codex-ananke-fixes
titan:feature/atlasbot-ananke-recovery
titan:feature/atlasbot
titan:deploy
titan:feature/vault-consumption
titan:feature/postgres-migration
titan:feature/bstein-dev-home
titan:feature/mailu
titan:feature/sso
titan:feature/atlas-monitoring
titan:restructure/hybrid-clusters
titan:fea/titan24-gpu
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "fix/hermes-restore-legacy-chat-triage-hosts-v3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Supersedes #38, #37 and #36 - please close all three in favour of this one. (The SCM broker only allows new-branch creation, never branch updates, so each revision needs a fresh branch and PR.)
Same content as #38 plus one further fix found while reviewing #38 against the oauth2-proxy source.
Why
Merged PR #34 renamed the chat/triage public hosts in place instead of adding the new names, removing chat.hermes.bstein.dev and triage.hermes.bstein.dev from the certificate SANs, the hermes-sites Ingress rules and the CoreDNS overrides in one change. Verified live on 2026-08-21:
Chat and triage therefore have no working hostname at all. The runbook's rollback stance for a failed OIDC step is to reinstate the known-good old DNS/ingress/cert/OIDC targets rather than remove anything.
Root cause of the stale Keycloak state: services/keycloak/kustomization.yaml sets generatorOptions.disableNameSuffixHash: true, so the hermes-access-oidc-script ConfigMap keeps a stable name. #34 updated the script in place, but Jobs are immutable, so nothing recreated hermes-access-oidc-client-ensure-10 and the old callbacks stayed registered. Bumping the Job name is the only mechanism that forces the rerun.
What this does
The additional fix
Restoring the hosts is not sufficient on its own. Both proxies pinned --redirect-url to the renamed host, and oauth2-proxy returns that value verbatim when it carries a host - getOAuthRedirectURI short-circuits on redirectURL.Host != "" (v7.15.3 oauthproxy.go:1113-1135). A login started on a legacy host would send the browser to the canonical host's callback, while the CSRF cookie stays behind: it is issued with the __Host- prefix, which forbids a Domain attribute and pins it to one origin. Confirmed live - the current 302 sets "_Host-hermes_chat_csrf; Path=/; Secure; SameSite=Lax" with no Domain. The callback would land without it and fail as "unable to find a valid CSRF token".
Removing the host makes oauth2-proxy derive the callback from the request host. For the renamed hosts the derived value is byte-identical to the pinned one, so their behaviour is unchanged. Derivation reads X-Forwarded-Host only behind a trusted reverse proxy (pkg/requests/util/util.go GetRequestHost), and both deployments already set --reverse-proxy=true and --trusted-proxy-ip=10.42.0.0/16. Keycloak still matches the result against its registered redirect URIs. Startup is unaffected: parseURL only errors on a genuine parse failure, and the insecure-default warning needs cookie-secure and reverse-proxy both off. The agent proxy keeps its pinned callback because it serves a single host.
Validation
Expected after merge
Flux reconciles, cert-manager reissues hermes-sites-tls covering all 5 names, and the ensure-11 Job registers both origins per client. All four hostnames then serve 302 to Keycloak and reach the login form instead of the 400.
Operator note: users must log in again on the renamed hosts because oauth2-proxy cookies are host-bound. Sessions on the legacy hosts are preserved.
Not verified from CI: the oauth2-proxy derivation path is proven by source reading and rendered-manifest checks, not by an live login, since that needs interactive credentials. Worth watching on the first login after merge; the fallback is to re-pin the callback host, which returns the legacy hosts to existing-session-only behaviour without affecting the renamed hosts.
Pull request closed