-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from GilbN/alpine-3.20
Rebase to Alpine 3.20
- Loading branch information
Showing
18 changed files
with
72 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
FROM lsiobase/alpine:3.15 | ||
FROM lsiobase/alpine:3.20 | ||
LABEL maintainer="GilbN" | ||
|
||
WORKDIR /geoip2influx | ||
COPY requirements.txt geoip2influx.py /geoip2influx/ | ||
RUN \ | ||
echo " ## Installing packages ## " && \ | ||
apk add --no-cache --virtual=build-dependencies \ | ||
python3 \ | ||
python3-dev \ | ||
py3-pip \ | ||
logrotate \ | ||
libmaxminddb && \ | ||
echo "**** install packages ****" && \ | ||
apk add --no-cache \ | ||
python3 && \ | ||
echo " ## Installing python modules ## " && \ | ||
python3 -m venv /lsiopy && \ | ||
pip3 install --no-cache-dir -r requirements.txt | ||
COPY root/ / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
██████╗ ███████╗ ██████╗ ██╗██████╗ ██████╗ ██╗███╗ ██╗███████╗██╗ ██╗ ██╗██╗ ██╗ | ||
██╔════╝ ██╔════╝██╔═══██╗██║██╔══██╗╚════██╗██║████╗ ██║██╔════╝██║ ██║ ██║╚██╗██╔╝ | ||
██║ ███╗█████╗ ██║ ██║██║██████╔╝ █████╔╝██║██╔██╗ ██║█████╗ ██║ ██║ ██║ ╚███╔╝ | ||
██║ ██║██╔══╝ ██║ ██║██║██╔═══╝ ██╔═══╝ ██║██║╚██╗██║██╔══╝ ██║ ██║ ██║ ██╔██╗ | ||
╚██████╔╝███████╗╚██████╔╝██║██║ ███████╗██║██║ ╚████║██║ ███████╗╚██████╔╝██╔╝ ██╗ | ||
╚═════╝ ╚══════╝ ╚═════╝ ╚═╝╚═╝ ╚══════╝╚═╝╚═╝ ╚═══╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ | ||
|
||
|
||
Made by @gilbN | ||
https://github.com/GilbN/geoip2influx |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/init-geoip2influx-setup/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
echo -e "[init-maxmind-setup] init started" | ||
|
||
# create GeoIP2 folder symlink | ||
mkdir -p \ | ||
/config/geoip2db | ||
if [[ -d /var/lib/libmaxminddb ]] && [[ ! -L /var/lib/libmaxminddb ]]; then | ||
rm -rf /var/lib/libmaxminddb | ||
fi | ||
if [[ ! -d /var/lib/libmaxminddb ]]; then | ||
ln -s /config/geoip2db /var/lib/libmaxminddb | ||
fi | ||
# check GeoIP2 database | ||
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 -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 -e "[init-maxmind-setup] Downloading GeoIP2 City database." | ||
/etc/periodic/weekly/libmaxminddb | ||
fi | ||
elif [[ -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]]; then | ||
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 "[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 "[init-maxmind-setup] init finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/init-maxmind-setup/run |
Empty file.
1 change: 1 addition & 0 deletions
1
root/etc/services.d/geoip2influx/run → ...c/s6-overlay/s6-rc.d/svc-geoip2influx/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
exec \ | ||
python3 /config/geoip2db/geoip2influx.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.