Compare commits

..

2 commits

Author SHA1 Message Date
f
a051c85237
feat: store logs
Some checks failed
ci/woodpecker/push/woodpecker/2 Pipeline is pending
ci/woodpecker/push/woodpecker/3 Pipeline is pending
ci/woodpecker/push/woodpecker/4 Pipeline is pending
ci/woodpecker/push/woodpecker/1 Pipeline failed
2024-11-05 11:21:20 -03:00
f
062e13bda0
feat: modsecurity 2024-11-05 11:21:04 -03:00
2 changed files with 5 additions and 1 deletions

View file

@ -13,6 +13,7 @@ steps:
- "ACCESS_LOG_VERSION=${ACCESS_LOG_VERSION}" - "ACCESS_LOG_VERSION=${ACCESS_LOG_VERSION}"
- "NGINX_VERSION=${NGINX_VERSION}" - "NGINX_VERSION=${NGINX_VERSION}"
- "BASE_IMAGE=gitea.nulo.in/sutty/monit" - "BASE_IMAGE=gitea.nulo.in/sutty/monit"
- "EXTRA_PACKAGES="
password: password:
from_secret: "DOCKER_PASSWORD" from_secret: "DOCKER_PASSWORD"
when: when:
@ -23,6 +24,7 @@ matrix:
- ALPINE_VERSION: "3.20.3" - ALPINE_VERSION: "3.20.3"
ACCESS_LOG_VERSION: "0.5.8" ACCESS_LOG_VERSION: "0.5.8"
NGINX_VERSION: "1.26.2-r0" NGINX_VERSION: "1.26.2-r0"
EXTRA_PACKAGES: "nginx-mod-http-modsecurity coreruleset"
- ALPINE_VERSION: "3.19.4" - ALPINE_VERSION: "3.19.4"
ACCESS_LOG_VERSION: "0.5.8" ACCESS_LOG_VERSION: "0.5.8"
NGINX_VERSION: "1.24.0-r16" NGINX_VERSION: "1.24.0-r16"

View file

@ -6,6 +6,7 @@ LABEL org.opencontainers.image.authors="f@sutty.nl"
ARG NGINX_VERSION="1.24.0-r7" ARG NGINX_VERSION="1.24.0-r7"
ARG ACCESS_LOGS_FLAGS="--database=sqlite3:///var/log/access_log.sqlite3 -c /usr/share/crawler-user-agents/crawler-user-agents.json" ARG ACCESS_LOGS_FLAGS="--database=sqlite3:///var/log/access_log.sqlite3 -c /usr/share/crawler-user-agents/crawler-user-agents.json"
ARG ACCESS_LOG_VERSION="0.5.6" ARG ACCESS_LOG_VERSION="0.5.6"
ARG EXTRA_PACKAGES
ENV ACCESS_LOGS_FLAGS=${ACCESS_LOGS_FLAGS} ENV ACCESS_LOGS_FLAGS=${ACCESS_LOGS_FLAGS}
@ -24,7 +25,7 @@ COPY --chown=nginx:nginx ./nginx /etc/nginx
COPY ./access_log.sqlite3 /var/lib/access_log.sqlite3 COPY ./access_log.sqlite3 /var/lib/access_log.sqlite3
# Install modules after rewriting /etc/nginx # Install modules after rewriting /etc/nginx
RUN apk add --no-cache nginx-mod-http-brotli nginx-mod-http-geoip2 nginx-mod-http-naxsi RUN apk add --no-cache nginx-mod-http-brotli nginx-mod-http-geoip2 ${EXTRA_PACKAGES}
# Add support for request_uri parsing if access_log >= 0.3.0 # Add support for request_uri parsing if access_log >= 0.3.0
RUN mv /etc/nginx/access_logd_`access_log -v`.conf /etc/nginx/access_logd.conf RUN mv /etc/nginx/access_logd_`access_log -v`.conf /etc/nginx/access_logd.conf
@ -36,6 +37,7 @@ RUN chown nginx:nginx /var/lib/access_log.sqlite3
VOLUME /etc/nginx/sites VOLUME /etc/nginx/sites
VOLUME /etc/letsencrypt VOLUME /etc/letsencrypt
VOLUME /var/lib/letsencrypt VOLUME /var/lib/letsencrypt
VOLUME /var/log
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443