Обновить seedbox-install.sh
This commit is contained in:
+44
-8
@@ -1,12 +1,19 @@
|
||||
echo "deb [trusted=yes] https://flood-apt-repo.pages.dev/ devel main" | sudo tee /etc/apt/sources.list.d/flood.list
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
|
||||
sudo apt update
|
||||
sudo apt install -y flood
|
||||
sudo apt install -y rtorrent
|
||||
|
||||
SERVICE_USER="download"
|
||||
FLOOD_PORT="8098"
|
||||
FLOOD_HOST="0.0.0.0"
|
||||
EXPLORER_PORT="8099"
|
||||
SERVER_HOST="0.0.0.0"
|
||||
|
||||
sudo useradd --create-home --shell /bin/false "$SERVICE_USER"
|
||||
sudo mkdir -p /home/$SERVICE_USER/downloads
|
||||
sudo mkdir -p /home/$SERVICE_USER/watch
|
||||
sudo mkdir -p /home/$SERVICE_USER/.config/filebrowser
|
||||
sudo chown -R $SERVICE_USER:$SERVICE_USER /home/$SERVICE_USER
|
||||
|
||||
|
||||
sudo tee /etc/systemd/system/flood@.service > /dev/null <<EOF
|
||||
@@ -19,8 +26,8 @@ User=%I
|
||||
Group=%I
|
||||
Type=simple
|
||||
KillMode=process
|
||||
ExecStart=/usr/bin/env flood --host=${FLOOD_HOST} --port=${FLOOD_PORT}
|
||||
Restart=on-failure
|
||||
ExecStart=/usr/bin/env flood --host=${SERVER_HOST} --port=${FLOOD_PORT}
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
@@ -37,18 +44,47 @@ Group=%I
|
||||
Type=simple
|
||||
KillMode=process
|
||||
ExecStart=/usr/bin/env rtorrent
|
||||
Restart=on-failure
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo tee /etc/systemd/system/filebrowser@.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=FileBrowser service for %I
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=%I
|
||||
Group=%I
|
||||
Type=simple
|
||||
KillMode=process
|
||||
ExecStart=/usr/local/bin/filebrowser -r /home/%I -p ${EXPLORER_PORT} -a ${SERVER_HOST} -d /home/%I/.config/filebrowser/filebrowser.db
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo -u $SERVICE_USER filebrowser \
|
||||
-r /home/$SERVICE_USER \
|
||||
-d /home/$SERVICE_USER/.config/filebrowser/filebrowser.db \
|
||||
users add admin admin \
|
||||
--perm.admin
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable flood@${SERVICE_USER}.service
|
||||
sudo systemctl enable flood@${SERVICE_USER}.service
|
||||
sudo systemctl restart rtorrent@${SERVICE_USER}.service
|
||||
sudo systemctl restart rtorrent@${SERVICE_USER}.service
|
||||
sudo systemctl enable rtorrent@$SERVICE_USER
|
||||
sudo systemctl enable flood@$SERVICE_USER
|
||||
sudo systemctl enable filebrowser@$SERVICE_USER
|
||||
sudo systemctl restart rtorrent@$SERVICE_USER
|
||||
sudo systemctl restart flood@$SERVICE_USER
|
||||
sudo systemctl restart filebrowser@$SERVICE_USER
|
||||
|
||||
echo "Flood run in:"
|
||||
echo "http://<SERVER_IP>:${FLOOD_PORT}"
|
||||
echo "Explorer run in:"
|
||||
echo "http://<SERVER_IP>:${EXPLORER_PORT}"
|
||||
echo "Login: admin | Password: admin"
|
||||
Reference in New Issue
Block a user