diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 23694068..6dc77c83 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -65,13 +65,16 @@ export default defineConfig({ items: [ { text: "Authentication", link: "/guide/authentication" }, { text: "Healthcheck", link: "/guide/healthcheck" }, - { text: "Remote Host", link: "/guide/remote-host" }, + { text: "Remote Hosts", link: "/guide/remote-hosts" }, { text: "Supported Env Vars", link: "/guide/supported-env-vars" }, ], }, { text: "Troubleshooting", - items: [{ text: "FAQ", link: "/guide/faq" }], + items: [ + { text: "FAQ", link: "/guide/faq" }, + { text: "Debugging", link: "/guide/debugging" }, + ], }, ], diff --git a/docs/guide/authentication.md b/docs/guide/authentication.md index 98a72d8d..20e47f38 100644 --- a/docs/guide/authentication.md +++ b/docs/guide/authentication.md @@ -27,3 +27,31 @@ services: ``` ::: + +## Setting up authentication with Docker secrets + +Dozzle also support path to file for username and password which can be used to with Docker Secrets. + +```yaml +version: "3" +services: + dozzle: + image: amir20/dozzle:latest + environment: + DOZZLE_LEVEL: debug + DOZZLE_USERNAME_FILE: /run/secrets/dozzle_user + DOZZLE_PASSWORD_FILE: /run/secrets/dozzle_password + volumes: + - /var/run/docker.sock:/var/run/docker.sock + secrets: + - dozzle_user + - dozzle_password + ports: + - 8080:8080 + +secrets: + dozzle_user: + file: dozzle_user.txt + dozzle_password: + file: dozzle_password.txt +``` diff --git a/docs/guide/debugging.md b/docs/guide/debugging.md new file mode 100644 index 00000000..25d535ad --- /dev/null +++ b/docs/guide/debugging.md @@ -0,0 +1,20 @@ +--- +title: Debugging +--- + +# Debugging with logs + +By default, Dozzle does not output a lot of logs. However this can be changed with `--level` flag. The default value is `info` which only prints limited logs. You can use `debug` or `trace` which will show details about memory, configuration and other stats. `DOZZLE_LEVEL` can be used in compose configurations. Below is an example of using `docker-compose.yml` file to enable `debug` level. + +```yaml +version: "3" +services: + dozzle: + image: amir20/dozzle:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 8080:8080 + environment: + DOZZLE_LEVEL: debug +``` diff --git a/docs/guide/remote-host.md b/docs/guide/remote-hosts.md similarity index 50% rename from docs/guide/remote-host.md rename to docs/guide/remote-hosts.md index 64c1db36..6c4c8564 100644 --- a/docs/guide/remote-host.md +++ b/docs/guide/remote-hosts.md @@ -6,16 +6,16 @@ title: Remote Host Setup Dozzle supports connecting to multiple remote hosts via `tcp://` using TLS and non-secured connections. Dozzle will need to have appropriate certs mounted to use secured connection. `ssh://` is not supported because Dozzle docker image does not ship with any ssh clients. -## Connecting remote hosts +## Connecting to remote hosts Remote hosts can be configured with `--remote-host` or `DOZZLE_REMOTE_HOST`. All certs must be mounted to `/certs` directory. The `/cert` directory expects to have `/certs/{ca,cert,key}.pem` or `/certs/{host}/{ca,cert,key}.pem` in case of multiple hosts. -Multiple `--remote-host` flags can be used to specify multiple hosts. +Multiple `--remote-host` flags can be used to specify multiple hosts. However, using `DOZZLE_REMOTE_HOST` the value should be comma separated. ::: code-group ```sh [cli] -$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/certs:/certs -p 8080:8080 amir20/dozzle --remote-host tcp://167.99.1.1:2376 +$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/certs:/certs -p 8080:8080 amir20/dozzle --remote-host tcp://167.99.1.1:2376 --remote-host tcp://167.99.1.2:2376 ``` ```yaml [docker-compose.yml] @@ -33,3 +33,23 @@ services: ``` ::: + +## Connecting with a socket proxy + +If you are in a private network then you can use [Docker Socket Proxy](https://github.com/Tecnativa/docker-socket-proxy) which expose `docker.sock` file without the need of TLS. Dozzle will never try to write to Docker but it will need access to list APIs. The following command will start a proxy with minimal access. + +```sh +docker container run --privileged -e CONTAINERS=1 -v /var/run/docker.sock:/var/run/docker.sock -p 2375:2375 tecnativa/docker-socket-proxy +``` + +Note that `CONTAINERS=1` is required to list running containers. `EVENTS` is also needed but it is enabled by default. + +Running Dozzle without any certs should work. Here is an example: + +```sh +docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --remote-host tcp://123.1.1.1:2375 +``` + +::: warning +Exposing `docker.sock` publicly is not safe. Only use a proxy for an internal network where all clients are trusted. +::: diff --git a/package.json b/package.json index 95e74e5c..b2f0656b 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "vue-tsc": "^1.2.0" }, "lint-staged": { - "*.{js,vue,css,ts,html}": [ + "*.{js,vue,css,ts,html,md}": [ "prettier --write" ] },