authoravatarclover caruso<git@paperclover.net>2026-10-28 21:48:15-07:00
committeravatarclover caruso<git@paperclover.net>2026-11-12 16:08:55-08:00
log0701dbcf4c737821b522372cdf8419a1cf3a085d
tree2b713760b7efde6cc4e15d02962b703838b68d22
parent308dd71916c2998f8ee2a241d8da499c31d9ad93
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

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

4 files changed, 9 insertions(+), 16 deletions(-)

service/cliproxy/service.pkl+2-3
......@@ -4,7 +4,6 @@ import "../../config/site.pkl" as site
44import "../../config/OpenID.pkl" as sso
55
66name = "CLIProxyAPI"
7enabled = false
87tagline = "Codex and Claude API access"
98access = "infra-admin"
109stageIsolation = "fresh"
......@@ -23,10 +22,10 @@ container {
2322 tmpfs { "/tmp:rw,nosuid,nodev,noexec,size=64m" }
2423 http {
2524 containerPort = 8080
26 subdomain = "cliproxy"
25 subdomain = "cpa"
2726 authRole = "infra-admin"
2827 checkPath = "/healthz"
29 plainHostnames { "cliproxy-api.\(site.domain)" }
28 plainHostnames { "cpa-api.\(site.domain)" }
3029 }
3130 volumes {
3231 ["/data"] {}
service/forward-auth/service.pkl+1-1
......@@ -14,7 +14,7 @@ requirements {
1414 name = module.name
1515 redirectUris {
1616 when (isPreview) { "https://\(module.id).\(site.domain)/snow.oauth2/callback" }
17 when (!isPreview) { for (host in new Listing<String> { "music"; "seedbox"; "ddns"; "redis"; "pg"; "snr"; "rdr"; "logs"; "metrics"; "traces"; "jkt"; "openclaw"; "cliproxy" }) {
17 when (!isPreview) { for (host in new Listing<String> { "music"; "seedbox"; "ddns"; "redis"; "pg"; "snr"; "rdr"; "logs"; "metrics"; "traces"; "jkt"; "openclaw"; "cpa" }) {
1818 "https://\(host).\(site.domain)/snow.oauth2/callback"
1919 } }
2020 }
tools/cliproxy-test.py+2-2
......@@ -31,7 +31,7 @@ PANEL = None
3131API_KEY = "a1" * 32
3232MANAGEMENT_KEY = "b2" * 32
3333ADMIN_HOST = "cliproxy-preview-12345678.paperclover.net"
34API_HOST = "cliproxy-preview-12345678-cliproxy-api.paperclover.net"
34API_HOST = "cliproxy-preview-12345678-cpa-api.paperclover.net"
3535
3636
3737class ServiceTests(unittest.TestCase):
......@@ -59,7 +59,7 @@ class ServiceTests(unittest.TestCase):
5959 self.assertEqual(config["oauth"]["auth-dir"], "/data/auth")
6060 self.assertTrue(config["management"]["disable-auto-update-panel"])
6161 self.assertEqual(app["http"]["authRole"], "infra-admin")
62 self.assertEqual(app["http"]["plainHostnames"], ['cliproxy-api.paperclover.net'])
62 self.assertEqual(app["http"]["plainHostnames"], ['cpa-api.paperclover.net'])
6363 self.assertEqual(self.data["stageIsolation"], "fresh")
6464
6565 def test_rendered_job_has_only_nonroot_private_managed_storage(self):
tools/cliproxy.md+4-10
......@@ -1,17 +1,11 @@
11# CLIProxyAPI
22
3The service is parked with `enabled = false`: its job and public routes are
4removed while the source, `/srv/prod/cliproxy`, and Nomad variables remain.
5To resume, set `enabled = true` in `service/cliproxy/service.pkl` and use the
6normal production deployment workflow; existing configuration and accounts are
7retained.
8
9`cliproxy.paperclover.net` is the management panel, protected by Snow's
3`cpa.paperclover.net` is the management panel, protected by Snow's
104`infra-admin` role. Snow sign-in opens it automatically; nginx supplies the
115independent management key to its management endpoints on the server.
12`cliproxy-api.paperclover.net` is the client endpoint: use
13`https://cliproxy-api.paperclover.net/v1` for OpenAI-compatible clients or
14`https://cliproxy-api.paperclover.net` for Claude-compatible clients.
6`cpa-api.paperclover.net` is the client endpoint: use
7`https://cpa-api.paperclover.net/v1` for OpenAI-compatible clients or
8`https://cpa-api.paperclover.net` for Claude-compatible clients.
159
1610Nomad variable `nomad/jobs/cliproxy` owns `api_key` and `management_key`.
1711Keep values in restricted private files or a password manager; do not paste them