37 lines
906 B
Bash
37 lines
906 B
Bash
|
#!/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
|