Skip to content

How-to

Connect Vaultwarden ​

This guide lets nocturn use the items of one Vaultwarden (or Bitwarden) collection as secrets, without copying their values into its own vault. It assumes a running daemon with NOCTURN_MASTER_PASSPHRASE set and a phone on the home network.

1. Prepare the collection ​

In Vaultwarden:

  1. Create a user of its own for nocturn, with read access to one collection, say nocturn.
  2. Put the items nocturn may use into that collection.
  3. Give each item an https:// URI with the host it belongs to, such as https://portainer.home.example. nocturn sends the item to that exact host and no other.
  4. Logged in as nocturn's user, open Settings › Security › Keys › View API key and note the client ID and secret.

Taking an item out of the collection is then how you take a secret back.

2. Add the source ​

  1. In the app, open Extensions, and under Built in tap Vaultwarden.

    The Vaultwarden page: one collection of a Vaultwarden or Bitwarden server, every item a secret, its sources, and Add Vaultwarden.The Vaultwarden page: one collection of a Vaultwarden or Bitwarden server, every item a secret, its sources, and Add Vaultwarden.
  2. Tap Add Vaultwarden and fill in the form:

FieldWhat to enter
Serverhttps://vault.home.example; plain http:// only to the daemon's own machine
Collectionits name or id
Organisationonly when the collection's name is not unique across your organisations
Namehow the source is called, such as vault-home; made from the server and collection if empty
Synchow often to read it again: 1 min, 5 min (default), 15 min or 1 h
API key client ID, API key client secretfrom step 1
Account email, Master passwordof nocturn's user
  1. Tap Add Vaultwarden. The credentials are kept in nocturn's vault and never shown again.

3. Check it ​

The source shows Connected, with the number of items and when it last synced.

The source vault-home: Connected, server https://vault.home.example, collection nocturn, sync every 5 min, 6 items, account stored, one item not readable, and Sync now, Edit, Replace credentials.The source vault-home: Connected, server https://vault.home.example, collection nocturn, sync every 5 min, 6 items, account stored, one item not readable, and Sync now, Edit, Replace credentials.

Each item is now a secret, secret/<alias>, in the Secrets section of Permissions. Give it to a server under Set token › Or use one you keep, or let a chat name it.

From the terminal instead ​

The four account values go in on stdin, one per line:

sh
printf '%s\n' "$CLIENT_ID" "$CLIENT_SECRET" nocturn@home.example "$MASTER_PASSWORD" | \
  nocturn secret source add bitwarden --name vault-home \
    --url https://vault.home.example --collection nocturn
nocturn secret source show

A running daemon unlocks a new source within a minute.

What is mirrored ​

Logins, secure notes and SSH keys of the one collection become secrets; cards, identities and every item outside the collection do not. An item's hosts are the exact hosts of its https://, http://, ssh:// or bare URIs, never widened to a base domain. An item with none has no host, and nothing can use it until you add one.

How an item rides in a request:

The itemGoes out as
has a custom field header (X-API-Key, or Authorization: Token)that header, with the field token or the login's password
a login with a usernameHTTP Basic credentials
a login without a usernameAuthorization: Bearer <password>
has a custom field tokenAuthorization: Bearer <token>
a note with exactly one custom fielda header named after that field
an SSH keya key for ssh_exec; a text field host names its hosts

Several sources ​

A workspace may connect several collections, each under its own name. An item named like another source's gets the source's name after it, such as router-office.

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