From 4376984515b3863b1d9de9bf0b4c04c28c0c56e5 Mon Sep 17 00:00:00 2001 From: "Hunam (Elie TD)" Date: Mon, 8 Apr 2024 15:45:12 +0300 Subject: [PATCH] feat(dozzle): add auth support (#3070) * feat(dozzle): add auth support * rename users.yml to users.yml.template for the template to work * dozzle requires a password hash instead of a raw password * make password hash field a type password again * fix username * password hash field: use hint --- apps/dozzle/config.json | 21 ++++++++++++++++++++- apps/dozzle/data/users.yml.template | 4 ++++ apps/dozzle/docker-compose.yml | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 apps/dozzle/data/users.yml.template diff --git a/apps/dozzle/config.json b/apps/dozzle/config.json index b175b398..a6042924 100644 --- a/apps/dozzle/config.json +++ b/apps/dozzle/config.json @@ -15,6 +15,25 @@ "author": "Amir Raminfar", "source": "https://github.com/amir20/dozzle", "form_fields": [ + { + "env_variable": "DOZZLE_USERNAME", + "label": "Username", + "required": true, + "min": 1, + "max": 128, + "type": "text" + }, + { + "env_variable": "DOZZLE_PASSWORD_HASH", + "label": "Password Hash (SHA-256)", + "hint": "Tutorial: https://gist.github.com/Hunam6/45ddf6f29e88af2d137efdded899cb25", + "pattern_error": "Invalid hash, make sure to follow this tutorial: https://gist.github.com/Hunam6/45ddf6f29e88af2d137efdded899cb25", + "regex": "^[a-fA-F0-9]{64}$", + "type": "password", + "required": true, + "min": 64, + "max": 64 + }, { "type": "boolean", "label": "Disable Google Analytics", @@ -26,4 +45,4 @@ "arm64", "amd64" ] -} +} \ No newline at end of file diff --git a/apps/dozzle/data/users.yml.template b/apps/dozzle/data/users.yml.template new file mode 100644 index 00000000..949b9199 --- /dev/null +++ b/apps/dozzle/data/users.yml.template @@ -0,0 +1,4 @@ +users: + {{DOZZLE_USERNAME}}: + name: {{DOZZLE_USERNAME}} + password: "{{DOZZLE_PASSWORD_HASH}}" \ No newline at end of file diff --git a/apps/dozzle/docker-compose.yml b/apps/dozzle/docker-compose.yml index a8f6ee58..cfe6b28e 100644 --- a/apps/dozzle/docker-compose.yml +++ b/apps/dozzle/docker-compose.yml @@ -5,12 +5,14 @@ services: restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock + - ${APP_DATA_DIR}/data:/data ports: - ${APP_PORT}:8080 networks: - tipi_main_network environment: - DOZZLE_NO_ANALYTICS=${DOZZLE_NO_ANALYTICS-true} + - DOZZLE_AUTH_PROVIDER=simple labels: # Main traefik.enable: true