Repository navigation
feat: keep the master key in a file llmr makes on first start - #88
Closed
recepkizilarslan wants to merge 1 commit into
Closed
recepkizilarslan wants to merge 1 commit into
recepkizilarslan wants to merge 1 commit into
Conversation
A stack that runs llmr next to its own services had no way to start without someone generating a key and pasting it into the environment first. LLMR_MASTER_KEY_FILE names a file instead. When the file is absent, llmr makes a new key there and reads it back on every later start. - The file is created with create_new and never replaced, so processes starting together agree on one key. On Unix it is readable by its owner only. - A file holding something that is not a key is an error. llmr never replaces it with a fresh key, which would orphan every stored credential. - LLMR_MASTER_KEY still wins when both are set. - The image prepares /var/lib/llmr-key, owned by its user, so a named volume mounted there keeps the key apart from the database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Not needed: Korkut's installer generates LLMR_MASTER_KEY, so llmr stays as it is. |
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.
Why
A stack that runs llmr beside its own services (Korkut installs with a single
docker compose up) could not start llmr without someone first generating a key and pasting it into the environment. Compose cannot generate a secret, and the image has no shell to do it in an entrypoint.What
LLMR_MASTER_KEY_FILEMasterKey::load_or_create) and reads it on every later start.create_newand never replaced: processes starting together agree on one key, and readers wait briefly for a key still being written. On Unix the file is mode 0600.LLMR_MASTER_KEYstill wins when both are set. With neither set, the error names both options./var/lib/llmr-key, owned by uid 65532, so a named volume mounted there can hold the key apart from the database. This keeps "a copy of the database alone opens nothing" true.Verified
fmt --check, the threeclippyvariants with-D warnings, andcargo testwith and without all features.crypto::tests:LLMR_MASTER_KEY_FILE=/var/lib/llmr-key/master_keyon a named volume./healthzreturns 200, and the key file is-rw------- 65532.problems: []).