diff --git a/hosts/ws-home/seedbox.nix b/hosts/ws-home/seedbox.nix index 6694c50..291f958 100644 --- a/hosts/ws-home/seedbox.nix +++ b/hosts/ws-home/seedbox.nix @@ -20,8 +20,7 @@ let wgIf = "wg-seedbox"; dataDir = "/var/lib/seedbox"; downloadsDir = "${dataDir}/downloads"; - webuiProxyPort = 8081; # localhost of this host only - webuiPort = 8080; # inside the namespace + webuiPort = 8081; sharePort = 8091; secret = name: config.sops.secrets."seedbox/${name}".path; @@ -130,8 +129,8 @@ in InaccessiblePaths = [ "-/run/nscd" ]; ReadWritePaths = [ dataDir ]; - # Initial settings, and the incoming port from the secret on every start. Other - # settings are left to the web interface. + # Defaults on first start, and the settings this setup depends on on every + # start. Everything else is left to the web interface. ExecStartPre = pkgs.writeShellScript "seedbox-config" '' set -euo pipefail PATH=${ @@ -139,33 +138,29 @@ in with pkgs; [ coreutils - gnused + crudini ] ) } - port=$(tr -dc 0-9 < ${secret "port"}) cfg=${dataDir}/qBittorrent/config/qBittorrent.conf mkdir -p ${downloadsDir} "$(dirname "$cfg")" + set_() { crudini --set "$cfg" "$@"; } + if [ ! -f "$cfg" ]; then - cat > "$cfg" <