diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-23 14:17:53 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-23 14:17:53 +0100 |
| commit | 0e0098c021080e2fc9271334de2f29b397ac5f25 (patch) | |
| tree | f2fbba9a151ab3bbe2031cb160d70790c8bc8fd7 | |
| parent | bbee9eb8f939ac71d864ec019e00987fc4a453aa (diff) | |
bitfroest: update
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
| -rwxr-xr-x | bundles/bitfroest/files/bitfroest | 13 | ||||
| -rw-r--r-- | bundles/bitfroest/files/kum4.ssh | 1 | ||||
| -rwxr-xr-x | bundles/bitfroest/files/qbapi | 7 | ||||
| -rw-r--r-- | bundles/bitfroest/items.py | 7 |
4 files changed, 18 insertions, 10 deletions
diff --git a/bundles/bitfroest/files/bitfroest b/bundles/bitfroest/files/bitfroest index ac3c010..9e2c3be 100755 --- a/bundles/bitfroest/files/bitfroest +++ b/bundles/bitfroest/files/bitfroest @@ -1,29 +1,28 @@ #!/bin/sh +[ -n "$DEBUG" ] && set -x set -eu -remote_host=kum4@porphyrion.feralhosting.com +remote_host=kum4@poseidon.feralhosting.com ssh_args='-i /home/robert/.ssh/kum4' inbox_dir=/media/hayasui/media/.inbox textfiles_dir=/run/prom do_transfer() { - local remote_path=$1 + local remote_path="$*" rsync --archive --protect-args \ + --chown=robert:robert \ --verbose \ -hhh --info=flist2,name,progress \ --partial \ - --rsh="ssh $ssh_args -o Compression=no" \ + --rsh="ssh $ssh_args -o Compression=no -o RemoteCommand=none" \ "$remote_host:$remote_path" \ "$inbox_dir"/ - - chown -R nobody:wheel "$inbox_dir/$name" - chmod g+w "$inbox_dir/$name" } do_fetch() { local name remote_path - qbapi getnew | while read -r name remote_path; do + qbapi getnew | while IFS=' ' read -r name remote_path; do do_transfer "$remote_path" qbapi markx "$name" do_notify "$name" diff --git a/bundles/bitfroest/files/kum4.ssh b/bundles/bitfroest/files/kum4.ssh new file mode 100644 index 0000000..afa41e8 --- /dev/null +++ b/bundles/bitfroest/files/kum4.ssh @@ -0,0 +1 @@ +${repo.vault.cmd("rbw get -f private_key ea15ce08-0c35-40cd-a400-662f116b4e51")} diff --git a/bundles/bitfroest/files/qbapi b/bundles/bitfroest/files/qbapi index 89d328e..bed63ba 100755 --- a/bundles/bitfroest/files/qbapi +++ b/bundles/bitfroest/files/qbapi @@ -1,7 +1,8 @@ #!/bin/sh +[ -n "$DEBUG" ] && set -x set -eu -qb_host=https://porphyrion.feralhosting.com/kum4/qbittorrent +qb_host=https://poseidon.feralhosting.com/kum4/qbittorrent qb_user=kum4 qb_pass=${repo.vault.cmd("rbw get 6e66abae-094c-4c98-83ad-9b7bae3eb1b2")} qb_cookiejar=/dev/shm/qb.cookies @@ -17,7 +18,7 @@ do_login() { do_getnew() { curl -sS -b "$qb_cookiejar" \ "$qb_host/api/v2/torrents/info?filter=completed&sort=added_on&tag=" | - jq -rc '.[]|[.name,.content_path]|@tsv' + jq -rc '.[]|[.name,(if .root_path != "" then .root_path else .content_path end)]|@tsv' } do_markx() { @@ -34,7 +35,7 @@ do_markx() { } main() { - test -f "$qb_cookiejar" || do_login + rm -f "$qb_cookiejar" && do_login case "$1" in getnew) do_getnew ;; diff --git a/bundles/bitfroest/items.py b/bundles/bitfroest/items.py index db880a9..3fb5d28 100644 --- a/bundles/bitfroest/items.py +++ b/bundles/bitfroest/items.py @@ -3,6 +3,13 @@ if node.os != "alpine": files = { + "/home/robert/.ssh/kum4": { + "source": "kum4.ssh", + "content_type": "mako", + "owner": "robert", + "group": "robert", + "mode": "0600", + }, "/usr/bin/qbapi": { "source": "qbapi", "content_type": "mako", |