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
|`LOG_FILE`|`/app/logs/crowdsec-manager.log`| Path to the internal application log file. |
12
+
**Are any variables absolutely necessary?**
13
+
Technically, **no**. The application is designed with sensible defaults for all configuration options. You can run the application without setting any environment variables, provided the default paths (like `./data` and `./logs`) are writable and Docker is available locally.
18
14
19
-
## Docker Integration
15
+
## Detailed Variable Breakdown
20
16
21
-
| Variable | Default | Description |
22
-
|----------|---------|-------------|
23
-
|`DOCKER_HOST`|`unix:///var/run/docker.sock`| Path to the Docker socket. Required for container management. |
24
-
|`COMPOSE_FILE`|`/app/docker-compose.yml`| Path to the compose file inside the container. |
17
+
### Core Application Configuration
18
+
19
+
| Variable | Default | Impact / Description |
20
+
| :--- | :--- | :--- |
21
+
|`PORT`|`8080`| The HTTP port the manager listens on. Change this if port 8080 is already in use. |
22
+
|`ENVIRONMENT`|`production`| Sets the application mode. Use `development` for verbose logging and dev features. |
|`LOG_FILE`|`/app/logs/crowdsec-manager.log`| Path where the application log file is written. |
25
+
26
+
### Docker & Service Discovery
27
+
28
+
| Variable | Default | Impact / Description |
29
+
| :--- | :--- | :--- |
30
+
|`DOCKER_HOST`|`unix:///var/run/docker.sock`| Address of the Docker daemon. If empty, it uses the default local socket. Set this if connecting to a remote Docker instance. |
31
+
|`COMPOSE_FILE`|`/app/docker-compose.yml`| Path to the Docker Compose file. The manager reads this to discover services and manage updates. |
32
+
|`*_CONTAINER_NAME`|`crowdsec`, `traefik`, etc. | Overrides for container names if your stack uses different names (e.g., `CROWDSEC_CONTAINER_NAME`, `TRAEFIK_CONTAINER_NAME`). |
25
33
|`PANGOLIN_DIR`|`/app`| Base working directory for the application. |
26
34
|`CONFIG_DIR`|`/app/config`| Directory where configuration files are stored. |
27
35
28
-
##Database
36
+
### File Paths & Persistence
29
37
30
-
| Variable | Default | Description |
31
-
|----------|---------|-------------|
32
-
|`DATABASE_PATH`|`/app/data/settings.db`| Path to the SQLite database file. Ensure this path is persistent. |
38
+
| Variable | Default | Impact / Description |
39
+
| :--- | :--- | :--- |
40
+
|`DATABASE_PATH`|`/app/data/settings.db`| Location of the SQLite database storing app settings. Ensure this path is persistent. |
41
+
|`BACKUP_DIR`|`/app/backups`| Directory where backups are stored. |
42
+
|`RETENTION_DAYS`|`60`| Number of days to keep backups before auto-deletion. |
33
43
34
-
##Traefik Integration
44
+
### Integrations (Traefik & CrowdSec)
35
45
36
-
| Variable | Default | Description |
37
-
|----------|---------|-------------|
38
-
|`TRAEFIK_DYNAMIC_CONFIG`|`/dynamic_config.yml`| Path to Traefik's dynamic configuration file. |
39
-
|`TRAEFIK_STATIC_CONFIG`|`/etc/traefik/traefik_config.yml`| Path to Traefik's static configuration file. |
46
+
| Variable | Default |Impact / Description |
47
+
| :---| :---| :---|
48
+
|`TRAEFIK_DYNAMIC_CONFIG`|`/etc/traefik/dynamic_config.yml`| Path to Traefik's dynamic config file. Used to manage middlewares/routers. |
49
+
|`TRAEFIK_STATIC_CONFIG`|`/etc/traefik/traefik_config.yml`| Path to Traefik's static config file. |
40
50
|`TRAEFIK_ACCESS_LOG`|`/var/log/traefik/access.log`| Path to read Traefik access logs from. |
41
51
|`TRAEFIK_ERROR_LOG`|`/var/log/traefik/traefik.log`| Path to read Traefik error logs from. |
52
+
|`CROWDSEC_ACQUIS_FILE`|`/etc/crowdsec/acquis.yaml`| Path to CrowdSec's acquisition configuration. |
53
+
|`INCLUDE_CROWDSEC`|`true`| Whether to manage CrowdSec container updates/restarts. |
42
54
43
-
## CrowdSec Integration
55
+
## Recommendation
44
56
45
-
| Variable | Default | Description |
46
-
|----------|---------|-------------|
47
-
|`CROWDSEC_ACQUIS_FILE`|`/etc/crowdsec/acquis.yaml`| Path to CrowdSec acquisition configuration. |
48
-
|`INCLUDE_CROWDSEC`|`false`| Whether to manage CrowdSec container updates/restarts. |
57
+
For a standard deployment, you likely only need to configure:
58
+
1.**`PORT`**: If you have a port conflict.
59
+
2.**`COMPOSE_FILE`**: If your compose file is not in the default location.
60
+
3.**`DOCKER_HOST`**: If running in a complex Docker environment.
49
61
50
-
## Backup Configuration
62
+
Everything else can safely be left to defaults unless you have specific customization needs (like changing log locations or backup retention).
51
63
52
-
| Variable | Default | Description |
53
-
|----------|---------|-------------|
54
-
|`BACKUP_DIR`|`/app/backups`| Directory where backups are stored. |
55
-
|`RETENTION_DAYS`|`60`| Number of days to keep backups before auto-deletion. |
64
+
## Handling Custom Paths
65
+
66
+
A common source of confusion is the difference between **internal container paths** (where the app looks for files) and **external host paths** (where files actually exist on your server).
67
+
68
+
### The Golden Rule
69
+
70
+
-**Environment Variables** tell the application **where to look inside the container**.
71
+
-**Docker Volumes** map your **real host files** to those **internal container locations**.
72
+
73
+
### Example: Custom CrowdSec Installation
74
+
75
+
Suppose your CrowdSec installation is at `/opt/my-custom-crowdsec` instead of the standard `/etc/crowdsec`.
76
+
77
+
**DO NOT** change the environment variable `CROWDSEC_ACQUIS_FILE` to `/opt/my-custom-crowdsec/acquis.yaml`. The container cannot see your `/opt` directory directly!
78
+
79
+
**Instead, update your `docker-compose.yml` volumes:**
80
+
81
+
```yaml
82
+
services:
83
+
crowdsec-manager:
84
+
environment:
85
+
# LEAVE THIS AS DEFAULT
86
+
- CROWDSEC_ACQUIS_FILE=/etc/crowdsec/acquis.yaml
87
+
volumes:
88
+
# Map YOUR custom path (left) to the CONTAINER'S expected path (right)
By changing the volume mapping, you "trick" the container into seeing your custom file at the standard location it expects. This is almost always the correct way to handle custom paths.
93
+
94
+
### Common Customization Examples
95
+
96
+
Here are examples for the most common customization requests. In all cases, **keep the environment variable at its default value** and change the volume mapping in `docker-compose.yml`.
97
+
98
+
#### 1. Custom CrowdSec Configuration Folder
99
+
100
+
If your CrowdSec configuration is stored in `/mnt/security/crowdsec`:
0 commit comments