From 11cdd1b2e2a9e2c1edb4e326a485c13fe849f6a6 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Sun, 9 Mar 2025 22:32:22 +0000 Subject: [PATCH] feat(vaultwarden): add instructions for admin token and signups allowed --- .env | 18 ++++++++++++++++++ compose.yaml | 2 ++ 2 files changed, 20 insertions(+) diff --git a/.env b/.env index 4d865ea..28bcfe6 100644 --- a/.env +++ b/.env @@ -595,8 +595,26 @@ ZIPLINE_HOSTNAME= # Profiles: vaultwarden, all # # After you have started the container, you will need to set up the admin user by just visiting the hostname you set below. +# +# The admin token can be generated with this command: +# openssl rand -base64 48 +# +# However, for further security, you should secure the token by storing a hash of it instead using Argon2. +# First, install argon2 with the following command: +# sudo apt install argon2 +# +# Then, run this command, replacing YourPreviouslyGeneratedTokenHere with the token generated using the openssl command earlier. +# echo -n "YourPreviouslyGeneratedTokenHere" | argon2 "$(openssl rand -base64 32)" -e -id -k 65540 -t 3 -p 4 | sed 's/\$/\$\$/g' +# +# Store the output of the above command in the environment variable below. Note, to log in at the /admin page, you need to use the original admin token +# before hashing +# +# Once you have created your own account, it is recommended that you disable signups by setting the 'VAULTWARDEN_SIGNUPS_ALLOWED' environment variable +# to false. # --------------------------------------------------------- VAULTWARDEN_HOSTNAME= +VAULTWARDEN_SIGNUPS_ALLOWED=true +VAULTWARDEN_ADMIN_TOKEN= # --------------------------------------------------------- # --------------------------------------------------------- diff --git a/compose.yaml b/compose.yaml index 98ed48c..87387e9 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1218,6 +1218,8 @@ services: - 80 environment: DOMAIN: "https://${VAULTWARDEN_HOSTNAME?}" + SIGNUPS_ALLOWED: ${VAULTWARDEN_SIGNUPS_ALLOWED:-true} + ADMIN_TOKEN: ${VAULTWARDEN_ADMIN_TOKEN?} volumes: - ./data/vaultwarden:/data/ labels: