chore: initial sanitized public snapshot
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Base config copied to /config/aria2.conf on first start.
|
||||
# Environment-derived overrides are appended at runtime without mutating this file.
|
||||
|
||||
continue=true
|
||||
split=5
|
||||
max-connection-per-server=16
|
||||
min-split-size=1K
|
||||
piece-length=1K
|
||||
check-certificate=true
|
||||
@@ -0,0 +1,3 @@
|
||||
udp://tracker.opentrackr.org:1337/announce
|
||||
udp://tracker.torrent.eu.org:451/announce
|
||||
http://tracker.opentrackr.org:1337/announce
|
||||
@@ -0,0 +1,5 @@
|
||||
download-dir=/downloads
|
||||
completed-dir=/downloads/completed
|
||||
upload-log=/config/upload.log
|
||||
move-log=/config/move.log
|
||||
dest-dir=/downloads/completed
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
echo "[INFO] Clean hook completed."
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
echo "[INFO] Delete hook completed."
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
config="/config/script.conf"
|
||||
dest="/downloads/completed"
|
||||
|
||||
if [ -f "${config}" ]; then
|
||||
configured_dest="$(awk -F= '$1 == "dest-dir" {print substr($0, index($0, "=") + 1)}' "${config}" | tail -n 1)"
|
||||
if [ -n "${configured_dest}" ]; then
|
||||
dest="${configured_dest}"
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "${dest}"
|
||||
echo "[INFO] Move hook completed. Destination: ${dest}"
|
||||
@@ -0,0 +1 @@
|
||||
RCLONE_DESTINATION=remote:downloads
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
aria2_conf="${1:-/config/aria2.conf}"
|
||||
tracker_url="${CUSTOM_TRACKER_URL:-https://trackerslist.com/all_aria2.txt}"
|
||||
tmp_file="$(mktemp)"
|
||||
|
||||
cleanup() {
|
||||
rm -f "${tmp_file}" "${tmp_file}.conf"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "[INFO] Updating BT trackers from ${tracker_url}"
|
||||
|
||||
if ! curl -fsSL --connect-timeout 10 --max-time 20 "${tracker_url}" -o "${tmp_file}"; then
|
||||
echo "[WARN] Failed to download tracker list from ${tracker_url}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trackers="$(
|
||||
sed 's/\r$//' "${tmp_file}" |
|
||||
awk 'NF {print}' |
|
||||
paste -sd, -
|
||||
)"
|
||||
|
||||
if [ -z "${trackers}" ]; then
|
||||
echo "[WARN] Tracker list is empty" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -q '^bt-tracker=' "${aria2_conf}"; then
|
||||
awk -v value="bt-tracker=${trackers}" '
|
||||
BEGIN { replaced = 0 }
|
||||
/^bt-tracker=/ { print value; replaced = 1; next }
|
||||
{ print }
|
||||
END { if (!replaced) print value }
|
||||
' "${aria2_conf}" > "${tmp_file}.conf"
|
||||
else
|
||||
cp "${aria2_conf}" "${tmp_file}.conf"
|
||||
printf '\nbt-tracker=%s\n' "${trackers}" >> "${tmp_file}.conf"
|
||||
fi
|
||||
|
||||
cat "${tmp_file}.conf" > "${aria2_conf}"
|
||||
echo "[INFO] Tracker file updated."
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
echo "[INFO] Rclone upload hook is enabled. Configure /config/rclone.conf and /config/script.conf for custom behavior."
|
||||
Reference in New Issue
Block a user