Skip to content

Commit

Permalink
Support dynamic resolver.
Browse files Browse the repository at this point in the history
Support optional find/replace.
  • Loading branch information
stooit committed Aug 21, 2024
1 parent b0a376d commit 10f5abd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .docker/images/nginx/helpers/012_internal_resolver.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver kube-dns.kube-system.svc.cluster.local valid=60s;
resolver "${RESTY_RESOLVER:-kube-dns.kube-system.svc.cluster.local}" valid=60s;
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ body_filter_by_lua_block {
return
end

-- support find/replace with lua pattern matches
if (os.getenv("JS_SBOM_FIND") and os.getenv("JS_SBOM_REPLACE")) then
ngx.arg[1] = ngx.arg[1]:gsub(os.getenv("JS_SBOM_FIND"), os.getenv("JS_SBOM_REPLACE"))
end

-- keep a buffered response to parse on final chunk
ngx.ctx.buffered = (ngx.ctx.buffered or "") .. ngx.arg[1]

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
LAGOON_IMAGE_VERSION: ${LAGOON_IMAGE_VERSION:-latest}
image: ${DOCKERHUB_NAMESPACE:-govcms}/nginx-drupal:${GOVCMS_RELEASE_TAG:-latest}
environment:
RESTY_RESOLVER: 8.8.8.8
LAGOON_ROUTE: ${LOCALDEV_URL:-http://govcmslagoon.docker.amazee.io}
LAGOON_LOCALDEV_URL: ${LOCALDEV_URL_NGINX:-http://govcms-lagoon-nginx.docker.amazee.io}
X_FRAME_OPTIONS: ${X_FRAME_OPTIONS:-SAMEORIGIN}
Expand Down

0 comments on commit 10f5abd

Please sign in to comment.