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...@@ -4,7 +4,6 @@ import "../../config/site.pkl" as site
4import "../../config/OpenID.pkl" as sso4import "../../config/OpenID.pkl" as sso
55
6name = "CLIProxyAPI"6name = "CLIProxyAPI"
7enabled = false
8tagline = "Codex and Claude API access"7tagline = "Codex and Claude API access"
9access = "infra-admin"8access = "infra-admin"
10stageIsolation = "fresh"9stageIsolation = "fresh"
...@@ -23,10 +22,10 @@ container {...@@ -23,10 +22,10 @@ container {
23 tmpfs { "/tmp:rw,nosuid,nodev,noexec,size=64m" }22 tmpfs { "/tmp:rw,nosuid,nodev,noexec,size=64m" }
24 http {23 http {
25 containerPort = 808024 containerPort = 8080
26 subdomain = "cliproxy"25 subdomain = "cpa"
27 authRole = "infra-admin"26 authRole = "infra-admin"
28 checkPath = "/healthz"27 checkPath = "/healthz"
29 plainHostnames { "cliproxy-api.\(site.domain)" }28 plainHostnames { "cpa-api.\(site.domain)" }
30 }29 }
31 volumes {30 volumes {
32 ["/data"] {}31 ["/data"] {}
service/forward-auth/service.pkl+1-1
...@@ -14,7 +14,7 @@ requirements {...@@ -14,7 +14,7 @@ requirements {
14 name = module.name14 name = module.name
15 redirectUris {15 redirectUris {
16 when (isPreview) { "https://\(module.id).\(site.domain)/snow.oauth2/callback" }16 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" }) {
18 "https://\(host).\(site.domain)/snow.oauth2/callback"18 "https://\(host).\(site.domain)/snow.oauth2/callback"
19 } }19 } }
20 }20 }
tools/cliproxy-test.py+2-2
...@@ -31,7 +31,7 @@ PANEL = None...@@ -31,7 +31,7 @@ PANEL = None
31API_KEY = "a1" * 3231API_KEY = "a1" * 32
32MANAGEMENT_KEY = "b2" * 3232MANAGEMENT_KEY = "b2" * 32
33ADMIN_HOST = "cliproxy-preview-12345678.paperclover.net"33ADMIN_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
37class ServiceTests(unittest.TestCase):37class ServiceTests(unittest.TestCase):
...@@ -59,7 +59,7 @@ class ServiceTests(unittest.TestCase):...@@ -59,7 +59,7 @@ class ServiceTests(unittest.TestCase):
59 self.assertEqual(config["oauth"]["auth-dir"], "/data/auth")59 self.assertEqual(config["oauth"]["auth-dir"], "/data/auth")
60 self.assertTrue(config["management"]["disable-auto-update-panel"])60 self.assertTrue(config["management"]["disable-auto-update-panel"])
61 self.assertEqual(app["http"]["authRole"], "infra-admin")61 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'])
63 self.assertEqual(self.data["stageIsolation"], "fresh")63 self.assertEqual(self.data["stageIsolation"], "fresh")
6464
65 def test_rendered_job_has_only_nonroot_private_managed_storage(self):65 def test_rendered_job_has_only_nonroot_private_managed_storage(self):
tools/cliproxy.md+4-10
...@@ -1,17 +1,11 @@...@@ -1,17 +1,11 @@
1# CLIProxyAPI1# CLIProxyAPI
22
3The service is parked with `enabled = false`: its job and public routes are3`cpa.paperclover.net` is the management panel, protected by Snow's
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
10`infra-admin` role. Snow sign-in opens it automatically; nginx supplies the4`infra-admin` role. Snow sign-in opens it automatically; nginx supplies the
11independent management key to its management endpoints on the server.5independent management key to its management endpoints on the server.
12`cliproxy-api.paperclover.net` is the client endpoint: use6`cpa-api.paperclover.net` is the client endpoint: use
13`https://cliproxy-api.paperclover.net/v1` for OpenAI-compatible clients or7`https://cpa-api.paperclover.net/v1` for OpenAI-compatible clients or
14`https://cliproxy-api.paperclover.net` for Claude-compatible clients.8`https://cpa-api.paperclover.net` for Claude-compatible clients.
159
16Nomad variable `nomad/jobs/cliproxy` owns `api_key` and `management_key`.10Nomad variable `nomad/jobs/cliproxy` owns `api_key` and `management_key`.
17Keep values in restricted private files or a password manager; do not paste them11Keep values in restricted private files or a password manager; do not paste them