deluge: add script

This commit is contained in:
bain 2023-01-02 16:54:32 +01:00
parent e8e67ed430
commit 16c3bc7574
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,5 @@
https://torrent.$domain {
@blocked not remote_ip 10.0.0.0/24 10.0.89.0/24
respond @blocked "Internal use only" 403
reverse_proxy http://localhost:8085
}

View file

@ -0,0 +1,17 @@
version: "2"
services:
deluge:
image: lscr.io/linuxserver/deluge:latest
container_name: deluge
restart: unless-stopped
environment:
- UMASK_SET=022
- TZ=$timezone
- PUID=1000
- PGID=1000
- DELUGE_LOGLEVEL=error
ports:
- 127.0.0.1:8085:8112
volumes:
- /data/deluge/downloads:/downloads
- /data/deluge/config:/config

36
scripts/deluge/script.sh Normal file
View file

@ -0,0 +1,36 @@
#!/bin/bash
set -euo pipefail
source "$HL_LIB"
_assert_vars HL_TIMEZONE HL_DOMAIN;
_ch_001-make_dirs() {
mkdir -p ~/deluge /data/deluge;
}
_ch_002-copy_compose() {
cp $(_fill docker-compose.yml.templ) ~/deluge/docker-compose.yml;
}
_ch_003-update_caddy() {
cp $(_fill Caddyfile.templ) /etc/caddy/conf.d/deluge.Caddyfile;
chmod a+r /etc/caddy/conf.d/deluge.Caddyfile;
sudo systemctl reload caddy.service;
}
_ch_004-install_wg_vpn() {
sudo apt-get install -y wireguard-tools
[ -f /data/deluge/wg-vpn.conf ] || _err "Please create /data/deluge/wg-vpn.conf with correct vpn config"
sudo chown root:root /data/deluge/wg-vpn.conf
sudo chmod 600 /data/deluge/wg-vpn.conf
sudo ln -sf /data/deluge/wg-vpn.conf /etc/wireguard/wg0.conf
sudo systemctl enable --now wg-quick@wg0
}
_ch_005-run_service() {
cd ~/deluge;
docker-compose up -d;
}
_run_checkpoints