Gentoo 403 Error

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Post Reply
lolicatgrill
Posts: 3
Joined: Tue Mar 15, 2016 5:40 am

Gentoo 403 Error

Post by lolicatgrill »

I followed the documentations for gentoo install and I edited my settings.json it was working fine but then after my machine restarted then suddenly my transmission web interface gave me a 403 error on my desktop.

Code: Select all

403: Forbidden

Unauthorized IP Address.

Either disable the IP address whitelist or add your address to it.

If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.

If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.
I'm running

Code: Select all

net-p2p/transmission-2.92::gentoo was built with the following:
USE="-ayatana -gtk -libressl -lightweight -qt4 -qt5 -systemd -xfs" ABI_X86="64"
/var/lib/transmission/config/settings.json

Code: Select all

"rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{8061a7e8759cf484ace40c2941b6760ca3ce8595/s9.Orzi",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "",
    "rpc-whitelist": "127.0.0.1,192.168.*.*",
    "rpc-whitelist-enabled": true,    
cat /etc/conf.d/transmission | grep -v '^#'

Code: Select all

TR_HOME=/var/transmission/config

 TR_DOWNLOAD=/tank/downloads

 TR_PORT=54318

 TR_ACL="192.168.2.1"

 TR_BLOCK=no

 CTL_PORT=9091

 TR_ENCRYPT=required
cat /etc/init.d/transmission | grep -v '^#'

Code: Select all

declare -a OPTIONS
OPTIONS+=" -a ${TR_ACL:=127.0.0.1}"
if [ -z "$TR_BLOCK" -o "$TR_BLOCK" = "no" ]; then
   OPTIONS+=" -B"
else
   OPTIONS+=" -b"
fi
OPTIONS+=" -g ${TR_HOME:-/var/transmission/config}"
OPTIONS+=" -l ${TR_PPT:-60}"
OPTIONS+=" -L ${TR_PEERS:-240}"
OPTIONS+=" -p ${CTL_PORT:-9091}"
if [ -z "$REMOTE_USER" -o -z "$REMOTE_PASS" ]; then
   OPTIONS+=" -T"
else
   OPTIONS+=" -t"
   OPTIONS+=" -u $REMOTE_USER"
   OPTIONS+=" -v $REMOTE_PASS"
fi
OPTIONS+=" -w ${TR_DOWNLOAD:-/var/transmission/downloads}"
declare -a EXTRA_OPT
if [ -z "$TR_UP_SPEED" -o "$TR_UP_SPEED" = "unlimited" ]; then
   EXTRA_OPT+=" -U"
else
   EXTRA_OPT+=" -u $TR_UP_SPEED"
fi
if [ -z "$TR_DN_SPEED" -o "$TR_DN_SPEED" = "unlimited" ]; then
   EXTRA_OPT+=" -D"
else
   EXTRA_OPT+=" -d $TR_DN_SPEED"
fi
if [ -z "$TR_PX" -o "$TR_PX" = "no" ]; then
  EXTRA_OPT+=" -X"
else
  EXTRA_OPT+=" -x"
fi
if [ -z "$TR_PMAP" -o "$TR_PMAP" = "no" ]; then
  EXTRA_OPT+=" -M"
else
  EXTRA_OPT+=" -m"
fi
if [ -z "$TR_ENCRYPT" -o "$TR_ENCRYPT" = "tolerated" ]; then
  EXTRA_OPT+=" -et"
elif [ "$TR_ENCRYPT" = "prefered" ]; then
  EXTRA_OPT+=" -ep"
elif [ "$TR_ENCRYPT" = "required" ]; then
  EXTRA_OPT+=" -er"
else
  EXTRA_OPT+=" -et"
fi
E_MSG="ERROR starting transmission, check configuration."

depend() {
   need net
}

start() {
   ebegin "Starting transmission daemon"
   start-stop-daemon --start --quiet \
      --chuid ${TR_USERNAME:-nobody} \
      --exec /usr/bin/transmission-daemon -- ${OPTIONS[@]} \
   || { eerror $E_MSG; eend 1; return 1; }
   sleep 2
   transmission-remote ${CTL_PORT:-9091} \
      ${REMOTE_PASS:+-n $REMOTE_USER:$REMOTE_PASS} \
      --port ${TR_PORT:-54318} ${EXTRA_OPT[@]} > /dev/null
   eend $?
}

stop() {
   ebegin "Stopping transmission daemon"
   start-stop-daemon --stop --quiet --retry=TERM/45/KILL/15 \
      --exec /usr/bin/transmission-daemon
   eend $?
}
lolicatgrill
Posts: 3
Joined: Tue Mar 15, 2016 5:40 am

Re: Gentoo 403 Error

Post by lolicatgrill »

I did that but it still wouldn't work.

But after noticing that transmission was run by "nobody" on htop I did

Code: Select all

chown -R root:nobody /usr/bin/transmission-daemon
and I can access my webgui again.

How do I make it as root as default to run it?
mike.dld
Transmission Developer
Posts: 306
Joined: Wed Dec 25, 2013 10:56 pm

Re: Gentoo 403 Error

Post by mike.dld »

Judging from the init script, you'll need to add

Code: Select all

TR_USERNAME=root
to conf.d file. I wouldn't do that though, as there is no good reason in running Transmission as root.
lolicatgrill
Posts: 3
Joined: Tue Mar 15, 2016 5:40 am

Re: Gentoo 403 Error

Post by lolicatgrill »

Yes I noticed it follows the settings.json, my problem was rather the permissions I think, and mike.dld is right, I shouldn't run this as root, I'll set it on my normal user account then see how it goes on my next reboot.
VoXqWBqQME6WtI
Posts: 13
Joined: Tue Jan 26, 2010 10:16 am

Re: Gentoo 403 Error

Post by VoXqWBqQME6WtI »

Gentoo creates user trasmission during install, you should/could use that for running it.
Post Reply