mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-27 15:41:45 +01:00
feat: uses bcrypt hash instead (#3293)
This commit is contained in:
@@ -18,16 +18,16 @@ The content of the file looks like:
|
||||
users:
|
||||
# "admin" here is username
|
||||
admin:
|
||||
name: "Admin"
|
||||
# Just sha-256 which can be computed with "echo -n password | shasum -a 256"
|
||||
password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
|
||||
email: me@email.net
|
||||
name: Admin
|
||||
# Generate with docker run amir20/dozzle generate --name Admin --email me@email.net --password secret admin
|
||||
password: $2a$11$9ho4vY2LdJ/WBopFcsAS0uORC0x2vuFHQgT/yBqZyzclhHsoaIkzK
|
||||
```
|
||||
|
||||
> [!TIP]
|
||||
> This file can be generated with `docker run amir20/dozzle generate` with v6.6.x. See [below](#generating-users-yml) for more details.
|
||||
Dozzle uses `email` to generate avatars using [Gravatar](https://gravatar.com/). It is optional. The password is hashed using `bcrypt` which can be generated using `docker run amir20/dozzle generate`.
|
||||
|
||||
Dozzle uses `email` to generate avatars using [Gravatar](https://gravatar.com/). It is optional. The password is hashed using `sha256` which can be generated with `echo -n 'secret-password' | shasum -a 256` or `echo -n 'secret-password' | sha256sum` on linux.
|
||||
> [!WARNING]
|
||||
> In previous versions of Dozzle, SHA-256 was used to hash passwords. Bcrypt is now more secure and is recommended for future use. Dozzle will revert to SHA-256 if it does not find a bcrypt hash. It is advisable to update the password hash to bcrypt using `docker run amir20/dozzle generate`. For more details, see [this issue](https://github.com/amir20/dozzle/security/advisories/GHSA-w7qr-q9fh-fj35).
|
||||
|
||||
You will need to mount this file for Dozzle to find it. Here is an example:
|
||||
|
||||
@@ -52,21 +52,19 @@ services:
|
||||
|
||||
```yaml [users.yml]
|
||||
users:
|
||||
# "admin" here is username
|
||||
admin:
|
||||
name: "Admin"
|
||||
# Just sha-256 which can be computed with "echo -n password | shasum -a 256"
|
||||
password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
|
||||
email: me@email.net
|
||||
name: Admin
|
||||
password: $2a$11$9ho4vY2LdJ/WBopFcsAS0uORC0x2vuFHQgT/yBqZyzclhHsoaIkzK
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
Dozzle uses [JWT](https://en.wikipedia.org/wiki/JSON_Web_Token) to generate tokens for authentication. This token is saved in a cookie.
|
||||
|
||||
## Generating users.yml <Badge type="tip" text="v6.6.x" />
|
||||
## Generating users.yml
|
||||
|
||||
Starting with version `v6.6.x`, Dozzle has a builtin `generate` command to generate `users.yml`. Here is an example:
|
||||
Dozzle has a builtin `generate` command to generate `users.yml`. Here is an example:
|
||||
|
||||
```sh
|
||||
docker run amir20/dozzle generate admin --password password --email test@email.net --name "John Doe" > users.yml
|
||||
|
||||
Reference in New Issue
Block a user