Skip to content

Commit

Permalink
feat: add script for rules activation
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed Aug 17, 2024
1 parent a55e0cf commit f10b82c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions caddy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ COPY --from=builder-caddy /usr/bin/caddy /usr/bin/caddy
# Copy out Coraza configuration files and rules from builder-caddy
COPY --from=builder-crs /opt/coraza /opt/coraza

# Copy rules activation script
COPY src/bin/activate-rules.sh /opt/coraza/activate-rules.sh

# Add user to run Caddy so it is not running as root
# This should only be done if the Caddy user/group is not set to root
# hadolint ignore=DL3018,SC1075
Expand Down
3 changes: 3 additions & 0 deletions caddy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ else
echo " - Done"
fi

# Activating CRS rules
. /opt/coraza/activate-rules.sh

# Launch Caddy
echo "Launching $*"
exec "$@"

0 comments on commit f10b82c

Please sign in to comment.