From 930c6eacfbcb8f664d6d63733d1ba78328c7aa45 Mon Sep 17 00:00:00 2001 From: Zoey Date: Fri, 10 Jan 2025 14:48:00 +0100 Subject: [PATCH] Update start.sh --- rootfs/usr/local/bin/start.sh | 54 +++++++++++++---------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/rootfs/usr/local/bin/start.sh b/rootfs/usr/local/bin/start.sh index ee96a177b..60d934f76 100755 --- a/rootfs/usr/local/bin/start.sh +++ b/rootfs/usr/local/bin/start.sh @@ -333,23 +333,8 @@ if [ "$GOA" = "true" ] && [ "$LOGROTATE" = "false" ]; then fi if echo "$GOACLA" | grep -vq "geoip-database"; then - if [ -s /data/etc/goaccess/geoip/GeoLite2-City.mmdb ] && [ ! -s /data/goaccess/geoip/GeoLite2-City.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/etc/goaccess/geoip/GeoLite2-City.mmdb" - fi - if [ -s /data/goaccess/geoip/GeoLite2-City.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/goaccess/geoip/GeoLite2-City.mmdb" - fi - if [ -s /data/etc/goaccess/geoip/GeoLite2-Country.mmdb ] && [ ! -s /data/goaccess/geoip/GeoLite2-Country.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/etc/goaccess/geoip/GeoLite2-Country.mmdb" - fi - if [ -s /data/goaccess/geoip/GeoLite2-Country.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/goaccess/geoip/GeoLite2-Country.mmdb" - fi - if [ -s /data/etc/goaccess/geoip/GeoLite2-ASN.mmdb ] && [ ! -s /data/goaccess/geoip/GeoLite2-ASN.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/etc/goaccess/geoip/GeoLite2-ASN.mmdb" - fi - if [ -s /data/goaccess/geoip/GeoLite2-ASN.mmdb ]; then - export GOACLA="$GOACLA --geoip-database=/data/goaccess/geoip/GeoLite2-ASN.mmdb" + if [ -s /data/goaccess/GeoLite2-City.mmdb ] && [ -s /data/goaccess/GeoLite2-Country.mmdb ] && [ -s /data/goaccess/GeoLite2-ASN.mmdb ]; then + export GOACLA="$GOACLA --geoip-database=/data/goaccess/geoip/GeoLite2-City.mmdb --geoip-database=/data/goaccess/geoip/GeoLite2-Country.mmdb --geoip-database=/data/goaccess/geoip/GeoLite2-ASN.mmdb" fi fi @@ -570,23 +555,6 @@ mkdir -vp /data/tls/certbot/renewal \ /data/nginx/dead_host \ /data/nginx/stream \ /data/custom_nginx -touch /data/modsecurity/modsecurity-extra.conf \ - /data/html/index.html \ - /tmp/ip_ranges.conf \ - /data/custom_nginx/events.conf \ - /data/custom_nginx/http.conf \ - /data/custom_nginx/http_top.conf \ - /data/custom_nginx/root_top.conf \ - /data/custom_nginx/root.conf \ - /data/custom_nginx/server_dead.conf \ - /data/custom_nginx/server_proxy.conf \ - /data/custom_nginx/server_redirect.conf \ - /data/custom_nginx/stream.conf \ - /data/custom_nginx/stream_top.conf \ - /data/custom_nginx/server_stream.conf \ - /data/custom_nginx/server_stream_tcp.conf \ - /data/custom_nginx/server_stream_udp.conf - if [ -s /data/keys.json ]; then @@ -649,6 +617,24 @@ if [ -d /data/tls/certbot/live ] && [ -d /data/tls/certbot/archive ]; then fi +touch /data/modsecurity/modsecurity-extra.conf \ + /data/html/index.html \ + /tmp/ip_ranges.conf \ + /data/custom_nginx/events.conf \ + /data/custom_nginx/http.conf \ + /data/custom_nginx/http_top.conf \ + /data/custom_nginx/root_top.conf \ + /data/custom_nginx/root.conf \ + /data/custom_nginx/server_dead.conf \ + /data/custom_nginx/server_proxy.conf \ + /data/custom_nginx/server_redirect.conf \ + /data/custom_nginx/stream.conf \ + /data/custom_nginx/stream_top.conf \ + /data/custom_nginx/server_stream.conf \ + /data/custom_nginx/server_stream_tcp.conf \ + /data/custom_nginx/server_stream_udp.conf + + if [ "$LOGROTATE" = "true" ]; then sed -i "s|rotate [0-9]\+|rotate $LOGROTATIONS|g" /etc/logrotate touch /data/nginx/access.log \