Skip to content

Commit

Permalink
Update UI iso-prod files to incorporate the syslog container to be ab…
Browse files Browse the repository at this point in the history
…le to see the logs in the web UI
  • Loading branch information
TheophileDiot committed Aug 7, 2024
1 parent 8fa0b02 commit 06848c2
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 12 deletions.
33 changes: 31 additions & 2 deletions misc/dev/docker-compose.autoconf.ui.misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ services:
bw-services:
aliases:
- bunkerweb
logging:
driver: syslog
options:
tag: "bunkerweb"
syslog-address: "udp://10.20.30.254:514"

bw-autoconf:
build:
Expand All @@ -46,6 +51,11 @@ services:
bw-docker:
aliases:
- bw-autoconf
logging:
driver: syslog
options:
tag: "bw-autoconf"
syslog-address: "udp://10.20.30.254:514"

bw-scheduler:
build:
Expand Down Expand Up @@ -81,15 +91,19 @@ services:
bw-db:
aliases:
- bw-scheduler
logging:
driver: syslog
options:
tag: "bw-scheduler"
syslog-address: "udp://10.20.30.254:514"

bw-ui:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
volumes:
- bw-logs:/var/log/syslog:ro
- ../../src/ui/src:/usr/share/bunkerweb/ui/src:ro
- ../../src/ui/static:/usr/share/bunkerweb/ui/static:ro
- ../../src/ui/templates:/usr/share/bunkerweb/ui/templates:ro
- ../../src/ui/gunicorn.conf.py:/usr/share/bunkerweb/ui/gunicorn.conf.py:ro
- ../../src/ui/main.py:/usr/share/bunkerweb/ui/main.py:ro
- ../../src/ui/models.py:/usr/share/bunkerweb/ui/models.py:ro
Expand Down Expand Up @@ -117,6 +131,11 @@ services:
- "bunkerweb.INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504"
- "bunkerweb.GENERATE_SELF_SIGNED_SSL=yes"
- bunkerweb.CUSTOM_CONF_MODSEC_CRS_ip-host=SecRuleRemoveById 920350
logging:
driver: syslog
options:
tag: "bw-ui"
syslog-address: "udp://10.20.30.254:514"

bw-db:
image: mariadb:11
Expand Down Expand Up @@ -146,6 +165,15 @@ services:
aliases:
- bw-docker

bw-syslog:
image: balabit/syslog-ng:4.7.1
volumes:
- bw-logs:/var/log
- ./syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
networks:
bw-universe:
ipv4_address: 10.20.30.254

app1:
image: nginxdemos/nginx-hello
restart: "unless-stopped"
Expand All @@ -162,6 +190,7 @@ services:
volumes:
bw-data:
bw-db:
bw-logs:

networks:
bw-universe:
Expand Down
33 changes: 31 additions & 2 deletions misc/dev/docker-compose.autoconf.ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ services:
bw-services:
aliases:
- bunkerweb
logging:
driver: syslog
options:
tag: "bunkerweb"
syslog-address: "udp://10.20.30.254:514"

bw-autoconf:
build:
Expand All @@ -46,6 +51,11 @@ services:
bw-docker:
aliases:
- bw-autoconf
logging:
driver: syslog
options:
tag: "bw-autoconf"
syslog-address: "udp://10.20.30.254:514"

bw-scheduler:
build:
Expand Down Expand Up @@ -78,15 +88,19 @@ services:
bw-db:
aliases:
- bw-scheduler
logging:
driver: syslog
options:
tag: "bw-scheduler"
syslog-address: "udp://10.20.30.254:514"

bw-ui:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
volumes:
- bw-logs:/var/log/syslog:ro
- ../../src/ui/src:/usr/share/bunkerweb/ui/src:ro
- ../../src/ui/static:/usr/share/bunkerweb/ui/static:ro
- ../../src/ui/templates:/usr/share/bunkerweb/ui/templates:ro
- ../../src/ui/gunicorn.conf.py:/usr/share/bunkerweb/ui/gunicorn.conf.py:ro
- ../../src/ui/main.py:/usr/share/bunkerweb/ui/main.py:ro
- ../../src/ui/models.py:/usr/share/bunkerweb/ui/models.py:ro
Expand All @@ -113,6 +127,11 @@ services:
- "bunkerweb.REVERSE_PROXY_HOST=http://bw-ui:7000"
- "bunkerweb.INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504"
- "bunkerweb.GENERATE_SELF_SIGNED_SSL=yes"
logging:
driver: syslog
options:
tag: "bw-ui"
syslog-address: "udp://10.20.30.254:514"

bw-db:
image: mariadb:11
Expand Down Expand Up @@ -142,6 +161,15 @@ services:
aliases:
- bw-docker

bw-syslog:
image: balabit/syslog-ng:4.7.1
volumes:
- bw-logs:/var/log
- ./syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
networks:
bw-universe:
ipv4_address: 10.20.30.254

app1:
image: nginxdemos/nginx-hello
restart: "unless-stopped"
Expand All @@ -158,6 +186,7 @@ services:
volumes:
bw-data:
bw-db:
bw-logs:

networks:
bw-universe:
Expand Down
33 changes: 31 additions & 2 deletions misc/dev/docker-compose.autoconf.wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ services:
bw-services:
aliases:
- bunkerweb
logging:
driver: syslog
options:
tag: "bunkerweb"
syslog-address: "udp://10.20.30.254:514"

bw-autoconf:
build:
Expand All @@ -46,6 +51,11 @@ services:
bw-docker:
aliases:
- bw-autoconf
logging:
driver: syslog
options:
tag: "bw-autoconf"
syslog-address: "udp://10.20.30.254:514"

