switch to hybrid

This commit is contained in:
aptalca
2022-08-26 09:21:43 -04:00
parent 485d51c7c3
commit 9b7bebbe68
12 changed files with 42 additions and 0 deletions
@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bash
if ! apk info 2>&1 | grep -q "libmaxminddb"; then
echo "**** adding libmaxminddb to package install list ****"
echo "libmaxminddb" >> /mod-repo-packages-to-install.list
if
else
echo "**** libmaxminddb already installed, skipping ****"
fi
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-swag-maxmind-add-package/run
@@ -0,0 +1,29 @@
#!/usr/bin/with-contenv bash
echo "Applying the maxmind mod..."
# create GeoIP2 folder symlink
mkdir -p \
/config/geoip2db
[[ -d /var/lib/libmaxminddb ]] && [[ ! -L /var/lib/libmaxminddb ]] && \
rm -rf /var/lib/libmaxminddb
[[ ! -d /var/lib/libmaxminddb ]] && \
ln -s /config/geoip2db /var/lib/libmaxminddb
# check GeoIP2 database
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."
/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."
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."
fi
if [ ! -f /config/nginx/maxmind.conf ]; then
cp /defaults/maxmind.conf /config/nginx/maxmind.conf
fi
echo "Applied the maxmind mod"
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-swag-maxmind-setup/run