Hearth documentation

Passwords

Passwords is a password manager inside Hearth. It is a Bitwarden client in front of Vaultwarden, a Bitwarden-compatible server you run next to Hearth. The same vaults also open in Bitwarden's own apps and browser extensions.

Hearth makes each person's vault account for them, and disables or deletes it with their Hearth account. Nobody signs up on Vaultwarden directly.

The Vaultwarden container

  hearth-vaultwarden:
    image: hearth-vaultwarden:local
    build:
      context: ./vaultwarden
      args:
        HEARTH_URL: https://hearth.example.org
    restart: unless-stopped
    environment:
      DOMAIN: https://vault.example.org
      SIGNUPS_ALLOWED: "false"
      INVITATIONS_ALLOWED: "false"
      SENDS_ALLOWED: "false"
      EMERGENCY_ACCESS_ALLOWED: "false"
      PASSWORD_HINTS_ALLOWED: "false"
      SHOW_PASSWORD_HINT: "false"
      WEB_VAULT_ENABLED: "true"
      WEB_VAULT_FOLDER: /vault-pages
      ADMIN_TOKEN_FILE: /run/secrets/vaultwarden-admin-token-hash
      IP_HEADER: X-Forwarded-For
      LOG_LEVEL: warn
    volumes:
      - ./data/vaultwarden:/data
      - ./secrets/vaultwarden-admin-token-hash:/run/secrets/vaultwarden-admin-token-hash:ro
    ports:
      - 127.0.0.1:8086:80
    mem_limit: 256m

Copy deploy/vaultwarden from the repository into the deployment folder as vaultwarden/. It builds on the official Vaultwarden image and replaces Vaultwarden's own web vault with two sets of pages: the connector pages Bitwarden's apps use for security keys, and Hearth's page for adding a security key. HEARTH_URL is Hearth's https address, without a trailing slash.

Sign-ups, invitations, mail and Sends are off on purpose: Hearth makes the accounts, and Vaultwarden's mail would stop Hearth from making them.

The admin token

Hearth uses Vaultwarden's admin interface to make and remove accounts.

  1. Make a random token of at least 32 characters:

    openssl rand -hex 32 > secrets/vaultwarden-admin-token
    
  2. Make its Argon2 hash for Vaultwarden, which keeps only the hash:

    docker compose run --rm hearth-vaultwarden /vaultwarden hash
    

    Paste the token when asked and save the line it prints (starting $argon2id$) as secrets/vaultwarden-admin-token-hash.

  3. Give Hearth the plain token and the addresses:

    VAULTWARDEN_URL: http://hearth-vaultwarden
    VAULTWARDEN_ADMIN_TOKEN_FILE: /run/hearth/vaultwarden-admin-token
    VAULTWARDEN_EMAIL_DOMAIN: vault.example.org
    VAULTWARDEN_PUBLIC_URL: https://vault.example.org
    
Setting Meaning
VAULTWARDEN_URL Vaultwarden as Hearth reaches it, on the private network
VAULTWARDEN_ADMIN_TOKEN_FILE the plain admin token
VAULTWARDEN_EMAIL_DOMAIN vault sign-in names are <username>@<this domain>; no mail is sent to them, so it need not receive mail
VAULTWARDEN_PUBLIC_URL where Bitwarden's apps reach the same server (https); shown in people's Passwords settings. Empty: Passwords works only inside Hearth

The first three go together; Passwords is off without them.

The proxy

Only Bitwarden's apps need Vaultwarden's own address. Refuse its admin page from outside, since only Hearth uses it:

vault.example.org {
	encode zstd gzip
	@admin path /admin /admin/*
	respond @admin 404
	reverse_proxy 127.0.0.1:8086
}

The proxy must set X-Forwarded-For from the real client, because Vaultwarden limits sign-in attempts by address.

What the server can see

Vaults are encrypted and decrypted in the browser, with Bitwarden's own scheme. Hearth's server passes encrypted values between the browser and Vaultwarden and never sees an item in the clear.

People can choose Unlock with Hearth's sign-in (on by default), which keeps their vault key sealed with Hearth's master key. Whoever controls the server and the master key could then open those vaults. People who turn it off rely on their vault password alone, and a forgotten vault password then means a lost vault.

Backups

Vaultwarden keeps every vault in its data folder (SQLite). Mount that folder read only into the Hearth containers and set BACKUP_VAULTWARDEN_DIR, and Hearth's backup copies it consistently while it runs (Backups).