Files
HomeLAB/LXC-Debian/PVE01_LXC_Debian_Seedbox.sh
2025-04-11 11:47:25 +02:00

199 lines
4.8 KiB
Bash

#!/bin/sh
#
# Check if user is root
#
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use the root user to install the software."
exit 1
fi
if [ ! -f /etc/debian_version ]; then
echo "Unsupported Linux Distribution. Prepared for Debian"
exit 1
fi
################################################################################
#
# Hostname: seedbox.vpn.lan
#
# IP: 192.168.20.10/24
#
# OS: Debian 12
#
# URL DanteProxy: http://192.168.20.10:1080
#
# URL qBittorrent: http://192.168.20.10:8080
#
# URL Jackett: http://192.168.20.10:9117
#
# Container ID: 109
#
# Node: PVE01
#
################################################################################
#
# qbittorrent Username is admin. Default password is “adminadmin”
# Config: /home/qbittorrent-nox/.config/qBittorrent/qBittorrent.conf
#
################################################################################
#
#
# echo 'mp0: /storage01/fileserver/downloads/torrent,mp=/srv/downloads' >> /etc/pve/nodes/pve01/lxc/109.conf
#
################################################################################
#
# systemctl [start | stop | reload | restart | status] danted
#
# systemctl [start | stop | reload | restart | status] qbittorrent-nox
#
# systemctl [start | stop | reload | restart | status] jackett
#
################################################################################
while :
do
clear
echo ""
echo "\033[1m I N S T A L L Seedbox"
echo " -----------------------------"
echo "\033[0m"
echo "01.Install Dante SOCKS5 proxy"
echo "02.Install qBittorrent"
echo "03.Install Jackett"
echo ""
echo " x. Exit"
echo ""
echo -n " Please enter option [01 - 03]"
read opt
case $opt in
##################################################################################
01) echo "************ Install Dante Proxy **********************";
##################################################################################
apt install -y dante-server
mv /etc/danted.conf /etc/danted.conf.default
cat > /etc/danted.conf <<"EOF"
#logoutput: /var/log/socks.log
internal: eth0 port = 1080
external: eth0
socksmethod: username none
user.privileged: root
user.notprivileged: nobody
client pass {
from: 192.168.10.0/24 port 1-65535 to: 0.0.0.0/0
}
client pass {
from: 127.0.0.0/8 port 1-65535 to: 0.0.0.0/0
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
socks pass {
from: 192.168.10.0/24 to: 0.0.0.0/0
protocol: tcp udp
}
socks pass {
from: 127.0.0.0/8 to: 0.0.0.0/0
protocol: tcp udp
}
socks block {
from: 0.0.0.0/0 to: 127.0.0.0/8
log: connect disconnect error
}
socks block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
EOF
service danted restart
cat > /root/myip.sh <<"EOF"
#!/bin/sh
#
curl ipinfo.io
EOF
chmod +x /root/myip.sh
apt autoremove && apt autoclean && apt clean
;;
##################################################################################
02) echo "************ Install qBittorrent ****************";
##################################################################################
#
# http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz
#
# /srv/downloads/torrent/tmp
# /srv/downloads/torrent/torrents
# /srv/downloads/torrent/qbittorrent
#
##################################################################################
apt install -y qbittorrent-nox
adduser --system --group qbittorrent-nox
cat > /etc/systemd/system/qbittorrent-nox.service <<"EOF"
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
#Do not change to "simple"
Type=forking
User=qbittorrent-nox
Group=qbittorrent-nox
UMask=000
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable qbittorrent-nox && systemctl start qbittorrent-nox
#systemctl status qbittorrent-nox
apt autoremove && apt autoclean && apt clean
;;
##################################################################################
03) echo "************ Install Jackett *****************";
##################################################################################
#https://github.com/Jackett/Jackett/releases
apt install -y liblttng-ust0 libunwind8 libuuid1 libcurl4 libkrb5-3 zlib1g libssl1.1
useradd -m jackett
cd /opt && wget https://github.com/Jackett/Jackett/releases/download/v0.20.314/Jackett.Binaries.LinuxAMDx64.tar.gz
tar zxvf Jackett.Binaries.LinuxAMDx64.tar.gz && rm Jackett.Binaries.LinuxAMDx64.tar.gz
chown -R jackett:jackett /opt/Jackett
/opt/Jackett/./install_service_systemd.sh
;;
x) echo "";
exit 1;;
*) echo " Press [enter] key to continue. . .";
read enterKey;;
esac
done