Skip to content

Commit

Permalink
Rename g2i init step
Browse files Browse the repository at this point in the history
remove old config files
more logging
  • Loading branch information
GilbN committed Jul 28, 2024
1 parent 4375e57 commit 6d0ac81
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 134 deletions.
1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/init-geoip2influx-config/up

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

echo -e "Variables set:\\n\
echo -e "[init-geoip2influx-setup] Starting"

echo -e "[init-geoip2influx-setup] Variables set:\\n\
NGINX_LOG_PATH=${NGINX_LOG_PATH}\\n\
INFLUX_HOST=${INFLUX_HOST}\\n\
INFLUX_HOST_PORT=${INFLUX_HOST_PORT}\\n\
Expand All @@ -23,8 +25,11 @@ mkdir -p \
cp -f /geoip2influx/geoip2influx.py /config/geoip2db
# move old log if needed
if [ -f /config/geoip2db/geoip2influx.log ]; then
echo -e "[init-geoip2influx-setup] Moving old log"
mv /config/geoip2db/geoip2influx.log /config/log/geoip2influx
fi

chmod +x /config/geoip2db/geoip2influx.py
chmod -R 0644 /etc/logrotate.d
chmod -R 0644 /etc/logrotate.d

echo -e "[init-geoip2influx-setup] Finished"
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-geoip2influx-setup/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-geoip2influx-setup/run
12 changes: 6 additions & 6 deletions root/etc/s6-overlay/s6-rc.d/init-maxmind-setup/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/with-contenv bash

echo "Maxmind init started"
echo -e "[init-maxmind-setup] init started"

# create GeoIP2 folder symlink
mkdir -p \
Expand All @@ -15,20 +15,20 @@ fi
if [[ -n "${MAXMINDDB_USER_ID}" ]]; then
sed -i "s|.*MAXMINDDB_USER_ID.*|MAXMINDDB_USER_ID=\"${MAXMINDDB_USER_ID}\"|g" /etc/libmaxminddb.cron.conf
else
echo "Starting with Alpine 3.20 rebase, MaxMindDB now requires setting the env var MAXMINDDB_USER_ID with your account's user id."
echo -e "[init-maxmind-setup] Starting with Alpine 3.20 rebase, MaxMindDB now requires setting the env var MAXMINDDB_USER_ID with your account's user id."
fi
if [[ -n "${MAXMINDDB_LICENSE_KEY}" ]]; then
sed -i "s|.*MAXMINDDB_LICENSE_KEY.*|MAXMINDDB_LICENSE_KEY=\"${MAXMINDDB_LICENSE_KEY}\"|g" /etc/libmaxminddb.cron.conf
if [[ ! -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]]; then
echo "Downloading GeoIP2 City database."
echo -e "[init-maxmind-setup] Downloading GeoIP2 City database."
/etc/periodic/weekly/libmaxminddb
fi
elif [[ -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]]; then
echo -e "Currently using the user provided GeoLite2-City.mmdb.\nIf you want to enable weekly auto-updates of the database, retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key."
echo -e "[init-maxmind-setup] Currently using the user provided GeoLite2-City.mmdb.\nIf you want to enable weekly auto-updates of the database, retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key."
else
echo -e "Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key."
echo -e "[init-maxmind-setup] Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please retrieve a free license key from MaxMind,\nand add a new env variable \"MAXMINDDB_LICENSE_KEY\", set to your license key."
fi

# permissions
lsiown -R abc:abc /config/geoip2db
echo "Maxmind init finished"
echo "[init-maxmind-setup] init finished"
44 changes: 0 additions & 44 deletions rootold/etc/cont-init.d/50-config

This file was deleted.

7 changes: 0 additions & 7 deletions rootold/etc/crontabs/root

This file was deleted.

14 changes: 0 additions & 14 deletions rootold/etc/logrotate.d/geoip2influx

This file was deleted.

45 changes: 0 additions & 45 deletions rootold/etc/s6-overlay/s6-rc.d/init-geoip2influx-config/run

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion rootold/etc/s6-overlay/s6-rc.d/init-geoip2influx-config/up

This file was deleted.

Empty file.

This file was deleted.

5 changes: 0 additions & 5 deletions rootold/etc/s6-overlay/s6-rc.d/svc-geoip2influx/run

This file was deleted.

3 changes: 0 additions & 3 deletions rootold/etc/services.d/cron/run

This file was deleted.

4 changes: 0 additions & 4 deletions rootold/etc/services.d/geoip2influx/run

This file was deleted.

0 comments on commit 6d0ac81

Please sign in to comment.