Skip to content

Commit

Permalink
Update start.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoey2936 committed Jan 10, 2025
1 parent a018bcd commit 930c6ea
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions rootfs/usr/local/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 930c6ea

Please sign in to comment.