[GH-ISSUE #3411] Allow noninteractive and silent usage (or stderr) for vaultwarden hash #1558

Closed
opened 2026-03-03 02:10:14 +03:00 by kerem · 2 comments
Owner

Originally created by @dionysius on GitHub (Apr 3, 2023).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/3411

Subject of the issue

vaultwarden hash currently ask interactively for the password and there is no option to be silent. In my packaging environment there is a way to interactively ask the admin for a password at the right time of the installation. And I would like use this input to generate the argon2 hash and automatically place it in the right place of the config file.

Suggestion: I'd like to pass in the password via STDIN and get only the hash out via STDOUT. (Although prefixed with ADMIN_TOKEN= is also fine, to make life easier for you)

Deployment environment

  • vaultwarden version: 1.28.1
  • Install method: debian-packaging (built from source)
Originally created by @dionysius on GitHub (Apr 3, 2023). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/3411 <!-- # ### NOTE: Please update to the latest version of vaultwarden before reporting an issue! This saves you and us a lot of time and troubleshooting. See: * https://github.com/dani-garcia/vaultwarden/issues/1180 * https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/redact personal or confidential information, such as passwords, IP addresses, and DNS names as appropriate. --> ### Subject of the issue <!-- Describe your issue here. --> `vaultwarden hash` currently ask interactively for the password and there is no option to be silent. In my packaging environment there is a way to interactively ask the admin for a password at the right time of the installation. And I would like use this input to generate the argon2 hash and automatically place it in the right place of the config file. Suggestion: I'd like to pass in the password via STDIN and get only the hash out via STDOUT. (Although prefixed with `ADMIN_TOKEN=` is also fine, to make life easier for you) ### Deployment environment <!-- ========================================================================================= Preferably, use the `Generate Support String` button on the admin page's Diagnostics tab. That will auto-generate most of the info requested in this section. ========================================================================================= --> <!-- The version number, obtained from the logs (at startup) or the admin diagnostics page --> <!-- This is NOT the version number shown on the web vault, which is versioned separately from vaultwarden --> <!-- Remember to check if your issue exists on the latest version first! --> * vaultwarden version: 1.28.1 <!-- How the server was installed: Docker image, OS package, built from source, etc. --> * Install method: debian-packaging (built from source)
kerem closed this issue 2026-03-03 02:10:14 +03:00
Author
Owner

@BlackDex commented on GitHub (Apr 3, 2023):

I'm not a big fan of piping passwords actually.
While it maybe would be fine for your use case, people tend to use the easy stuff and then passwords end up in the history.

Not sure if you can depend on the argon2 cli tool and use that? That does support what you want.

<!-- gh-comment-id:1493670329 --> @BlackDex commented on GitHub (Apr 3, 2023): I'm not a big fan of piping passwords actually. While it maybe would be fine for your use case, people tend to use the easy stuff and then passwords end up in the history. Not sure if you can depend on the argon2 cli tool and use that? That does support what you want.
Author
Owner

@dionysius commented on GitHub (Apr 3, 2023):

I totally understand you have different goals with the command, just asking. Using vaultwarden would've saved me declaring this dependency and maintaining the recommended settings, but it's not a big deal.

<!-- gh-comment-id:1493697063 --> @dionysius commented on GitHub (Apr 3, 2023): I totally understand you have different goals with the command, just asking. Using vaultwarden would've saved me declaring this dependency and maintaining the recommended settings, but it's not a big deal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#1558
No description provided.