mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
fix: fix caddy_logs accessibility to monitoring tools
This commit is contained in:
@@ -5,12 +5,18 @@
|
|||||||
# Enable metrics for Prometheus
|
# Enable metrics for Prometheus
|
||||||
metrics
|
metrics
|
||||||
|
|
||||||
# Logging
|
# Console logging for Docker logs
|
||||||
log {
|
log {
|
||||||
level INFO
|
level INFO
|
||||||
format console
|
format console
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Access logs for CrowdSec and Promtail
|
||||||
|
log {
|
||||||
|
output file /var/log/caddy/access.log
|
||||||
|
format json
|
||||||
|
}
|
||||||
|
|
||||||
# Allow CrowdSec globally
|
# Allow CrowdSec globally
|
||||||
crowdsec {
|
crowdsec {
|
||||||
api_url http://crowdsec:8080
|
api_url http://crowdsec:8080
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
|
- ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
|
||||||
- ./crowdsec/data:/var/lib/crowdsec/data
|
- ./crowdsec/data:/var/lib/crowdsec/data
|
||||||
- ./caddy/logs:/var/log/caddy:ro
|
- caddy_logs:/var/log/caddy:ro
|
||||||
environment:
|
environment:
|
||||||
- COLLECTIONS=crowdsecurity/caddy crowdsecurity/whitelist-good-actors crowdsecurity/http-cve
|
- COLLECTIONS=crowdsecurity/caddy crowdsecurity/whitelist-good-actors crowdsecurity/http-cve
|
||||||
- BOUNCER_KEY_CADDY=${CROWDSEC_API_KEY}
|
- BOUNCER_KEY_CADDY=${CROWDSEC_API_KEY}
|
||||||
@@ -27,7 +27,7 @@ services:
|
|||||||
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
|
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||||
- ./caddy/sites-enabled:/etc/caddy/sites-enabled
|
- ./caddy/sites-enabled:/etc/caddy/sites-enabled
|
||||||
- ./caddy/coraza/coraza.conf:/etc/caddy/coraza.conf
|
- ./caddy/coraza/coraza.conf:/etc/caddy/coraza.conf
|
||||||
- ./caddy/logs:/var/log/caddy
|
- caddy_logs:/var/log/caddy
|
||||||
- caddy_data:/data
|
- caddy_data:/data
|
||||||
- caddy_config:/config
|
- caddy_config:/config
|
||||||
networks:
|
networks:
|
||||||
@@ -40,6 +40,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
caddy_data:
|
caddy_data:
|
||||||
caddy_config:
|
caddy_config:
|
||||||
|
caddy_logs:
|
||||||
|
name: caddy_logs
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
caddy_net:
|
caddy_net:
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ services:
|
|||||||
container_name: promtail
|
container_name: promtail
|
||||||
volumes:
|
volumes:
|
||||||
- ./promtail/promtail.yml:/etc/promtail/config.yml
|
- ./promtail/promtail.yml:/etc/promtail/config.yml
|
||||||
- ../web-server/caddy/logs:/var/log/caddy:ro
|
- caddy_logs:/caddy-logs:ro
|
||||||
- /var/log:/var/log:ro
|
- /var/log:/var/log:ro
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
@@ -82,6 +82,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
prometheus_data:
|
prometheus_data:
|
||||||
loki_data:
|
loki_data:
|
||||||
|
caddy_logs:
|
||||||
|
external: true
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
monitoring_net:
|
monitoring_net:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ scrape_configs:
|
|||||||
- localhost
|
- localhost
|
||||||
labels:
|
labels:
|
||||||
job: caddy
|
job: caddy
|
||||||
__path__: /var/log/caddy/access.log
|
__path__: /caddy-logs/access.log
|
||||||
pipeline_stages:
|
pipeline_stages:
|
||||||
- json:
|
- json:
|
||||||
expressions:
|
expressions:
|
||||||
|
|||||||
Reference in New Issue
Block a user