Skip to content

Commit

Permalink
Rework this with Michael's reccs
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenPaugh committed May 7, 2024
1 parent 6c7dde9 commit 81cac33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/_configure_plextrac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,6 @@ function create_volume_directories() {
stat "${PLEXTRAC_HOME}/volumes/redis" &>/dev/null || mkdir -vp "${PLEXTRAC_HOME}/volumes/redis"
stat "${PLEXTRAC_HOME}/volumes/nginx_ssl_certs" &>/dev/null || mkdir -vp "${PLEXTRAC_HOME}/volumes/nginx_ssl_certs"
stat "${PLEXTRAC_HOME}/volumes/nginx_logos" &>/dev/null || mkdir -vp "${PLEXTRAC_HOME}/volumes/nginx_logos"
stat "${PLEXTRAC_HOME}/volumes/naxsi-waf/customer_curated.rules" &>/dev/null || mkdir -vp "${PLEXTRAC_HOME}/volumes/naxsi-waf"; echo "## Custom WAF Rules Below" > ${PLEXTRAC_HOME}/volumes/naxsi-waf/customer_curated.rules
fi
}

function configure_waf() {
title "Create directory and file for customer curated WAF rules"
info "Validating directory and file for customer curated WAF rules"
debug "Ensuring directory and file exist for WAF."
if test -f "${PLEXTRAC_HOME}/volumes/naxsi-waf/customer_curated.rules"; then
debug "WAF Config already exists"
else
mkdir -vp "${PLEXTRAC_HOME}/volumes/naxsi-waf"
echo "## Custom WAF Rules Below" > ${PLEXTRAC_HOME}/volumes/naxsi-waf/customer_curated.rules
}
8 changes: 7 additions & 1 deletion static/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ services:
restart: always
volumes:
- letsencrypt:/etc/letsencrypt:rw
- ${PLEXTRAC_HOME:-.}/volumes/naxsi-waf/customer_curated.rules:/etc/nginx/conf.d/customer_curated.rules:r
- nginx-waf:/etc/nginx/conf.d/customer_curated.rules:Z
healthcheck:
test:
- "CMD-SHELL"
Expand Down Expand Up @@ -364,6 +364,12 @@ volumes:
type: "none"
o: "bind"
device: "${PLEXTRAC_BACKUP_PATH}/postgres"
nginx-waf:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "${PLEXTRAC_HOME}/volumes/naxsi-waf/customer_curated.rules"

networks:
default:
Expand Down

0 comments on commit 81cac33

Please sign in to comment.