Skip to content

How-to

Manage secrets from the terminal ​

This guide lists, sets, points and removes secrets with nocturn secret. Run every command on the daemon's machine, in the folder that holds .env and nocturn-data/, with NOCTURN_MASTER_PASSPHRASE set. In Docker, prefix each with docker compose exec -T nocturn.

List what is stored ​

sh
nocturn secret ls
nocturn secret source show

ls prints names only, never a value.

Give an extension its credential ​

sh
printf %s "$TOKEN" | nocturn secret set acme              # an MCP server, or an extension with one credential
printf %s "$KEY"   | nocturn secret set weather/apikey    # one named credential of a plugin
nocturn reload

The value is read from stdin. Running set again replaces it.

Point a credential at a Vaultwarden item ​

Instead of a copy, keep a reference to an item of a connected source:

sh
nocturn secret set weather/apikey --ref vault-home:<item id>

Keep a secret of your own for some hosts ​

An entry of nocturn's own vault, vault/<name>, can be used by the HTTP tools (as: vault/<name>) for the hosts you name and no others:

sh
printf %s "$TOKEN" | nocturn secret set vault/grafana --host grafana.home.example
printf %s "$TOKEN" | nocturn secret set vault/hass --host hass.home.example \
  --header Authorization --prefix 'Bearer '

--host repeats for several hosts. The value rides in Authorization: Bearer <value> unless --header and --prefix say otherwise. Without any --host, nothing can use it.

Store an SSH key ​

sh
nocturn secret set vault/fw-admin --ssh-user admin --host fw.home.example < ~/.ssh/nocturn_fw

The key must have no passphrase: the vault is encrypted already. See SSH.

The mailbox's passwords ​

sh
printf %s "$SMTP_PASSWORD" | nocturn secret set mail/smtp   # a separate app password for sending

Change or remove a source ​

sh
nocturn secret source set vault-home --sync 15m               # change how often it syncs
nocturn secret source set vault-home --name vault-family      # rename; aliases and rules follow
nocturn secret source add bitwarden --replace --name vault-home --url https://vault.home.example --collection nocturn
nocturn secret source remove vault-home

A new --url needs the credentials again, so it goes through add --replace, which reads them from stdin as add does. Removing a source also drops the rules on its items.

Remove a secret ​

sh
nocturn secret rm weather/apikey
nocturn secret rm vault/grafana

nocturn is open source. Example hosts and people on these pages are made up.