From 0701dbcf4c737821b522372cdf8419a1cf3a085d Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 28 Oct 2026 21:48:15 -0700 Subject: [PATCH] Restore CLIProxyAPI at cpa Protect the management panel with Snow SSO and expose the separately keyed client endpoint at cpa-api. Preserve existing service data and credentials. Assisted-by: gpt-6.1-terra --- service/cliproxy/service.pkl | 5 ++--- service/forward-auth/service.pkl | 2 +- tools/cliproxy-test.py | 4 ++-- tools/cliproxy.md | 14 ++++---------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/service/cliproxy/service.pkl b/service/cliproxy/service.pkl index d5810a58591196e6778c726f1739382cb4c3e54d..11680c0ad14ab567dcc815b37339c474e775637f 100644 --- a/service/cliproxy/service.pkl +++ b/service/cliproxy/service.pkl @@ -4,7 +4,6 @@ import "../../config/site.pkl" as site import "../../config/OpenID.pkl" as sso name = "CLIProxyAPI" -enabled = false tagline = "Codex and Claude API access" access = "infra-admin" stageIsolation = "fresh" @@ -23,10 +22,10 @@ container { tmpfs { "/tmp:rw,nosuid,nodev,noexec,size=64m" } http { containerPort = 8080 - subdomain = "cliproxy" + subdomain = "cpa" authRole = "infra-admin" checkPath = "/healthz" - plainHostnames { "cliproxy-api.\(site.domain)" } + plainHostnames { "cpa-api.\(site.domain)" } } volumes { ["/data"] {} diff --git a/service/forward-auth/service.pkl b/service/forward-auth/service.pkl index 8a7d5f376d80747c44519580ba30b59451c89546..6e4e43055d22c751674dd0a2fb4c87977f3b1791 100644 --- a/service/forward-auth/service.pkl +++ b/service/forward-auth/service.pkl @@ -14,7 +14,7 @@ requirements { name = module.name redirectUris { when (isPreview) { "https://\(module.id).\(site.domain)/snow.oauth2/callback" } - when (!isPreview) { for (host in new Listing { "music"; "seedbox"; "ddns"; "redis"; "pg"; "snr"; "rdr"; "logs"; "metrics"; "traces"; "jkt"; "openclaw"; "cliproxy" }) { + when (!isPreview) { for (host in new Listing { "music"; "seedbox"; "ddns"; "redis"; "pg"; "snr"; "rdr"; "logs"; "metrics"; "traces"; "jkt"; "openclaw"; "cpa" }) { "https://\(host).\(site.domain)/snow.oauth2/callback" } } } diff --git a/tools/cliproxy-test.py b/tools/cliproxy-test.py index fae29e774da78261a563aaa7c732843b3a87f096..3218829d5b59dfda5967be0f73801052f8fad120 100644 --- a/tools/cliproxy-test.py +++ b/tools/cliproxy-test.py @@ -31,7 +31,7 @@ PANEL = None API_KEY = "a1" * 32 MANAGEMENT_KEY = "b2" * 32 ADMIN_HOST = "cliproxy-preview-12345678.paperclover.net" -API_HOST = "cliproxy-preview-12345678-cliproxy-api.paperclover.net" +API_HOST = "cliproxy-preview-12345678-cpa-api.paperclover.net" class ServiceTests(unittest.TestCase): @@ -59,7 +59,7 @@ class ServiceTests(unittest.TestCase): self.assertEqual(config["oauth"]["auth-dir"], "/data/auth") self.assertTrue(config["management"]["disable-auto-update-panel"]) self.assertEqual(app["http"]["authRole"], "infra-admin") - self.assertEqual(app["http"]["plainHostnames"], ['cliproxy-api.paperclover.net']) + self.assertEqual(app["http"]["plainHostnames"], ['cpa-api.paperclover.net']) self.assertEqual(self.data["stageIsolation"], "fresh") def test_rendered_job_has_only_nonroot_private_managed_storage(self): diff --git a/tools/cliproxy.md b/tools/cliproxy.md index c5b9126e4ac1d4d03dfa36b1464ab3f54d811de4..c676e410b4461c09d4abfbfdc385e8ea36c403d5 100644 --- a/tools/cliproxy.md +++ b/tools/cliproxy.md @@ -1,17 +1,11 @@ # CLIProxyAPI -The service is parked with `enabled = false`: its job and public routes are -removed while the source, `/srv/prod/cliproxy`, and Nomad variables remain. -To resume, set `enabled = true` in `service/cliproxy/service.pkl` and use the -normal production deployment workflow; existing configuration and accounts are -retained. - -`cliproxy.paperclover.net` is the management panel, protected by Snow's +`cpa.paperclover.net` is the management panel, protected by Snow's `infra-admin` role. Snow sign-in opens it automatically; nginx supplies the independent management key to its management endpoints on the server. -`cliproxy-api.paperclover.net` is the client endpoint: use -`https://cliproxy-api.paperclover.net/v1` for OpenAI-compatible clients or -`https://cliproxy-api.paperclover.net` for Claude-compatible clients. +`cpa-api.paperclover.net` is the client endpoint: use +`https://cpa-api.paperclover.net/v1` for OpenAI-compatible clients or +`https://cpa-api.paperclover.net` for Claude-compatible clients. Nomad variable `nomad/jobs/cliproxy` owns `api_key` and `management_key`. Keep values in restricted private files or a password manager; do not paste them -- 2.54.1