-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: uses bcrypt hash instead (#3293)
- Loading branch information
Showing
4 changed files
with
37 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: [email protected] | ||
name: Admin | ||
# Generate with docker run amir20/dozzle generate --name Admin --email [email protected] --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: [email protected] | ||
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 [email protected] --name "John Doe" > users.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters