Variables and secrets
andamio app secret set myapp STRIPE_KEYIt asks for the value hidden (it isn’t shown while you type, nor kept in your terminal’s history). It works the same for something secret (an API key) and for something that isn’t (a setting).
What happens
Section titled “What happens”- The value is stored encrypted with sops in
apps/myapp/secrets.sops.env, in your copy. - It’s committed and pushed; the message carries only the name, never the value.
- It’s applied on the server: your app restarts with the new variable, in seconds. No deploy is needed, because the image is the same.
✓ STRIPE_KEY added (apps/myapp/secrets.sops.env, encrypted)✓ myapp now runs with the changes (restarted, no deploy needed: same image)If it already existed, its value is replaced (✓ STRIPE_KEY updated). There are never
two with the same name.
If the last deploy failed
Section titled “If the last deploy failed”Typical: you pushed code that reads a new variable and forgot to create it. The deploy fails (and your previous version stays online). When you create the variable, andamio asks:
myapp's last deploy failed. Retry it now, with the changes? [Y/n]And re-runs that deploy without you going to GitHub.
Several at once
Section titled “Several at once”From a .env file (one KEY=value per line; export and quotes are fine, lines with # are
ignored): all are checked before touching anything, they’re encrypted together and the app
restarts only once. The commit carries only the names.
andamio app secret import myapp .env.productionIn the panel: Variables → Paste several, paste the .env or choose the file, and see which
are new, which replace one and which have a problem, with the values hidden.
Another way: save them one by one without applying and apply once at the end:
andamio app secret set myapp STRIPE_KEY --laterandamio app secret set myapp SMTP_PASSWORD --laterandamio app apply myappOther commands
Section titled “Other commands”andamio app secret list myapp # names only, never valuesandamio app secret rm myapp STRIPE_KEY # remove itcat key.txt | andamio app secret set myapp STRIPE_KEY # the value from a fileDOMAIN, DATABASE_URL, MYSQL_URL, REDIS_URL and TAG are set by andamio and can’t be changed by
hand.
Why not GitHub Secrets
Section titled “Why not GitHub Secrets”GitHub’s Secrets only exist inside the pipeline: taking them to your server would force the
deploy key to carry secrets, and they’re write-only, so a rebuilt server would have nowhere
to get them from. With sops they live encrypted in your repo, the key to decrypt them is
only on your machine, and andamio server puts them back.
GitHub’s Secrets are the right place for build secrets. See Deploys.