{"action":"created","issue":{"url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/17","repository_url":"https://api.github.com/repos/binhex/arch-delugevpn","labels_url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/17/comments","events_url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/17/events","html_url":"https://github.com/binhex/arch-delugevpn/issues/17","id":187501906,"number":17,"title":"Opening port 58846 for remote access","user":{"login":"paranoiid","id":7196864,"avatar_url":"https://avatars.githubusercontent.com/u/7196864?v=3","gravatar_id":"","url":"https://api.github.com/users/paranoiid","html_url":"https://github.com/paranoiid","followers_url":"https://api.github.com/users/paranoiid/followers","following_url":"https://api.github.com/users/paranoiid/following{/other_user}","gists_url":"https://api.github.com/users/paranoiid/gists{/gist_id}","starred_url":"https://api.github.com/users/paranoiid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paranoiid/subscriptions","organizations_url":"https://api.github.com/users/paranoiid/orgs","repos_url":"https://api.github.com/users/paranoiid/repos","events_url":"https://api.github.com/users/paranoiid/events{/privacy}","received_events_url":"https://api.github.com/users/paranoiid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-05T15:02:59Z","updated_at":"2016-11-18T04:36:00Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to add the port for the daemon so I can use a thinclient on a Windows machine to access Deluge but so far I'm stumped.\r\n\r\nI've pulled the rep, built the dockerfile using the modified Iptables.sh as follows:\r\n\r\n```\r\n#!/bin/bash\r\n\r\n# ip route\r\n###\r\n\r\n# split comma seperated string into list from LAN_NETWORK env variable\r\nIFS=',' read -ra lan_network_list <<< \"${LAN_NETWORK}\"\r\n\r\n# process lan networks in the list\r\nfor lan_network_item in \"${lan_network_list[@]}\"; do\r\n\r\n        # strip whitespace from start and end of lan_network_item\r\n        lan_network_item=$(echo \"${lan_network_item}\" | sed -e 's/^[ \\t]*//')\r\n\r\n        echo \"[info] Adding ${lan_network_item} as route via docker eth0\"\r\n        ip route add \"${lan_network_item}\" via \"${DEFAULT_GATEWAY}\" dev eth0\r\n\r\ndone\r\n\r\necho \"[info] ip route defined as follows...\"\r\necho \"--------------------\"\r\nip route\r\necho \"--------------------\"\r\n\r\n\r\n# setup iptables marks to allow routing of defined ports via eth0\r\n###\r\n\r\n# check kernel for iptable_mangle module\r\nlsmod | grep \"iptable_mangle\" > /dev/null\r\niptable_mangle_exit_code=$?\r\n\r\nif [[ \"${DEBUG}\" == \"true\" ]]; then\r\n        echo \"[debug] Modules currently loaded for kernel\" ; lsmod\r\nfi\r\n\r\n# if iptable_mangle is not available then attempt to load module\r\nif [[ $iptable_mangle_exit_code != 0 ]]; then\r\n\r\n        # attempt to load module\r\n        echo \"[info] iptable_mangle module not supported, attempting to load...\"\r\n        modprobe iptable_mangle > /dev/null\r\n        iptable_mangle_exit_code=$?\r\nfi\r\n\r\n# if iptable_mangle is available then set fwmark\r\nif [[ $iptable_mangle_exit_code == 0 ]]; then\r\n\r\n        echo \"[info] iptable_mangle support detected, adding fwmark for tables\"\r\n\r\n        # setup route for deluge webui using set-mark to route traffic for port 8112 to eth0\r\n        echo \"8112    webui\" >> /etc/iproute2/rt_tables\r\n        ip rule add fwmark 1 table webui\r\n        ip route add default via $DEFAULT_GATEWAY table webui\r\n\r\n        echo \"58846    delrem\" >> /etc/iproute2/rt_tables\r\n        ip rule add fwmark 3 table webui\r\n        ip route add default via $DEFAULT_GATEWAY table delrem\r\n\r\n        # setup route for privoxy using set-mark to route traffic for port 8118 to eth0\r\n        if [[ $ENABLE_PRIVOXY == \"yes\" ]]; then\r\n                echo \"8118    privoxy\" >> /etc/iproute2/rt_tables\r\n                ip rule add fwmark 2 table privoxy\r\n                ip route add default via $DEFAULT_GATEWAY table privoxy\r\n        fi\r\n\r\nelse\r\n\r\n        echo \"[warn] iptable_mangle module not supported, you will not be able to connect to Deluge webui or Privoxy outside of your LAN\"\r\n\r\nfi\r\n\r\n# input iptable rules\r\n###\r\n\r\n# set policy to drop for input\r\niptables -P INPUT DROP\r\n\r\n# accept input to tunnel adapter\r\niptables -A INPUT -i \"${VPN_DEVICE_TYPE}0\" -j ACCEPT\r\n\r\n# accept input to/from docker containers (172.x range is internal dhcp)\r\niptables -A INPUT -s 172.17.0.0/16 -d 172.17.0.0/16 -j ACCEPT\r\n\r\n# accept input to vpn gateway\r\niptables -A INPUT -i eth0 -p $VPN_PROTOCOL --sport $VPN_PORT -j ACCEPT\r\n\r\n# accept input to deluge webui port 8112\r\niptables -A INPUT -i eth0 -p tcp --dport 8112 -j ACCEPT\r\niptables -A INPUT -i eth0 -p tcp --sport 8112 -j ACCEPT\r\niptables -A INPUT -i eth0 -p tcp --dport 58846 -j ACCEPT\r\niptables -A INPUT -i eth0 -p tcp --sport 58846 -j ACCEPT\r\n\r\n\r\n# accept input to privoxy port 8118 if enabled\r\nif [[ $ENABLE_PRIVOXY == \"yes\" ]]; then\r\n        iptables -A INPUT -i eth0 -p tcp --dport 8118 -j ACCEPT\r\n        iptables -A INPUT -i eth0 -p tcp --sport 8118 -j ACCEPT\r\nfi\r\n\r\n# process lan networks in the list\r\nfor lan_network_item in \"${lan_network_list[@]}\"; do\r\n\r\n        # strip whitespace from start and end of lan_network_item\r\n        lan_network_item=$(echo \"${lan_network_item}\" | sed -e 's/^[ \\t]*//')\r\n\r\n        # accept input to deluge daemon port - used for lan access\r\n        iptables -A INPUT -i eth0 -s \"${lan_network_item}\" -p tcp --dport 58846 -j ACCEPT\r\n\r\ndone\r\n\r\n# accept input dns lookup\r\niptables -A INPUT -p udp --sport 53 -j ACCEPT\r\n\r\n# accept input icmp (ping)\r\niptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT\r\n\r\n# accept input to local loopback\r\niptables -A INPUT -i lo -j ACCEPT\r\n\r\n# output iptable rules\r\n###\r\n\r\n# set policy to drop for output\r\niptables -P OUTPUT DROP\r\n\r\n# accept output from tunnel adapter\r\niptables -A OUTPUT -o \"${VPN_DEVICE_TYPE}0\" -j ACCEPT\r\n\r\n# accept output to/from docker containers (172.x range is internal dhcp)\r\niptables -A OUTPUT -s 172.17.0.0/16 -d 172.17.0.0/16 -j ACCEPT\r\n\r\n# accept output from vpn gateway\r\niptables -A OUTPUT -o eth0 -p $VPN_PROTOCOL --dport $VPN_PORT -j ACCEPT\r\n\r\n# if iptable mangle is available (kernel module) then use mark\r\nif [[ $iptable_mangle_exit_code == 0 ]]; then\r\n\r\n        # accept output from deluge webui port 8112 - used for external access\r\n        iptables -t mangle -A OUTPUT -p tcp --dport 8112 -j MARK --set-mark 1\r\n        iptables -t mangle -A OUTPUT -p tcp --sport 8112 -j MARK --set-mark 1\r\n        iptables -t mangle -A OUTPUT -p tcp --dport 58846 -j MARK --set-mark 1\r\n        iptables -t mangle -A OUTPUT -p tcp --sport 58846 -j MARK --set-mark 1\r\n\r\n\r\n        # accept output from privoxy port 8118 - used for external access\r\n        if [[ $ENABLE_PRIVOXY == \"yes\" ]]; then\r\n                iptables -t mangle -A OUTPUT -p tcp --dport 8118 -j MARK --set-mark 2\r\n                iptables -t mangle -A OUTPUT -p tcp --sport 8118 -j MARK --set-mark 2\r\n        fi\r\n\r\nfi\r\n\r\n# accept output from deluge webui port 8112 - used for lan access\r\niptables -A OUTPUT -o eth0 -p tcp --dport 8112 -j ACCEPT\r\niptables -A OUTPUT -o eth0 -p tcp --sport 8112 -j ACCEPT\r\niptables -A OUTPUT -o eth0 -p tcp --dport 58846 -j ACCEPT\r\niptables -A OUTPUT -o eth0 -p tcp --sport 58846 -j ACCEPT\r\n\r\n# accept output from privoxy port 8118 - used for lan access\r\nif [[ $ENABLE_PRIVOXY == \"yes\" ]]; then\r\n        iptables -A OUTPUT -o eth0 -p tcp --dport 8118 -j ACCEPT\r\n        iptables -A OUTPUT -o eth0 -p tcp --sport 8118 -j ACCEPT\r\nfi\r\n\r\n# process lan networks in the list\r\nfor lan_network_item in \"${lan_network_list[@]}\"; do\r\n\r\n        # strip whitespace from start and end of lan_network_item\r\n        lan_network_item=$(echo \"${lan_network_item}\" | sed -e 's/^[ \\t]*//')\r\n\r\n        # accept output to deluge daemon port - used for lan access\r\n        iptables -A OUTPUT -o eth0 -d \"${lan_network_item}\" -p tcp --sport 58846 -j ACCEPT\r\n\r\ndone\r\n\r\n# accept output for dns lookup\r\niptables -A OUTPUT -p udp --dport 53 -j ACCEPT\r\n\r\n# accept output for icmp (ping)\r\niptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT\r\n\r\n# accept output from local loopback adapter\r\niptables -A OUTPUT -o lo -j ACCEPT\r\n\r\necho \"[info] iptables defined as follows...\"\r\necho \"--------------------\"\r\niptables -S\r\necho \"--------------------\"\r\n\r\n```\r\n\r\nAnd of course also added \r\n-p 58846:58846 \\\r\nto the docker init script.\r\n\r\nBut I still can't connect to the server. I can access the WebUi just fine.\r\n\r\nAny hints you can give me? :)"},"comment":{"url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/comments/261446859","html_url":"https://github.com/binhex/arch-delugevpn/issues/17#issuecomment-261446859","issue_url":"https://api.github.com/repos/binhex/arch-delugevpn/issues/17","id":261446859,"user":{"login":"smvoss","id":1350045,"avatar_url":"https://avatars.githubusercontent.com/u/1350045?v=3","gravatar_id":"","url":"https://api.github.com/users/smvoss","html_url":"https://github.com/smvoss","followers_url":"https://api.github.com/users/smvoss/followers","following_url":"https://api.github.com/users/smvoss/following{/other_user}","gists_url":"https://api.github.com/users/smvoss/gists{/gist_id}","starred_url":"https://api.github.com/users/smvoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smvoss/subscriptions","organizations_url":"https://api.github.com/users/smvoss/orgs","repos_url":"https://api.github.com/users/smvoss/repos","events_url":"https://api.github.com/users/smvoss/events{/privacy}","received_events_url":"https://api.github.com/users/smvoss/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T04:36:00Z","updated_at":"2016-11-18T04:36:00Z","body":"I actually am having the same issue, using `-p 58847:58846` and with my LAN_NETWORK set to suggested.\r\n\r\nI am only able to remedy this by actually passing through `-p 58846:58846` and using the default port. If I try to pass through as a different port (if this is my second instance of deluge) it will not work.\r\n\r\nWith this, trying to change deluged port (I tested 58847; set in the config file), the container will not even launch and fail out with a python include error.\r\n\r\nHopefully this helps debug the issue!"}}
{"actor":{"display_login":"smvoss"}}