Skip to content

Commit 1ffb533

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev-mf-docu
2 parents 6f6d864 + 32468cc commit 1ffb533

21 files changed

Lines changed: 877 additions & 518 deletions

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
BunkerWeb Helm chart — deploys BunkerWeb (open-source WAF/reverse proxy) on Kubernetes. Chart version 1.0.14, app version 1.6.9. Helm 3, API v2.
7+
BunkerWeb Helm chart — deploys BunkerWeb (open-source WAF/reverse proxy) on Kubernetes. Chart version 1.0.17, app version 1.6.10. Helm 3, API v2.
88

99
## Repository Layout
1010

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# BunkerWeb Kubernetes Helm Chart
22

3-
![Version](https://img.shields.io/badge/version-1.0.2-blue)
4-
![AppVersion](https://img.shields.io/badge/app%20version-1.6.4-green)
3+
![Version](https://img.shields.io/badge/version-1.0.19-blue)
4+
![AppVersion](https://img.shields.io/badge/app%20version-1.6.10-green)
55

66
Official [Helm chart](https://helm.sh/docs/) to deploy [BunkerWeb](https://www.bunkerweb.io/?utm_campaign=self&utm_source=github) on Kubernetes - A next-generation, open-source **web application firewall (WAF)** and reverse proxy.
77

charts/bunkerweb/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.0.16
18+
version: 1.0.19
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.6.9"
24+
appVersion: "1.6.10"

charts/bunkerweb/templates/NOTES.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
BunkerWeb has been successfully deployed!
22

3+
{{- if and .Release.IsUpgrade (ne (include "bunkerweb.apiEnabled" .) "true") }}
4+
5+
================================================================================
6+
UPGRADE NOTICE (chart 1.0.19)
7+
================================================================================
8+
9+
The external API is now DISABLED by default (was enabled in <= 1.0.18, where
10+
it crash-looped without authentication). If you previously relied on the
11+
default-on API, set api.enabled=true AND configure authentication
12+
(settings.api.useBearerToken / useUserPass / apiAclBootstrapFile).
13+
{{- end }}
14+
15+
{{- if and .Release.IsUpgrade .Values.redis.enabled .Values.redis.useConfigFile }}
16+
17+
================================================================================
18+
UPGRADE NOTICE (chart 1.0.17 / app 1.6.10)
19+
================================================================================
20+
21+
Redis default eviction policy changed: allkeys-lru -> volatile-lru.
22+
The bundled redis.conf now also uses `save 60 1000` instead of `save ""`.
23+
24+
Why: BunkerWeb 1.6.10 Redis Best Practices recommend volatile-lru so that
25+
keys WITH a TTL (rate-limit counters, bad-behavior windows, sessions) are
26+
evicted first, while keys WITHOUT a TTL (permanent bans) are preserved
27+
under memory pressure.
28+
29+
Impact: keys without TTL accumulate. Under sustained pressure with
30+
non-TTL writers, Redis will OOM on writes instead of evicting LRU keys.
31+
32+
If you store non-TTL keys in this Redis instance, override the policy:
33+
34+
redis:
35+
config:
36+
file: |
37+
appendonly yes
38+
save 60 1000
39+
loglevel verbose
40+
maxmemory 512mb
41+
maxmemory-policy allkeys-lru # previous default
42+
43+
Reference: https://docs.bunkerweb.io/1.6.10/features/#redis-best-practices
44+
{{- end }}
45+
346
================================================================================
447
DEPLOYMENT INFORMATION
548
================================================================================

charts/bunkerweb/templates/_helpers.tpl

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,30 @@ REDIS settings
130130
{{- end }}
131131
{{- end }}
132132

133+
{{/*
134+
Whether the external API component must run.
135+
True when the API is explicitly enabled, or when MCP is enabled and points at
136+
the internal API (mcp.config.bunkerwebBaseUrl empty) — MCP depends on it.
137+
*/}}
138+
{{- define "bunkerweb.apiEnabled" -}}
139+
{{- if or .Values.api.enabled (and .Values.mcp.enabled (empty .Values.mcp.config.bunkerwebBaseUrl)) -}}
140+
true
141+
{{- end -}}
142+
{{- end -}}
143+
144+
{{/*
145+
Whether any API authentication method is configured.
146+
*/}}
147+
{{- define "bunkerweb.apiAuthConfigured" -}}
148+
{{- $s := .Values.settings.api -}}
149+
{{- $hasToken := or (and $s.useBearerToken.fromExistingSecret (not (empty .Values.settings.existingSecret))) (and (not $s.useBearerToken.fromExistingSecret) (not (empty $s.useBearerToken.token))) -}}
150+
{{- $hasUserPass := or (and $s.useUserPass.fromExistingSecret (not (empty .Values.settings.existingSecret))) (and (not $s.useUserPass.fromExistingSecret) (not (empty $s.useUserPass.apiUsername)) (not (empty $s.useUserPass.apiPassword))) -}}
151+
{{- $hasAcl := not (empty $s.apiAclBootstrapFile) -}}
152+
{{- if or $hasToken $hasUserPass $hasAcl -}}
153+
true
154+
{{- end -}}
155+
{{- end -}}
156+
133157
{{/*
134158
Generate BunkerWeb feature environment variables
135159
*/}}
@@ -150,6 +174,14 @@ Generate BunkerWeb feature environment variables
150174
- name: DISABLE_DEFAULT_SERVER_STRICT_SNI
151175
value: {{ .global.disableDefaultServerStrictSni | quote }}
152176
{{- end }}
177+
{{- if and .global.maxHeaders (ne .global.maxHeaders "") }}
178+
- name: MAX_HEADERS
179+
value: {{ .global.maxHeaders | quote }}
180+
{{- end }}
181+
{{- if and .global.workerShutdownTimeout (ne .global.workerShutdownTimeout "") }}
182+
- name: WORKER_SHUTDOWN_TIMEOUT
183+
value: {{ .global.workerShutdownTimeout | quote }}
184+
{{- end }}
153185

154186
# =============================================================================
155187
# NGINX TIMEOUTS
@@ -238,9 +270,17 @@ Generate BunkerWeb feature environment variables
238270
- name: MODSECURITY_CRS_PLUGINS
239271
value: {{ .modsecurity.modsecurityCrsPlugins | quote }}
240272
{{- end }}
273+
{{- if and .modsecurity .modsecurity.modsecuritySecRequestBodyLimit (ne .modsecurity.modsecuritySecRequestBodyLimit "") }}
274+
- name: MODSECURITY_SEC_REQUEST_BODY_LIMIT
275+
value: {{ .modsecurity.modsecuritySecRequestBodyLimit | quote }}
276+
{{- end }}
277+
{{- if and .modsecurity .modsecurity.modsecuritySecRequestBodyLimitAction (ne .modsecurity.modsecuritySecRequestBodyLimitAction "") }}
278+
- name: MODSECURITY_SEC_REQUEST_BODY_LIMIT_ACTION
279+
value: {{ .modsecurity.modsecuritySecRequestBodyLimitAction | quote }}
280+
{{- end }}
241281

242282
# =============================================================================
243-
# ANTIBOT PROTECTION
283+
# ANTIBOT PROTECTION
244284
# =============================================================================
245285
{{- if and .antibot .antibot.useAntibot (ne .antibot.useAntibot "") }}
246286
- name: USE_ANTIBOT
@@ -270,6 +310,10 @@ Generate BunkerWeb feature environment variables
270310
- name: ANTIBOT_RECAPTCHA_CLASSIC
271311
value: {{ .antibot.antibotRecaptchaClassic | quote }}
272312
{{- end }}
313+
{{- if and .antibot .antibot.antibotRdnsGlobal (ne .antibot.antibotRdnsGlobal "") }}
314+
- name: ANTIBOT_RDNS_GLOBAL
315+
value: {{ .antibot.antibotRdnsGlobal | quote }}
316+
{{- end }}
273317

274318
# =============================================================================
275319
# RATE LIMITING
@@ -445,6 +489,10 @@ Generate BunkerWeb feature environment variables
445489
- name: LETS_ENCRYPT_ZEROSSL_API_RETRY_DELAY
446490
value: {{ .letsEncrypt.letsEncryptZerosslApiRetryDelay | quote }}
447491
{{- end }}
492+
{{- if and .letsEncrypt .letsEncrypt.letsEncryptMaxLogBackups (ne .letsEncrypt.letsEncryptMaxLogBackups "") }}
493+
- name: LETS_ENCRYPT_MAX_LOG_BACKUPS
494+
value: {{ .letsEncrypt.letsEncryptMaxLogBackups | quote }}
495+
{{- end }}
448496

449497
# Custom SSL certificate
450498
{{- if and .customSsl .customSsl.useCustomSsl (ne .customSsl.useCustomSsl "") }}
@@ -537,6 +585,18 @@ Generate BunkerWeb feature environment variables
537585
- name: REVERSE_PROXY_READ_TIMEOUT
538586
value: {{ .reverseProxy.reverseProxyReadTimeout | quote }}
539587
{{- end }}
588+
{{- if and .reverseProxy .reverseProxy.reverseProxyKeepalive (ne .reverseProxy.reverseProxyKeepalive "") }}
589+
- name: REVERSE_PROXY_KEEPALIVE
590+
value: {{ .reverseProxy.reverseProxyKeepalive | quote }}
591+
{{- end }}
592+
{{- if and .reverseProxy .reverseProxy.reverseProxyHttpVersion (ne .reverseProxy.reverseProxyHttpVersion "") }}
593+
- name: REVERSE_PROXY_HTTP_VERSION
594+
value: {{ .reverseProxy.reverseProxyHttpVersion | quote }}
595+
{{- end }}
596+
{{- if and .reverseProxy .reverseProxy.reverseProxyModsecurity (ne .reverseProxy.reverseProxyModsecurity "") }}
597+
- name: REVERSE_PROXY_MODSECURITY
598+
value: {{ .reverseProxy.reverseProxyModsecurity | quote }}
599+
{{- end }}
540600

541601
# =============================================================================
542602
# GRPC REVERSE PROXY
@@ -749,6 +809,10 @@ Generate BunkerWeb feature environment variables
749809
- name: SESSIONS_CHECK_USER_AGENT
750810
value: {{ .sessions.sessionsCheckUserAgent | quote }}
751811
{{- end }}
812+
{{- if and .sessions .sessions.sessionsDomain (ne .sessions.sessionsDomain "") }}
813+
- name: SESSIONS_DOMAIN
814+
value: {{ .sessions.sessionsDomain | quote }}
815+
{{- end }}
752816

753817
# =============================================================================
754818
# METRICS AND MONITORING
@@ -765,10 +829,22 @@ Generate BunkerWeb feature environment variables
765829
- name: METRICS_MAX_BLOCKED_REQUESTS
766830
value: {{ .metrics.metricsMaxBlockedRequests | quote }}
767831
{{- end }}
832+
{{- if and .metrics .metrics.metricsMaxBlockedRequestsRedis (ne .metrics.metricsMaxBlockedRequestsRedis "") }}
833+
- name: METRICS_MAX_BLOCKED_REQUESTS_REDIS
834+
value: {{ .metrics.metricsMaxBlockedRequestsRedis | quote }}
835+
{{- end }}
768836
{{- if and .metrics .metrics.metricsSaveToRedis (ne .metrics.metricsSaveToRedis "") }}
769837
- name: METRICS_SAVE_TO_REDIS
770838
value: {{ .metrics.metricsSaveToRedis | quote }}
771839
{{- end }}
840+
{{- if and .metrics .metrics.maxLruHistory (ne .metrics.maxLruHistory "") }}
841+
- name: MAX_LRU_HISTORY
842+
value: {{ .metrics.maxLruHistory | quote }}
843+
{{- end }}
844+
{{- if and .metrics .metrics.datastoreLruSize (ne .metrics.datastoreLruSize "") }}
845+
- name: DATASTORE_LRU_SIZE
846+
value: {{ .metrics.datastoreLruSize | quote }}
847+
{{- end }}
772848

773849
# =============================================================================
774850
# AUTH BASIC

charts/bunkerweb/templates/api-deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{{- if .Values.api.enabled -}}
1+
{{- if eq (include "bunkerweb.apiEnabled" .) "true" -}}
2+
{{- if ne (include "bunkerweb.apiAuthConfigured" .) "true" }}
3+
{{- fail "The external API is enabled (api.enabled=true, or mcp.enabled uses the internal API) but no authentication is configured. The BunkerWeb API refuses to start without auth and will CrashLoopBackOff. Set one of: settings.api.useBearerToken.token (or .fromExistingSecret), settings.api.useUserPass.apiUsername+apiPassword (or .fromExistingSecret), or settings.api.apiAclBootstrapFile. Otherwise set api.enabled=false." }}
4+
{{- end }}
25
apiVersion: apps/v1
36
kind: Deployment
47
metadata:
@@ -122,7 +125,7 @@ spec:
122125
- name: api-acl-bootstrap
123126
mountPath: /var/lib/bunkerweb/api_acl_bootstrap.json
124127
{{- end }}
125-
{{- if .Values.settings.api.apiAclBootstrapFile }}
128+
{{- if .Values.settings.api.apiAclBootstrapFile }}
126129
volumes:
127130
- name: api-acl-bootstrap
128131
configMap:

charts/bunkerweb/templates/api-httproute.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.settings.api.httpRoutes.enabled -}}
1+
{{- if and (eq (include "bunkerweb.apiEnabled" .) "true") .Values.settings.api.httpRoutes.enabled -}}
22
apiVersion: gateway.networking.k8s.io/v1
33
kind: HTTPRoute
44
metadata:

charts/bunkerweb/templates/api-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.settings.api.ingress.enabled -}}
1+
{{- if and (eq (include "bunkerweb.apiEnabled" .) "true") .Values.settings.api.ingress.enabled -}}
22
apiVersion: networking.k8s.io/v1
33
kind: Ingress
44
metadata:

charts/bunkerweb/templates/api-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.api.enabled -}}
1+
{{- if eq (include "bunkerweb.apiEnabled" .) "true" -}}
22
apiVersion: v1
33
kind: Service
44
metadata:

charts/bunkerweb/templates/clusterrole.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
{{- include "bunkerweb.labels" . | nindent 4 }}
77
rules:
88
- apiGroups: [""]
9-
resources: ["services", "pods", "configmaps", "secrets"]
9+
resources: ["nodes", "services", "pods", "configmaps", "secrets"]
1010
verbs: ["get", "watch", "list"]
1111
- apiGroups: ["networking.k8s.io"]
1212
resources: ["ingresses"]
@@ -31,4 +31,4 @@ rules:
3131
- grpcroutes
3232
- grpcroutes/status
3333
- referencegrants
34-
verbs: ["get", "watch", "list", "patch", "update"]
34+
verbs: ["get", "watch", "list", "patch", "update"]

0 commit comments

Comments
 (0)