Skip to content

Commit 8cc85cd

Browse files
authored
Merge pull request #228 from linuxserver/crontab-fixes
Fix GeoIP crontab update, update readme
2 parents 1e3f463 + 19b5e1f commit 8cc85cd

8 files changed

Lines changed: 34 additions & 9 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN \
3434
p7zip && \
3535
echo "**** grab GeoIP database ****" && \
3636
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
37-
"https://geo.el0.org/GeoIP.dat.gz" \
37+
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
3838
| gunzip > /usr/share/GeoIP/GeoIP.dat && \
3939
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
4040
echo "**** cleanup ****" && \

Dockerfile.aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN \
3434
p7zip && \
3535
echo "**** grab GeoIP database ****" && \
3636
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
37-
"https://geo.el0.org/GeoIP.dat.gz" \
37+
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
3838
| gunzip > /usr/share/GeoIP/GeoIP.dat && \
3939
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
4040
echo "**** cleanup ****" && \

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,18 @@ Change the inbound port to 6881 (or whichever port you've mapped for the contain
8080

8181
This image can be run with a read-only container filesystem. For details please [read the docs](https://docs.linuxserver.io/misc/read-only/).
8282

83+
### Caveats
84+
85+
* Automatic GeoIP updates will not work
86+
8387
## Non-Root Operation
8488

8589
This image can be run with a non-root user. For details please [read the docs](https://docs.linuxserver.io/misc/non-root/).
8690

91+
### Caveats
92+
93+
* Automatic GeoIP updates will not work
94+
8795
## Usage
8896

8997
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
315323

316324
## Versions
317325

326+
* **29.12.25:** - Fix some issues with GeoIP updates.
318327
* **23.08.25:** - Update GeoIP provider, add weekly cronjob to update.
319328
* **12.01.25:** - Rebase libtorrentv1 branch to Alpine 3.21.
320329
* **19.09.24:** - Prevent race condition related delay during container stop.

readme-vars.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ opt_param_usage_include_ports: true
4141
opt_param_ports:
4242
- {external_port: "58846", internal_port: "58846", port_desc: "Default deluged port for thin client connectivity"}
4343
readonly_supported: true
44+
readonly_message: |
45+
* Automatic GeoIP updates will not work
4446
nonroot_supported: true
47+
nonroot_message: |
48+
* Automatic GeoIP updates will not work
4549
# application setup block
4650
app_setup_block_enabled: true
4751
app_setup_block: |
@@ -96,6 +100,7 @@ init_diagram: |
96100
"deluge:latest" <- Base Images
97101
# changelog
98102
changelogs:
103+
- {date: "29.12.25:", desc: "Fix some issues with GeoIP updates."}
99104
- {date: "23.08.25:", desc: "Update GeoIP provider, add weekly cronjob to update."}
100105
- {date: "12.01.25:", desc: "Rebase libtorrentv1 branch to Alpine 3.21."}
101106
- {date: "19.09.24:", desc: "Prevent race condition related delay during container stop."}

root/app/update-geoip.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ sleep $(( RANDOM % 10800 ))
88
geoip_dat_path="/usr/share/GeoIP/GeoIP.dat"
99

1010
if [[ -e "${geoip_dat_path}" ]]; then
11-
curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors \
12-
"https://geo.el0.org/GeoIP.dat.gz" |
13-
gunzip > /tmp/GeoIP.dat && \
14-
mv /tmp/GeoIP.dat "${geoip_dat_path}" && \
15-
chmod 644 "${geoip_dat_path}"
11+
# Only update if the SHAs are different
12+
source_sha=$(sha1sum "${geoip_dat_path}" | awk '{print $1}')
13+
dest_sha=$(curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors "https://geoip.linuxserver.io/dat_sha1.txt")
14+
15+
if [[ "${source_sha}" != "${dest_sha}" ]]; then
16+
curl -s -L --retry 2 --retry-max-time 10 --retry-all-errors \
17+
"https://geoip.linuxserver.io/GeoIP.dat.gz" |
18+
gunzip > /tmp/GeoIP.dat && \
19+
mv /tmp/GeoIP.dat "${geoip_dat_path}" && \
20+
chmod 644 "${geoip_dat_path}"
21+
fi
1622
fi

root/crontabs/root

Lines changed: 0 additions & 2 deletions
This file was deleted.

root/etc/s6-overlay/s6-rc.d/init-deluge-config/dependencies.d/init-crontab-config

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/init-deluge-config/run

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ if [[ ! -d /config/torrents ]]; then
1212
mkdir -p /config/torrents
1313
fi
1414

15+
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
16+
# Pick a random day and hour to update the GeoIP DB
17+
X=$(shuf -i 0-23 -n 1)
18+
Y=$(shuf -i 0-6 -n 1)
19+
(crontab -l 2>/dev/null; echo "0 ${X} * * ${Y} /app/geoip-update.sh 2>&1") | crontab -
20+
fi
21+
1522
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
1623
# permissions
1724
lsiown -R abc:abc \

0 commit comments

Comments
 (0)