diff --git a/README.md b/README.md index fe2e861..c14c1fb 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e TRANSMISSION_WEB_HOME=/combustion-release/` | Specify an alternative UI options are `/combustion-release/`, `/transmission-web-control/`, and `/kettu/` . | | `-e USER=username` | Specify an optional username for the interface | | `-e PASS=password` | Specify an optional password for the interface | +| `-e WHITELIST=iplist` | Specify an optional list of comma separated host whitelist | | `-v /config` | Where transmission should store config files and logs. | | `-v /downloads` | Local path for downloads. | | `-v /watch` | Watch folder for torrent files. | @@ -167,8 +168,6 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel Webui is on port 9091, the settings.json file in /config has extra settings not available in the webui. Stop the container before editing it or any changes won't be saved. -For users pulling an update and unable to access the webui setting you may need to set "rpc-host-whitelist-enabled": false, in /config/settings.json` - If you choose to use transmission-web-control as your default UI, just note that the origional Web UI will not be available to you despite the button being present. ## Securing the webui with a username/password. @@ -183,6 +182,9 @@ The automatic update is a shell script that downloads a blocklist from the url s The automatic update will run once a day at 3am local server time. +## Using whitelist + +Use `WHITELIST` to enable an ip of whitelist. Both notation `rpc-whitelist` and `rpc-host-whitelist` are supported. When `WHITELIST` is empty the whitelist is disabled. ## Docker Mods [![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=transmission&query=%24.mods%5B%27transmission%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=transmission "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") diff --git a/root/defaults/settings.json b/root/defaults/settings.json index 053ce11..91c5c37 100644 --- a/root/defaults/settings.json +++ b/root/defaults/settings.json @@ -47,6 +47,8 @@ "rpc-port": 9091, "rpc-url": "/transmission/", "rpc-username": "", + "rpc-host-whitelist": "127.0.0.1", + "rpc-host-whitelist-enabled": false, "rpc-whitelist": "127.0.0.1", "rpc-whitelist-enabled": false, "scrape-paused-torrents-enabled": true, diff --git a/root/etc/cont-init.d/20-config b/root/etc/cont-init.d/20-config index 0a05f3b..946bd10 100644 --- a/root/etc/cont-init.d/20-config +++ b/root/etc/cont-init.d/20-config @@ -18,6 +18,18 @@ else sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json fi +if [ ! -z "$WHITELIST" ]; then + sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": true,' /config/settings.json + sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$WHITELIST\"," /config/settings.json + sed -i '/rpc-whitelist-enabled/c\ "rpc-host-whitelist-enabled": true,' /config/settings.json + sed -i "/\"rpc-whitelist\"/c\ \"rpc-host-whitelist\": \"$WHITELIST\"," /config/settings.json +else + sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": false,' /config/settings.json + sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$WHITELIST\"," /config/settings.json + sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": false,' /config/settings.json + sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json +fi + # permissions chown abc:abc \ /config/settings.json \