diff --git a/Dockerfile b/Dockerfile index 8504536..032d3e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ RUN \ p7zip && \ echo "**** grab GeoIP database ****" && \ curl -L --retry 10 --retry-max-time 60 --retry-all-errors \ - "https://geo.el0.org/GeoIP.dat.gz" \ + "https://geoip.linuxserver.io/GeoIP.dat.gz" \ | gunzip > /usr/share/GeoIP/GeoIP.dat && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index bbf8d49..2d364df 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -34,7 +34,7 @@ RUN \ p7zip && \ echo "**** grab GeoIP database ****" && \ curl -L --retry 10 --retry-max-time 60 --retry-all-errors \ - "https://geo.el0.org/GeoIP.dat.gz" \ + "https://geoip.linuxserver.io/GeoIP.dat.gz" \ | gunzip > /usr/share/GeoIP/GeoIP.dat && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ diff --git a/README.md b/README.md index d392393..6035268 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,18 @@ Change the inbound port to 6881 (or whichever port you've mapped for the contain This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/). +### Caveats + +* Automatic GeoIP updates will not work + ## Non-Root Operation This image can be run with a non-root user. For details please [read the docs](https://docs.linuxserver.io/misc/non-root/). +### Caveats + +* Automatic GeoIP updates will not work + ## Usage To help you get started creating a container from this image you can either use docker-compose or the docker cli. @@ -315,6 +323,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **29.12.25:** - Fix some issues with GeoIP updates. * **23.08.25:** - Update GeoIP provider, add weekly cronjob to update. * **12.01.25:** - Rebase libtorrentv1 branch to Alpine 3.21. * **19.09.24:** - Prevent race condition related delay during container stop. diff --git a/readme-vars.yml b/readme-vars.yml index 1a81282..33253ca 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -41,7 +41,11 @@ opt_param_usage_include_ports: true opt_param_ports: - {external_port: "58846", internal_port: "58846", port_desc: "Default deluged port for thin client connectivity"} readonly_supported: true +readonly_message: | + * Automatic GeoIP updates will not work nonroot_supported: true +nonroot_message: | + * Automatic GeoIP updates will not work # application setup block app_setup_block_enabled: true app_setup_block: | @@ -96,6 +100,7 @@ init_diagram: | "deluge:latest" <- Base Images # changelog changelogs: + - {date: "29.12.25:", desc: "Fix some issues with GeoIP updates."} - {date: "23.08.25:", desc: "Update GeoIP provider, add weekly cronjob to update."} - {date: "12.01.25:", desc: "Rebase libtorrentv1 branch to Alpine 3.21."} - {date: "19.09.24:", desc: "Prevent race condition related delay during container stop."} diff --git a/root/app/update-geoip.sh b/root/app/update-geoip.sh index 0bb147b..f8aeb97 100755 --- a/root/app/update-geoip.sh +++ b/root/app/update-geoip.sh @@ -8,9 +8,15 @@ sleep $(( RANDOM % 10800 )) geoip_dat_path="/usr/share/GeoIP/GeoIP.dat" if [[ -e "${geoip_dat_path}" ]]; then - curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors \ - "https://geo.el0.org/GeoIP.dat.gz" | - gunzip > /tmp/GeoIP.dat && \ - mv /tmp/GeoIP.dat "${geoip_dat_path}" && \ - chmod 644 "${geoip_dat_path}" + # Only update if the SHAs are different + source_sha=$(sha1sum "${geoip_dat_path}" | awk '{print $1}') + dest_sha=$(curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors "https://geoip.linuxserver.io/dat_sha1.txt") + + if [[ "${source_sha}" != "${dest_sha}" ]]; then + curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors \ + "https://geoip.linuxserver.io/GeoIP.dat.gz" | + gunzip > /tmp/GeoIP.dat && \ + mv /tmp/GeoIP.dat "${geoip_dat_path}" && \ + chmod 644 "${geoip_dat_path}" + fi fi diff --git a/root/crontabs/root b/root/crontabs/root deleted file mode 100644 index e31e825..0000000 --- a/root/crontabs/root +++ /dev/null @@ -1,2 +0,0 @@ -# min hour day month weekday command -0 3 * * 0 /app/geoip-update.sh 2>&1 diff --git a/root/etc/s6-overlay/s6-rc.d/init-deluge-config/dependencies.d/init-crontab-config b/root/etc/s6-overlay/s6-rc.d/init-deluge-config/dependencies.d/init-crontab-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run b/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run index eb214a8..f4c6d70 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-deluge-config/run @@ -12,6 +12,13 @@ if [[ ! -d /config/torrents ]]; then mkdir -p /config/torrents fi +if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then + # Pick a random day and hour to update the GeoIP DB + X=$(shuf -i 0-23 -n 1) + Y=$(shuf -i 0-6 -n 1) + (crontab -l 2>/dev/null; echo "0 ${X} * * ${Y} /app/geoip-update.sh 2>&1") | crontab - +fi + if [[ -z ${LSIO_NON_ROOT_USER} ]]; then # permissions lsiown -R abc:abc \