bw-scheduler:
build:
Expand Down Expand Up @@ -78,15 +88,19 @@ services:
bw-db:
aliases:
- bw-scheduler
logging:
driver: syslog
options:
tag: "bw-scheduler"
syslog-address: "udp://10.20.30.254:514"

bw-ui:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
volumes:
- bw-logs:/var/log/syslog:ro
- ../../src/ui/src:/usr/share/bunkerweb/ui/src:ro
- ../../src/ui/static:/usr/share/bunkerweb/ui/static:ro
- ../../src/ui/templates:/usr/share/bunkerweb/ui/templates:ro
- ../../src/ui/gunicorn.conf.py:/usr/share/bunkerweb/ui/gunicorn.conf.py:ro
- ../../src/ui/main.py:/usr/share/bunkerweb/ui/main.py:ro
- ../../src/ui/models.py:/usr/share/bunkerweb/ui/models.py:ro
Expand All @@ -103,6 +117,11 @@ services:
bw-db:
aliases:
- bw-ui
logging:
driver: syslog
options:
tag: "bw-ui"
syslog-address: "udp://10.20.30.254:514"

bw-db:
image: mariadb:11
Expand Down Expand Up @@ -132,6 +151,15 @@ services:
aliases:
- bw-docker

bw-syslog:
image: balabit/syslog-ng:4.7.1
volumes:
- bw-logs:/var/log
- ./syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
networks:
bw-universe:
ipv4_address: 10.20.30.254

app1:
image: nginxdemos/nginx-hello
restart: "unless-stopped"
Expand All @@ -148,6 +176,7 @@ services:
volumes:
bw-data:
bw-db:
bw-logs:

networks:
bw-universe:
Expand Down
136 changes: 136 additions & 0 deletions misc/dev/docker-compose.ui.1.5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
x-env: &env
DATABASE_URI: "mariadb+pymysql://bunkerweb:secret@bw-db:3306/db"
DOCKER_HOST: "tcp://bw-docker:2375"
LOG_LEVEL: "debug"

services:
bunkerweb:
image: bunkerity/bunkerweb:1.5.9
ports:
- 80:8080/tcp
- 443:8443/tcp
- 443:8443/udp
labels:
- "bunkerweb.INSTANCE=yes"
environment:
- SERVER_NAME=www.example.com app1.example.com
- MULTISITE=yes
- API_WHITELIST_IP=127.0.0.0/24 10.20.30.0/24
- USE_BUNKERNET=no
- USE_BLACKLIST=no
- USE_WHITELIST=no
- SEND_ANONYMOUS_REPORT=no
- LOG_LEVEL=info
- SERVE_FILES=no
- DISABLE_DEFAULT_SERVER=yes
- USE_CLIENT_CACHE=yes
- USE_GZIP=yes
- EXTERNAL_PLUGIN_URLS=https://github.com/bunkerity/bunkerweb-plugins/archive/refs/heads/dev.zip
- CUSTOM_CONF_MODSEC_CRS_reqbody-suppress=SecRuleRemoveById 200002
- www.example.com_USE_UI=yes
- www.example.com_USE_REVERSE_PROXY=yes
- www.example.com_REVERSE_PROXY_URL=/admin
- www.example.com_REVERSE_PROXY_HOST=http://bw-ui:7000
- www.example.com_INTERCEPTED_ERROR_CODES=400 404 405 413 429 500 501 502 503 504
- www.example.com_GENERATE_SELF_SIGNED_SSL=yes
- www.example.com_CUSTOM_CONF_MODSEC_CRS_ip-host=SecRuleRemoveById 920350
- app1.example.com_USE_REVERSE_PROXY=yes
- app1.example.com_REVERSE_PROXY_URL=/
- app1.example.com_REVERSE_PROXY_HOST=http://app1:8080
restart: "unless-stopped"
networks:
bw-universe:
aliases:
- bunkerweb
bw-services:
aliases:
- bunkerweb

bw-scheduler:
image: bunkerity/bunkerweb-scheduler:1.5.9
depends_on:
- bunkerweb
- bw-docker
volumes:
- bw-data:/data
- ./configs/server-http/hello.conf:/data/configs/server-http/hello.conf:ro
environment:
<<: *env
restart: "unless-stopped"
networks:
bw-universe:
aliases:
- bw-scheduler
bw-docker:
aliases:
- bw-scheduler

bw-docker:
image: tecnativa/docker-socket-proxy:nightly
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- CONTAINERS=1
- LOG_LEVEL=warning
restart: "unless-stopped"
networks:
bw-docker:
aliases:
- bw-docker

bw-ui:
image: bunkerity/bunkerweb-ui:1.5.9
depends_on:
- bw-docker
environment:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
DEBUG: "1"
restart: "unless-stopped"
networks:
bw-universe:
aliases:
- bw-ui
bw-docker:
aliases:
- bw-ui

bw-db:
image: mariadb:11
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=db
- MYSQL_USER=bunkerweb
- MYSQL_PASSWORD=secret
volumes:
- bw-db:/var/lib/mysql
restart: "unless-stopped"
networks:
bw-docker:
aliases:
- bw-db

app1:
image: nginxdemos/nginx-hello
restart: "unless-stopped"
networks:
bw-services:
aliases:
- app1

volumes:
bw-data:
bw-db:

networks:
bw-universe:
name: bw-universe
ipam:
driver: default
config:
- subnet: 10.20.30.0/24
bw-services:
name: bw-services
bw-docker:
name: bw-docker
Loading

0 comments on commit 06848c2

Please sign in to comment.