Repository navigation
Separate the admin account from inference API keys - #102
Merged
Merged
Conversation
- WebUI sign-in uses an admin username and scrypt-hashed password; sessions last 12 hours or 400 days with "remember me", and account changes revoke other sessions and return a fresh CSRF token - Startup migrates the legacy default key into the admin password and a hashed admin API key; without CODEBUDDY2API_KEY it prints a random initial password and creates no inference key - New Keys page and /admin/keys API: one hashed admin key plus standard keys with expiry, IP/CIDR allowlists, RPM and model limits, rotation, reveal and copy - API keys authorize only /v1/*, the management Cookie only /admin/*; standard keys cannot read account-pool billing or other keys' video tasks, and any key row disables open no-auth mode - Audit rows record the calling key: logs filter by key and the Keys table shows 24-hour requests and last use; clearing all logs now re-confirms with the management password - `converter.py admin reset-password` resets the account from a TTY; config migration moves to v3 and carries api_keys - Settings gains an Admin account tab, the login page asks for a username and password, preview seeds sample keys, and the English and Chinese docs cover the new model
|
Sorry @maiphucgiang, your pull request is larger than the review limit of 150,000 diff characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CODEBUDDY2API_KEYstays an inference-only admin key and doubles as the initial password until it is changed. Without one, startup prints a random initial password and creates no inference key./admin/keysAPI. At most one database admin key (unrestricted, shown only at creation or rotation, hash stored), plus standard keys with name, enable/disable, expiry, IP/CIDR allowlist, RPM and model restrictions, rotation, reveal, copy and deletion. Standard keys are stored in plaintext incontrol.sqlite3and backups, which the docs and.env.examplenow call out./v1/*, and the management Cookie authorizes only/admin/*. Standard keys cannot read account-pool billing or poll another key's video tasks. Any key row, even a disabled or expired one, turns offCODEBUDDY2API_ALLOW_OPEN_NOAUTH.<id> (deleted)or— (pre-upgrade)for older rows, and the Keys table shows approximate 24-hour requests and last use. Clearing all logs and statistics now re-confirms with the management password.converter.py admin reset-password [--username NAME]resets the account from a TTY, even while the server runs. Config migration moves to schema v3 and carriesapi_keys. The preview signs in asadmin/previewand seeds sample restricted keys.AGENTS.mdlists the new subcommand.#101