Repository navigation
deploy: install-key.sh — put a secret into the VM's env file over SSH, stdin only - #20
Open
luiscota99 wants to merge 1 commit into
Open
luiscota99 wants to merge 1 commit into
luiscota99 wants to merge 1 commit into
Conversation
…, stdin only The operator runs it on their own machine. The value is read from a local file (default ~/Documents/engram-hub-key.txt), validated (placeholder refused; ENGRAM_LLM_API_KEY must be sk-ant-…; no whitespace/quotes), and sent to the VM on stdin — never as an argument, never echoed, never in a log or a transcript. On the VM (sudo -n): create /etc/engram if missing, install deploy/engram.env.example if the env file is missing (0640 root:engram, or root:root until the engram group exists), replace the one VAR= line, restart engram-serve only if it is running. The local file is deleted afterwards unless --keep. --dry-run shows the plan and sends nothing; --var/--key-file install a second secret (Gemini) the same way. Test: bash -n, dry run never prints the key, placeholder and non-sk-ant values refused with exit 2, bad var name refused. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
deploy/install-key.sh: the operator runs it on their own machine to put an API key into/etc/engram/engram.envon the hub VM without the key appearing in a shell argument, a log, or a chat transcript.~/Documents/engram-hub-key.txt, line 1), refuses the placeholder, refuses a non-sk-ant-value forENGRAM_LLM_API_KEY, refuses whitespace/quotes. Never echoes it.sudo -n: creates/etc/engramif missing, installsdeploy/engram.env.exampleif the env file is missing (0640root:engram, orroot:rootuntil theengramgroup exists), replaces the oneVAR=line with the value from stdin, restartsengram-serveonly if it is running.shred/rm -P) unless--keep.--dry-runprints the plan and sends nothing.--var ENGRAM_EMBED_API_KEY --key-file …installs a second secret the same way.deploy/README.mdstep 2 documents it beside the on-VM alternative.Verification
bash -nparses;shellchecknot installed locallytests/test_deploy_files.py: dry run output never contains the key, names host/path/length; placeholder → exit 2; non-Anthropic value → exit 2 without echoing it; bad var name → exit 2hubuser has passwordless sudo, Ubuntu 26.04, Python 3.14, Engram not yet installed — the script's "template if missing / root:root until the group exists" branches are for exactly that state🤖 Generated with Claude Code