polkaned / dockerfiles

MIT License
108 stars 53 forks source link

Unable to change whitelist #14

Closed 0ShinyNinetales0 closed 4 years ago

0ShinyNinetales0 commented 4 years ago

expressvpn-transmission

I have been trying to use your image and it seems to run well. Sadly I only have problems accessing the WebUI. It gives me error 403, Forbidden.

When I see the transmission-daemon boot, I can see in the logging the whitelist is set to 127.0.0.1. I don't know where to change it. When trying to change settings.json in /var/lib/transmission-daemon/info it did not work.

Also I found a settings.json in root/.config/transmission-daemon/ When I change the whitelist here, settings don't save and after a reboot the setting is gone. Am I able to restart just the tranmission-daemon in the container or make the setting saved after a reboot?

Creating my own settings.json based on a copy with a changed IP address (I need 192.168.2.3 to be whitelisted) and mounting it, but then the container crashes when trying to load it.

I've been stuck on this for a couple days now and I'm wondering if you have any advice for me to troubleshoot this.

later edit:

I managed to get 192.168.2.3 on the whitelist by adding --allowed 192.168.2.3 as a boot command. However, I still get the 403, Forbidden error.

My output looks like this:

[2020-05-19 19:48:35.660] Transmission 2.94 (d8e60ee44f) started (session.c:740) [2020-05-19 19:48:35.660] RPC Server Adding address to whitelist: 192.168.2.3 (rpc-server.c:971) [2020-05-19 19:48:35.661] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1213) [2020-05-19 19:48:35.661] RPC Server Whitelist enabled (rpc-server.c:1217) [2020-05-19 19:48:35.661] UDP Failed to set receive buffer: requested 4194304, got 425984 (tr-udp.c:84) [2020-05-19 19:48:35.661] UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:89) [2020-05-19 19:48:35.661] UDP Failed to set send buffer: requested 1048576, got 425984 (tr-udp.c:95) [2020-05-19 19:48:35.661] UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:100) [2020-05-19 19:48:35.661] DHT Generating new id (tr-dht.c:311) [2020-05-19 19:48:35.661] Using settings from "/root/.config/transmission-daemon" (daemon.c:528) [2020-05-19 19:48:35.661] Saved "/root/.config/transmission-daemon/settings.json" (variant.c:1266) 2020-05-19 19:48:35.661] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:70) [2020-05-19 19:48:35.661] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:70) [2020-05-19 19:48:43.660] Port Forwarding State changed from "Not forwarded" to "Starting" (port-forwarding.c:92)

In the docker image, I have installed the nano package to be able to view the settings.json file in /root/.config/transmission-daemon where the log is pointing to. I have made changes there to allow 192.168.2.3 in the whitelist but it did not work. Also I have tried turning the whitelist off but I'm still getting the Forbidden message.

0ShinyNinetales0 commented 4 years ago

Got it working by setting my docker gateway ip in the whitelist by using a launch command:

/usr/bin/transmission-daemon --allowed 172.17.0.1 --foreground

This seemed to work but now my entire local network can access the transmission page. Not really what I was aiming for but at least I can access it now.

Setting --username and --password does not give me a login prompt when connecting to the webui however. Any experience with this?

polkaned commented 4 years ago

I added a new ENV var T_ALLOWED to the image: you can now specify whitelist on container's start:

docker run \
...
  --env=T_ALLOWED=172.17.0.1 \
...

I will add username and password ENV vars soon.

polkaned commented 4 years ago

I added authentication support (T_USERNAME & T_PASSWORD ENV vars).

0ShinyNinetales0 commented 4 years ago

Awesome! Thank you very much. I will give it a try right away.

0ShinyNinetales0 commented 4 years ago

After redeploying the container, I can properly set the whitelist trough the ENV variable T_ALLOWED. Setting this the Docker bridge gateway address (in my case 172.17.0.1), hosts from my local network can access the transmission page.

By using the T_USERNAME and T_PASSWORD ENV variables, I can now greet users with a login prompt before they can access the page.

Thank you very much for adding this in the image!