Skip to content

Commit 61a7a10

Browse files
committed
Add new required var for userid
1 parent 87df076 commit 61a7a10

File tree

2 files changed

+9
-2
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-swag-maxmind-setup

2 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Follow these steps to enable the maxmind mod:
1212
2. In the container's docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:swag-maxmind`
1313

1414
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:swag-maxmind|linuxserver/mods:swag-mod2`
15-
3. In the container's docker arguments, set an environment variable `MAXMINDDB_LICENSE_KEY=<license-key>` with your license key.
15+
3. In the container's docker arguments, set the following environment variables:
16+
- `MAXMINDDB_LICENSE_KEY=<license-key>` with your license key
17+
- `MAXMINDDB_USER_ID=<user-id>` with your user id
1618
4. Recreate the container to apply the changes.
1719
5. Add the following line to `/config/nginx/nginx.conf` under the `http` section:
1820

root/etc/s6-overlay/s6-rc.d/init-mod-swag-maxmind-setup/run

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ if [[ ! -d /var/lib/libmaxminddb ]]; then
1212
ln -s /config/geoip2db /var/lib/libmaxminddb
1313
fi
1414
# check GeoIP2 database
15-
if [[ -n "$MAXMINDDB_LICENSE_KEY" ]]; then
15+
if [[ -n "${MAXMINDDB_USER_ID}" ]]; then
16+
sed -i "s|.*MAXMINDDB_USER_ID.*|MAXMINDDB_USER_ID=\"${MAXMINDDB_USER_ID}\"|g" /etc/libmaxminddb.cron.conf
17+
else
18+
echo "Starting with Alpine 3.20 rebase, MaxMindDB now requires setting the env var MAXMINDDB_USER_ID with your account's user id."
19+
fi
20+
if [[ -n "${MAXMINDDB_LICENSE_KEY}" ]]; then
1621
sed -i "s|.*MAXMINDDB_LICENSE_KEY.*|MAXMINDDB_LICENSE_KEY=\"${MAXMINDDB_LICENSE_KEY}\"|g" /etc/libmaxminddb.cron.conf
1722
if [[ ! -f /var/lib/libmaxminddb/GeoLite2-City.mmdb ]]; then
1823
echo "Downloading GeoIP2 City database."

0 commit comments

Comments
 (0)