From 6fd82448c5a5c0e215770c02a70c50c688e8cf2c Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Nov 2026 22:51:21 -0800 Subject: [PATCH] Dashboard: an API key button that shows the key with a copy button Behind the same sign-in as the rest of the dashboard (GET /api/key, no-store), so whoever can open the dashboard can hand the key to a client without a shell on the server. Co-Authored-By: Claude Opus 5.5 --- README.md | 3 ++- llmhost/web/index.html | 45 ++++++++++++++++++++++++++++++++++-- llmhost/web/server.py | 5 ++++ tests/test_dashboard_auth.py | 8 +++++++ 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f5bc98..a064f65 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,8 @@ It ends by printing the two Pangolin HTTP resources to create, both pointing at | dashboard, at the `--public-url` host | `:` | llm-host, through your OIDC provider | | API, at a host of your choice | `:` | llm-host, with the API key | -Clients then use `https:///v1` with the key from `llmhost key`. +Clients then use `https:///v1` with the key from `llmhost key`, or from the dashboard's **API key** button, +which shows it to anyone signed in, with a copy button. For Authelia, the client looks like this: diff --git a/llmhost/web/index.html b/llmhost/web/index.html index bb3f75e..08eff7e 100644 --- a/llmhost/web/index.html +++ b/llmhost/web/index.html @@ -158,6 +158,9 @@ pre { background: var(--panel-2); color: var(--text); margin-bottom: 12px; } .dialog .err { color: var(--bad); font-size: 12.5px; min-height: 18px; margin: -6px 0 8px; } +.dialog .keyrow { display: flex; gap: 6px; margin-bottom: 14px; } +.dialog .keyrow input { margin: 0; flex: 1; min-width: 0; } +.dialog .actions { display: flex; justify-content: flex-end; } .toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .25s; pointer-events: none; } .toast.show { opacity: 1; } @@ -171,6 +174,7 @@ pre { + @@ -276,6 +280,14 @@ pre { Sign in +
+ +