[GH-ISSUE #188] Use hash for user passwords in config file #1331

Closed
opened 2026-04-16 07:58:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @RichyHBM on GitHub (Feb 11, 2025).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/188

Currently the password is saved in plain text which makes it insecure when committing to repos etc. Ideally the installer script would hash the password and then save it to the config in that format.

Imagine the short term migration could be, check user submitted password hashed matches stored hashed password, otherwise just check if both are the same (to account for users that may not have hashed passwords when upgrading)

Bcrypt seems to be a good standard these days

Originally created by @RichyHBM on GitHub (Feb 11, 2025). Original GitHub issue: https://github.com/fosrl/pangolin/issues/188 Currently the password is saved in plain text which makes it insecure when committing to repos etc. Ideally the installer script would hash the password and then save it to the config in that format. Imagine the short term migration could be, check user submitted password hashed matches stored hashed password, otherwise just check if both are the same (to account for users that may not have hashed passwords when upgrading) Bcrypt seems to be a good standard these days
Author
Owner

@miloschwartz commented on GitHub (Feb 11, 2025):

ALL authentication data (password, access tokens, etc) are hashed according to industry standards before saving in the database. ONLY the main user is stored in the YAML file.

We decided to keep the admin user in the YAML to allow you to easily reset the password without email enabled for password recovery to prevent you from getting locked out. Every time the server starts, it reads this password, hashes it, and inserts it into the database.

If you'd prefer to set this password at runtime via an environment variable, you can set USERS_SERVERADMIN_PASSWORD. This will override the password in the config.yml file, and enables you to use Docker secrets or some other method of loading environment variables securely.

<!-- gh-comment-id:2651184661 --> @miloschwartz commented on GitHub (Feb 11, 2025): ALL authentication data (password, access tokens, etc) are hashed according to industry standards before saving in the database. ONLY the main user is stored in the YAML file. We decided to keep the admin user in the YAML to allow you to easily reset the password without email enabled for password recovery to prevent you from getting locked out. Every time the server starts, it reads this password, hashes it, and inserts it into the database. If you'd prefer to set this password at runtime via an environment variable, you can set `USERS_SERVERADMIN_PASSWORD`. This will override the password in the config.yml file, and enables you to use Docker secrets or some other method of loading environment variables securely.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#1331