Merge pull request #16 from phendryx/blocklist-update

Blocklist update
This commit is contained in:
sparklyballs
2016-10-30 13:30:10 +00:00
committed by GitHub
6 changed files with 40 additions and 0 deletions

View File

@@ -10,6 +10,8 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
RUN \
apk add --no-cache \
curl \
jq \
transmission-cli \
transmission-daemon
# copy local files

View File

@@ -81,6 +81,13 @@ this requires 3 settings to be changed in the settings.json file.
Transmission will convert it to a hash when you restart the container after making the above edits.
## Updating Blocklists Automatically
This requires `"blocklist-enabled": true,` to be set. By setting this to true, it is assumed you have also populated `blocklist-url` with a valid block list.
The automatic update is a shell script that downloads a blocklist from the url stored in the settings.json, gunzips it, and restarts the transmission daemon.
The automatic update will run once a day at 3am local server time.
## Info
@@ -97,6 +104,7 @@ Transmission will convert it to a hash when you restart the container after maki
## Versions
+ **16.10.16:** Blocklist autoupdate with optional authentication.
+ **14.10.16:** Add version layer information.
+ **23.09.16:** Add information about securing the webui to README..
+ **21.09.16:** Add curl package.

View File

@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bash
BLOCKLIST_URL=`jq -r '.["blocklist-url"]' settings.json`
rm /config/blocklists/*
cd /config/blocklists
wget -q $BLOCKLIST_URL
gunzip *.gz
chmod go+r *
s6-svc -h /var/run/s6/services/transmission

View File

@@ -8,10 +8,17 @@ mkdir -p \
[[ ! -f /config/settings.json ]] && cp \
/defaults/settings.json /config/settings.json
# copy blocklist-update script
[[ ! -f /config/blocklist-update.sh ]] && cp \
/defaults/blocklist-update.sh /config/blocklist-update.sh
# permissions
chown abc:abc \
/config/settings.json \
/config/blocklist-update.sh \
/downloads \
/downloads/complete \
/downloads/incomplete \
/watch
chmod 755 /config/blocklist-update.sh

10
root/etc/crontabs/root Normal file
View File

@@ -0,0 +1,10 @@
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 * * * * run-parts /etc/periodic/15min
0 * * * * run-parts /etc/periodic/hourly
0 2 * * * run-parts /etc/periodic/daily
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
# run daily blocklist update
0 3 * * * /config/blocklist-update.sh 2>&1

View File

@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
/usr/sbin/crond -f -S -l 0 -c /etc/crontabs