├── heroku.yml ├── content ├── aria2 │ ├── dht.dat │ ├── rclone.env │ ├── clean.sh │ ├── script.conf │ ├── move.sh │ ├── delete.sh │ ├── copy_remote_first.sh │ ├── move_remote_only.sh │ ├── copy_remote_other.sh │ ├── move_remote.sh │ ├── copy_remote.sh │ ├── tracker.sh │ ├── core │ ├── aria2_chs.conf │ └── aria2_en.conf ├── homer_conf │ ├── ttyd.png │ ├── AriaNg.ico │ ├── metube.png │ ├── rcloneng.png │ ├── filebrowser.png │ ├── homer_chs.yml │ └── homer_en.yml ├── service │ ├── 2 │ │ ├── log │ │ │ └── run │ │ └── run │ ├── ttyd │ │ ├── log │ │ │ └── run │ │ └── run │ ├── xray │ │ ├── log │ │ │ └── run │ │ └── run │ ├── caddy │ │ ├── log │ │ │ └── run │ │ └── run │ ├── rclone │ │ ├── log │ │ │ └── run │ │ └── run │ ├── metube │ │ ├── log │ │ │ └── run │ │ └── run │ ├── filebrowser │ │ ├── log │ │ │ └── run │ │ └── run │ ├── rclone_webdav │ │ ├── log │ │ │ └── run │ │ └── run │ ├── backup_files │ │ ├── log │ │ │ └── run │ │ └── run │ └── update_token │ │ └── run ├── bashrc ├── install.sh ├── entrypoint.sh ├── ytdlptorclone.sh ├── caddy_init_chs.sh ├── caddy_init_en.sh └── Caddyfile ├── .env ├── .github └── workflows │ ├── heroku-deploy-dev.yml │ └── heroku-deploy-release.yml ├── Dockerfile ├── app.json ├── README.md └── README_en.md /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile -------------------------------------------------------------------------------- /content/aria2/dht.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/aria2/dht.dat -------------------------------------------------------------------------------- /content/homer_conf/ttyd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/homer_conf/ttyd.png -------------------------------------------------------------------------------- /content/service/2/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/aria2 2>/dev/null 4 | exec svlogd /mnt/data/log/aria2 -------------------------------------------------------------------------------- /content/service/ttyd/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/ttyd 2>/dev/null 4 | exec svlogd /mnt/data/log/ttyd -------------------------------------------------------------------------------- /content/service/xray/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/xray 2>/dev/null 4 | exec svlogd /mnt/data/log/xray -------------------------------------------------------------------------------- /content/homer_conf/AriaNg.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/homer_conf/AriaNg.ico -------------------------------------------------------------------------------- /content/homer_conf/metube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/homer_conf/metube.png -------------------------------------------------------------------------------- /content/homer_conf/rcloneng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/homer_conf/rcloneng.png -------------------------------------------------------------------------------- /content/service/caddy/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/caddy 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/caddy -------------------------------------------------------------------------------- /content/service/rclone/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/rclone 2>/dev/null 4 | exec svlogd /mnt/data/log/rclone -------------------------------------------------------------------------------- /content/service/metube/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/metube 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/metube -------------------------------------------------------------------------------- /content/homer_conf/filebrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wy580477/Heroku-All-In-One-APP/HEAD/content/homer_conf/filebrowser.png -------------------------------------------------------------------------------- /content/service/filebrowser/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/filebrowser 2>/dev/null 4 | exec svlogd /mnt/data/log/filebrowser -------------------------------------------------------------------------------- /content/service/rclone_webdav/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/rclone_webdav 2>/dev/null 4 | exec svlogd /mnt/data/log/rclone_webdav -------------------------------------------------------------------------------- /content/service/backup_files/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/log/backup_files 2>/dev/null 4 | exec svlogd -tt /mnt/data/log/backup_files -------------------------------------------------------------------------------- /content/bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LS_OPTIONS='--color=auto' 4 | alias ls='ls $LS_OPTIONS' 5 | alias ll='ls $LS_OPTIONS -l' 6 | alias l='ls $LS_OPTIONS -lA' 7 | export PS1='\w$ ' 8 | export HOME=/mnt/data 9 | alias dlpr="yt-dlp --exec ytdlptorclone.sh -P /mnt/data/videos" 10 | cd 11 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | GLOBAL_USER=admin 2 | GLOBAL_PASSWORD=password 3 | GLOBAL_LANGUAGE=en 4 | GLOBAL_PORTAL_PATH=/portal 5 | HEROKU_KEEP_AWAKE=true 6 | HEROKU_RESTART_TIME=11:05 7 | RCLONE_AUTO_MODE=move_remote 8 | RCLONE_DRIVE_NAME=auto 9 | TZ=Asia/Shanghai 10 | VMESS_UUID=a3ac20a7-45fe-4656-97ee-937ffec46144 11 | VMESS_PATH=/f495ba1f 12 | -------------------------------------------------------------------------------- /content/service/ttyd/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 4 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/bashrc /mnt/data/config/bashrc 2>/dev/null 5 | 6 | exec 2>&1 7 | exec ttyd -i 127.0.0.1 -p 61803 -P 3 -t fontSize=17 -t titleFixed=Heroku_ttyd -t 'theme={"background": "black"}' bash --rcfile /mnt/data/config/bashrc -------------------------------------------------------------------------------- /content/service/metube/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Configure & run metube 4 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 5 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/queue /.aria2allinoneworkdir/.metube/ 2>/dev/null 6 | OUTPUT_TEMPLATE=${YTDL_OUTPUT_TEMPLATE} 7 | sv start caddy || exit 1 8 | sleep 10 9 | cd /app 10 | exec 2>&1 11 | exec python3 /app/app/main.py -------------------------------------------------------------------------------- /content/service/rclone/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run rclone 4 | htpasswd -csb /.aria2allinoneworkdir/htpasswd ${GLOBAL_USER} ${GLOBAL_PASSWORD} 5 | exec 2>&1 6 | exec rclone rcd --rc-serve \ 7 | --rc-web-gui-no-open-browser \ 8 | --rc-htpasswd=/.aria2allinoneworkdir/htpasswd \ 9 | --rc-addr=localhost:61802 \ 10 | --buffer-size 4M \ 11 | --transfers 4 \ 12 | --config /mnt/data/config/rclone.conf \ 13 | --rc-allow-origin=* \ 14 | --use-mmap 15 | -------------------------------------------------------------------------------- /content/service/rclone_webdav/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 4 | 5 | # Run rclone 6 | htpasswd -csb /.aria2allinoneworkdir/htpasswd_webdav ${GLOBAL_USER} ${GLOBAL_PASSWORD} 7 | exec 2>&1 8 | exec rclone serve webdav ${DRIVENAME}:/ \ 9 | --htpasswd=/.aria2allinoneworkdir/htpasswd_webdav \ 10 | --addr=localhost:61805 \ 11 | --buffer-size 4M \ 12 | --config /mnt/data/config/rclone.conf \ 13 | --use-mmap \ 14 | --vfs-cache-mode writes -------------------------------------------------------------------------------- /content/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Install Rclone 4 | DIR_TMP="$(mktemp -d)" 5 | VERSION="$(curl --retry 10 --retry-max-time 60 https://api.github.com/repos/rclone/rclone/releases/latest | jq .tag_name | sed 's/\"//g')" 6 | wget -qO - https://github.com/rclone/rclone/releases/download/${VERSION}/rclone-${VERSION}-linux-amd64.zip | busybox unzip -qd ${DIR_TMP} - 7 | install -m 755 ${DIR_TMP}/rclone-${VERSION}-linux-amd64/rclone /usr/bin 8 | rm -rf ${DIR_TMP} 9 | 10 | # Install Aria2 11 | wget -qO - https://github.com/P3TERX/Aria2-Pro-Core/releases/download/1.36.0_2021.08.22/aria2-1.36.0-static-linux-amd64.tar.gz | tar -zxf - -C /usr/bin -------------------------------------------------------------------------------- /.github/workflows/heroku-deploy-dev.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action 14 | with: 15 | heroku_api_key: ${{secrets.HEROKU_API_KEY}} 16 | heroku_app_name: ${{secrets.HEROKU_APP_NAME}} 17 | heroku_email: ${{secrets.HEROKU_EMAIL}} 18 | usedocker: true 19 | env_file: ".env" 20 | env: 21 | HD_RCLONE_CONFIG_BASE64: ${{secrets.RCLONE_CONFIG_BASE64}} 22 | HD_HEROKU_APP_NAME: ${{secrets.HEROKU_APP_NAME}} 23 | HD_HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}} -------------------------------------------------------------------------------- /.github/workflows/heroku-deploy-release.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | push: 5 | tags: [ 'v*.*.*' ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action 13 | with: 14 | heroku_api_key: ${{secrets.HEROKU_API_KEY}} 15 | heroku_app_name: ${{secrets.HEROKU_APP_NAME}} 16 | heroku_email: ${{secrets.HEROKU_EMAIL}} 17 | usedocker: true 18 | env_file: ".env" 19 | env: 20 | HD_RCLONE_CONFIG_BASE64: ${{secrets.RCLONE_CONFIG_BASE64}} 21 | HD_HEROKU_APP_NAME: ${{secrets.HEROKU_APP_NAME}} 22 | HD_HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}} 23 | -------------------------------------------------------------------------------- /content/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /mnt/data/config /mnt/data/downloads /mnt/data/videos 4 | mv /.aria2allinoneworkdir/bashrc /mnt/data/config/ 5 | echo ${RCLONE_CONFIG_BASE64} | base64 -d >/mnt/data/config/rclone.conf 6 | 7 | DRIVE_NAME_AUTO="$(sed -n '1p' /mnt/data/config/rclone.conf | sed "s/\[//g" | sed "s/\]//g")" 8 | if [ "${RCLONE_DRIVE_NAME}" = "auto" ]; then 9 | DRIVENAME=${DRIVE_NAME_AUTO} 10 | else 11 | DRIVENAME=${RCLONE_DRIVE_NAME} 12 | fi 13 | 14 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/script.conf /mnt/data/config/ 2>/dev/null 15 | 16 | if [ ! -f "/mnt/data/config/script.conf" ]; then 17 | cp /.aria2allinoneworkdir/aria2/script.conf /mnt/data/config/script.conf 18 | fi 19 | 20 | sed -i "s|^drive-name=.*|drive-name=${DRIVENAME}|g" /mnt/data/config/script.conf 21 | 22 | exec runsvdir -P /etc/service -------------------------------------------------------------------------------- /content/service/backup_files/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sleep 600 4 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 5 | 6 | exec 2>&1 7 | 8 | if [ "${HEROKU_KEEP_AWAKE}" = "true" ]; then 9 | curl https://${HEROKU_APP_NAME}.herokuapp.com/${RANDOM} 10 | fi 11 | 12 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/.aria2allinoneworkdir/aria2 srcRemote=aria2.session dstFs="${DRIVENAME}":/"${HEROKU_APP_NAME}" dstRemote=aria2.session _async=true 13 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/.aria2allinoneworkdir/aria2 srcRemote=dht.dat dstFs="${DRIVENAME}":/"${HEROKU_APP_NAME}" dstRemote=dht.dat _async=true 14 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/.aria2allinoneworkdir/.metube srcRemote=queue dstFs="${DRIVENAME}":/"${HEROKU_APP_NAME}" dstRemote=queue _async=true 15 | rclone copy --config /mnt/data/config/rclone.conf /mnt/data/config "${DRIVENAME}":/"${HEROKU_APP_NAME}" 16 | -------------------------------------------------------------------------------- /content/aria2/rclone.env: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:rclone.env 4 | # Description: RCLONE environment variables file 5 | # Version: 2020.11.26 6 | # 7 | # For more information on RCLONE environment variables: 8 | # https://rclone.org/docs/#environment-variables 9 | # 10 | # 此文件设置无效,勿修改 11 | # This file has no fuction, do not modify. 12 | # 13 | 14 | # RCLONE 配置文件路径 15 | #RCLONE_CONFIG=$HOME/.config/rclone/rclone.conf 16 | 17 | # RCLONE 配置文件密码 18 | #RCLONE_CONFIG_PASS= 19 | 20 | # RCLONE 并行上传文件数,使用 Aria2 联动上传时仅适用于单个任务。 21 | #RCLONE_TRANSFERS=4 22 | 23 | # RCLONE 缓存大小。默认:16M 24 | # 理论上此项值越大文件传输速度越快。每个并行任务都将占用此大小的内存进行缓存,根据实际内存大小合理设置,设置得太大可能会导致进程中断。 25 | #RCLONE_BUFFER_SIZE=16M 26 | 27 | # RCLONE 上传失败重试次数,默认:3 28 | #RCLONE_RETRIES=3 29 | 30 | # RCLONE 上传失败重试等待时间(s, m, h),默认禁用 31 | RCLONE_RETRIES_SLEEP=10s 32 | 33 | # RCLONE 跳过错误继续上传。默认:false 34 | #RCLONE_IGNORE_ERRORS=true 35 | 36 | # RCLONE 跳过已经存在的文件。默认:false 37 | #RCLONE_IGNORE_EXISTING=true 38 | 39 | # RCLONE 实时显示传输进度。默认:false(每分钟显示一次) 40 | #RCLONE_PROGRESS=true 41 | 42 | # RCLONE 代理设置 43 | #HTTP_PROXY=localhost:1080 44 | #HTTPS_PROXY=$HTTP_PROXY 45 | -------------------------------------------------------------------------------- /content/service/update_token/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sleep 55 4 | 5 | DATE=$(date +%H%M | sed 's/^0//g') 6 | RESTART_TIME=$(echo ${HEROKU_RESTART_TIME/:/} | sed 's/^0//g') 7 | 8 | if [[ "${DATE}" = "${RESTART_TIME}" ]] && [[ "${HEROKU_API_KEY}" != "" ]]; then 9 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 10 | rclone copy --config /mnt/data/config/rclone.conf /.aria2allinoneworkdir/aria2/aria2.session "${DRIVENAME}":/"${HEROKU_APP_NAME}"/ 11 | rclone copy --config /mnt/data/config/rclone.conf /.aria2allinoneworkdir/.metube/queue "${DRIVENAME}":/"${HEROKU_APP_NAME}"/ 12 | CONF=$(base64 /mnt/data/config/rclone.conf) 13 | curl -n -X PATCH https://api.heroku.com/apps/"${HEROKU_APP_NAME}"/config-vars \ 14 | -d '{"RCLONE_CONFIG_BASE64": "'"${CONF}"'"}' \ 15 | -H "Content-Type: application/json" \ 16 | -H "Accept: application/vnd.heroku+json; version=3" -H "Authorization: Bearer "${HEROKU_API_KEY}"" 17 | curl -n -X DELETE https://api.heroku.com/apps/"${HEROKU_APP_NAME}"/dynos \ 18 | -H "Content-Type: application/json" \ 19 | -H "Accept: application/vnd.heroku+json; version=3" \ 20 | -H "Authorization: Bearer "${HEROKU_API_KEY}"" 21 | fi 22 | -------------------------------------------------------------------------------- /content/service/caddy/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # Configure AriaNG & Rclone WebUI 5 | sed -i 's|rpcInterface:"jsonrpc"|rpcInterface:"'"${GLOBAL_PORTAL_PATH/\//}"'/jsonrpc"|g' /.aria2allinoneworkdir/ariang/js/aria-ng-a87a79b0e7.min.js 6 | sed -i 's|ipAddress:a|ipAddress:`${window.location.protocol}//${window.location.hostname}'"${GLOBAL_PORTAL_PATH}"'/rclonerc`|g' /.aria2allinoneworkdir/rcloneweb/build/static/js/3.90421092.chunk.js 7 | 8 | # Configure homer 9 | cp /.aria2allinoneworkdir/homer_conf/* /.aria2allinoneworkdir/homer/assets/tools/ 10 | cp /.aria2allinoneworkdir/homer_conf/homer_${GLOBAL_LANGUAGE}.yml /.aria2allinoneworkdir/homer/assets/config.yml 11 | sed -i "s|GLOBAL_PORTAL_PATH|${GLOBAL_PORTAL_PATH}|g;s|VMESS_PATH|${VMESS_PATH}|g;s|VMESS_UUID|${VMESS_UUID}|g" /.aria2allinoneworkdir/homer/assets/config.yml 12 | 13 | # Run language script 14 | /.aria2allinoneworkdir/caddy_init_${GLOBAL_LANGUAGE}.sh 15 | 16 | # Configure Caddyfile 17 | HASH="$(caddy hash-password --plaintext ${GLOBAL_PASSWORD})" 18 | sed -i "s|HASH|${HASH}|g" /.aria2allinoneworkdir/Caddyfile 19 | 20 | # Run caddy 21 | exec 2>&1 22 | exec caddy run --config /.aria2allinoneworkdir/Caddyfile --adapter caddyfile 23 | -------------------------------------------------------------------------------- /content/service/xray/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Global variables 4 | DIR_RUNTIME="/usr/bin" 5 | DIR_TMP="$(mktemp -d)" 6 | 7 | # Write Ray configuration 8 | cat << EOF > /.aria2allinoneworkdir/ray.yaml 9 | log: 10 | loglevel: warning 11 | dns: 12 | servers: 13 | - https+local://8.8.8.8/dns-query 14 | inbounds: 15 | - port: 61804 16 | listen: localhost 17 | protocol: vmess 18 | settings: 19 | clients: 20 | - id: "${VMESS_UUID}" 21 | streamSettings: 22 | network: ws 23 | wsSettings: 24 | path: "${VMESS_PATH}" 25 | sniffing: 26 | enabled: true 27 | destOverride: 28 | - http 29 | - tls 30 | outbounds: 31 | - protocol: freedom 32 | tag: direct 33 | settings: 34 | domainStrategy: UseIPv4 35 | EOF 36 | 37 | # Get Ray executable release 38 | wget -qO - https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip | busybox unzip -qd ${DIR_TMP} - 39 | 40 | # Install Ray 41 | install -m 755 ${DIR_TMP}/xray ${DIR_RUNTIME}/ray 42 | rm -rf ${DIR_TMP} 43 | curl -s --retry 10 --retry-max-time 60 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o ${DIR_RUNTIME}/geoip.dat 44 | curl -s --retry 10 --retry-max-time 60 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o ${DIR_RUNTIME}/geosite.dat 45 | 46 | # Run Ray 47 | exec ${DIR_RUNTIME}/ray -config=/.aria2allinoneworkdir/ray.yaml -------------------------------------------------------------------------------- /content/ytdlptorclone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DRIVE_NAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 4 | DRIVE_DIR="$(grep ^drive-dir /mnt/data/config/script.conf | cut -d= -f2-)" 5 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}" 6 | FILEPATH=$(echo $1 | sed 's:[^/]*$::') 7 | FILENAME=$(basename "$1") 8 | mv "$1" "${FILEPATH}""${FILENAME}" 9 | 10 | if [ "${RCLONE_AUTO_MODE}" = "move" ]; then 11 | : 12 | elif [[ "${RCLONE_AUTO_MODE}" =~ "move" ]]; then 13 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/movefile srcFs="${FILEPATH}" srcRemote="${FILENAME}" dstFs="${REMOTE_PATH}" dstRemote="${FILENAME}" _async=true 14 | EXIT_CODE=$? 15 | if [ ${EXIT_CODE} -eq 0 ]; then 16 | echo "[INFO] Successfully send job to rclone: $1 -> ${REMOTE_PATH}" 17 | else 18 | echo "[ERROR] Failed to send job to rclone: $1" 19 | fi 20 | elif [[ "${RCLONE_AUTO_MODE}" =~ "copy" ]]; then 21 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs="${FILEPATH}" srcRemote="${FILENAME}" dstFs="${REMOTE_PATH}" dstRemote="${FILENAME}" _async=true 22 | EXIT_CODE=$? 23 | if [ ${EXIT_CODE} -eq 0 ]; then 24 | echo "[INFO] Successfully send job to rclone: $1 -> ${REMOTE_PATH}" 25 | else 26 | echo "[ERROR] Failed to send job to rclone: $1" 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alexta69/metube:latest 2 | 3 | COPY ./content /.aria2allinoneworkdir/ 4 | 5 | RUN apk add --no-cache curl caddy jq bash findutils runit apache2-utils tzdata ttyd \ 6 | && wget -qO - https://github.com/mayswind/AriaNg/releases/download/1.2.4/AriaNg-1.2.4.zip | busybox unzip -qd /.aria2allinoneworkdir/ariang - \ 7 | && wget -qO - https://github.com/rclone/rclone-webui-react/releases/download/v2.0.5/currentbuild.zip | busybox unzip -qd /.aria2allinoneworkdir/rcloneweb - \ 8 | && wget -qO - https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip | busybox unzip -qd /.aria2allinoneworkdir/homer - \ 9 | && sed -i 's|6800|443|g' /.aria2allinoneworkdir/ariang/js/aria-ng-a87a79b0e7.min.js \ 10 | && wget -qO - https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -zxf - -C /usr/bin \ 11 | && chmod +x /.aria2allinoneworkdir/service/*/run /.aria2allinoneworkdir/service/*/log/run /.aria2allinoneworkdir/aria2/*.sh /.aria2allinoneworkdir/*.sh \ 12 | && /.aria2allinoneworkdir/install.sh \ 13 | && mv /.aria2allinoneworkdir/ytdlptorclone.sh /usr/bin/ \ 14 | && ln -s /.aria2allinoneworkdir/service/* /etc/service/ 15 | 16 | ENV DOWNLOAD_DIR=/mnt/data/videos 17 | ENV STATE_DIR=/.aria2allinoneworkdir/.metube 18 | ENV OUTPUT_TEMPLATE="%(title)s_%(uploader)s.%(ext)s" 19 | 20 | ENTRYPOINT ["sh","/.aria2allinoneworkdir/entrypoint.sh"] 21 | -------------------------------------------------------------------------------- /content/service/filebrowser/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Configure filebrowser 4 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 5 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/filebrowser.db /mnt/data/config/ 2>/dev/null 6 | 7 | if [ ! -f "/mnt/data/config/filebrowser.db" ]; then 8 | filebrowser -d /mnt/data/config/filebrowser.db config init -r /mnt/data 9 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --commands="sv,aria2c,rclone,du,df,free,nslookup,netstat,top,ps" 10 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 11 | filebrowser -d /mnt/data/config/filebrowser.db users update ${GLOBAL_USER} --locale zh-cn 12 | fi 13 | else 14 | if [ "${GLOBAL_LANGUAGE}" = "chs" ]; then 15 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --locale zh-cn --commands="sv,aria2c,rclone,du,df,free,nslookup,netstat,top,ps" 16 | else 17 | filebrowser -d /mnt/data/config/filebrowser.db users add ${GLOBAL_USER} ${GLOBAL_PASSWORD} --perm.admin --commands="sv,aria2c,rclone,du,df,free,nslookup,netstat,top,ps" 18 | fi 19 | filebrowser -d /mnt/data/config/filebrowser.db users update ${GLOBAL_USER} -p ${GLOBAL_PASSWORD} 20 | fi 21 | 22 | # Run filebrowser 23 | exec 2>&1 24 | exec filebrowser -d /mnt/data/config/filebrowser.db -b ${GLOBAL_PORTAL_PATH}/files -p 61801 25 | -------------------------------------------------------------------------------- /content/caddy_init_chs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 4 | 5 | if [ "${RCLONE_AUTO_MODE}" = "dummy" ]; then 6 | sed -i "s|MODE_STATUS||g" /.aria2allinoneworkdir/homer/assets/config.yml 7 | elif [ "${RCLONE_AUTO_MODE}" = "move" ]; then 8 | sed -i "s|MODE_STATUS|
[move] 下载任务完成后移动到本地 finished 目录|g" /.aria2allinoneworkdir/homer/assets/config.yml 9 | elif [ "${RCLONE_AUTO_MODE}" = "custom" ]; then 10 | sed -i "s|MODE_STATUS|
Aria2自动化模式: [custom] 自定义|g" /.aria2allinoneworkdir/homer/assets/config.yml 11 | elif [ ! -f "/mnt/data/config/rclone.conf" ]; then 12 | sed -i "s|MODE_STATUS|
Aria2自动化模式:
未找到 Rclone 配置文件|g" /.aria2allinoneworkdir/homer/assets/config.yml 13 | elif [ "${RCLONE_AUTO_MODE}" = "copy_remote" ]; then 14 | sed -i "s|MODE_STATUS|
Aria2自动化模式:
[copy_remote] 下载及做种完成后移动到本地finished目录, 然后复制到Rclone远程存储${DRIVENAME}|g" /.aria2allinoneworkdir/homer/assets/config.yml 15 | elif [ "${RCLONE_AUTO_MODE}" = "copy_remote_first" ]; then 16 | sed -i "s|MODE_STATUS|
Aria2自动化模式:
[copy_remote_first] 下载完成后复制到Rclone远程存储${DRIVENAME}, BT任务在进入做种前触发上传|g" /.aria2allinoneworkdir/homer/assets/config.yml 17 | elif [ "${RCLONE_AUTO_MODE}" = "move_remote" ]; then 18 | sed -i "s|MODE_STATUS|
Aria2自动化模式:
[move_remote] 下载及做种完成后移动到本地finished目录, 然后移动到Rclone远程存储${DRIVENAME}|g" /.aria2allinoneworkdir/homer/assets/config.yml 19 | elif [ "${RCLONE_AUTO_MODE}" = "move_remote_only" ]; then 20 | sed -i "s|MODE_STATUS|
Aria2自动化模式:
[move_remote_only] 下载及做种完成后移动到Rclone远程存储${DRIVENAME}|g" /.aria2allinoneworkdir/homer/assets/config.yml 21 | fi 22 | -------------------------------------------------------------------------------- /content/aria2/clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:clean.sh 5 | # Description: Remove redundant files after Aria2 download is complete 6 | # Version: 3.0 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | 29 | CHECK_CORE_FILE() { 30 | CORE_FILE="$(dirname $0)/core" 31 | if [[ -f "${CORE_FILE}" ]]; then 32 | . "${CORE_FILE}" 33 | else 34 | echo "!!! core file does not exist !!!" 35 | exit 1 36 | fi 37 | } 38 | 39 | CHECK_CORE_FILE "$@" 40 | CHECK_PARAMETER "$@" 41 | CHECK_FILE_NUM 42 | CHECK_SCRIPT_CONF 43 | GET_TASK_INFO 44 | GET_DOWNLOAD_DIR 45 | CONVERSION_PATH 46 | CLEAN_UP 47 | exit 0 48 | -------------------------------------------------------------------------------- /content/caddy_init_en.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 4 | 5 | if [ "${RCLONE_AUTO_MODE}" = "dummy" ]; then 6 | sed -i "s|MODE_STATUS||g" /.aria2allinoneworkdir/homer/assets/config.yml 7 | elif [ "${RCLONE_AUTO_MODE}" = "move" ]; then 8 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
[move] Move files to local finished folder after download completed|g" /.aria2allinoneworkdir/homer/assets/config.yml 9 | elif [ "${RCLONE_AUTO_MODE}" = "custom" ]; then 10 | sed -i "s|MODE_STATUS|
Aria2 Event Hook: [custom]|g" /.aria2allinoneworkdir/homer/assets/config.yml 11 | elif [ ! -f "/mnt/data/config/rclone.conf" ]; then 12 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
Fail to find Rclone config file|g" /.aria2allinoneworkdir/homer/assets/config.yml 13 | elif [ "${RCLONE_AUTO_MODE}" = "copy_remote" ]; then 14 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
[copy_remote] Move files to local finished folder after both download and seeding completed, then copy to Rclone remote ${DRIVENAME}|g" /.aria2allinoneworkdir/homer/assets/config.yml 15 | elif [ "${RCLONE_AUTO_MODE}" = "copy_remote_first" ]; then 16 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
[copy_remote_first] Copy files to Rclone remote ${DRIVENAME} after download completed, triggerd before seeding for Bittorrent task|g" /.aria2allinoneworkdir/homer/assets/config.yml 17 | elif [ "${RCLONE_AUTO_MODE}" = "move_remote" ]; then 18 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
[move_remove] Move files to local finished folder after both download and seeding completed, then move to Rclone remote ${DRIVENAME}|g" /.aria2allinoneworkdir/homer/assets/config.yml 19 | elif [ "${RCLONE_AUTO_MODE}" = "move_remote_only" ]; then 20 | sed -i "s|MODE_STATUS|
Aria2 Event Hook:
[move_remote_only] Move files to Rclone remote ${DRIVENAME} after both download and seeding completed|g" /.aria2allinoneworkdir/homer/assets/config.yml 21 | fi 22 | -------------------------------------------------------------------------------- /content/service/2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Configure aria2 4 | touch /.aria2allinoneworkdir/aria2/aria2.session 5 | DRIVENAME="$(grep ^drive-name /mnt/data/config/script.conf | cut -d= -f2-)" 6 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/aria2.conf /mnt/data/config/ 2>/dev/null 7 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/aria2.session /.aria2allinoneworkdir/aria2/ 2>/dev/null 8 | rclone copy --config /mnt/data/config/rclone.conf "${DRIVENAME}":/"${HEROKU_APP_NAME}"/dht.dat /.aria2allinoneworkdir/aria2/ 2>/dev/null 9 | 10 | if [ ! -f "/mnt/data/config/aria2.conf" ]; then 11 | cp /.aria2allinoneworkdir/aria2/aria2_${GLOBAL_LANGUAGE}.conf /mnt/data/config/aria2.conf 12 | fi 13 | 14 | /.aria2allinoneworkdir/aria2/tracker.sh /mnt/data/config/aria2.conf 2>/dev/null 15 | 16 | if [ "${RCLONE_AUTO_MODE}" = "copy_remote_first" ]; then 17 | sed -i "s|^on-bt-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-bt-download-complete=/.aria2allinoneworkdir/aria2/"${RCLONE_AUTO_MODE}".sh|g" /mnt/data/config/aria2.conf 18 | sed -i "s|^on-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-download-complete=/.aria2allinoneworkdir/aria2/copy_remote_other.sh|g" /mnt/data/config/aria2.conf 19 | elif [ "${RCLONE_AUTO_MODE}" = "dummy" ]; then 20 | sed -i "s|^on-bt-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-bt-download-complete=/.aria2allinoneworkdir/aria2/clean.sh|g" /mnt/data/config/aria2.conf 21 | sed -i "s|^on-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-download-complete=/.aria2allinoneworkdir/aria2/clean.sh|g" /mnt/data/config/aria2.conf 22 | elif [ "${RCLONE_AUTO_MODE}" = "custom" ]; then 23 | : 24 | else 25 | sed -i "s|^on-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-download-complete=/.aria2allinoneworkdir/aria2/"${RCLONE_AUTO_MODE}".sh|g" /mnt/data/config/aria2.conf 26 | sed -i "s|^on-bt-download-complete=/.aria2allinoneworkdir/aria2/.*.sh|on-bt-download-complete=/.aria2allinoneworkdir/aria2/clean.sh|g" /mnt/data/config/aria2.conf 27 | fi 28 | 29 | EXEC=$(head /dev/urandom |cksum |md5sum |cut -c 1-8) 30 | mv /usr/bin/aria2c /usr/bin/${EXEC} 31 | 32 | # Run aria2 33 | exec 2>&1 34 | exec ${EXEC} --conf-path="/mnt/data/config/aria2.conf" \ 35 | --enable-rpc \ 36 | --rpc-secret=${GLOBAL_PASSWORD} \ 37 | --rpc-listen-port=61800 38 | -------------------------------------------------------------------------------- /content/Caddyfile: -------------------------------------------------------------------------------- 1 | # Created by wy580477 for customized container 2 | { 3 | log { 4 | exclude http.handlers.reverse_proxy 5 | } 6 | } 7 | :{$PORT} 8 | encode gzip 9 | # Configure xray 10 | @websockets { 11 | header Connection *Upgrade* 12 | header Upgrade websocket 13 | path {$VMESS_PATH}* 14 | } 15 | handle @websockets { 16 | reverse_proxy * localhost:61804 17 | } 18 | # Configure ttyd 19 | handle {$GLOBAL_PORTAL_PATH}/ttyd* { 20 | redir {$GLOBAL_PORTAL_PATH}/ttyd {$GLOBAL_PORTAL_PATH}/ttyd/ 21 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/ttyd 22 | basicauth { 23 | {$GLOBAL_USER} HASH 24 | } 25 | reverse_proxy * localhost:61803 26 | } 27 | # Configure AriaNg 28 | handle {$GLOBAL_PORTAL_PATH}/ariang* { 29 | redir {$GLOBAL_PORTAL_PATH}/ariang {$GLOBAL_PORTAL_PATH}/ariang/ 30 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/ariang 31 | basicauth { 32 | {$GLOBAL_USER} HASH 33 | } 34 | root * /.aria2allinoneworkdir/ariang 35 | file_server 36 | } 37 | # Configure Rclone Web UI 38 | handle {$GLOBAL_PORTAL_PATH}/rcloneweb* { 39 | redir {$GLOBAL_PORTAL_PATH}/rcloneweb {$GLOBAL_PORTAL_PATH}/rcloneweb/ 40 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/rcloneweb 41 | basicauth { 42 | {$GLOBAL_USER} HASH 43 | } 44 | root * /.aria2allinoneworkdir/rcloneweb/build 45 | file_server 46 | } 47 | # Configure Rclone RC 48 | handle_path {$GLOBAL_PORTAL_PATH}/rclonerc { 49 | reverse_proxy * localhost:61802 50 | } 51 | # Configure Rclone Serve 52 | handle_path {$GLOBAL_PORTAL_PATH}/rclonerc/* { 53 | reverse_proxy * localhost:61802 54 | } 55 | # Configure Rclone Serve Webdav 56 | handle {$GLOBAL_PORTAL_PATH}/rclonedav* { 57 | redir {$GLOBAL_PORTAL_PATH}/rclonedav {$GLOBAL_PORTAL_PATH}/rclonedav/ 58 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/rclonedav 59 | reverse_proxy * localhost:61805 60 | } 61 | # Configure Aria2 RPC 62 | handle {$GLOBAL_PORTAL_PATH}/jsonrpc { 63 | uri replace {$GLOBAL_PORTAL_PATH}/jsonrpc /jsonrpc 64 | reverse_proxy /jsonrpc localhost:61800 65 | } 66 | # Configure Filebrowser 67 | handle {$GLOBAL_PORTAL_PATH}/files* { 68 | reverse_proxy {$GLOBAL_PORTAL_PATH}/files* localhost:61801 69 | } 70 | # Configure metube 71 | handle {$GLOBAL_PORTAL_PATH}/metube* { 72 | redir {$GLOBAL_PORTAL_PATH}/metube {$GLOBAL_PORTAL_PATH}/metube/ 73 | uri strip_prefix {$GLOBAL_PORTAL_PATH}/metube 74 | basicauth { 75 | {$GLOBAL_USER} HASH 76 | } 77 | reverse_proxy * localhost:8081 78 | } 79 | # Configure homer 80 | handle {$GLOBAL_PORTAL_PATH}* { 81 | redir {$GLOBAL_PORTAL_PATH} {$GLOBAL_PORTAL_PATH}/ 82 | uri strip_prefix {$GLOBAL_PORTAL_PATH} 83 | basicauth { 84 | {$GLOBAL_USER} HASH 85 | } 86 | root * /.aria2allinoneworkdir/homer 87 | file_server 88 | } -------------------------------------------------------------------------------- /content/aria2/script.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:script.conf 4 | # Description: Aria2 additional function script configuration file 5 | # Version: 2021.07.04 6 | # 7 | # Modified and translated by wy580477 for customized container 8 | # 9 | 10 | 11 | ## 自动删除失败或已移除的未完成任务文件设置(delete.sh) ## 12 | ## Auto-delete files from failed or unfinished task setting (delete.sh)## 13 | 14 | # 删除正在下载任务后删除文件 15 | # Delete files after task removed during downloading. 16 | delete-on-removed=true 17 | 18 | # 下载错误时删除文件 19 | # Delete files of failed task. 20 | delete-on-error=true 21 | 22 | # 删除正在下载任务后且任务信息无法读取时删除文件(第三方度盘工具) 23 | # Delete status unknown files. 24 | delete-on-unknown=true 25 | 26 | 27 | ## 自动删除文件设置 ## 28 | ## files cleaning setting ## 29 | 30 | # 删除空目录。 31 | # Auto delete empty dir. 32 | delete-empty-dir=true 33 | 34 | # 删除 .aria2 文件 35 | delete-dot-aria2=false 36 | 37 | # 删除 .torrent 文件。可选:normal | enhanced | true | false 38 | # Delete .torrent file. The possible values are normal, enhanced, true and false. 39 | # normal: 删除相关任务的种子文件,但可能无法删除通过 RPC 方式(比如 WebUI、Bot)上传的种子文件(文件名无法确定)。 40 | # normal: delete torrents of tasks. It's possible that torrents uploaded through RPC can't be deleted. 41 | # enhanced:在下载目录中查找非正在下载和暂停任务以外的其它种子文件并删除(非实时)。开启 强制保存(force-save) 后此项无效。 42 | # enhanced: delete torrents of tasking excluding seeding and paused task. This option doesn't work if force-save enabled in Aria2 config file. 43 | # true:优先使用 normal 模式,在种子文件名无法确定的情况下使用 enhanced 模式。 44 | # true: Try normal mode first, if fail then use enhanced mode. 45 | # false:不删除种子文件 46 | # false: disable auto-delete torrent file. 47 | # 注意:通过 RPC 自定义临时下载目录的任务可能不会保存种子文件,与此功能无关。 48 | # It's possible that torrents aren't saved if set custom download folder throught RPC, unrelated to settings in this script. 49 | delete-dot-torrent=true 50 | 51 | ## 文件过滤设置 ## 52 | ## Files filtering setting ## 53 | # 仅 BT 多文件下载时有效,用于过滤无用文件。 54 | # Only works when multiple files in bt download task. 55 | 56 | # 排除小文件。低于此大小的文件将在下载完成后被删除。 57 | # Exclude small files. Files smaller than this will be deleted after download completed. 58 | #min-size=10M 59 | 60 | # 保留文件类型。其它文件类型将在下载完成后被删除。 61 | # Include file extension. Files without extension in this setting will be deleted after download completed. 62 | #include-file=mp4|mkv|rmvb|mov|avi 63 | 64 | # 排除文件类型。排除的文件类型将在下载完成后被删除。 65 | # Exclude file extension. Files with extension in this setting will be deleted after download completed. 66 | #exclude-file=html|url|lnk|txt|jpg|png 67 | 68 | # 保留文件(正则表达式)。其它文件将在下载完成后被删除。 69 | # Include files(RegExp). Other files will be deleted after download completed. 70 | #include-file-regex= 71 | 72 | # 排除文件(正则表达式)。排除的文件将在下载完成后被删除。 73 | # 示例为排除比特彗星的 padding file 74 | # Exclude files(RegExp). Matched files will be deleted after download completed. 75 | #exclude-file-regex="(.*/)_+(padding)(_*)(file)(.*)(_+)" 76 | 77 | 78 | ## 文件上传设置 ## 79 | ## Aria2 Event Hook setting ## 80 | 81 | # 网盘名称(RCLONE 配置时填写的 name),此项由容器变量控制,勿修改。 82 | # Rclone remote name. Controlled by container env, do not modify this option. 83 | drive-name="${REMOTE_NAME}" 84 | 85 | # 网盘目录(上传目标目录,网盘中的文件夹路径)。注释或留空为网盘根目录,末尾不要有斜杠。 86 | # Rclone remote path. 87 | drive-dir=/upload 88 | 89 | # 上传日志保存路径。注释或留空为不保存。 90 | # Upload log. 91 | #upload-log=/mnt/config/aria2/upload.log 92 | 93 | 94 | ## 文件移动设置(move.sh) ## 95 | ## Local files moving setting ## 96 | 97 | # Local dst folder. Do not modify this option. 98 | dest-dir=/mnt/data/finished 99 | 100 | # 移动日志保存路径。注释或留空为不保存。 101 | # log of local files moving 102 | #move-log=/mnt/config/aria2/move.log 103 | -------------------------------------------------------------------------------- /content/aria2/move.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:move.sh 5 | # Description: Move files after Aria2 download is complete 6 | # Version: 3.0 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | 29 | CHECK_CORE_FILE() { 30 | CORE_FILE="$(dirname $0)/core" 31 | if [[ -f "${CORE_FILE}" ]]; then 32 | . "${CORE_FILE}" 33 | else 34 | echo "!!! core file does not exist !!!" 35 | exit 1 36 | fi 37 | } 38 | 39 | TASK_INFO() { 40 | echo -e " 41 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 42 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 43 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 44 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 45 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 46 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 47 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 48 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 49 | ${LIGHT_PURPLE_FONT_PREFIX}Source Path:${FONT_COLOR_SUFFIX} ${SOURCE_PATH} 50 | ${LIGHT_PURPLE_FONT_PREFIX}Destination Path:${FONT_COLOR_SUFFIX} ${DEST_PATH} 51 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 52 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 53 | " 54 | } 55 | 56 | OUTPUT_MOVE_LOG() { 57 | LOG="${MOVE_LOG}" 58 | LOG_PATH="${MOVE_LOG_PATH}" 59 | OUTPUT_LOG 60 | } 61 | 62 | DEFINITION_PATH() { 63 | SOURCE_PATH="${TASK_PATH}" 64 | if [[ "${DOWNLOAD_DIR}" != "${ARIA2_DOWNLOAD_DIR}" && "${DOWNLOAD_DIR}" =~ "${ARIA2_DOWNLOAD_DIR}" ]]; then 65 | DEST_PATH="${DEST_DIR}${DEST_PATH_SUFFIX%/*}" 66 | else 67 | DEST_PATH="${DEST_DIR}" 68 | fi 69 | } 70 | 71 | MOVE_FILE() { 72 | echo -e "$(DATE_TIME) ${INFO} Start move files ..." 73 | TASK_INFO 74 | mkdir -p "${DEST_PATH}" 75 | mv -vf "${SOURCE_PATH}" "${DEST_PATH}" 76 | MOVE_EXIT_CODE=$? 77 | if [ ${MOVE_EXIT_CODE} -eq 0 ]; then 78 | MOVE_LOG="$(DATE_TIME) ${INFO} Move done: ${SOURCE_PATH} -> ${DEST_PATH}" 79 | else 80 | MOVE_LOG="$(DATE_TIME) ${ERROR} Move failed: ${SOURCE_PATH}" 81 | fi 82 | OUTPUT_MOVE_LOG 83 | DELETE_EMPTY_DIR 84 | } 85 | 86 | CHECK_CORE_FILE "$@" 87 | CHECK_PARAMETER "$@" 88 | CHECK_FILE_NUM 89 | CHECK_SCRIPT_CONF 90 | GET_TASK_INFO 91 | GET_DOWNLOAD_DIR 92 | CONVERSION_PATH 93 | DEFINITION_PATH 94 | CLEAN_UP 95 | MOVE_FILE 96 | exit 0 97 | -------------------------------------------------------------------------------- /content/aria2/delete.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:delete.sh 5 | # Description: Delete files after Aria2 download error or task removed 6 | # Version: 3.0 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | 29 | CHECK_CORE_FILE() { 30 | CORE_FILE="$(dirname $0)/core" 31 | if [[ -f "${CORE_FILE}" ]]; then 32 | . "${CORE_FILE}" 33 | else 34 | echo "!!! core file does not exist !!!" 35 | exit 1 36 | fi 37 | } 38 | 39 | CHECK_RPC_CONECTION() { 40 | READ_ARIA2_CONF 41 | if [[ "${RPC_SECRET}" ]]; then 42 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX","params":["token:'${RPC_SECRET}'"]}' 43 | else 44 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX"}' 45 | fi 46 | (curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}") >/dev/null 47 | } 48 | 49 | DELETE_ON_STOP() { 50 | if [[ "${TASK_STATUS}" = "error" && "${DELETE_ON_ERROR}" = "true" ]] || [[ "${TASK_STATUS}" = "removed" && "${DELETE_ON_REMOVED}" = "true" ]]; then 51 | if [[ -f "${TASK_PATH}.aria2" ]]; then 52 | echo -e "$(DATE_TIME) ${INFO} Download task ${TASK_STATUS}, deleting files..." 53 | rm -vrf "${TASK_PATH}.aria2" "${TASK_PATH}" 54 | else 55 | [[ -e "${TASK_PATH}" ]] && 56 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${TASK_PATH}" || 57 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${TASK_PATH}" 58 | fi 59 | else 60 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Task status invalid: ${TASK_STATUS}" 61 | fi 62 | } 63 | 64 | DELETE_ON_UNKNOWN() { 65 | if [[ -f "${FILE_PATH}.aria2" ]]; then 66 | echo -e "$(DATE_TIME) ${INFO} Download task force removed, deleting files..." 67 | rm -vrf "${FILE_PATH}.aria2" "${FILE_PATH}" 68 | else 69 | [[ -e "${FILE_PATH}" ]] && 70 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${FILE_PATH}" || 71 | echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${FILE_PATH}" 72 | fi 73 | } 74 | 75 | DELETE_FILE() { 76 | if GET_TASK_INFO; then 77 | GET_DOWNLOAD_DIR 78 | GET_TASK_STATUS 79 | CONVERSION_PATH 80 | DELETE_ON_STOP 81 | CLEAN_UP 82 | elif CHECK_RPC_CONECTION && [[ "${DELETE_ON_UNKNOWN}" = "true" && ${FILE_NUM} -eq 1 ]]; then 83 | DELETE_ON_UNKNOWN 84 | else 85 | echo -e "$(DATE_TIME) ${ERROR} Aria2 RPC interface error!" 86 | exit 1 87 | fi 88 | } 89 | 90 | CHECK_CORE_FILE "$@" 91 | CHECK_PARAMETER "$@" 92 | CHECK_FILE_NUM 93 | CHECK_SCRIPT_CONF 94 | DELETE_FILE 95 | exit 0 96 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Deploy", 3 | "description": "Deploy", 4 | "keywords": ["Deploy"], 5 | "env": { 6 | "GLOBAL_USER": { 7 | "description": "Username for all web services", 8 | "value": "admin" 9 | }, 10 | "GLOBAL_PASSWORD": { 11 | "description": "Password for all web services, double as Aria2 RPC token. Recommend strong password.", 12 | "value": "password" 13 | }, 14 | "GLOBAL_LANGUAGE": { 15 | "description": "Set language of portal page & filebrowser.(en or chs)", 16 | "value": "en" 17 | }, 18 | "GLOBAL_PORTAL_PATH": { 19 | "description": "Portal page & base URL for all web services. Do not set to blank or '/'", 20 | "value": "/portal" 21 | }, 22 | "RCLONE_AUTO_MODE": { 23 | "description": "Aria2 Event Hook mode, this also controls file operation after metube downloads completed.See detailed explanation in README.", 24 | "value": "move_remote" 25 | }, 26 | "RCLONE_DRIVE_NAME": { 27 | "description": "Rclone remote name for auto-uploading. Do not add ':' at the end of value. If set to auto, Remote name will be extracted from the first line of rclone config file.", 28 | "value": "auto" 29 | }, 30 | "RCLONE_CONFIG_BASE64": { 31 | "description": "Base64 encoded Rclone config file. You can use base64 command in linux OS or online base64 tools to encode rclone config file. Rclone config file with multiple remotes could exceed Heroku's 32kb limit for config vars.", 32 | "required": false, 33 | "value": "" 34 | }, 35 | "TZ": { 36 | "description": "Timezone", 37 | "value": "UTC" 38 | }, 39 | "HEROKU_APP_NAME": { 40 | "description": "Name of this heroku app. Optional.", 41 | "required": false, 42 | "value": "" 43 | }, 44 | "HEROKU_KEEP_AWAKE": { 45 | "description": "Optional. Set value to true for preventing dyno from auto-sleeping. Need HEROKU_APP_NAME to work.", 46 | "required": false, 47 | "value": "" 48 | }, 49 | "HEROKU_API_KEY": { 50 | "description": "Your heroku api key. Optional. It's used with HEROKU_APP_NAME and HEROKU_RESTART_TIME for refreshing Rclone token from within dyno to prevent token expiration.", 51 | "required": false, 52 | "value": "" 53 | }, 54 | "HEROKU_RESTART_TIME": { 55 | "description": "Optional. It's used with HEROKU_API_KEY for refreshing rclone token from within dyno. Dyno needs to be running at value time and will be restarted. Format: 6:00, 24-hour clock.", 56 | "required": false, 57 | "value": "" 58 | }, 59 | "VMESS_UUID": { 60 | "description": "Vmess proxy protocol UUID. Use UUID tools to generate you own UUID.", 61 | "value": "a3ac20a7-45fe-4656-97ee-937ffec46144" 62 | }, 63 | "VMESS_PATH": { 64 | "description": "Vmess proxy protocol Websocket Path. Set this path to a value which doesn't contain sensitive information.", 65 | "value": "/f495ba1f" 66 | }, 67 | "YTDL_OPTIONS": { 68 | "description": "metube yt-dlp options. Default value will send job to rclone according to RCLONE_AUTO_MODE after download completed. For more information: https://github.com/alexta69/metube#configuration-via-environment-variables", 69 | "required": false, 70 | "value": "{\"postprocessors\":[{\"key\":\"Exec\",\"exec_cmd\":\"ytdlptorclone.sh\"}],\"noprogress\":true}" 71 | }, 72 | "YTDL_OUTPUT_TEMPLATE": { 73 | "description": "metube yt-dlp output template. For more information: https://github.com/yt-dlp/yt-dlp#output-template", 74 | "required": false, 75 | "value": "%(webpage_url_domain)s_%(title)s_%(uploader)s.%(ext)s" 76 | } 77 | }, 78 | "stack": "container" 79 | } 80 | -------------------------------------------------------------------------------- /content/homer_conf/homer_chs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Homepage configuration 3 | # See https://fontawesome.com/icons for icons options 4 | # Modified by wy580477 for customized container 5 | 6 | title: "Dashboard for Heroku-All-In-One container" 7 | subtitle: "Homer" 8 | logo: "logo.png" 9 | # icon: "fas fa-skull-crossbones" # Optional icon 10 | 11 | header: false 12 | footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. 13 | 14 | # Optional theme customization 15 | theme: default 16 | colors: 17 | light: 18 | highlight-primary: "#3367d6" 19 | highlight-secondary: "#4285f4" 20 | highlight-hover: "#5a95f5" 21 | background: "#f5f5f5" 22 | card-background: "#ffffff" 23 | text: "#363636" 24 | text-header: "#ffffff" 25 | text-title: "#303030" 26 | text-subtitle: "#424242" 27 | card-shadow: rgba(0, 0, 0, 0.1) 28 | link: "#3273dc" 29 | link-hover: "#363636" 30 | dark: 31 | highlight-primary: "#3367d6" 32 | highlight-secondary: "#4285f4" 33 | highlight-hover: "#5a95f5" 34 | background: "#131313" 35 | card-background: "#2b2b2b" 36 | text: "#eaeaea" 37 | text-header: "#ffffff" 38 | text-title: "#fafafa" 39 | text-subtitle: "#f5f5f5" 40 | card-shadow: rgba(0, 0, 0, 0.4) 41 | link: "#3273dc" 42 | link-hover: "#ffdd57" 43 | 44 | # Optional message 45 | message: 46 | #url: https://b4bz.io 47 | style: "is-dark" # See https://bulma.io/documentation/components/message/#colors for styling options. 48 | #title: "Demo !" 49 | # icon: "fa fa-grin" 50 | content: "Vmess UUID: VMESS_UUID
Vmess Websocket Path: VMESS_PATHMODE_STATUS" 51 | 52 | # Optional navbar 53 | # links: [] # Allows for navbar (dark mode, layout, and search) without any links 54 | links: 55 | - name: "Google" 56 | url: "https://www.google.com/" 57 | - name: "Youtube" 58 | url: "https://www.youtube.com/" 59 | - name: "Twitter" 60 | url: "https://twitter.com/" 61 | - name: "Reddit" 62 | url: "www.reddit.com/" 63 | - name: "Wikipedia" 64 | url: "https://www.wikipedia.org/" 65 | 66 | # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file 67 | # see url field and assets/additionnal-page.yml.dist used in this example: 68 | # - name: "another page!" 69 | # icon: "fas fa-file-alt" 70 | # url: "#additionnal-page" 71 | 72 | # Services 73 | # First level array represent a group. 74 | # Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). 75 | services: 76 | - name: "Web 应用" 77 | icon: "fas fa-cloud" 78 | items: 79 | - name: "metube" 80 | logo: "./assets/tools/metube.png" 81 | subtitle: "yt-dlp Web 前端" 82 | tag: "app" 83 | url: "GLOBAL_PORTAL_PATH/metube" 84 | target: "_blank" # optional html a tag target attribute 85 | - name: "AriaNg" 86 | logo: "./assets/tools/AriaNg.ico" 87 | subtitle: "Aria2 Web 前端" 88 | tag: "app" 89 | url: "GLOBAL_PORTAL_PATH/ariang" 90 | target: "_blank" # optional html a tag target attribute 91 | - name: "Filebrowser" 92 | logo: "./assets/tools/filebrowser.png" 93 | subtitle: "Filebrowser 轻量个人网盘" 94 | tag: "app" 95 | url: "GLOBAL_PORTAL_PATH/files" 96 | target: "_blank" 97 | - name: "Rclone Web UI" 98 | logo: "./assets/tools/rcloneng.png" 99 | subtitle: "Rclone Web 前端" 100 | tag: "app" 101 | url: "GLOBAL_PORTAL_PATH/rcloneweb" 102 | target: "_blank" 103 | - name: "Rclone Serve" 104 | logo: "./assets/tools/rcloneng.png" 105 | subtitle: "Rclone 远程存储文件列表" 106 | tag: "app" 107 | url: "GLOBAL_PORTAL_PATH/rclonerc/" 108 | target: "_blank" 109 | - name: "ttyd" 110 | logo: "./assets/tools/ttyd.png" 111 | subtitle: "Web共享终端" 112 | tag: "app" 113 | url: "GLOBAL_PORTAL_PATH/ttyd" 114 | target: "_blank" 115 | -------------------------------------------------------------------------------- /content/homer_conf/homer_en.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Homepage configuration 3 | # See https://fontawesome.com/icons for icons options 4 | # Modified by wy580477 for customized container 5 | 6 | title: "Dashboard for Heroku-All-In-One container" 7 | subtitle: "Homer" 8 | logo: "logo.png" 9 | # icon: "fas fa-skull-crossbones" # Optional icon 10 | 11 | header: false 12 | footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. 13 | 14 | # Optional theme customization 15 | theme: default 16 | colors: 17 | light: 18 | highlight-primary: "#3367d6" 19 | highlight-secondary: "#4285f4" 20 | highlight-hover: "#5a95f5" 21 | background: "#f5f5f5" 22 | card-background: "#ffffff" 23 | text: "#363636" 24 | text-header: "#ffffff" 25 | text-title: "#303030" 26 | text-subtitle: "#424242" 27 | card-shadow: rgba(0, 0, 0, 0.1) 28 | link: "#3273dc" 29 | link-hover: "#363636" 30 | dark: 31 | highlight-primary: "#3367d6" 32 | highlight-secondary: "#4285f4" 33 | highlight-hover: "#5a95f5" 34 | background: "#131313" 35 | card-background: "#2b2b2b" 36 | text: "#eaeaea" 37 | text-header: "#ffffff" 38 | text-title: "#fafafa" 39 | text-subtitle: "#f5f5f5" 40 | card-shadow: rgba(0, 0, 0, 0.4) 41 | link: "#3273dc" 42 | link-hover: "#ffdd57" 43 | 44 | # Optional message 45 | message: 46 | #url: https://b4bz.io 47 | style: "is-dark" # See https://bulma.io/documentation/components/message/#colors for styling options. 48 | #title: "Demo !" 49 | # icon: "fa fa-grin" 50 | content: "Vmess UUID: VMESS_UUID
Vmess Websocket Path: VMESS_PATHMODE_STATUS" 51 | 52 | # Optional navbar 53 | # links: [] # Allows for navbar (dark mode, layout, and search) without any links 54 | links: 55 | - name: "Google" 56 | url: "https://www.google.com/" 57 | - name: "Youtube" 58 | url: "https://www.youtube.com/" 59 | - name: "Twitter" 60 | url: "https://twitter.com/" 61 | - name: "Reddit" 62 | url: "www.reddit.com/" 63 | - name: "Wikipedia" 64 | url: "https://www.wikipedia.org/" 65 | 66 | # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file 67 | # see url field and assets/additionnal-page.yml.dist used in this example: 68 | # - name: "another page!" 69 | # icon: "fas fa-file-alt" 70 | # url: "#additionnal-page" 71 | 72 | # Services 73 | # First level array represent a group. 74 | # Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). 75 | services: 76 | - name: "Applications" 77 | icon: "fas fa-cloud" 78 | items: 79 | - name: "metube" 80 | logo: "./assets/tools/metube.png" 81 | subtitle: "Web GUI for yt-dlp" 82 | tag: "app" 83 | url: "GLOBAL_PORTAL_PATH/metube" 84 | target: "_blank" # optional html a tag target attribute 85 | - name: "AriaNg" 86 | logo: "./assets/tools/AriaNg.ico" 87 | subtitle: "Web frontend for Aria2" 88 | tag: "app" 89 | url: "GLOBAL_PORTAL_PATH/ariang" 90 | target: "_blank" # optional html a tag target attribute 91 | - name: "Filebrowser" 92 | logo: "./assets/tools/filebrowser.png" 93 | subtitle: "Web File Browser" 94 | tag: "app" 95 | url: "GLOBAL_PORTAL_PATH/files" 96 | target: "_blank" 97 | - name: "Rclone Web UI" 98 | logo: "./assets/tools/rcloneng.png" 99 | subtitle: "Full fledged UI for Rclone" 100 | tag: "app" 101 | url: "GLOBAL_PORTAL_PATH/rcloneweb" 102 | target: "_blank" 103 | - name: "Rclone Serve" 104 | logo: "./assets/tools/rcloneng.png" 105 | subtitle: "Serve Rclone remote over HTTP" 106 | tag: "app" 107 | url: "GLOBAL_PORTAL_PATH/rclonerc/" 108 | target: "_blank" 109 | - name: "ttyd" 110 | logo: "./assets/tools/ttyd.png" 111 | subtitle: "Share your terminal over the web" 112 | tag: "app" 113 | url: "GLOBAL_PORTAL_PATH/ttyd" 114 | target: "_blank" 115 | -------------------------------------------------------------------------------- /content/aria2/copy_remote_first.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:copy_remote_first.sh 5 | 6 | # Description: Use Rclone to copy files to Rclone remote after Aria2 download is complete 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documentation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furnished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in all 21 | # copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | # SOFTWARE. 30 | 31 | 32 | CHECK_CORE_FILE() { 33 | CORE_FILE="$(dirname $0)/core" 34 | if [[ -f "${CORE_FILE}" ]]; then 35 | . "${CORE_FILE}" 36 | else 37 | echo && echo "!!! core file does not exist !!!" 38 | exit 1 39 | fi 40 | } 41 | 42 | CHECK_RCLONE() { 43 | [[ $# -eq 0 ]] && { 44 | echo && echo -e "Checking RCLONE connection ..." 45 | rclone mkdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 46 | if [[ $? -eq 0 ]]; then 47 | rclone rmdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 48 | echo 49 | echo -e "${LIGHT_GREEN_FONT_PREFIX}success${FONT_COLOR_SUFFIX}" 50 | exit 0 51 | else 52 | echo 53 | echo -e "${RED_FONT_PREFIX}failure${FONT_COLOR_SUFFIX}" 54 | exit 1 55 | fi 56 | } 57 | } 58 | 59 | TASK_INFO() { 60 | echo -e " 61 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 62 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 63 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 64 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 65 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 66 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 67 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 68 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 69 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 70 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 71 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 72 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 73 | " 74 | } 75 | 76 | OUTPUT_UPLOAD_LOG() { 77 | LOG="${UPLOAD_LOG}" 78 | LOG_PATH="${UPLOAD_LOG_PATH}" 79 | OUTPUT_LOG 80 | } 81 | 82 | DEFINITION_PATH() { 83 | LOCAL_PATH="${TASK_PATH}" 84 | if [[ -f "${TASK_PATH}" ]]; then 85 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX%/*}" 86 | else 87 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 88 | fi 89 | } 90 | 91 | LOAD_RCLONE_ENV() { 92 | RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env" 93 | [[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0) 94 | } 95 | 96 | UPLOAD_FILE() { 97 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 98 | TASK_INFO 99 | RETRY=0 100 | RETRY_NUM=3 101 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 102 | [ ${RETRY} != 0 ] && ( 103 | echo 104 | echo -e "$(DATE_TIME) ${ERROR} Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 105 | echo 106 | ) 107 | if [ -f "${LOCAL_PATH}" ]; then 108 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/mnt/data/downloads srcRemote="${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" dstRemote="${TASK_FILE_NAME}" _async=true 109 | else 110 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 sync/copy srcFs="${LOCAL_PATH}" dstFs="${REMOTE_PATH}" _async=true 111 | fi 112 | RCLONE_EXIT_CODE=$? 113 | if [ ${RCLONE_EXIT_CODE} -eq 0 ]; then 114 | UPLOAD_LOG="$(DATE_TIME) ${INFO} Successfully send job to rclone: ${LOCAL_PATH} -> ${REMOTE_PATH}" 115 | OUTPUT_UPLOAD_LOG 116 | DELETE_EMPTY_DIR 117 | break 118 | else 119 | RETRY=$((${RETRY} + 1)) 120 | [ ${RETRY} -gt ${RETRY_NUM} ] && ( 121 | echo 122 | UPLOAD_LOG="$(DATE_TIME) ${ERROR} Upload failed: ${LOCAL_PATH}" 123 | OUTPUT_UPLOAD_LOG 124 | ) 125 | sleep 3 126 | fi 127 | done 128 | } 129 | 130 | CHECK_CORE_FILE "$@" 131 | CHECK_SCRIPT_CONF 132 | CHECK_RCLONE "$@" 133 | CHECK_FILE_NUM 134 | GET_TASK_INFO 135 | GET_DOWNLOAD_DIR 136 | CONVERSION_PATH 137 | DEFINITION_PATH 138 | CLEAN_UP 139 | LOAD_RCLONE_ENV 140 | UPLOAD_FILE 141 | exit 0 142 | -------------------------------------------------------------------------------- /content/aria2/move_remote_only.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:move_remote_only.sh 5 | 6 | # Description: Use Rclone to move files to Rclone Remote after Aria2 download is complete 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documentation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furnished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in all 21 | # copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | # SOFTWARE. 30 | 31 | 32 | CHECK_CORE_FILE() { 33 | CORE_FILE="$(dirname $0)/core" 34 | if [[ -f "${CORE_FILE}" ]]; then 35 | . "${CORE_FILE}" 36 | else 37 | echo && echo "!!! core file does not exist !!!" 38 | exit 1 39 | fi 40 | } 41 | 42 | CHECK_RCLONE() { 43 | [[ $# -eq 0 ]] && { 44 | echo && echo -e "Checking RCLONE connection ..." 45 | rclone mkdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 46 | if [[ $? -eq 0 ]]; then 47 | rclone rmdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 48 | echo 49 | echo -e "${LIGHT_GREEN_FONT_PREFIX}success${FONT_COLOR_SUFFIX}" 50 | exit 0 51 | else 52 | echo 53 | echo -e "${RED_FONT_PREFIX}failure${FONT_COLOR_SUFFIX}" 54 | exit 1 55 | fi 56 | } 57 | } 58 | 59 | TASK_INFO() { 60 | echo -e " 61 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 62 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 63 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 64 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 65 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 66 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 67 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 68 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 69 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 70 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 71 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 72 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 73 | " 74 | } 75 | 76 | OUTPUT_UPLOAD_LOG() { 77 | LOG="${UPLOAD_LOG}" 78 | LOG_PATH="${UPLOAD_LOG_PATH}" 79 | OUTPUT_LOG 80 | } 81 | 82 | DEFINITION_PATH() { 83 | LOCAL_PATH="${TASK_PATH}" 84 | if [[ -f "${TASK_PATH}" ]]; then 85 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX%/*}" 86 | else 87 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 88 | fi 89 | } 90 | 91 | LOAD_RCLONE_ENV() { 92 | RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env" 93 | [[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0) 94 | } 95 | 96 | UPLOAD_FILE() { 97 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 98 | TASK_INFO 99 | RETRY=0 100 | RETRY_NUM=3 101 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 102 | [ ${RETRY} != 0 ] && ( 103 | echo 104 | echo -e "$(DATE_TIME) ${ERROR} Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 105 | echo 106 | ) 107 | if [ -f "${LOCAL_PATH}" ]; then 108 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/movefile srcFs="${DOWNLOAD_DIR}" srcRemote="${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" dstRemote="${TASK_FILE_NAME}" _async=true 109 | else 110 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 sync/move srcFs="${LOCAL_PATH}" dstFs="${REMOTE_PATH}" _async=true 111 | fi 112 | RCLONE_EXIT_CODE=$? 113 | if [ ${RCLONE_EXIT_CODE} -eq 0 ]; then 114 | UPLOAD_LOG="$(DATE_TIME) ${INFO} Successfully send job to rclone: ${LOCAL_PATH} -> ${REMOTE_PATH}" 115 | OUTPUT_UPLOAD_LOG 116 | DELETE_EMPTY_DIR 117 | break 118 | else 119 | RETRY=$((${RETRY} + 1)) 120 | [ ${RETRY} -gt ${RETRY_NUM} ] && ( 121 | echo 122 | UPLOAD_LOG="$(DATE_TIME) ${ERROR} Upload failed: ${LOCAL_PATH}" 123 | OUTPUT_UPLOAD_LOG 124 | ) 125 | sleep 3 126 | fi 127 | done 128 | } 129 | 130 | CHECK_CORE_FILE "$@" 131 | CHECK_SCRIPT_CONF 132 | CHECK_RCLONE "$@" 133 | CHECK_FILE_NUM 134 | GET_TASK_INFO 135 | GET_DOWNLOAD_DIR 136 | CONVERSION_PATH 137 | DEFINITION_PATH 138 | CLEAN_UP 139 | LOAD_RCLONE_ENV 140 | UPLOAD_FILE 141 | exit 0 142 | -------------------------------------------------------------------------------- /content/aria2/copy_remote_other.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:copy_remote_other.sh 5 | 6 | # Description: Use Rclone to copy files of Non-bittorrent task to Rclone remote after Aria2 download is complete 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documentation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furnished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in all 21 | # copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | # SOFTWARE. 30 | 31 | # Modified by wy580477 for customized container 32 | 33 | CHECK_CORE_FILE() { 34 | CORE_FILE="$(dirname $0)/core" 35 | if [[ -f "${CORE_FILE}" ]]; then 36 | . "${CORE_FILE}" 37 | else 38 | echo && echo "!!! core file does not exist !!!" 39 | exit 1 40 | fi 41 | } 42 | 43 | CHECK_RCLONE() { 44 | [[ $# -eq 0 ]] && { 45 | echo && echo -e "Checking RCLONE connection ..." 46 | rclone mkdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 47 | if [[ $? -eq 0 ]]; then 48 | rclone rmdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 49 | echo 50 | echo -e "${LIGHT_GREEN_FONT_PREFIX}success${FONT_COLOR_SUFFIX}" 51 | exit 0 52 | else 53 | echo 54 | echo -e "${RED_FONT_PREFIX}failure${FONT_COLOR_SUFFIX}" 55 | exit 1 56 | fi 57 | } 58 | } 59 | 60 | TASK_INFO() { 61 | echo -e " 62 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 63 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 64 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 65 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 66 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 67 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 68 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 69 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 70 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 71 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 72 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 73 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 74 | " 75 | } 76 | 77 | OUTPUT_UPLOAD_LOG() { 78 | LOG="${UPLOAD_LOG}" 79 | LOG_PATH="${UPLOAD_LOG_PATH}" 80 | OUTPUT_LOG 81 | } 82 | 83 | DEFINITION_PATH() { 84 | LOCAL_PATH="${TASK_PATH}" 85 | if [[ -f "${TASK_PATH}" ]]; then 86 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX%/*}" 87 | else 88 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 89 | fi 90 | } 91 | 92 | LOAD_RCLONE_ENV() { 93 | RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env" 94 | [[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0) 95 | } 96 | 97 | UPLOAD_FILE() { 98 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 99 | TASK_INFO 100 | RETRY=0 101 | RETRY_NUM=3 102 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 103 | [ ${RETRY} != 0 ] && ( 104 | echo 105 | echo -e "$(DATE_TIME) ${ERROR} Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 106 | echo 107 | ) 108 | if [ -f "${LOCAL_PATH}" ]; then 109 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/mnt/data/downloads srcRemote="${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" dstRemote="${TASK_FILE_NAME}" _async=true 110 | else 111 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 sync/copy srcFs="${LOCAL_PATH}" dstFs="${REMOTE_PATH}" _async=true 112 | fi 113 | RCLONE_EXIT_CODE=$? 114 | if [ ${RCLONE_EXIT_CODE} -eq 0 ]; then 115 | UPLOAD_LOG="$(DATE_TIME) ${INFO} Successfully send job to rclone: ${LOCAL_PATH} -> ${REMOTE_PATH}" 116 | OUTPUT_UPLOAD_LOG 117 | DELETE_EMPTY_DIR 118 | break 119 | else 120 | RETRY=$((${RETRY} + 1)) 121 | [ ${RETRY} -gt ${RETRY_NUM} ] && ( 122 | echo 123 | UPLOAD_LOG="$(DATE_TIME) ${ERROR} Upload failed: ${LOCAL_PATH}" 124 | OUTPUT_UPLOAD_LOG 125 | ) 126 | sleep 3 127 | fi 128 | done 129 | } 130 | 131 | CHECK_CORE_FILE "$@" 132 | CHECK_SCRIPT_CONF 133 | CHECK_RCLONE "$@" 134 | CHECK_FILE_NUM 135 | GET_TASK_INFO 136 | GET_INFO_HASH 137 | GET_DOWNLOAD_DIR 138 | CONVERSION_PATH 139 | DEFINITION_PATH 140 | CLEAN_UP 141 | if GET_INFO_HASH; then 142 | exit 0 143 | fi 144 | LOAD_RCLONE_ENV 145 | UPLOAD_FILE 146 | exit 0 147 | -------------------------------------------------------------------------------- /content/aria2/move_remote.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:move_remote.sh 5 | 6 | # Description: Move files to finished folder after Aria2 download is complete, then use Rclone to move files to Rclone Remote. 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # Permission is hereby granted, free of charge, to any person obtaining a copy 14 | # of this software and associated documentation files (the "Software"), to deal 15 | # in the Software without restriction, including without limitation the rights 16 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | # copies of the Software, and to permit persons to whom the Software is 18 | # furnished to do so, subject to the following conditions: 19 | # 20 | # The above copyright notice and this permission notice shall be included in all 21 | # copies or substantial portions of the Software. 22 | # 23 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | # SOFTWARE. 30 | 31 | 32 | CHECK_CORE_FILE() { 33 | CORE_FILE="$(dirname $0)/core" 34 | if [[ -f "${CORE_FILE}" ]]; then 35 | . "${CORE_FILE}" 36 | else 37 | echo && echo "!!! core file does not exist !!!" 38 | exit 1 39 | fi 40 | } 41 | 42 | CHECK_RCLONE() { 43 | [[ $# -eq 0 ]] && { 44 | echo && echo -e "Checking RCLONE connection ..." 45 | rclone mkdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 46 | if [[ $? -eq 0 ]]; then 47 | rclone rmdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 48 | echo 49 | echo -e "${LIGHT_GREEN_FONT_PREFIX}success${FONT_COLOR_SUFFIX}" 50 | exit 0 51 | else 52 | echo 53 | echo -e "${RED_FONT_PREFIX}failure${FONT_COLOR_SUFFIX}" 54 | exit 1 55 | fi 56 | } 57 | } 58 | 59 | TASK_INFO() { 60 | echo -e " 61 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 62 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 63 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 64 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 65 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 66 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 67 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 68 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 69 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 70 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 71 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 72 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 73 | " 74 | } 75 | 76 | OUTPUT_UPLOAD_LOG() { 77 | LOG="${UPLOAD_LOG}" 78 | LOG_PATH="${UPLOAD_LOG_PATH}" 79 | OUTPUT_LOG 80 | } 81 | 82 | DEFINITION_PATH() { 83 | LOCAL_PATH="${TASK_PATH}" 84 | if [[ -f "${TASK_PATH}" ]]; then 85 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX%/*}" 86 | else 87 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 88 | fi 89 | } 90 | 91 | LOAD_RCLONE_ENV() { 92 | RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env" 93 | [[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0) 94 | } 95 | 96 | UPLOAD_FILE() { 97 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 98 | TASK_INFO 99 | RETRY=0 100 | RETRY_NUM=3 101 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 102 | [ ${RETRY} != 0 ] && ( 103 | echo 104 | echo -e "$(DATE_TIME) ${ERROR} Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 105 | echo 106 | ) 107 | if [ -f "${LOCAL_PATH}" ]; then 108 | mkdir -p /mnt/data/finished 109 | mv -vf "${LOCAL_PATH}" /mnt/data/finished/ 110 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/movefile srcFs=/mnt/data/finished srcRemote="${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" dstRemote="${TASK_FILE_NAME}" _async=true 111 | else 112 | mkdir -p /mnt/data/finished 113 | mv -vf "${LOCAL_PATH}" /mnt/data/finished/ 114 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 sync/move srcFs=/mnt/data/finished/"${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" _async=true 115 | fi 116 | RCLONE_EXIT_CODE=$? 117 | if [ ${RCLONE_EXIT_CODE} -eq 0 ]; then 118 | UPLOAD_LOG="$(DATE_TIME) ${INFO} Successfully send job to rclone: ${LOCAL_PATH} -> ${REMOTE_PATH}" 119 | OUTPUT_UPLOAD_LOG 120 | DELETE_EMPTY_DIR 121 | break 122 | else 123 | RETRY=$((${RETRY} + 1)) 124 | [ ${RETRY} -gt ${RETRY_NUM} ] && ( 125 | echo 126 | UPLOAD_LOG="$(DATE_TIME) ${ERROR} Upload failed: ${LOCAL_PATH}" 127 | OUTPUT_UPLOAD_LOG 128 | ) 129 | sleep 3 130 | fi 131 | done 132 | } 133 | 134 | CHECK_CORE_FILE "$@" 135 | CHECK_SCRIPT_CONF 136 | CHECK_RCLONE "$@" 137 | CHECK_FILE_NUM 138 | GET_TASK_INFO 139 | GET_DOWNLOAD_DIR 140 | CONVERSION_PATH 141 | DEFINITION_PATH 142 | CLEAN_UP 143 | LOAD_RCLONE_ENV 144 | UPLOAD_FILE 145 | exit 0 146 | -------------------------------------------------------------------------------- /content/aria2/copy_remote.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:copy_remote.sh 5 | 6 | # Description: Move files to finished folder after Aria2 download is complete, then then use Rclone to copy files to Rclone Remote. 7 | # Version: 3.1 8 | # 9 | # Copyright (c) 2018-2021 P3TERX 10 | # 11 | # Modified by wy580477 for customized container 12 | # 13 | # 14 | # Permission is hereby granted, free of charge, to any person obtaining a copy 15 | # of this software and associated documentation files (the "Software"), to deal 16 | # in the Software without restriction, including without limitation the rights 17 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | # copies of the Software, and to permit persons to whom the Software is 19 | # furnished to do so, subject to the following conditions: 20 | # 21 | # The above copyright notice and this permission notice shall be included in all 22 | # copies or substantial portions of the Software. 23 | # 24 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | # SOFTWARE. 31 | # Modified by wy580477 for customized container 32 | # 33 | 34 | CHECK_CORE_FILE() { 35 | CORE_FILE="$(dirname $0)/core" 36 | if [[ -f "${CORE_FILE}" ]]; then 37 | . "${CORE_FILE}" 38 | else 39 | echo && echo "!!! core file does not exist !!!" 40 | exit 1 41 | fi 42 | } 43 | 44 | CHECK_RCLONE() { 45 | [[ $# -eq 0 ]] && { 46 | echo && echo -e "Checking RCLONE connection ..." 47 | rclone mkdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 48 | if [[ $? -eq 0 ]]; then 49 | rclone rmdir "${DRIVE_NAME}:${DRIVE_DIR}/P3TERX.COM" 50 | echo 51 | echo -e "${LIGHT_GREEN_FONT_PREFIX}success${FONT_COLOR_SUFFIX}" 52 | exit 0 53 | else 54 | echo 55 | echo -e "${RED_FONT_PREFIX}failure${FONT_COLOR_SUFFIX}" 56 | exit 1 57 | fi 58 | } 59 | } 60 | 61 | TASK_INFO() { 62 | echo -e " 63 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 64 | ${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} 65 | ${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} 66 | ${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} 67 | ${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} 68 | ${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} 69 | ${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} 70 | ${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} 71 | ${LIGHT_PURPLE_FONT_PREFIX}Local Path:${FONT_COLOR_SUFFIX} ${LOCAL_PATH} 72 | ${LIGHT_PURPLE_FONT_PREFIX}Remote Path:${FONT_COLOR_SUFFIX} ${REMOTE_PATH} 73 | ${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} 74 | -------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- 75 | " 76 | } 77 | 78 | OUTPUT_UPLOAD_LOG() { 79 | LOG="${UPLOAD_LOG}" 80 | LOG_PATH="${UPLOAD_LOG_PATH}" 81 | OUTPUT_LOG 82 | } 83 | 84 | DEFINITION_PATH() { 85 | LOCAL_PATH="${TASK_PATH}" 86 | if [[ -f "${TASK_PATH}" ]]; then 87 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX%/*}" 88 | else 89 | REMOTE_PATH="${DRIVE_NAME}:${DRIVE_DIR}${DEST_PATH_SUFFIX}" 90 | fi 91 | } 92 | 93 | LOAD_RCLONE_ENV() { 94 | RCLONE_ENV_FILE="${ARIA2_CONF_DIR}/rclone.env" 95 | [[ -f ${RCLONE_ENV_FILE} ]] && export $(grep -Ev "^#|^$" ${RCLONE_ENV_FILE} | xargs -0) 96 | } 97 | 98 | UPLOAD_FILE() { 99 | echo -e "$(DATE_TIME) ${INFO} Start upload files..." 100 | TASK_INFO 101 | RETRY=0 102 | RETRY_NUM=3 103 | while [ ${RETRY} -le ${RETRY_NUM} ]; do 104 | [ ${RETRY} != 0 ] && ( 105 | echo 106 | echo -e "$(DATE_TIME) ${ERROR} Upload failed! Retry ${RETRY}/${RETRY_NUM} ..." 107 | echo 108 | ) 109 | if [ -f "${LOCAL_PATH}" ]; then 110 | mkdir -p /mnt/data/finished 111 | mv -vf "${LOCAL_PATH}" /mnt/data/finished/ 112 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 operations/copyfile srcFs=/mnt/data/finished srcRemote="${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" dstRemote="${TASK_FILE_NAME}" _async=true 113 | else 114 | mkdir -p /mnt/data/finished 115 | mv -vf "${LOCAL_PATH}" /mnt/data/finished/ 116 | rclone rc --user "${GLOBAL_USER}" --pass "${GLOBAL_PASSWORD}" --rc-addr=localhost:61802 sync/copy srcFs=/mnt/data/finished/"${TASK_FILE_NAME}" dstFs="${REMOTE_PATH}" _async=true 117 | fi 118 | RCLONE_EXIT_CODE=$? 119 | if [ ${RCLONE_EXIT_CODE} -eq 0 ]; then 120 | UPLOAD_LOG="$(DATE_TIME) ${INFO} Successfully send job to rclone: ${LOCAL_PATH} -> ${REMOTE_PATH}" 121 | OUTPUT_UPLOAD_LOG 122 | DELETE_EMPTY_DIR 123 | break 124 | else 125 | RETRY=$((${RETRY} + 1)) 126 | [ ${RETRY} -gt ${RETRY_NUM} ] && ( 127 | echo 128 | UPLOAD_LOG="$(DATE_TIME) ${ERROR} Upload failed: ${LOCAL_PATH}" 129 | OUTPUT_UPLOAD_LOG 130 | ) 131 | sleep 3 132 | fi 133 | done 134 | } 135 | 136 | CHECK_CORE_FILE "$@" 137 | CHECK_SCRIPT_CONF 138 | CHECK_RCLONE "$@" 139 | CHECK_FILE_NUM 140 | GET_TASK_INFO 141 | GET_DOWNLOAD_DIR 142 | CONVERSION_PATH 143 | DEFINITION_PATH 144 | CLEAN_UP 145 | LOAD_RCLONE_ENV 146 | UPLOAD_FILE 147 | exit 0 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Warning | 警告 2 | 2022/5/21 3 | 4 | - Unmaintained repo | 停止维护 5 | - Deploy at your own risk | 部署风险自负 6 | - 新项目 | Checkout [Heroku-AIO-APP-EX](https://github.com/wy580477/Heroku-AIO-APP-EX) 7 | 8 | 9 | [Click here for English version](https://github.com/wy580477/Heroku-All-In-One-APP/blob/main/README_en.md) 10 | 11 | ## 鸣谢 12 | 13 | - [alexta69/metube](https://github.com/alexta69/metube) 简洁好用的yt-dlp前端。 14 | - [P3TERX/aria2.conf](https://github.com/P3TERX/aria2.conf) 依靠来自P3TERX的Aria2脚本,实现了Aria2下载完成自动触发Rclone上传。 15 | - [wahyd4/aria2-ariang-docker](https://github.com/wahyd4/aria2-ariang-docker) 启发了本项目的总体思路。 16 | - [bastienwirtz/homer](https://github.com/bastienwirtz/homer) 使用yaml配置文件的静态导航页,便于自定义。 17 | - [mayswind/AriaNg](https://github.com/mayswind/AriaNg) | [filebrowser/filebrowser](https://github.com/filebrowser/filebrowser) | [aria2/aria2](https://github.com/aria2/aria2) | [rclone/rclone](https://github.com/rclone/rclone) | [yt-dlp/yt-dlp](https://github.com/yt-dlp/yt-dlp) 18 | 19 | ## 注意 20 | 21 | 1. **请勿滥用,重度使用可能导致账号被封。** 22 | 2. Heroku的文件系统是临时性的,每24小时强制重启一次后会恢复到部署时状态。不适合长期BT下载和共享文件用途。 23 | 3. Aria2配置文件默认限速5MB/s。 24 | 4. 所有可以登陆此APP的用户可以访问/修改此APP以及Rclone远程存储的所有数据,不要存放敏感数据,不要与他人共享使用。 25 | 5. 免费Heroku dyno半小时无Web访问会休眠,可以使用[hetrixtools](https://hetrixtools.com/uptime-monitor/215727.html)这样的免费VPS/网站监测服务定时http ping,保持持续运行。 26 | 27 | [概述](#概述) 28 | 29 | [部署方式](#部署方式) 30 | 31 | [变量设置](#变量设置) 32 | 33 | [初次使用](#初次使用) 34 | 35 | [更多用法和注意事项](#更多用法和注意事项) 36 | 37 | ## 概述 38 | 39 | 本项目集成了Metube yt-dlp Web前端、Aria2+Rclone+WebUI、Aria2+Rclone联动自动上传功能、Rclone远程存储文件列表和Webdav服务、可自定义的导航页、Filebrowser轻量网盘、ttyd Web终端、Xray Vmess协议。 40 | 41 | [VPS部署版本](https://github.com/wy580477/Aria2-AIO-Container) 42 | 43 | [qBittorrent版本](https://github.com/wy580477/qBit-to-Rclone-on-Heroku) 44 | 45 | ![image](https://user-images.githubusercontent.com/98247050/165098261-7290ff50-ec0f-47ac-b8ec-7fe09f468a0e.png) 46 | 47 | 1. 联动上传功能只需要准备rclone.conf配置文件, 其他一切配置都预备齐全。 48 | 2. Aria2和Rclone多种联动模式,复制、移动、边做种边上传。 49 | 3. yt-dlp Web前端metube下载后同样支持rclone联动。 50 | 4. Rclone以daemon方式运行,可在WebUI上手动传输文件和实时监测传输情况。 51 | 5. Aria2和Rclone可以接入其它host上运行的AriaNg/RcloneNg等前端面板,方便多host集中管理控制。 52 | 6. 自动备份相关配置文件到Rclone远程存储,dyno重启时尝试从远程恢复,实现了配置文件和下载任务列表的持久化。 53 | 7. ttyd网页终端,可命令行执行yt-dlp下载工具和其它命令。 54 | 8. log目录下有每个服务独立日志。 55 | 56 | ## 部署方式 57 | 58 | **请勿使用本仓库直接部署** 59 | 60 | **Heroku修复安全漏洞中,目前无法通过网页从私有库部署** 61 | 62 | 1. 点击右上角Fork,再点击Create Fork。 63 | 2. 在Fork出来的仓库页面上点击Setting,勾选Template repository。 64 | 3. 然后点击Code返回之前的页面,点Setting下面新出现的按钮Use this template,起个随机名字创建新库。 65 | 4. 比如你的Github用户名是bobby,新库名称是green。浏览器登陆heroku后,访问 即可部署。 66 | 67 | ### 变量设置 68 | 69 | 对部署时可设定的变量做如下说明。 70 | | 变量| 说明 | 71 | | :--- | :--- | 72 | | `GLOBAL_USER` | 用户名,适用于所有需要输入用户名的页面 | 73 | | `GLOBAL_PASSWORD` | 务必修改为强密码,同样适用于所有需要输入密码的页面,同时也是Aria2 RPC密钥。 | 74 | | `GLOBAL_LANGUAGE` | 设置导航页和Filebrowser界面语言,chs为中文 | 75 | | `GLOBAL_PORTAL_PATH` | 导航页路径和所有Web服务的基础URL,相当于密码之外多一层保护。不能为“/"和空值,结尾不能加“/" | 76 | | `RCLONE_CONFIG_BASE64` | Rclone配置文件Base64编码,可使用linux系统base64命令或者在线base64工具生成。注意,多远程存储Rclone配置文件可能超过Heroku变量32kb的上限。 | 77 | | `RCLONE_DRIVE_NAME` | Rclone远程存储配置名称,后面不要加冒号。默认值auto将从配置文件第一行中提取 | 78 | | `RCLONE_AUTO_MODE` | 控制Aria2、metube和dlpr指令与Rclone联动模式,详细说明见下文 | 79 | | `TZ` | 时区,Asia/Shanghai为中国时区 | 80 | | `HEROKU_API_KEY` | Heroku账号API密钥,可选项,用于从dyno内部更新rclone配置文件变量,解决rclone token过期问题。需要HEROKU_APP_NAME和HEROKU_RESTART_TIME变量配合,而且dyno在指定的HEROKU_RESTART_TIME必须正在运行。可从Heroku账号面板处获得,也可以用heroku cli命令heroku authorizations:create创建。 | 81 | | `HEROKU_APP_NAME` | Heroku APP名称。 | 82 | | `HEROKU_KEEP_AWAKE` | 设置为"true"可以阻止dyno空闲时休眠,需要HEROKU_APP_NAME变量配合。 | 83 | | `HEROKU_RESTART_TIME` | 指定更新Rclone配置文件的时间,可选项,在指定的时间正在运行的dyno会重启。格式为6:00,24小时制,时区为TZ变量所指定的时区。 | 84 | | `YTDL_OPTIONS` | metube下载所使用的yt-dlp参数,默认值与rclone联动。更多参数详见[metube#configuration](https://github.com/alexta69/metube#configuration-via-environment-variables) | 85 | | `YTDL_OUTPUT_TEMPLATE` | Metube下载输出文件名格式,详见[yt-dlp#output-template](https://github.com/yt-dlp/yt-dlp#output-template) | 86 | | `VMESS_UUID` | Vmess协议UUID,务必修改,建议使用UUID工具生成 | 87 | | `VMESS_PATH` | Vmess协议路径,不要包含敏感信息 | 88 | 89 | RCLONE_AUTO_MODE: 90 | 91 | 1. dummy模式为无操作,move模式为Aria2下载及做种完成后移动到本地finished目录。 92 | 2. move_remote模式为Aria2下载及做种完成后先移动到本地data数据卷下finished目录,然后移动到rclone远程存储。 93 | 3. move_remote_only模式为Aria2下载及做种完成后移动到rclone远程存储。 94 | 4. copy_remote_first模式为Aria2下载完成后立即复制到rclone远程存储,BT任务在做种前即触发。 95 | 5. copy_remote模式为Aria2下载及做种完成后先移动到本地finished目录,然后复制到rclone远程存储。 96 | 6. custom模式为自行设置Aria2配置文件触发脚本选项。 97 | 98 | move_remote和move_remote_only模式下mutube以及dlpr指令下载完成后会移动文件至rclone远程存储,copy_remote和copy_remote_first模式下则为复制。 99 | 100 | ### 初次使用 101 | 102 | 1. 部署完成后,比如你的heroku域名是bobby.herokuapp.com,导航页路径是/portal,访问bobby.herokuapp.com/portal 即可到达导航页。 103 | 2. 点击AriaNg,这时会弹出认证失败警告,按下图把之前部署时设置的密码填入RPC密钥即可。 104 | ![image](https://user-images.githubusercontent.com/98247050/163184113-d0f09e78-01f9-4d4a-87b9-f4a9c1218253.png) 105 | 3. yt-dlp下载工具可以通过ttyd在网页终端执行,使用方法详细见: 106 | 内置快捷指令: 107 | dlpr:使用yt-dlp下载视频到videos文件夹下,下载完成后发送任务到rclone,受RCLONE_AUTO_MODE变量控制。 108 | 4. Rclone Webdav 地址:Heroku_app域名/${GLOBAL_PORTAL_PATH}/rclonedav 109 | 110 | ### 更多用法和注意事项 111 | 112 | 1. 如果网页访问APP出现故障,按下shift+F5强制刷新,如果还不行,从浏览器中清除app对应的heroku域名缓存和cookie。 113 | 2. Heroku每24小时重启后恢复到部署时文件系统,尽管config文件夹下配置文件会自动备份和尝试恢复,除了变量外任何改动都建议在部署前在github仓库内修改。 114 | 3. 修改Heroku app变量方法:在Heroku app页面上点击setting,再点击Reveal Config Vars即可修改。 115 | 4. Rclone配置文件末尾加上如下内容,可以在Rclone Web前端中挂载本地存储,方便手动上传。 116 | 117 | ``` 118 | [local] 119 | type = alias 120 | remote = /mnt/data 121 | ``` 122 | 123 | 4. 无法通过Rclone Web前端建立需要网页认证的存储配置。 124 | 5. 个别标题有特殊字符的视频metube下载后rclone可能无法上传,需要在YTDL_OPTIONS变量中添加:"restrictfilenames":true 125 | 6. content/aria2目录下,aria2_chs(en).conf为Aria2配置文件,按需要指定的语言环境变量选择版本修改。script.conf为Aria2自动化配置文件,可以设置aria2清理文件方式和Rclone上传目录。 126 | 7. 每次dyno启动自动更新BT tracker list,如果需要禁用,重命名或删除/content/aria2/tracker.sh文件。 127 | 8. content/homer_conf目录下是导航页设置文件homer_chs(en).yml和图标资源,新加入的图标,在设置文件中要以./assets/tools/example.png这样的路径调用。 128 | 9. Vmess协议AlterID为0,可用Vmess WS 80端口或者Vmess WS tls 443端口连接。Xray设置可以通过content/service/xray/run文件修改。Heroku国内直连很难,需要使用Cloudflare或其它方式中转。 129 | -------------------------------------------------------------------------------- /content/aria2/tracker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # https://github.com/P3TERX/aria2.conf 4 | # File name:tracker.sh 5 | # Description: Get BT trackers and add to Aria2 6 | # Version: 3.1 7 | # 8 | # Copyright (c) 2018-2021 P3TERX 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in all 18 | # copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | # SOFTWARE. 27 | # 28 | # BT tracker is provided by the following project. 29 | # https://github.com/XIU2/TrackersListCollection 30 | # 31 | # Fallback URLs provided by jsDelivr 32 | # https://www.jsdelivr.com 33 | # 34 | # 注意: 执行此文件将会覆盖aria2配置文件原有tracker列表。 35 | # Warning: This script will override your tracker list in aria2 config file. 36 | # 37 | 38 | RED_FONT_PREFIX="\033[31m" 39 | GREEN_FONT_PREFIX="\033[32m" 40 | YELLOW_FONT_PREFIX="\033[1;33m" 41 | LIGHT_PURPLE_FONT_PREFIX="\033[1;35m" 42 | FONT_COLOR_SUFFIX="\033[0m" 43 | INFO="[${GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" 44 | ERROR="[${RED_FONT_PREFIX}ERROR${FONT_COLOR_SUFFIX}]" 45 | ARIA2_CONF=${1:-aria2*.conf} 46 | DOWNLOADER="curl -fsSL --connect-timeout 3 --max-time 3 --retry 2" 47 | NL=$'\n' 48 | 49 | DATE_TIME() { 50 | date +"%m/%d %H:%M:%S" 51 | } 52 | 53 | GET_TRACKERS() { 54 | 55 | if [[ -z "${CUSTOM_TRACKER_URL}" ]]; then 56 | echo && echo -e "$(DATE_TIME) ${INFO} Get BT trackers..." 57 | TRACKER=$( 58 | ${DOWNLOADER} https://trackerslist.com/all_aria2.txt || 59 | ${DOWNLOADER} https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection@master/all_aria2.txt || 60 | ${DOWNLOADER} https://trackers.p3terx.com/all_aria2.txt 61 | ) 62 | else 63 | echo && echo -e "$(DATE_TIME) ${INFO} Get BT trackers from url(s):${CUSTOM_TRACKER_URL} ..." 64 | URLS=$(echo ${CUSTOM_TRACKER_URL} | tr "," "$NL") 65 | for URL in $URLS; do 66 | TRACKER+="$(${DOWNLOADER} ${URL} | tr "," "\n")$NL" 67 | done 68 | TRACKER="$(echo "$TRACKER" | awk NF | sort -u | sed 'H;1h;$!d;x;y/\n/,/' )" 69 | fi 70 | 71 | [[ -z "${TRACKER}" ]] && { 72 | echo 73 | echo -e "$(DATE_TIME) ${ERROR} Unable to get trackers, network failure or invalid links." && exit 1 74 | } 75 | } 76 | 77 | ECHO_TRACKERS() { 78 | echo -e " 79 | --------------------[BitTorrent Trackers]-------------------- 80 | ${TRACKER} 81 | --------------------[BitTorrent Trackers]-------------------- 82 | " 83 | } 84 | 85 | ADD_TRACKERS() { 86 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to Aria2 configuration file ${LIGHT_PURPLE_FONT_PREFIX}${ARIA2_CONF}${FONT_COLOR_SUFFIX} ..." && echo 87 | if [ ! -f ${ARIA2_CONF} ]; then 88 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 89 | exit 1 90 | else 91 | [ -z $(grep "bt-tracker=" ${ARIA2_CONF}) ] && echo "bt-tracker=" >>${ARIA2_CONF} 92 | sed -i "s@^\(bt-tracker=\).*@\1${TRACKER}@" ${ARIA2_CONF} && echo -e "$(DATE_TIME) ${INFO} BT trackers successfully added to Aria2 configuration file !" 93 | fi 94 | } 95 | 96 | ADD_TRACKERS_RPC() { 97 | if [[ "${RPC_SECRET}" ]]; then 98 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.changeGlobalOption","id":"P3TERX","params":["token:'${RPC_SECRET}'",{"bt-tracker":"'${TRACKER}'"}]}' 99 | else 100 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.changeGlobalOption","id":"P3TERX","params":[{"bt-tracker":"'${TRACKER}'"}]}' 101 | fi 102 | curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}" 103 | } 104 | 105 | ADD_TRACKERS_RPC_STATUS() { 106 | RPC_RESULT=$(ADD_TRACKERS_RPC) 107 | [[ $(echo ${RPC_RESULT} | grep OK) ]] && 108 | echo -e "$(DATE_TIME) ${INFO} BT trackers successfully added to Aria2 !" || 109 | echo -e "$(DATE_TIME) ${ERROR} Network failure or Aria2 RPC interface error!" 110 | } 111 | 112 | ADD_TRACKERS_REMOTE_RPC() { 113 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to remote Aria2: ${LIGHT_PURPLE_FONT_PREFIX}${RPC_ADDRESS%/*}${FONT_COLOR_SUFFIX} ..." && echo 114 | ADD_TRACKERS_RPC_STATUS 115 | } 116 | 117 | ADD_TRACKERS_LOCAL_RPC() { 118 | if [ ! -f ${ARIA2_CONF} ]; then 119 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 120 | exit 1 121 | else 122 | RPC_PORT=$(grep ^rpc-listen-port ${ARIA2_CONF} | cut -d= -f2-) 123 | RPC_SECRET=$(grep ^rpc-secret ${ARIA2_CONF} | cut -d= -f2-) 124 | [[ ${RPC_PORT} ]] || { 125 | echo -e "$(DATE_TIME) ${ERROR} Aria2 configuration file incomplete." 126 | exit 1 127 | } 128 | RPC_ADDRESS="localhost:${RPC_PORT}/jsonrpc" 129 | echo -e "$(DATE_TIME) ${INFO} Adding BT trackers to Aria2 ..." && echo 130 | ADD_TRACKERS_RPC_STATUS 131 | fi 132 | } 133 | 134 | [ $(command -v curl) ] || { 135 | echo -e "$(DATE_TIME) ${ERROR} curl is not installed." 136 | exit 1 137 | } 138 | 139 | if [ "$1" = "cat" ]; then 140 | GET_TRACKERS 141 | ECHO_TRACKERS 142 | elif [ "$1" = "RPC" ]; then 143 | RPC_ADDRESS="$2/jsonrpc" 144 | RPC_SECRET="$3" 145 | GET_TRACKERS 146 | ECHO_TRACKERS 147 | ADD_TRACKERS_REMOTE_RPC 148 | elif [ "$2" = "RPC" ]; then 149 | GET_TRACKERS 150 | ECHO_TRACKERS 151 | ADD_TRACKERS 152 | echo 153 | ADD_TRACKERS_LOCAL_RPC 154 | else 155 | GET_TRACKERS 156 | ECHO_TRACKERS 157 | ADD_TRACKERS 158 | fi 159 | 160 | exit 0 161 | -------------------------------------------------------------------------------- /README_en.md: -------------------------------------------------------------------------------- 1 | ## Acknowledgments 2 | 3 | - [alexta69/metube](https://github.com/alexta69/metube) Simple and easy-to-use yt-dlp frontend. 4 | - [P3TERX/aria2.conf](https://github.com/P3TERX/aria2.conf) Rely on the Aria2 script from P3TERX to automatically trigger the Rclone upload after the Aria2 downloads completed. 5 | - [wahyd4/aria2-ariang-docker](https://github.com/wahyd4/aria2-ariang-docker) Inspiration for this project. 6 | - [bastienwirtz/homer](https://github.com/bastienwirtz/homer) A very simple static homepage for your server. 7 | - [mayswind/AriaNg](https://github.com/mayswind/AriaNg) | [filebrowser/filebrowser](https://github.com/filebrowser/filebrowser) | [aria2/aria2](https://github.com/aria2/aria2) | [rclone/rclone](https://github.com/rclone/rclone) | [yt-dlp/yt-dlp](https://github.com/yt-dlp/yt-dlp) 8 | 9 | ## Attention 10 | 11 | 1. **Do not abuse heroku's service, or your account could get banned.** 12 | 2. Aria2 download speed is limited to 5MB/s on default. 13 | 3. Anyone who can login into this app has full access to data in this app and Rclone remotes. Do not share with other ppl, and do not store sensitive information with this app. 14 | 15 | [Overview](#Overview) 16 | 17 | [Deployment](#Deployment) 18 | 19 | [First run](#first) 20 | 21 | [More usages and precautions](#more) 22 | 23 | ## Overview 24 | 25 | This project integrates metube yt-dlp web frontend, Aria2 + WebUI, Rclone + WebUI with auto-upload function, Rclone Serve HTTP & Webdav, customizable portal page, Filebrowser, ttyd web terminal, Xray Vmess proxy protocol. 26 | 27 | [VPS version](https://github.com/wy580477/Aria2-AIO-Container) 28 | 29 | [qBittorrent version](https://github.com/wy580477/qBit-to-Rclone-on-Heroku) 30 | 31 | ![image](https://user-images.githubusercontent.com/98247050/165098261-7290ff50-ec0f-47ac-b8ec-7fe09f468a0e.png) 32 | 33 | 1. Rclone auto-upload function only needs to prepare rclone.conf file, and all other configurations are set to go. 34 | 2. Rclone have multiple auto-upload modes, copy, move, and uploading while seeding. 35 | 3. YT-dlp Web front-end metube also supports Rclone auto-upload after downloading. 36 | 4. Rclone runs on daemon mode, easy to manually transfer files and monitor transfers in real time on WebUI. 37 | 5. You can connect Aria2 and Rclone from frontends such as AriaNg/RcloneNg running on other hosts. 38 | 6. Auto-backup configuration files and task list to Rclone remote, and try to restore from Rclone remote when dyno restarts. 39 | 7. ttyd web terminal, which can execute yt-dlp and other commands on the command line. 40 | 8. There are independent logs for each service in the log directory. 41 | 42 | ## Deployment 43 | 44 | **Do not deploy directly from this repository** 45 | 46 | 1. Fork this this repository. 47 | 2. Click Setting on fork repository page and check Template repository. 48 | 3. Click new button: Use this template,create a new repository。 49 | 4. For example, your Github username is bobby, and the new repository name is green. After logging in to heroku, visit to deploy. 50 | 5. Detailed explanation of RCLONE_AUTO_MODE env: 51 | dummy: Do nothing,move: Move files to local finished folder after Aria2 download & seeding completed. 52 | move_remote: Move files to local finished folder after Aria2 download & seeding completed,then move to Rclone remote storage. 53 | move_remote_only: Move files to Rclone remote storage after Aria2 download & seeding completed. 54 | copy_remote_first: Copy files to Rclone remote storage after Aria2 download completed, triggered before seeding for bittorrent tasks. 55 | copy_remote: Copy files to Rclone remote storage after Aria2 download & seeding completed. 56 | custom: set Aria2 Event Hook options in aria2 configure file by yourself. 57 | Under move_remote & move_remote_only modes, videos downloaded by mutube and dlpr command will be moved to Rclone remote storage. 58 | Under copy_remote & copy_remote_first modes, videos downloaded by mutube and dlpr command will be copied to Rclone remote storage. 59 | 60 | ## First run 61 | 62 | 1. After deployment, for example, your heroku domain name is bobby.herokuapp.com, the portal page path is /portal, then visit bobby.herokuapp.com/portal to reach the portal page. 63 | 2. Click AriaNg, then authentication failure warning will pop up, fill in Aria2 secret RPC token with password set during deployment. 64 | 65 | ![image](https://user-images.githubusercontent.com/98247050/165651080-b1b79ba6-7cc0-4c7c-b65b-fbc4256f59f9.png) 66 | 67 | 3. yt-dlp command can be executed through ttyd web terminal,for more information: 68 | Built-in alias: 69 | dlpr:Use yt-dlp to download videos to videos folder, then send task to Rclone after downloads completed. 70 | 4. Rclone Webdav address: your_Heroku_domain/${GLOBLA_PORTAL_PATH}/rclonedav 71 | 72 | ## More usages and precautions 73 | 74 | 1. Hit shift+F5 to force refresh if web services don't work properly. If app still doesn't work, clear cache and cookie of your heroku domain from browser. 75 | 2. Heroku has ephemeral filesystem,although configuration files are automatically back up to Rclone remote and attempted to be restored after dyno restarted, any changes other than Config Vars are recommended to be modified in the github repository before deployment. 76 | 3. How to modify Heroku Config Vars: Click setting on Heroku app page, then click Reveal Config Vars to modify. 77 | 4. Add the following content to the end of the Rclone config file, you can add local heroku storage in Rclone Web UI for manual upload. 78 | 79 | ``` 80 | [local] 81 | type = alias 82 | remote = /mnt/data 83 | ``` 84 | 85 | 4. It is not possible to configure a Rclone remote which requires web authentication through Rclone web UI in this app. 86 | 5. Rclone may fail to upload some videos with special characters in title, add following in the YTDL_OPTIONS env: "restrictfilenames":true 87 | 6. Under content/aria2 directory in repository, aria2_en.conf is Aria2 config file, script.conf is Aria2 Event Hook config file which controls Aria2 auto-cleanup settings and Rclone auto-upload directory. 88 | 7. BT tracker list is auto-updated each time dyno restarted, rename or delete /content/aria2/tracker.sh file to disable this function. 89 | 8. Portal page config file homer_en.yml and icon resources are under content/homer_conf directory in repository, use path as ./assets/tools/example.png to add the new icon to homer config file. 90 | 9. Vmess proxy protocol: AlterID is 0, you can connect to either Vmess WS port 80 or Vmess WS tls port 443. Xray settings can be modified via content/service/xray/run file in repository. Heroku is difficult to connect in Mainland China. 91 | Example client setting: 92 | ![image](https://user-images.githubusercontent.com/98247050/165655041-9fe1bada-be23-48f1-bcb3-57288e998035.png) 93 | With tls: 94 | ![image](https://user-images.githubusercontent.com/98247050/165655141-76846405-595d-4197-b020-e29d71e1f12c.png) 95 | -------------------------------------------------------------------------------- /content/aria2/core: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:core 4 | # Description: Aria2 additional function script core file 5 | # Version: 3.3 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # Permission is hereby granted, free of charge, to any person obtaining a copy 10 | # of this software and associated documentation files (the "Software"), to deal 11 | # in the Software without restriction, including without limitation the rights 12 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | # copies of the Software, and to permit persons to whom the Software is 14 | # furnished to do so, subject to the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included in all 17 | # copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | # SOFTWARE. 26 | # 27 | # Modified by wy580477 for customized container 28 | # 29 | 30 | TASK_GID=$1 31 | FILE_NUM=$2 32 | FILE_PATH=$3 33 | ARIA2_CONF_DIR="$(dirname $0)" 34 | ARIA2_CONF="/mnt/data/config/aria2.conf" 35 | ARIA2_SESSION="/.aria2allinoneworkdir/aria2/aria2.session" 36 | SCRIPT_CONF="/mnt/data/config/script.conf" 37 | RED_FONT_PREFIX="\033[31m" 38 | LIGHT_GREEN_FONT_PREFIX="\033[1;32m" 39 | YELLOW_FONT_PREFIX="\033[1;33m" 40 | LIGHT_PURPLE_FONT_PREFIX="\033[1;35m" 41 | FONT_COLOR_SUFFIX="\033[0m" 42 | INFO="[${LIGHT_GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" 43 | ERROR="[${RED_FONT_PREFIX}ERROR${FONT_COLOR_SUFFIX}]" 44 | WARNING="[${YELLOW_FONT_PREFIX}WARNING${FONT_COLOR_SUFFIX}]" 45 | 46 | DATE_TIME() { 47 | date +"%m/%d %H:%M:%S" 48 | } 49 | 50 | CHECK_PARAMETER() { 51 | [[ $# -eq 0 ]] && { 52 | echo && echo -e "${ERROR} This script can only be used by passing parameters through Aria2." 53 | exit 1 54 | } 55 | } 56 | 57 | CHECK_FILE_NUM() { 58 | [[ ${FILE_NUM} -eq 0 ]] && { 59 | echo && echo -e "$(DATE_TIME) ${WARRING} Number of files is zero, maybe a Magnet Link." 60 | exit 0 61 | } 62 | } 63 | 64 | CHECK_SCRIPT_CONF() { 65 | if [[ -f "${SCRIPT_CONF}" ]]; then 66 | LOAD_SCRIPT_CONF 67 | else 68 | echo && echo "!!! '${SCRIPT_CONF}' does not exist !!!" 69 | exit 1 70 | fi 71 | } 72 | 73 | LOAD_SCRIPT_CONF() { 74 | DRIVE_NAME="$(grep ^drive-name "${SCRIPT_CONF}" | cut -d= -f2-)" 75 | DRIVE_DIR="$(grep ^drive-dir "${SCRIPT_CONF}" | cut -d= -f2-)" 76 | UPLOAD_LOG_PATH="$(grep ^upload-log "${SCRIPT_CONF}" | cut -d= -f2-)" 77 | DEST_DIR="$(grep ^dest-dir "${SCRIPT_CONF}" | cut -d= -f2-)" 78 | MOVE_LOG_PATH="$(grep ^move-log "${SCRIPT_CONF}" | cut -d= -f2-)" 79 | DELETE_ON_REMOVED="$(grep ^delete-on-removed "${SCRIPT_CONF}" | cut -d= -f2-)" 80 | DELETE_ON_ERROR="$(grep ^delete-on-error "${SCRIPT_CONF}" | cut -d= -f2-)" 81 | DELETE_ON_UNKNOWN="$(grep ^delete-on-unknown "${SCRIPT_CONF}" | cut -d= -f2-)" 82 | DELETE_DOT_ARIA2="$(grep ^delete-dot-aria2 "${SCRIPT_CONF}" | cut -d= -f2-)" 83 | DELETE_DOT_TORRENT="$(grep ^delete-dot-torrent "${SCRIPT_CONF}" | cut -d= -f2-)" 84 | DELETE_EMPTY_DIR="$(grep ^delete-empty-dir "${SCRIPT_CONF}" | cut -d= -f2-)" 85 | MIN_SIZE="$(grep ^min-size "${SCRIPT_CONF}" | cut -d= -f2-)" 86 | INCLUDE_FILE="$(grep ^include-file "${SCRIPT_CONF}" | cut -d= -f2-)" 87 | EXCLUDE_FILE="$(grep ^exclude-file "${SCRIPT_CONF}" | cut -d= -f2-)" 88 | INCLUDE_FILE_REGEX="$(grep ^include-file-regex "${SCRIPT_CONF}" | cut -d= -f2-)" 89 | EXCLUDE_FILE_REGEX="$(grep ^exclude-file-regex "${SCRIPT_CONF}" | cut -d= -f2-)" 90 | } 91 | 92 | READ_ARIA2_CONF() { 93 | if [ ! -f "${ARIA2_CONF}" ]; then 94 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_CONF}' does not exist." 95 | exit 1 96 | else 97 | ARIA2_DOWNLOAD_DIR=$(grep ^dir "${ARIA2_CONF}" | cut -d= -f2-) 98 | RPC_PORT=61800 99 | RPC_SECRET=$(grep ^rpc-secret "${ARIA2_CONF}" | cut -d= -f2-) 100 | SAVE_SESSION_INTERVAL=$(grep ^save-session-interval "${ARIA2_CONF}" | cut -d= -f2-) 101 | [[ ${ARIA2_DOWNLOAD_DIR} && ${RPC_PORT} && ${SAVE_SESSION_INTERVAL} ]] || { 102 | echo -e "$(DATE_TIME) ${ERROR} Aria2 configuration file incomplete." 103 | exit 1 104 | } 105 | RPC_ADDRESS="localhost:${RPC_PORT}/jsonrpc" 106 | fi 107 | } 108 | 109 | RPC_TASK_INFO() { 110 | if [[ "${RPC_SECRET}" ]]; then 111 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.tellStatus","id":"P3TERX","params":["token:'"${GLOBAL_PASSWORD}"'","'${TASK_GID}'"]}' 112 | else 113 | RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.tellStatus","id":"P3TERX","params":["token:'"${GLOBAL_PASSWORD}"'","'${TASK_GID}'"]}' 114 | fi 115 | curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}" 116 | } 117 | 118 | GET_TASK_INFO() { 119 | READ_ARIA2_CONF 120 | RPC_RESULT="$(RPC_TASK_INFO)" 121 | } 122 | 123 | GET_DOWNLOAD_DIR() { 124 | [[ -z ${RPC_RESULT} ]] && { 125 | echo -e "$(DATE_TIME) ${ERROR} Aria2 RPC interface error!" 126 | exit 1 127 | } 128 | DOWNLOAD_DIR=$(echo "${RPC_RESULT}" | jq -r '.result.dir') 129 | [[ -z "${DOWNLOAD_DIR}" || "${DOWNLOAD_DIR}" = "null" ]] && { 130 | echo ${RPC_RESULT} | jq '.result' 131 | echo -e "$(DATE_TIME) ${ERROR} Failed to get download directory!" 132 | exit 1 133 | } 134 | } 135 | 136 | GET_TASK_STATUS() { 137 | TASK_STATUS=$(echo "${RPC_RESULT}" | jq -r '.result.status') 138 | [[ -z "${TASK_STATUS}" || "${TASK_STATUS}" = "null" ]] && { 139 | echo "${RPC_RESULT}" | jq '.result' 140 | echo -e "$(DATE_TIME) ${ERROR} Failed to get task status!" 141 | exit 1 142 | } 143 | } 144 | 145 | GET_INFO_HASH() { 146 | INFO_HASH=$(echo "${RPC_RESULT}" | jq -r '.result.infoHash') 147 | if [[ -z "${INFO_HASH}" ]]; then 148 | echo "${RPC_RESULT}" | jq '.result' 149 | echo -e "$(DATE_TIME) ${ERROR} Failed to get Info Hash!" 150 | exit 1 151 | elif [[ "${INFO_HASH}" = "null" ]]; then 152 | return 1 153 | else 154 | TORRENT_FILE="${DOWNLOAD_DIR}/${INFO_HASH}.torrent" 155 | fi 156 | } 157 | 158 | CONVERSION_PATH() { 159 | RELATIVE_PATH="${FILE_PATH#"${DOWNLOAD_DIR}/"}" 160 | TASK_FILE_NAME="${RELATIVE_PATH%%/*}" 161 | TASK_PATH="${DOWNLOAD_DIR}/${TASK_FILE_NAME}" 162 | DEST_PATH_SUFFIX="${TASK_PATH#"${ARIA2_DOWNLOAD_DIR}"}" 163 | } 164 | 165 | OUTPUT_LOG() { 166 | echo -e "${LOG}" 167 | [[ "${LOG_PATH}" && -e "${LOG_PATH%/*}" ]] && echo -e "${LOG}" | sed "s,\x1B\[[0-9;]*m,,g" >>"${LOG_PATH}" 168 | } 169 | 170 | CHECK_DOT_ARIA2() { 171 | if [ -f "${FILE_PATH}.aria2" ]; then 172 | DOT_ARIA2_FILE="${FILE_PATH}.aria2" 173 | elif [ -f "${TASK_PATH}.aria2" ]; then 174 | DOT_ARIA2_FILE="${TASK_PATH}.aria2" 175 | else 176 | DOT_ARIA2_FILE='null' 177 | echo -e "$(DATE_TIME) ${INFO} .aria2 file does not exist." 178 | return 1 179 | fi 180 | } 181 | 182 | DELETE_DOT_ARIA2() { 183 | if [[ "${DELETE_DOT_ARIA2}" = "true" ]] && CHECK_DOT_ARIA2; then 184 | echo -e "$(DATE_TIME) ${INFO} Deleting .aria2 file ..." 185 | rm -vf "${DOT_ARIA2_FILE}" 186 | fi 187 | } 188 | 189 | DELETE_TORRENT_FILES() { 190 | sleep $(($SAVE_SESSION_INTERVAL + 1)) 191 | TORRENT_FILES=$(ls "${DOWNLOAD_DIR}" | grep '.*.torrent') 192 | if [[ -f "${ARIA2_SESSION}" && -n "${TORRENT_FILES}" ]]; then 193 | for TORRENT_FILE in "${TORRENT_FILES}"; do 194 | if [[ -n "${TORRENT_FILE}" && -z $(cat "${ARIA2_SESSION}" | grep -i "${TORRENT_FILE%.*}") ]]; then 195 | echo -e "$(DATE_TIME) ${INFO} Deleting .torrent file (enhanced) ..." 196 | rm -vf ${DOWNLOAD_DIR}/${TORRENT_FILE} 197 | fi 198 | done 199 | else 200 | [[ ! -f "${ARIA2_SESSION}" ]] && 201 | echo -e "$(DATE_TIME) ${ERROR} '${ARIA2_SESSION}' does not exist." || 202 | echo -e "$(DATE_TIME) ${WARRING} .torrent file does not exist." 203 | fi 204 | } 205 | 206 | DELETE_DOT_TORRENT() { 207 | if GET_INFO_HASH; then 208 | if [[ "${DELETE_DOT_TORRENT}" = "true" || "${DELETE_DOT_TORRENT}" = "normal" ]] && [[ -f "${TORRENT_FILE}" ]]; then 209 | echo -e "$(DATE_TIME) ${INFO} Deleting .torrent file ..." 210 | rm -vf ${TORRENT_FILE} 211 | elif [[ "${DELETE_DOT_TORRENT}" = "true" || "${DELETE_DOT_TORRENT}" = "enhanced" ]]; then 212 | DELETE_TORRENT_FILES 213 | elif [[ "${DELETE_DOT_TORRENT}" = "normal" ]]; then 214 | echo -e "$(DATE_TIME) ${WARRING} .torrent file may exist but cannot be found. Recommended to enable enhanced mode." 215 | else 216 | echo -e "$(DATE_TIME) ${INFO} Delete .torrent file function is disabled." 217 | fi 218 | else 219 | echo -e "$(DATE_TIME) ${INFO} General download task, skipped delete .torrent file." 220 | fi 221 | } 222 | 223 | DELETE_EMPTY_DIR() { 224 | if [[ "${DELETE_EMPTY_DIR}" = "true" ]]; then 225 | echo -e "$(DATE_TIME) ${INFO} Deleting empty directory ..." 226 | # if [[ "${DOWNLOAD_DIR}" =~ "${ARIA2_DOWNLOAD_DIR}" ]]; then 227 | # find "${ARIA2_DOWNLOAD_DIR}" ! -path "${ARIA2_DOWNLOAD_DIR}" -depth -type d -empty -exec rm -vrf {} \; 228 | # else 229 | find /mnt/data/downloads -depth -mindepth 1 -type d -empty -exec rm -vrf {} \; 2>/dev/null 230 | find /mnt/data/finished -depth -mindepth 1 -type d -empty -exec rm -vrf {} \; 2>/dev/null 231 | # fi 232 | fi 233 | } 234 | 235 | DELETE_EXCLUDE_FILE() { 236 | if [[ ${FILE_NUM} -gt 1 ]] && [[ -n ${MIN_SIZE} || -n ${INCLUDE_FILE} || -n ${EXCLUDE_FILE} || -n ${EXCLUDE_FILE_REGEX} || -n ${INCLUDE_FILE_REGEX} ]]; then 237 | echo -e "${INFO} Deleting excluded files ..." 238 | [[ -n ${MIN_SIZE} ]] && find "${TASK_PATH}" -type f -size -${MIN_SIZE} -print0 | xargs -0 rm -vf 239 | [[ -n ${EXCLUDE_FILE} ]] && find "${TASK_PATH}" -type f -regextype posix-extended -iregex ".*\.(${EXCLUDE_FILE})" -print0 | xargs -0 rm -vf 240 | [[ -n ${INCLUDE_FILE} ]] && find "${TASK_PATH}" -type f -regextype posix-extended ! -iregex ".*\.(${INCLUDE_FILE})" -print0 | xargs -0 rm -vf 241 | [[ -n ${EXCLUDE_FILE_REGEX} ]] && find "${TASK_PATH}" -type f -regextype posix-extended -iregex "${EXCLUDE_FILE_REGEX}" -print0 | xargs -0 rm -vf 242 | [[ -n ${INCLUDE_FILE_REGEX} ]] && find "${TASK_PATH}" -type f -regextype posix-extended ! -iregex "${INCLUDE_FILE_REGEX}" -print0 | xargs -0 rm -vf 243 | fi 244 | } 245 | 246 | CLEAN_UP() { 247 | DELETE_DOT_ARIA2 248 | DELETE_DOT_TORRENT 249 | DELETE_EXCLUDE_FILE 250 | DELETE_EMPTY_DIR 251 | } 252 | -------------------------------------------------------------------------------- /content/aria2/aria2_chs.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:aria2.conf 4 | # Description: Awesome Aria2 configuration file 5 | # Version: 2021.09.15 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # This is free software, licensed under the MIT License. 10 | # See /LICENSE for more informationo 11 | # 12 | # Modified by wy580477 for customized container 13 | # . 14 | 15 | 16 | ## 文件保存设置 ## 17 | 18 | # 下载目录。可使用绝对路径或相对路径, 默认: 当前启动位置。 勿修改此项设置。 19 | dir=/mnt/data/downloads 20 | 21 | # 磁盘缓存, 0 为禁用缓存,默认:16M 22 | # 磁盘缓存的作用是把下载的数据块临时存储在内存中,然后集中写入硬盘,以减少磁盘 I/O ,提升读写性能,延长硬盘寿命。 23 | # 建议在有足够的内存空闲情况下适当增加,但不要超过剩余可用内存空间大小。 24 | # 此项值仅决定上限,实际对内存的占用取决于网速(带宽)和设备性能等其它因素。 25 | disk-cache=16M 26 | 27 | # 文件预分配方式, 可选:none, prealloc, trunc, falloc, 默认:prealloc 28 | # 预分配对于机械硬盘可有效降低磁盘碎片、提升磁盘读写性能、延长磁盘寿命。 29 | # 机械硬盘使用 ext4(具有扩展支持),btrfs,xfs 或 NTFS(仅 MinGW 编译版本)等文件系统建议设置为 falloc 30 | # 若无法下载,提示 fallocate failed.cause:Operation not supported 则说明不支持,请设置为 none 31 | # prealloc 分配速度慢, trunc 无实际作用,不推荐使用。 32 | # 固态硬盘不需要预分配,只建议设置为 none ,否则可能会导致双倍文件大小的数据写入,从而影响寿命。 33 | # 所需时间 none < falloc ? trunc « prealloc, falloc和trunc需要文件系统和内核支持 34 | file-allocation=falloc 35 | 36 | # 文件预分配大小限制。小于此选项值大小的文件不预分配空间,单位 K 或 M,默认:5M 37 | no-file-allocation-limit=64M 38 | 39 | # 断点续传 40 | continue=true 41 | 42 | # 始终尝试断点续传,无法断点续传则终止下载,默认:true 43 | always-resume=false 44 | 45 | # 不支持断点续传的 URI 数值,当 always-resume=false 时生效。 46 | # 达到这个数值从将头开始下载,值为 0 时所有 URI 不支持断点续传时才从头开始下载。 47 | max-resume-failure-tries=0 48 | 49 | # 获取服务器文件时间,默认:false 50 | remote-time=true 51 | 52 | 53 | ## 进度保存设置 ## 54 | 55 | # 从会话文件中读取下载任务 56 | input-file=/.aria2allinoneworkdir/aria2/aria2.session 57 | 58 | # 会话文件保存路径,勿修改。 59 | # 在Aria2退出时保存`错误/未完成`的下载任务到会话文件 60 | save-session=/.aria2allinoneworkdir/aria2/aria2.session 61 | 62 | # 任务状态改变后保存会话的间隔时间(秒), 0 为仅在进程正常退出时保存, 默认:0 63 | # 为了及时保存任务状态、防止任务丢失,此项值只建议设置为 1 64 | save-session-interval=1 65 | 66 | # 自动保存任务进度到控制文件(*.aria2)的间隔时间(秒),0 为仅在进程正常退出时保存,默认:60 67 | # 此项值也会间接影响从内存中把缓存的数据写入磁盘的频率 68 | # 想降低磁盘 IOPS (每秒读写次数)则提高间隔时间 69 | # 想在意外非正常退出时尽量保存更多的下载进度则降低间隔时间 70 | # 非正常退出:进程崩溃、系统崩溃、SIGKILL 信号、设备断电等 71 | auto-save-interval=5 72 | 73 | # 强制保存,即使任务已完成也保存信息到会话文件, 默认:false 74 | # 开启后会在任务完成后保留 .aria2 文件,文件被移除且任务存在的情况下重启后会重新下载。 75 | # 关闭后已完成的任务列表会在重启后清空。 76 | force-save=false 77 | 78 | 79 | ## 下载连接设置 ## 80 | 81 | # 文件未找到重试次数,默认:0 (禁用) 82 | # 重试时同时会记录重试次数,所以也需要设置 max-tries 这个选项 83 | max-file-not-found=10 84 | 85 | # 最大尝试次数,0 表示无限,默认:5 86 | max-tries=0 87 | 88 | # 重试等待时间(秒), 默认:0 (禁用) 89 | retry-wait=10 90 | 91 | # 连接超时时间(秒)。默认:60 92 | connect-timeout=10 93 | 94 | # 超时时间(秒)。默认:60 95 | timeout=10 96 | 97 | # 最大同时下载任务数, 运行时可修改, 默认:5 98 | max-concurrent-downloads=10 99 | 100 | # 单服务器最大连接线程数, 任务添加时可指定, 默认:1 101 | # 最大值为 16, 且受限于单任务最大连接线程数(split)所设定的值。 102 | max-connection-per-server=16 103 | 104 | # 单任务最大连接线程数, 任务添加时可指定, 默认:5 105 | split=64 106 | 107 | # 文件最小分段大小, 添加时可指定, 取值范围 1M-1024M (增强版最小值为 1K), 默认:20M 108 | # 比如此项值为 10M, 当文件为 20MB 会分成两段并使用两个来源下载, 文件为 15MB 则只使用一个来源下载。 109 | # 理论上值越小使用下载分段就越多,所能获得的实际线程数就越大,下载速度就越快,但受限于所下载文件服务器的策略。 110 | min-split-size=4M 111 | 112 | # HTTP/FTP 下载分片大小,所有分割都必须是此项值的倍数,最小值为 1M (增强版为 1K),默认:1M 113 | piece-length=1M 114 | 115 | # 允许分片大小变化。默认:false 116 | # false:当分片大小与控制文件中的不同时将会中止下载 117 | # true:丢失部分下载进度继续下载 118 | allow-piece-length-change=true 119 | 120 | # 最低下载速度限制。当下载速度低于或等于此选项的值时关闭连接,此选项与 BT 下载无关。单位 K 或 M ,默认:0 (无限制) 121 | lowest-speed-limit=0 122 | 123 | # 全局最大下载速度限制, 运行时可修改, 默认:0 (无限制) 124 | max-overall-download-limit=5M 125 | 126 | # 单任务下载速度限制, 默认:0 (无限制) 127 | max-download-limit=0 128 | 129 | # 禁用 IPv6, 默认:false. Heroku无ipv6网络,勿修改此项。 130 | disable-ipv6=true 131 | 132 | # GZip 支持,默认:false 133 | http-accept-gzip=true 134 | 135 | # URI 复用,默认: true 136 | reuse-uri=false 137 | 138 | # 禁用 netrc 支持,默认:false 139 | no-netrc=true 140 | 141 | # 允许覆盖,当相关控制文件(.aria2)不存在时从头开始重新下载。默认:false 142 | allow-overwrite=false 143 | 144 | # 文件自动重命名,此选项仅在 HTTP(S)/FTP 下载中有效。新文件名在名称之后扩展名之前加上一个点和一个数字(1..9999)。默认:true 145 | auto-file-renaming=true 146 | 147 | # 使用 UTF-8 处理 Content-Disposition ,默认:false 148 | content-disposition-default-utf8=true 149 | 150 | # 最低 TLS 版本,可选:TLSv1.1、TLSv1.2、TLSv1.3 默认:TLSv1.2 151 | #min-tls-version=TLSv1.2 152 | 153 | 154 | ## BT/PT 下载设置 ## 155 | 156 | # BT 监听端口(TCP), 默认:6881-6999 157 | # Heroku只有nat网络,此项设置没有实际意义。 158 | listen-port=60500-61500 159 | 160 | # DHT 网络与 UDP tracker 监听端口(UDP), 默认:6881-6999 161 | # Heroku只有nat网络,此项设置没有实际意义。 162 | dht-listen-port=60500-61500 163 | 164 | # 启用 IPv4 DHT 功能, PT 下载(私有种子)会自动禁用, 默认:true 165 | enable-dht=true 166 | 167 | # 启用 IPv6 DHT 功能, PT 下载(私有种子)会自动禁用,默认:false 168 | # 在没有 IPv6 支持的环境开启可能会导致 DHT 功能异常 169 | # Heroku无ipv6网络,勿修改此项。 170 | enable-dht6=false 171 | 172 | # 指定 BT 和 DHT 网络中的 IP 地址 173 | # 使用场景:在家庭宽带没有公网 IP 的情况下可以把 BT 和 DHT 监听端口转发至具有公网 IP 的服务器,在此填写服务器的 IP ,可以提升 BT 下载速率。 174 | #bt-external-ip= 175 | 176 | # IPv4 DHT 文件路径,默认:$HOME/.aria2/dht.dat 177 | dht-file-path=/.aria2allinoneworkdir/aria2/dht.dat 178 | 179 | # IPv4 DHT 网络引导节点 180 | dht-entry-point=dht.transmissionbt.com:6881 181 | 182 | # 本地节点发现, PT 下载(私有种子)会自动禁用 默认:false 183 | bt-enable-lpd=false 184 | 185 | # 指定用于本地节点发现的接口,可能的值:接口,IP地址 186 | # 如果未指定此选项,则选择默认接口。 187 | #bt-lpd-interface= 188 | 189 | # 启用节点交换, PT 下载(私有种子)会自动禁用, 默认:true 190 | enable-peer-exchange=true 191 | 192 | # BT 下载最大连接数(单任务),运行时可修改。0 为不限制,默认:55 193 | # 理想情况下连接数越多下载越快,但在实际情况是只有少部分连接到的做种者上传速度快,其余的上传慢或者不上传。 194 | # 如果不限制,当下载非常热门的种子或任务数非常多时可能会因连接数过多导致进程崩溃或网络阻塞。 195 | # 进程崩溃:如果设备 CPU 性能一般,连接数过多导致 CPU 占用过高,因资源不足 Aria2 进程会强制被终结。 196 | # 网络阻塞:在内网环境下,即使下载没有占满带宽也会导致其它设备无法正常上网。因远古低性能路由器的转发性能瓶颈导致。 197 | #bt-max-peers= 198 | 199 | # BT 下载期望速度值(单任务),运行时可修改。单位 K 或 M 。默认:50K 200 | # BT 下载速度低于此选项值时会临时提高连接数来获得更快的下载速度,不过前提是有更多的做种者可供连接。 201 | # 实测临时提高连接数没有上限,但不会像不做限制一样无限增加,会根据算法进行合理的动态调节。 202 | #bt-request-peer-speed-limit= 203 | 204 | # 全局最大上传速度限制, 运行时可修改, 默认:0 (无限制) 205 | # 设置过低可能影响 BT 下载速度 206 | max-overall-upload-limit=5M 207 | 208 | # 单任务上传速度限制, 默认:0 (无限制) 209 | max-upload-limit=0 210 | 211 | # 最小分享率。当种子的分享率达到此选项设置的值时停止做种, 0 为一直做种, 默认:1.0 212 | # 强烈建议您将此选项设置为大于等于 1.0 213 | seed-ratio=1.0 214 | 215 | # 最小做种时间(分钟)。设置为 0 时将在 BT 任务下载完成后停止做种。 216 | seed-time=0 217 | 218 | # 做种前检查文件哈希, 默认:true 219 | bt-hash-check-seed=true 220 | 221 | # 继续之前的BT任务时, 无需再次校验, 默认:false 222 | bt-seed-unverified=false 223 | 224 | # BT tracker 服务器连接超时时间(秒)。默认:60 225 | # 建立连接后,此选项无效,将使用 bt-tracker-timeout 选项的值 226 | bt-tracker-connect-timeout=10 227 | 228 | # BT tracker 服务器超时时间(秒)。默认:60 229 | bt-tracker-timeout=10 230 | 231 | # BT 服务器连接间隔时间(秒)。默认:0 (自动) 232 | #bt-tracker-interval=0 233 | 234 | # BT 下载优先下载文件开头或结尾 235 | bt-prioritize-piece=head=32M,tail=32M 236 | 237 | # 保存通过 WebUI(RPC) 上传的种子文件(.torrent),默认:true 238 | # 所有涉及种子文件保存的选项都建议开启,不保存种子文件有任务丢失的风险。 239 | # 通过 RPC 自定义临时下载目录可能不会保存种子文件。 240 | rpc-save-upload-metadata=true 241 | 242 | # 下载种子文件(.torrent)自动开始下载, 默认:true,可选:false|mem 243 | # true:保存种子文件 244 | # false:仅下载种子文件 245 | # mem:将种子保存在内存中 246 | follow-torrent=true 247 | 248 | # 种子文件下载完后暂停任务,默认:false 249 | # 在开启 follow-torrent 选项后下载种子文件或磁力会自动开始下载任务进行下载,而同时开启当此选项后会建立相关任务并暂停。 250 | pause-metadata=false 251 | 252 | # 保存磁力链接元数据为种子文件(.torrent), 默认:false 253 | bt-save-metadata=true 254 | 255 | # 加载已保存的元数据文件(.torrent),默认:false 256 | bt-load-saved-metadata=true 257 | 258 | # 删除 BT 下载任务中未选择文件,默认:false 259 | bt-remove-unselected-file=true 260 | 261 | # BT强制加密, 默认: false 262 | # 启用后将拒绝旧的 BT 握手协议并仅使用混淆握手及加密。可以解决部分运营商对 BT 下载的封锁,且有一定的防版权投诉与迅雷吸血效果。 263 | # 此选项相当于后面两个选项(bt-require-crypto=true, bt-min-crypto-level=arc4)的快捷开启方式,但不会修改这两个选项的值。 264 | bt-force-encryption=true 265 | 266 | # BT加密需求,默认:false 267 | # 启用后拒绝与旧的 BitTorrent 握手协议(\19BitTorrent protocol)建立连接,始终使用混淆处理握手。 268 | #bt-require-crypto=true 269 | 270 | # BT最低加密等级,可选:plain(明文),arc4(加密),默认:plain 271 | #bt-min-crypto-level=arc4 272 | 273 | # 分离仅做种任务,默认:false 274 | # 从正在下载的任务中排除已经下载完成且正在做种的任务,并开始等待列表中的下一个任务。 275 | bt-detach-seed-only=true 276 | 277 | 278 | ## 客户端伪装 ## 279 | 280 | # 自定义 User Agent 281 | #user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47 282 | user-agent=Deluge 1.3.15 283 | 284 | # BT 客户端伪装 285 | # PT 下载需要保持 user-agent 和 peer-agent 两个参数一致 286 | # 部分 PT 站对 Aria2 有特殊封禁机制,客户端伪装不一定有效,且有封禁账号的风险。 287 | peer-agent=Deluge 1.3.15 288 | peer-id-prefix=-DE13F0- 289 | 290 | 291 | ## RPC 设置 ## 292 | 293 | # 启用 JSON-RPC/XML-RPC 服务器, 默认:false 294 | enable-rpc=true 295 | 296 | # 接受所有远程请求,web界面跨域授权需要,默认:false 297 | rpc-allow-origin-all=true 298 | 299 | # 允许外部访问, false的话只监听本地端口,默认:false 300 | rpc-listen-all=false 301 | 302 | # RPC 监听端口, 勿修改 303 | rpc-listen-port=56800 304 | 305 | # RPC 密钥 306 | # 此项由容器变量控制,勿修改。 307 | rpc-secret=PASSWORD 308 | 309 | # RPC 最大请求大小 310 | rpc-max-request-size=10M 311 | 312 | # RPC 服务 SSL/TLS 加密, 默认:false 313 | # 启用加密后必须使用 https 或者 wss 协议连接 314 | # 不推荐开启,建议使用 web server 反向代理,比如 Nginx、Caddy ,灵活性更强。 315 | # 勿修改此选项。 316 | #rpc-secure=false 317 | 318 | # 在 RPC 服务中启用 SSL/TLS 加密时的证书文件(.pem/.crt) 319 | #rpc-certificate=/root/.aria2/xxx.pem 320 | 321 | # 在 RPC 服务中启用 SSL/TLS 加密时的私钥文件(.key) 322 | #rpc-private-key=/root/.aria2/xxx.key 323 | 324 | # 事件轮询方式, 可选:epoll, kqueue, port, poll, select, 不同系统默认值不同 325 | #event-poll=select 326 | 327 | 328 | ## 高级选项 ## 329 | 330 | # 启用异步 DNS 功能。默认:true 331 | async-dns=true 332 | 333 | # 指定异步 DNS 服务器列表,未指定则从 /etc/resolv.conf 中读取。 334 | async-dns-server=8.8.8.8,1.1.1.1 335 | 336 | enable-mmap=true 337 | 338 | # 指定单个网络接口,可能的值:接口,IP地址,主机名 339 | # 如果接口具有多个 IP 地址,则建议指定 IP 地址。 340 | # 已知指定网络接口会影响依赖本地 RPC 的连接的功能场景,即通过 localhost 和 127.0.0.1 无法与 Aria2 服务端进行讯通。 341 | #interface= 342 | 343 | # 指定多个网络接口,多个值之间使用逗号(,)分隔。 344 | # 使用 interface 选项时会忽略此项。 345 | #multiple-interface= 346 | 347 | 348 | ## 日志设置 ## 349 | 350 | # 日志文件保存路径,忽略或设置为空为不保存,默认:不保存 351 | #log= 352 | 353 | # 日志级别,可选 debug, info, notice, warn, error 。默认:debug 354 | #log-level=notice 355 | 356 | # 控制台日志级别,可选 debug, info, notice, warn, error ,默认:notice 357 | console-log-level=notice 358 | 359 | # 安静模式,禁止在控制台输出日志,默认:false 360 | quiet=false 361 | 362 | show-console-readout=false 363 | 364 | # 下载进度摘要输出间隔时间(秒),0 为禁止输出。默认:60 365 | summary-interval=0 366 | 367 | 368 | ## 执行额外命令 ## 369 | 370 | # 下载停止后执行的命令 371 | # 从 正在下载 到 删除、错误、完成 时触发。暂停被标记为未开始下载,故与此项无关。 372 | on-download-stop=/.aria2allinoneworkdir/aria2/delete.sh 373 | 374 | # 下载完成后执行的命令 375 | # 此项未定义则执行 下载停止后执行的命令 (on-download-stop) 376 | # 此项由容器变量控制,除custom自定义外,勿修改。 377 | on-download-complete=/.aria2allinoneworkdir/aria2/POSTMODE.sh 378 | 379 | # 下载错误后执行的命令 380 | # 此项未定义则执行 下载停止后执行的命令 (on-download-stop) 381 | #on-download-error= 382 | 383 | # 下载暂停后执行的命令 384 | #on-download-pause= 385 | 386 | # 下载开始后执行的命令 387 | #on-download-start= 388 | 389 | # BT 下载完成后执行的命令,BT 下载完成后做种前执行的命令 390 | # 此项由容器变量控制,除custom自定义模式外,勿修改。 391 | on-bt-download-complete=/.aria2allinoneworkdir/aria2/POSTMODE.sh 392 | 393 | 394 | # BT trackers 395 | bt-tracker=http://1337.abcvg.info:80/announce,http://207.241.226.111:6969/announce,http://207.241.231.226:6969/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://bt.okmp3.ru:2710/announce,http://buny.uk:6969/announce,http://fxtt.ru:80/announce,http://milanesitracker.tekcities.com:80/announce,http://nyaa.tracker.wf:7777/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.tracker.ink:6969/announce,http://opentracker.i2p.rocks:6969/announce,http://opentracker.xyz:80/announce,http://p4p.arenabg.com:1337/announce,http://retracker.hotplug.ru:2710/announce,http://share.camoe.cn:8080/announce,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t.publictracker.xyz:6969/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bt4g.com:2095/announce,http://tracker.dler.org:6969/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.lelux.fi:80/announce,http://tracker.loadbt.com:6969/announce,http://tracker.merded.xyz:8000/announce,http://tracker.mywaifu.best:6969/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker2.dler.org:80/announce,http://vps02.net.orel.ru:80/announce,https://1337.abcvg.info:443/announce,https://abir0dev.github.io:443/announce,https://carbon-bonsai-621.appspot.com:443/announce,https://chihaya-heroku.120181311.xyz:443/announce,https://opentracker.cc:443/announce,https://opentracker.i2p.rocks:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.abiir.top:443/announce,https://tr.abir.ga:443/announce,https://tr.abirxo.cf:443/announce,https://tr.burnabyhighstar.com:443/announce,https://tr.doogh.club:443/announce,https://tr.fuckbitcoin.xyz:443/announce,https://tr.highstar.shop:443/announce,https://tr.ready4.icu:443/announce,https://tr.torland.ga:443/announce,https://tracker.babico.name.tr:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.iriseden.fr:443/announce,https://tracker.kuroy.me:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.lilithraws.org:443/announce,https://tracker.moeblog.cn:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.yarr.pt:443/announce,https://trackme.theom.nz:443/announce,udp://207.241.226.111:6969/announce,udp://207.241.231.226:6969/announce,udp://212.1.226.176:2710/announce,udp://52.58.128.163:6969/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://78.30.254.12:2710/announce,udp://9.rarbg.com:2810/announce,udp://91.216.110.52:451/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a0f:e586:f:f::220]:6969/announce,udp://abufinzio.monocul.us:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://bclearning.top:6969/announce,udp://bt1.archive.org:6969/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.babico.name.tr:8000/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.monitorit4.me:6969/announce,udp://leet-tracker.moe:23861/announce,udp://leet-tracker.moe:38151/announce,udp://mirror.aptus.co.tz:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://open.demonii.com:1337/announce,udp://open.dstud.io:6969/announce,udp://open.free-tracker.ga:6969/announce,udp://open.stealth.si:80/announce,udp://open.tracker.ink:6969/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://run.publictracker.xyz:6969/announce,udp://torrentclub.space:6969/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.auctor.tv:6969/announce,udp://tracker.babico.name.tr:8000/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bitsearch.to:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.ddunlimited.net:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.edkj.club:6969/announce,udp://tracker.fatkhoala.org:13710/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.htp.re:4444/announce,udp://tracker.jordan.im:6969/announce,udp://tracker.leech.ie:1337/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.loadbt.com:6969/announce,udp://tracker.merded.xyz:8000/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.monitorit4.me:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.pomf.se:80/announce,udp://tracker.skynetcloud.site:6969/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker1.myporn.club:9337/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker6.lelux.fi:6969/announce,udp://u4.trakx.crim.ist:1337/announce,udp://vibe.sleepyinternetfun.xyz:1738/announce,udp://xxx.xxtor.com:3074/announce,ws://hub.bugout.link:80/announce,wss://tracker.openwebtorrent.com:443/announce 396 | 397 | -------------------------------------------------------------------------------- /content/aria2/aria2_en.conf: -------------------------------------------------------------------------------- 1 | # 2 | # https://github.com/P3TERX/aria2.conf 3 | # File name:aria2_en.conf 4 | # Description: Awesome Aria2 configuration file 5 | # Version: 2021.09.15 6 | # 7 | # Copyright (c) 2018-2021 P3TERX 8 | # 9 | # This is free software, licensed under the MIT License. 10 | # See /LICENSE for more informationo 11 | # 12 | # Modified by wy580477 for customized container 13 | 14 | 15 | ## Files saving setting ## 16 | 17 | # The directory to store the downloaded file. Do not modify this option. 18 | dir=/mnt/data/downloads 19 | 20 | # Enable disk cache. If SIZE is 0, the disk cache is disabled. 21 | # The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit. 22 | disk-cache=16M 23 | 24 | # Specify file allocation method. Possible Values: none, prealloc, trunc, falloc Default: prealloc 25 | # "prealloc" pre-allocates file space before download begins. This may take some time depending on the size of the file. 26 | # "falloc" is your best choice newer file systems on HDD such as ext4 (with extents support), btrfs, xfs. 27 | # "trunc" does not help avoiding fragmentation. 28 | # SSD doesn't need file pre-allocation, "none" is the best choice. 29 | # If download fails,show "fallocate failed.cause:Operation not supported", set this option to "none" 30 | file-allocation=falloc 31 | 32 | # No file allocation is made for files whose size is smaller than SIZE. 33 | no-file-allocation-limit=64M 34 | 35 | # Continue downloading a partially downloaded file. Currently this option is only applicable to HTTP(S)/FTP downloads. 36 | continue=true 37 | 38 | # Always resume download. 39 | # If true is given, aria2 always tries to resume download and if resume is not possible, aborts download. 40 | # If false is given, when all resume attempts fail, aria2 downloads file from scratch. 41 | always-resume=false 42 | 43 | # When used with --always-resume=false, aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. 44 | # If N is 0, aria2 downloads file from scratch when all given URIs do not support resume. 45 | max-resume-failure-tries=0 46 | 47 | # Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file. 48 | remote-time=true 49 | 50 | 51 | ## Session saving setting ## 52 | 53 | # Read download tasks from file. 54 | input-file=/.aria2allinoneworkdir/aria2/aria2.session 55 | 56 | # Save error/unfinished dowload tasks on exit. 57 | # Do not modify this option. 58 | save-session=/.aria2allinoneworkdir/aria2/aria2.session 59 | 60 | # Save error/unfinished downloads to a file specified by save-session option every SEC seconds. 61 | # If 0 is given, file will be saved only when aria2 exits. 62 | save-session-interval=1 63 | 64 | # Save a control file(*.aria2) every SEC seconds. 65 | # If 0 is given, a control file is not saved during download. 66 | auto-save-interval=5 67 | 68 | # Save download with save-session option even if the download is completed or removed. 69 | # If set to false, downloaded task list will be empty after reboot. 70 | force-save=false 71 | 72 | 73 | ## Connection setting ## 74 | 75 | # If aria2 receives "file not found" status NUM times, then force the download to fail. 76 | max-file-not-found=10 77 | 78 | # Set number of tries. 0 means unlimited. 79 | max-tries=0 80 | 81 | # Set the seconds to wait between retries. 82 | retry-wait=10 83 | 84 | # Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server. 85 | connect-timeout=10 86 | 87 | # Set timeout in seconds. 88 | timeout=10 89 | 90 | # Set the maximum number of parallel downloads for every queue item. 91 | max-concurrent-downloads=10 92 | 93 | # The maximum number of connections to one server for each download. 94 | max-connection-per-server=16 95 | 96 | # Download a file using N connections. 97 | split=64 98 | 99 | # aria2 does not split less than 2*SIZE byte range. 100 | min-split-size=1M 101 | 102 | # Set a piece length for HTTP/FTP downloads. 103 | piece-length=1M 104 | 105 | # If false is given, aria2 aborts download when a piece length is different from one in a control file. 106 | # If true is given, you can proceed but some download progress will be lost. Default: false 107 | allow-piece-length-change=true 108 | 109 | # Close connection if download speed is lower than or equal to this value. 110 | # This option does not affect BitTorrent downloads. 111 | lowest-speed-limit=0 112 | 113 | # Set max overall download speed. 0 means unrestricted. 114 | max-overall-download-limit=5M 115 | 116 | # Set max download speed per each download. 0 means unrestricted. 117 | max-download-limit=0 118 | 119 | # Disable IPv6. Heroku dyno doesn't have ipv6 network, keep it disabled. 120 | disable-ipv6=true 121 | 122 | # Send Accept: deflate, gzip request header. 123 | http-accept-gzip=true 124 | 125 | # Reuse already used URIs if no unused URIs are left. 126 | reuse-uri=false 127 | 128 | # Disables netrc support. 129 | no-netrc=true 130 | 131 | # Restart download from scratch if the corresponding control file doesn't exist. 132 | allow-overwrite=false 133 | 134 | # Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. 135 | auto-file-renaming=true 136 | 137 | # Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-8859-1. 138 | content-disposition-default-utf8=true 139 | 140 | # Specify minimum SSL/TLS version to enable. Possible Values: TLSv1.1, TLSv1.2, TLSv1.3 Default: TLSv1.2 141 | #min-tls-version=TLSv1.2 142 | 143 | 144 | ## Bittorrent setting ## 145 | 146 | # Set TCP port number for BitTorrent downloads. 147 | listen-port=60500-61500 148 | 149 | # Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. 150 | dht-listen-port=60500-61500 151 | 152 | # Enable IPv4 DHT functionality. It also enables UDP tracker support. 153 | # If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. 154 | enable-dht=true 155 | 156 | # Enable IPv6 DHT functionality. 157 | # If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. 158 | # Heroku dyno doesn't have ipv6 network, keep it disabled. 159 | enable-dht6=false 160 | 161 | # Specify the external IP address to use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. 162 | #bt-external-ip= 163 | 164 | # IPv4 DHT routing table file PATH 165 | dht-file-path=/.aria2allinoneworkdir/aria2/dht.dat 166 | 167 | # Set host and port as an entry point to IPv4 DHT network. 168 | dht-entry-point=dht.transmissionbt.com:6881 169 | 170 | # Enable Local Peer Discovery. 171 | # If a private flag is set in a torrent, aria2 doesn't use this feature for that download even if true is given. 172 | bt-enable-lpd=false 173 | 174 | # Use given interface for Local Peer Discovery. If this option is not specified, the default interface is chosen. 175 | #bt-lpd-interface= 176 | 177 | # Enable Peer Exchange extension. 178 | # If a private flag is set in a torrent, this feature is disabled for that download even if true is given. 179 | enable-peer-exchange=true 180 | 181 | # Specify the maximum number of peers per torrent. 0 means unlimited. 182 | #bt-max-peers= 183 | 184 | # If the whole download speed of every torrent is lower than SPEED, 185 | # aria2 temporarily increases the number of peers to try for more download speed. Default: 50K 186 | #bt-request-peer-speed-limit= 187 | 188 | # Set max overall upload speed. 0 means unrestricted. 189 | max-overall-upload-limit=5M 190 | 191 | # Set max upload speed per each torrent. 0 means unrestricted. 192 | max-upload-limit=0 193 | 194 | # Specify share ratio. Seed completed torrents until share ratio reaches RATIO. 195 | # Specify 0.0 if you intend to do seeding regardless of share ratio. 196 | # If --seed-time option is specified along with this option, seeding ends when at least one of the conditions is satisfied. 197 | seed-ratio=1.0 198 | 199 | # Specify seeding time in (fractional) minutes. 200 | seed-time=0 201 | 202 | # If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. 203 | # If you want to check file and download it only when it is damaged or incomplete, set this option to false. 204 | # This option has effect only on BitTorrent download. 205 | bt-hash-check-seed=true 206 | 207 | # Seed previously downloaded files without verifying piece hashes. 208 | bt-seed-unverified=false 209 | 210 | # Set the connect timeout in seconds to establish connection to tracker. 211 | # After the connection is established, this option makes no effect and --bt-tracker-timeout option is used instead. 212 | bt-tracker-connect-timeout=10 213 | 214 | # Set timeout in seconds. 215 | bt-tracker-timeout=10 216 | 217 | # Set the interval in seconds between tracker requests. 218 | # If 0 is set, aria2 determines interval based on the response of tracker and the download progress. Default: 0 219 | #bt-tracker-interval=0 220 | 221 | # Try to download first and last pieces of each file first. This is useful for previewing files. 222 | bt-prioritize-piece=head=32M,tail=32M 223 | 224 | # Save the uploaded torrent or metalink meta data in the directory specified by --dir option. 225 | rpc-save-upload-metadata=true 226 | 227 | # If true or mem is specified, when a torrent file is downloaded, aria2 downloads files mentioned in it. 228 | # If mem is specified, a torrent file is not written to the disk, but is just kept in memory. 229 | # If false is specified, the .torrent file is downloaded to the disk, but its contents are not downloaded. 230 | follow-torrent=true 231 | 232 | # Pause downloads created as a result of metadata download. 233 | # This option is effective only when --enable-rpc=true is given. 234 | pause-metadata=false 235 | 236 | # Save meta data as ".torrent" file. This option has effect only when BitTorrent Magnet URI is used. 237 | bt-save-metadata=true 238 | 239 | # Before getting torrent metadata from DHT, first try to read file saved by --bt-save-metadata option. 240 | # If it is successful, then skip downloading metadata from DHT. 241 | bt-load-saved-metadata=true 242 | 243 | # Removes the unselected files when download is completed in BitTorrent. 244 | bt-remove-unselected-file=true 245 | 246 | # Requires BitTorrent message payload encryption with arc4. 247 | # If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload. 248 | # This is a shorthand of bt-require-crypto bt-min-crypto-level=arc4. This option does not change the option value of those options. 249 | bt-force-encryption=true 250 | 251 | # If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake 252 | #bt-require-crypto=true 253 | 254 | # Set minimum level of encryption method. 255 | #bt-min-crypto-level=arc4 256 | 257 | # Exclude seed only downloads when counting concurrent active downloads. 258 | bt-detach-seed-only=true 259 | 260 | 261 | ## Client camouflage ## 262 | # Do not relay on settings here to bypass private tracker restriction, you could get your account banned. 263 | 264 | # Set user agent for HTTP(S) downloads. 265 | #user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47 266 | user-agent=Deluge 1.3.15 267 | 268 | # Specify the string used during the bitorrent extended handshake for the peer's client version. 269 | # Download from private traker needs user-agent match peer-agent. 270 | peer-agent=Deluge 1.3.15 271 | 272 | # Specify the prefix of peer ID. 273 | peer-id-prefix=-DE13F0- 274 | 275 | 276 | ## RPC setting ## 277 | 278 | # Enable JSON-RPC/XML-RPC server. 279 | enable-rpc=true 280 | 281 | # Add Access-Control-Allow-Origin header field with value * to the RPC response. 282 | rpc-allow-origin-all=true 283 | 284 | # Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. 285 | # If false is given, listen only on local loopback interface. 286 | rpc-listen-all=false 287 | 288 | # Specify a port number for JSON-RPC/XML-RPC server to listen to. 289 | # Controlled by container env, do not modify this option. 290 | rpc-listen-port=56800 291 | 292 | # Set RPC secret authorization token. 293 | # Controlled by container env, do not modify this option. 294 | rpc-secret=PASSWORD 295 | 296 | # Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection. 297 | rpc-max-request-size=10M 298 | 299 | # RPC transport will be encrypted by SSL/TLS. Do not modify this option. 300 | #rpc-secure=false 301 | 302 | # Use the certificate in FILE for RPC server. 303 | #rpc-certificate=/root/.aria2/xxx.pem 304 | 305 | # Use the private key in FILE for RPC server. 306 | #rpc-private-key=/root/.aria2/xxx.key 307 | 308 | # Specify the method for polling events. 309 | #event-poll=select 310 | 311 | 312 | ## Advanced setting ## 313 | 314 | # Enable asynchronous DNS. Default: true 315 | async-dns=true 316 | 317 | # Comma separated list of DNS server address used in asynchronous DNS resolver. 318 | # Otherwise asynchronous DNS resolver reads DNS server addresses from /etc/resolv.conf. 319 | async-dns-server=8.8.8.8,1.1.1.1 320 | 321 | enable-mmap=true 322 | 323 | # Bind sockets to given interface. 324 | # If an interface has multiple addresses, it is highly recommended to specify IP address explicitly. 325 | #interface= 326 | 327 | # Comma separated list of interfaces to bind sockets to. 328 | #multiple-interface= 329 | 330 | 331 | ## Log setting ## 332 | 333 | # The file name of the log file. If - is specified, log is written to stdout. 334 | # If empty string("") is specified, or this option is omitted, no log is written to disk at all. 335 | #log= 336 | 337 | # Set log level to output. LEVEL is either debug, info, notice, warn or error. 338 | #log-level=notice 339 | 340 | # Set log level to output to console. LEVEL is either debug, info, notice, warn or error. 341 | console-log-level=notice 342 | 343 | # Make aria2 quiet (no console output). 344 | quiet=false 345 | 346 | show-console-readout=false 347 | 348 | # Set interval in seconds to output download progress summary. Setting 0 suppresses the output. 349 | summary-interval=0 350 | 351 | 352 | ## Event Hook ## 353 | 354 | # Set the command to be executed after download stopped. 355 | # Triggered after download deleted/aborted due to error/completed. Paused downloads don't trigger this option. 356 | on-download-stop=/.aria2allinoneworkdir/aria2/delete.sh 357 | 358 | # Set the command to be executed after download completed. 359 | # For BitTorrent, this option is called after download completed and seeding is over. 360 | # Controlled by container env, do not modify this option unless using custom mode. 361 | on-download-complete=/.aria2allinoneworkdir/aria2/POSTMODE.sh 362 | 363 | # Set the command to be executed after download aborted due to error. 364 | #on-download-error= 365 | 366 | # Set the command to be executed after download was paused. 367 | #on-download-pause= 368 | 369 | # Set the command to be executed after download got started. 370 | #on-download-start= 371 | 372 | # Set the command to be executed after bt download completed but before seeding. 373 | # Controlled by container env, do not modify this option unless using custom mode. 374 | on-bt-download-complete=/.aria2allinoneworkdir/aria2/POSTMODE.sh 375 | 376 | 377 | # BT trackers 378 | bt-tracker=http://1337.abcvg.info:80/announce,http://207.241.226.111:6969/announce,http://207.241.231.226:6969/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://bt.okmp3.ru:2710/announce,http://buny.uk:6969/announce,http://fxtt.ru:80/announce,http://milanesitracker.tekcities.com:80/announce,http://nyaa.tracker.wf:7777/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.tracker.ink:6969/announce,http://opentracker.i2p.rocks:6969/announce,http://opentracker.xyz:80/announce,http://p4p.arenabg.com:1337/announce,http://retracker.hotplug.ru:2710/announce,http://share.camoe.cn:8080/announce,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t.publictracker.xyz:6969/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bt4g.com:2095/announce,http://tracker.dler.org:6969/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.lelux.fi:80/announce,http://tracker.loadbt.com:6969/announce,http://tracker.merded.xyz:8000/announce,http://tracker.mywaifu.best:6969/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker2.dler.org:80/announce,http://vps02.net.orel.ru:80/announce,https://1337.abcvg.info:443/announce,https://abir0dev.github.io:443/announce,https://carbon-bonsai-621.appspot.com:443/announce,https://chihaya-heroku.120181311.xyz:443/announce,https://opentracker.cc:443/announce,https://opentracker.i2p.rocks:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.abiir.top:443/announce,https://tr.abir.ga:443/announce,https://tr.abirxo.cf:443/announce,https://tr.burnabyhighstar.com:443/announce,https://tr.doogh.club:443/announce,https://tr.fuckbitcoin.xyz:443/announce,https://tr.highstar.shop:443/announce,https://tr.ready4.icu:443/announce,https://tr.torland.ga:443/announce,https://tracker.babico.name.tr:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.iriseden.fr:443/announce,https://tracker.kuroy.me:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.lilithraws.org:443/announce,https://tracker.moeblog.cn:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.yarr.pt:443/announce,https://trackme.theom.nz:443/announce,udp://207.241.226.111:6969/announce,udp://207.241.231.226:6969/announce,udp://212.1.226.176:2710/announce,udp://52.58.128.163:6969/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://78.30.254.12:2710/announce,udp://9.rarbg.com:2810/announce,udp://91.216.110.52:451/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a0f:e586:f:f::220]:6969/announce,udp://abufinzio.monocul.us:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://bclearning.top:6969/announce,udp://bt1.archive.org:6969/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.babico.name.tr:8000/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.monitorit4.me:6969/announce,udp://leet-tracker.moe:23861/announce,udp://leet-tracker.moe:38151/announce,udp://mirror.aptus.co.tz:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://open.demonii.com:1337/announce,udp://open.dstud.io:6969/announce,udp://open.free-tracker.ga:6969/announce,udp://open.stealth.si:80/announce,udp://open.tracker.ink:6969/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://run.publictracker.xyz:6969/announce,udp://torrentclub.space:6969/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.auctor.tv:6969/announce,udp://tracker.babico.name.tr:8000/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bitsearch.to:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.ddunlimited.net:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.edkj.club:6969/announce,udp://tracker.fatkhoala.org:13710/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.htp.re:4444/announce,udp://tracker.jordan.im:6969/announce,udp://tracker.leech.ie:1337/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.loadbt.com:6969/announce,udp://tracker.merded.xyz:8000/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.monitorit4.me:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.pomf.se:80/announce,udp://tracker.skynetcloud.site:6969/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker1.myporn.club:9337/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker6.lelux.fi:6969/announce,udp://u4.trakx.crim.ist:1337/announce,udp://vibe.sleepyinternetfun.xyz:1738/announce,udp://xxx.xxtor.com:3074/announce,ws://hub.bugout.link:80/announce,wss://tracker.openwebtorrent.com:443/announce 379 | 380 | --------------------------------------------------------------------------------