Skip to content

Commit 663bf15

Browse files
committed
Probably fix the crontabs, update GeoIP URL to one we control
1 parent 4063274 commit 663bf15

8 files changed

Lines changed: 34 additions & 11 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN \
4444
pygeoip && \
4545
echo "**** grab GeoIP database ****" && \
4646
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
47-
"https://geo.el0.org/GeoIP.dat.gz" \
47+
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
4848
| gunzip > /usr/share/GeoIP/GeoIP.dat && \
4949
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
5050
echo "**** cleanup ****" && \

Dockerfile.aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN \
4444
pygeoip && \
4545
echo "**** grab GeoIP database ****" && \
4646
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
47-
"https://geo.el0.org/GeoIP.dat.gz" \
47+
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
4848
| gunzip > /usr/share/GeoIP/GeoIP.dat && \
4949
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
5050
echo "**** cleanup ****" && \

README.md

Lines changed: 9 additions & 1 deletion
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,7 +323,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
315323

316324
## Versions
317325

318-
* **28.12.25:** - Rebase to Alpine 3.23, update GeoIP provider, add weekly cronjob to update.
326+
* **29.12.25:** - Rebase to Alpine 3.23, update GeoIP provider, add weekly cronjob to update.
319327
* **12.01.25:** - Rebase to Alpine 3.21.
320328
* **19.09.24:** - Prevent race condition related delay during container stop.
321329
* **26.08.24:** - Add libtorrentv1 tag.

readme-vars.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ opt_param_usage_include_ports: true
4040
opt_param_ports:
4141
- {external_port: "58846", internal_port: "58846", port_desc: "Default deluged port for thin client connectivity"}
4242
readonly_supported: true
43+
readonly_message: |
44+
* Automatic GeoIP updates will not work
4345
nonroot_supported: true
46+
nonroot_message: |
47+
* Automatic GeoIP updates will not work
4448
# application setup block
4549
app_setup_block_enabled: true
4650
app_setup_block: |
@@ -95,7 +99,7 @@ init_diagram: |
9599
"deluge:libtorrentv1" <- Base Images
96100
# changelog
97101
changelogs:
98-
- {date: "28.12.25:", desc: "Rebase to Alpine 3.23, update GeoIP provider, add weekly cronjob to update."}
102+
- {date: "29.12.25:", desc: "Rebase to Alpine 3.23, update GeoIP provider, add weekly cronjob to update."}
99103
- {date: "12.01.25:", desc: "Rebase to Alpine 3.21."}
100104
- {date: "19.09.24:", desc: "Prevent race condition related delay during container stop."}
101105
- {date: "26.08.24:", desc: "Add libtorrentv1 tag."}

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)