You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/agent.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,23 @@ services:
117
117
118
118
This will change the agent's name to `my-special-name` and will be reflected on the UI when connecting to the agent.
119
119
120
+
## Setting Up Filters
121
+
122
+
You can set up filters for the agent to limit the containers it can access. These filters are passed directly to Docker, restricting what Dozzle can view.
123
+
124
+
```yaml
125
+
services:
126
+
dozzle-agent:
127
+
image: amir20/dozzle:latest
128
+
command: agent
129
+
environment:
130
+
- DOZZLE_FILTER=label=color
131
+
volumes:
132
+
- /var/run/docker.sock:/var/run/docker.sock:ro
133
+
```
134
+
135
+
This will restrict the agent to displaying only containers with the label `color`. Keep in mind that these filters are combined with the UI filters to narrow down the containers. To learn more about the different types of filters, read the [filters documentation](/guide/filters#ui-agents-and-user-filters).
136
+
120
137
## Custom Certificates
121
138
122
139
By default, Dozzle uses self-signed certificates for communication between agents. This is a private certificate which is only valid to other Dozzle instances. This is secure and recommended for most use cases. However, if Dozzle is exposed externally and an attacker knows exactly which port the agent is running on, then they can set up their own Dozzle instance and connect to the agent. To prevent this, you can provide your own certificates.
@@ -169,5 +186,6 @@ Agents are similar to remote connections, but they have some advantages. General
169
186
| Permissions | Full access to Docker | Can be controlled with a proxy |
Copy file name to clipboardExpand all lines: docs/guide/authentication.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Authentication
3
3
---
4
4
5
-
# Setting Up Authentication
5
+
# Setting Up Authentication <Badgetype="tip"text="Updated" />
6
6
7
7
Dozzle supports two configurations for authentication. In the first configuration, you bring your own authentication method by protecting Dozzle through a proxy. Dozzle can read appropriate headers out of the box.
8
8
@@ -22,6 +22,7 @@ users:
22
22
name: Admin
23
23
# Generate with docker run amir20/dozzle generate --name Admin --email me@email.net --password secret admin
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`.
@@ -90,15 +91,39 @@ services:
90
91
91
92
Note that only duration is supported. You can only use `s`, `m`, `h` for seconds, minutes and hours respectively.
92
93
94
+
### Setting specific filters for users
95
+
96
+
Dozzle supports setting filters for users. Filters are used to restrict the containers that a user can see. Filters are set in the `users.yml` file. Here is an example:
In this example, the `admin` user has no filter, so they can see all containers. The `guest` user can only see containers with the label `com.example.app`. This is useful for restricting access to specific containers.
114
+
115
+
> [!NOTE]
116
+
> Filters can also be set [globally](/guide/filters) with the `--filter` flag. This flag is applied to all users. If a user has a filter set, it will override the global filter.
117
+
93
118
## Generating users.yml
94
119
95
120
Dozzle has a built-in `generate` command to generate `users.yml`. Here is an example:
In this example, `admin` is the username. Email and name are optional but recommended to display accurate avatars. `docker run amir20/dozzle generate --help` displays all options.
126
+
In this example, `admin` is the username. Email and name are optional but recommended to display accurate avatars. `docker run amir20/dozzle generate --help` displays all options. The `--user-filter` flag is a comma-separated list of filters.
102
127
103
128
## Forward Proxy
104
129
@@ -129,6 +154,7 @@ In this mode, Dozzle expects the following headers:
129
154
- `Remote-User`to map to the username e.g. `johndoe`
130
155
- `Remote-Email`to map to the user's email address. This email is also used to find the right [Gravatar](https://gravatar.com/) for the user.
131
156
- `Remote-Name`to be a display name like `John Doe`
157
+
- `Remote-Filter`to be a comma-separated list of filters allowed for user.
Copy file name to clipboardExpand all lines: docs/guide/filters.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,3 +27,16 @@ services:
27
27
:::
28
28
29
29
Common filters are `name` or `label` to limit Dozzle's access to containers.
30
+
31
+
## UI, Agents, and User Filters <Badge type="tip" text="New" />
32
+
33
+
Dozzle supports multiple filters to limit the containers it can see. Filters can be set at the UI, agent, or user level.
34
+
35
+
1. **UI Filters**: These filters are applied to the Dozzle UI instance and sent to Docker to restrict the visible containers. They affect all agents and users who do not have their own filters.
36
+
2. **Agent Filters**: These filters are set at the agent level and sent to Docker to limit the containers exposed by that agent. Agent filters and UI filters work together to restrict the containers.
37
+
3. **User Filters**: These filters are set at the user level and determine which containers the user can see. If user filters are not defined, Dozzle defaults to using the UI filters.
38
+
39
+
For more information on setting filters for specific users, see [user filters](/guide/authentication#setting-specific-filters-for-users). For details on setting filters for agents, see [agent filters](/guide/agent#setting-up-filters).
40
+
41
+
> [!WARNING]
42
+
> It is important to understand that multiple filters are combined to limit the containers. For example, if you set `--filter label=color` at the UI level and `--filter label=type` at the agent level, Dozzle will only display containers that have both the `color` and `type` labels.
Copy file name to clipboardExpand all lines: internal/support/cli/args.go
+24-22Lines changed: 24 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -10,28 +10,29 @@ import (
10
10
varVersion="head"
11
11
12
12
typeArgsstruct {
13
-
Addrstring`arg:"env:DOZZLE_ADDR" default:":8080" help:"sets host:port to bind for server. This is rarely needed inside a docker container."`
14
-
Basestring`arg:"env:DOZZLE_BASE" default:"/" help:"sets the base for http router."`
15
-
Hostnamestring`arg:"env:DOZZLE_HOSTNAME" help:"sets the hostname for display. This is useful with multiple Dozzle instances."`
16
-
Levelstring`arg:"env:DOZZLE_LEVEL" default:"info" help:"set Dozzle log level. Use debug for more logging."`
17
-
AuthProviderstring`arg:"--auth-provider,env:DOZZLE_AUTH_PROVIDER" default:"none" help:"sets the auth provider to use. Currently only forward-proxy is supported."`
18
-
AuthTTLstring`arg:"--auth-ttl,env:DOZZLE_AUTH_TTL" default:"session" help:"sets the TTL for the auth token. Accepts duration values like 12h. Valid time units are s, m, h"`
19
-
AuthHeaderUserstring`arg:"--auth-header-user,env:DOZZLE_AUTH_HEADER_USER" default:"Remote-User" help:"sets the HTTP Header to use for username in Forward Proxy configuration."`
20
-
AuthHeaderEmailstring`arg:"--auth-header-email,env:DOZZLE_AUTH_HEADER_EMAIL" default:"Remote-Email" help:"sets the HTTP Header to use for email in Forward Proxy configuration."`
21
-
AuthHeaderNamestring`arg:"--auth-header-name,env:DOZZLE_AUTH_HEADER_NAME" default:"Remote-Name" help:"sets the HTTP Header to use for name in Forward Proxy configuration."`
22
-
EnableActionsbool`arg:"--enable-actions,env:DOZZLE_ENABLE_ACTIONS" default:"false" help:"enables essential actions on containers from the web interface."`
23
-
FilterStrings []string`arg:"env:DOZZLE_FILTER,--filter,separate" help:"filters docker containers using Docker syntax."`
24
-
Filtermap[string][]string`arg:"-"`
25
-
RemoteHost []string`arg:"env:DOZZLE_REMOTE_HOST,--remote-host,separate" help:"list of hosts to connect remotely"`
26
-
RemoteAgent []string`arg:"env:DOZZLE_REMOTE_AGENT,--remote-agent,separate" help:"list of agents to connect remotely"`
Modestring`arg:"env:DOZZLE_MODE" default:"server" help:"sets the mode to run in (server, swarm)"`
29
-
TimeoutStringstring`arg:"--timeout,env:DOZZLE_TIMEOUT" default:"3s" help:"sets the timeout for docker client"`
30
-
Timeout time.Duration`arg:"-"`
31
-
Healthcheck*HealthcheckCmd`arg:"subcommand:healthcheck" help:"checks if the server is running"`
32
-
Generate*GenerateCmd`arg:"subcommand:generate" help:"generates a configuration file for simple auth"`
33
-
Agent*AgentCmd`arg:"subcommand:agent" help:"starts the agent"`
34
-
AgentTest*AgentTestCmd`arg:"subcommand:agent-test" help:"tests an agent"`
13
+
Addrstring`arg:"env:DOZZLE_ADDR" default:":8080" help:"sets host:port to bind for server. This is rarely needed inside a docker container."`
14
+
Basestring`arg:"env:DOZZLE_BASE" default:"/" help:"sets the base for http router."`
15
+
Hostnamestring`arg:"env:DOZZLE_HOSTNAME" help:"sets the hostname for display. This is useful with multiple Dozzle instances."`
16
+
Levelstring`arg:"env:DOZZLE_LEVEL" default:"info" help:"set Dozzle log level. Use debug for more logging."`
17
+
AuthProviderstring`arg:"--auth-provider,env:DOZZLE_AUTH_PROVIDER" default:"none" help:"sets the auth provider to use. Currently only forward-proxy is supported."`
18
+
AuthTTLstring`arg:"--auth-ttl,env:DOZZLE_AUTH_TTL" default:"session" help:"sets the TTL for the auth token. Accepts duration values like 12h. Valid time units are s, m, h"`
19
+
AuthHeaderUserstring`arg:"--auth-header-user,env:DOZZLE_AUTH_HEADER_USER" default:"Remote-User" help:"sets the HTTP Header to use for username in Forward Proxy configuration."`
20
+
AuthHeaderEmailstring`arg:"--auth-header-email,env:DOZZLE_AUTH_HEADER_EMAIL" default:"Remote-Email" help:"sets the HTTP Header to use for email in Forward Proxy configuration."`
21
+
AuthHeaderNamestring`arg:"--auth-header-name,env:DOZZLE_AUTH_HEADER_NAME" default:"Remote-Name" help:"sets the HTTP Header to use for name in Forward Proxy configuration."`
22
+
AuthHeaderFilterstring`arg:"--auth-header-filter,env:DOZZLE_AUTH_HEADER_FILTER" default:"Remote-Filter" help:"sets the HTTP Header to use for filtering in Forward Proxy configuration."`
23
+
EnableActionsbool`arg:"--enable-actions,env:DOZZLE_ENABLE_ACTIONS" default:"false" help:"enables essential actions on containers from the web interface."`
24
+
FilterStrings []string`arg:"env:DOZZLE_FILTER,--filter,separate" help:"filters docker containers using Docker syntax."`
25
+
Filtermap[string][]string`arg:"-"`
26
+
RemoteHost []string`arg:"env:DOZZLE_REMOTE_HOST,--remote-host,separate" help:"list of hosts to connect remotely"`
27
+
RemoteAgent []string`arg:"env:DOZZLE_REMOTE_AGENT,--remote-agent,separate" help:"list of agents to connect remotely"`
0 commit comments