1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

Adds more docs

This commit is contained in:
Amir Raminfar
2023-03-10 16:05:48 -08:00
parent 1c07142bce
commit c15a680797
12 changed files with 342 additions and 178 deletions

View File

@@ -5,4 +5,4 @@ node_modules
dist
.git
e2e
docs

View File

@@ -7,12 +7,13 @@ RUN npm install -g pnpm
WORKDIR /build
# Install dependencies from lock file
COPY pnpm-lock.yaml ./
COPY pnpm-*.yaml ./
RUN pnpm fetch
# Copy package.json and install dependencies
COPY docs/package.json ./docs/package.json
COPY package.json ./
RUN pnpm install -r --offline --ignore-scripts --no-optional
RUN pnpm install --offline --ignore-scripts --no-optional
# Copy assets and translations to build
COPY .* vite.config.ts index.html ./

View File

@@ -55,6 +55,19 @@ export default defineConfig({
{ text: "Getting Started", link: "/guide/getting-started" },
],
},
{
text: "Advanced Configuration",
items: [
{ text: "Authentication", link: "/guide/authentication" },
{ text: "Healthcheck", link: "/guide/healthcheck" },
{ text: "Remote Host", link: "/guide/remote-host" },
{ text: "Supported Env Vars", link: "/guide/supported-env-vars" },
],
},
{
text: "Troubleshooting",
items: [{ text: "FAQ", link: "/guide/faq" }],
},
],
footer: {

View File

@@ -0,0 +1,29 @@
---
title: Authentication
---
# Setting Up Authentication
Dozzle supports a very simple authentication out of the box with just username and password. You should deploy using SSL to keep the credentials safe. See configuration to use `--username` and `--password`. You can also use docker secrets `--usernamefile` and `--passwordfile`.
::: code-group
```sh [cli]
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --username amirraminfar --password supersecretpassword
```
```yaml [docker-compose.yml]
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
environment:
DOZZLE_USERNAME: amirraminfar
DOZZLE_PASSWORD: supersecretpassword
```
:::

51
docs/guide/faq.md Normal file
View File

@@ -0,0 +1,51 @@
---
title: FAQ
---
# Frequently Asked Questions
## I installed Dozzle, but logs are slow or they never load. What do I do?
Dozzle uses Server Sent Events (SSE) which connects to a server using a HTTP stream without closing the connection. If any proxy tries to buffer this connection, then Dozzle never receives the data and hangs forever waiting for the reverse proxy to flush the buffer. Since version `1.23.0`, Dozzle sends the `X-Accel-Buffering: no` header which should stop reverse proxies buffering. However, some proxies may ignore this header. In those cases, you need to explicitly disable any buffering.
Below is an example with nginx and using `proxy_pass` to disable buffering:
```
server {
...
location / {
proxy_pass http://<dozzle.container.ip.address>:8080;
}
location /api {
proxy_pass http://<dozzle.container.ip.address>:8080;
proxy_buffering off;
proxy_cache off;
}
}
```
## We have tools that uses Dozzle when a new container is created. How can I get a direct link to a container by name?
Dozzle has a special [route](https://github.com/amir20/dozzle/blob/master/assets/pages/show.vue) that can be used to search containers by name and then forward to that container. For example, if you have a container with name `"foo.bar"` and id `abc123`, you can send your users to `/show?name=foo.bar` which will be forwarded to `/container/abc123`.
## I installed Dozzle but memory consumption doesn't show up!
_This is an issue specific to ARM devices._
Dozzle uses the Docker API to gather information about the containers' memory usage. If the memory usage is not showing up, then it is likely that the Docker API is not returning the memory usage.
You can verify this by running docker info, and you should see the following:
```
WARNING: No memory limit support
WARNING: No swap limit support
```
In this case, you'll need to add the following line to your `/boot/cmdline.txt` file and reboot your device.
```
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
```

24
docs/guide/healthcheck.md Normal file
View File

@@ -0,0 +1,24 @@
---
title: Healthcheck
---
# Adding healthcheck
Dozzle doesn't enable healthcheck by default as it adds extra CPU usage. `healthcheck` can be enabled manually.
```yaml
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
healthcheck:
test: ["CMD", "/dozzle", "healthcheck"]
interval: 3s
timeout: 30s
retries: 5
start_period: 30s
```

35
docs/guide/remote-host.md Normal file
View File

@@ -0,0 +1,35 @@
---
title: Remote Host Setup
---
# 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
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.
::: 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
```
```yaml [docker-compose.yml]
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/certs:/certs
ports:
- 8080:8080
environment:
DOZZLE_REMOTE_HOST: tcp://167.99.1.1:2376,tcp://167.99.1.2:2376
```
:::

View File

@@ -0,0 +1,21 @@
---
title: Environment variables and configuration
---
# Environment variables and configuration
Configurations can be done with flags or environment variables. The table below outlines all supported options and their respective env vars.
| Flag | Env Variable | Default |
| ---------------- | ---------------------- | ------- |
| `--addr` | `DOZZLE_ADDR` | `:8080` |
| `--base` | `DOZZLE_BASE` | `/` |
| `--hostname` | `DOZZLE_HOSTNAME` | `""` |
| `--level` | `DOZZLE_LEVEL` | `info` |
| `--filter` | `DOZZLE_FILTER` | `""` |
| `--username` | `DOZZLE_USERNAME` | `""` |
| `--password` | `DOZZLE_PASSWORD` | `""` |
| `--usernamefile` | `DOZZLE_USERNAME_FILE` | `""` |
| `--passwordfile` | `DOZZLE_PASSWORD_FILE` | `""` |
| `--no-analytics` | `DOZZLE_NO_ANALYTICS` | false |
| `--remote-host` | `DOZZLE_REMOTE_HOST` | |

View File

@@ -1,7 +1,11 @@
{
"private": true,
"type": "module",
"devDependencies": {
"dozzle": "workspace:*"
}
"private": true,
"type": "module",
"devDependencies": {
"@unocss/preset-typography": "^0.50.4",
"@unocss/reset": "^0.50.4",
"@unocss/transformer-directives": "^0.50.4",
"dozzle": "workspace:*",
"unocss": "^0.50.4"
}
}

View File

@@ -111,7 +111,7 @@ func main() {
clients["localhost"] = dockerClient
for _, host := range args.RemoteHost {
log.Infof("Creating a client for %s", host)
log.Infof("Creating client for %s", host)
client := docker.NewClientWithTlsAndFilter(args.Filter, host)
clients[host] = client
}

View File

@@ -86,6 +86,7 @@
"vite": "4.1.4",
"vite-plugin-pages": "^0.28.0",
"vite-plugin-vue-layouts": "^0.8.0",
"vitepress": "1.0.0-alpha.51",
"vitest": "^0.29.2",
"vue-tsc": "^1.2.0"
},
@@ -102,12 +103,5 @@
"npm": {
"publish": false
}
},
"optionalDependencies": {
"@unocss/preset-typography": "^0.50.4",
"@unocss/reset": "^0.50.4",
"@unocss/transformer-directives": "^0.50.4",
"unocss": "^0.50.4",
"vitepress": "1.0.0-alpha.51"
}
}

316
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff