New steps for install, ufw rules and configuration notes

This commit is contained in:
2021-03-28 23:44:15 +02:00
parent b46c4b6302
commit bb19a0f8ad
2 changed files with 68 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
# TRDA = transmission-daemon
TRDA_PEER_PORT=51413
TRDA_REMOTE_AUTH_LOC="/etc/transmission-daemon/transmission.sec"
TRDA_REMOTE_AUTH="machine localhost
login transmission

View File

@@ -2,17 +2,19 @@
toolName=transmission
toolDeps=transmission-daemon
toolService=transmission-daemon
toolUser=debian-transmission
toolCronLoc="/etc/cron.d/transmission_daemon"
# Get script working directory
# (when called from a different directory)
WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)"
APTOPT=
CONFIG=0
SCRIPT_NAME=$(basename -- $0)
SCRIPT_NAME=${SCRIPT_NAME%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
aptOpt=
step_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
@@ -22,10 +24,22 @@ step_config() {
# End if no configuration file exists
[ $DRY -eq 0 ] && return 1
fi
[ $QUIET -ne 0 ] && aptOpt="-y"
[ $QUIET -ne 0 ] && APTOPT="-y"
return 0
}
step_1_info() { echo "Install $toolName"; }
step_1_alias() { ALIAS="install"; }
step_1() {
exe apt update
exe apt install $toolDeps $APTOPT
exe systemctl stop $toolService
exe systemctl disable $toolService
exe mkdir -p "$TRDA_WATCH_LOCAL"
exe chown ${toolUser}: "$TRDA_WATCH_LOCAL"
}
step_10_info() { echo "Setup blocklist update cron job"; }
step_10_alias() { ALIAS="bllupdate"; }
step_10() {
@@ -35,5 +49,56 @@ step_10() {
addConf -s "$TRDA_CRON" "$toolCronLoc"
}
step_12_info() { echo "Add ufw rules for rpc and peer port (default 9091 and 51413)"; }
step_12_alias() { ALIAS="ufw"; }
step_12() {
local trdaRpcPort=9091
exe ufw allow in on eth0 to any port $trdaRpcPort proto tcp comment "Transmission rpc"
exe ufw allow in on tun0 to any port $TRDA_PEER_PORT comment "Transmission peer port"
exe ufw deny out on eth0 to any port $TRDA_PEER_PORT comment "Suppress transmission escapes"
}
step_20_info() { echo "Configuration notes"; }
step_20_alias() { ALIAS="notes"; }
step_20() {
outColor green
cat <<NOTES_EOF
[I] Change rpc password
1) Make sure $toolName service is stopped before editing the configuration file.
2) Adjust config and enter clear text password like this:
"rpc-password": "MYTRANSMISSIONPASS",
3) Start $toolName service again, which will hash the password in the config
[I] Some notes about configuration for smaller internet bandwith
[/etc/transmission/settings.json]
"alt-speed-down": 500,
"alt-speed-enabled": true,
"alt-speed-up": 16,
"blocklist-enabled": true,
"blocklist-url": "http://john.bitsurge.net/public/biglist.p2p.gz",
"download-dir": "/DOWNLOAD_DIR/completed",
"idle-seeding-limit": 15,
"idle-seeding-limit-enabled": true,
"incomplete-dir": "/DOWNLOAD_DIR/incomplete",
"message-level": 1,
"ratio-limit": 0.2000,
"ratio-limit-enabled": true,
"rpc-whitelist": "127.0.0.1,192.168.0.*",
"speed-limit-down": 360,
"speed-limit-up": 16,
"speed-limit-up-enabled": true,
"utp-enabled": true,
"watch-dir": "/var/torrentwatch",
"watch-dir-enabled": true
[I] Changes requested by transmission-daemon
Check syslog after startup to find values for your system.
[/etc/sysctl.conf]
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
NOTES_EOF
}
VERSION_SEQREV=12
. /usr/local/bin/sequencer.sh