Compare commits

...
12 Commits
Author SHA1 Message Date
junvandGitHub 3cf974c98c Support just enable rpc-secret for aria2c (#229) 2023-04-12 14:59:48 +10:00
junv-repo-bot 0610f47717 Update version 2022-12-30 07:45:31 +00:00
junvandGitHub 5d4656db63 Expose /rpc to support Sonarr and Radarr (#226) 2022-12-30 18:42:26 +11:00
junv-repo-bot 311696caa1 Update version 2022-12-26 07:47:17 +00:00
junvandGitHub e3cfdf6f68 Fix image due to alpine and rclone changes (#225) 2022-12-26 18:44:35 +11:00
junvandGitHub 58886cfc13 Fix badge url 2022-12-26 18:16:32 +11:00
junv-repo-bot dc9238fc7d Update version 2022-12-26 07:14:59 +00:00
junvandGitHub 8488801ec6 Update all caddy, filebrowser, rlcone and ariang (#224) 2022-12-26 18:11:06 +11:00
junvandGitHub ce31e13a61 Update readme 2022-06-25 17:44:49 +10:00
junv-repo-bot fc572ada3e Update version 2022-06-24 12:55:28 +00:00
junvandGitHub 654f8f4b3d Simply auto upload logic base on Pull request #214 (#217)
* Simply auto upload logic base on Pull request #214

* No bash debugging

* Minor refactor

* Update logic to handle single file or folder
2022-06-24 22:51:50 +10:00
junv-repo-bot 2196929d63 Update version 2022-06-23 13:06:38 +00:00
8 changed files with 59 additions and 55 deletions
+1 -1
View File
@@ -1 +1 @@
4.15.0
5.1.0
+1
View File
@@ -10,6 +10,7 @@ redir /ui/ / 301
redir /rclone /rclone/ 301
redir /files /files/ 301
reverse_proxy /rpc 127.0.0.1:6800
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
+8 -6
View File
@@ -4,7 +4,7 @@ English | [简体中文](https://github.com/wahyd4/aria2-ariang-docker/blob/mast
[![](https://images.microbadger.com/badges/image/wahyd4/aria2-ui.svg)](https://microbadger.com/images/wahyd4/aria2-ui "Get your own image badge on microbadger.com")
[![Docker Pulls](https://img.shields.io/docker/pulls/wahyd4/aria2-ui.svg)](https://hub.docker.com/r/wahyd4/aria2-ui/)
[![Github Build](https://github.com/wahyd4/aria2-ariang-docker/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/wahyd4/aria2-ariang-docker/actions)
[![Github Build](https://github.com/wahyd4/aria2-ariang-docker/actions/workflows/dockerimage.yml/badge.svg)](https://github.com/wahyd4/aria2-ariang-docker/actions)
[![Page Views Count](https://badges.toozhao.com/svg/aria2-ariang-docker)](https://badges.toozhao.com/stats/aria2-ariang-docker "Page Views Count")
@@ -131,11 +131,11 @@ Then simply run `docker-compose up -d`, that's it!
| `DOMAIN` | The domain you'd like to bind, when domain is a `https://` thing, then auto TLS feature will be enabled |
| `RCLONE_CONFIG_BASE64` | Inject and config Rclone through `base64` string, which is the only way to use Rclone on Heroku. Please use `cat /app/conf/rclone.conf \| base64` or any base64 online tools such as [this](https://www.base64encode.org/) to encode your `rclone.conf` as bse64 string. Note, you need to set `ENABLE_RCLONE` to true as well. |
| `ENABLE_APP_CHECKER` | By default it's set to `true` to check if any new docker image version release on daily basis, which can help you get notification when new features released as well as some security vulnerabilities get fixed. You can set it to `false` to disable this feature. Note: you still need to manually pull the new image version and re run the docker container to complete upgrading. |
| CADDY_LOG_LEVEL | For specifying the log level of Caddy, set it to `ERROR` to reduce logs. Default: `INFO` |
| RCLONE_AUTO_UPLOAD_PROVIDER | The Rclone remote storage provider name, which can be found under `Rclone -> Configs`, default `""`, which means auto upload is disabled. When the value is not empty, then the files will be attempted to be uploaded.|
| RCLONE_AUTO_UPLOAD_REMOTE_PATH | The file folder in remote cloud storage provider, default `/downloads`|
| RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE | Set the minimum file size of auto uploader, files smaller than it won't be uploaded, default `1K` |
| RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE | Set the limit of the Max file can be uploaded to 3rd party storage provider, default `100G`. |
| `CADDY_LOG_LEVEL` | For specifying the log level of Caddy, set it to `WARN` or`ERROR` to reduce logs. Default: `INFO` |
| `RCLONE_AUTO_UPLOAD_PROVIDER` | The Rclone remote storage provider name, which can be found under `Rclone -> Configs`, default `""`, which means auto upload is disabled. When the value is not empty, then the files will be attempted to be uploaded.|
| `RCLONE_AUTO_UPLOAD_REMOTE_PATH` | The file folder in remote cloud storage provider, default `/downloads`|
| `RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE` | Set the minimum file size of auto uploader, files smaller than it won't be uploaded, default `1K` |
| `RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE` | Set the limit of the Max file can be uploaded to 3rd party storage provider, default `100G`. |
### Supported Volumes
@@ -148,9 +148,11 @@ Then simply run `docker-compose up -d`, that's it!
|`/app/conf/aria2.conf` | See description above👆🏼 |
|`/app/conf/aria2.session` | See description above👆🏼 |
|`/app/conf/rclone.conf` | See description above👆🏼 |
| `/app/conf/auto-upload.sh` | The bash script to be used for uploading downloaded files to remote storage provider via Rclone, mount your own script if you want to have custom logic. |
| `/app/filebrowser.db` | File Browser settings database, make sure you make a empty file first on your host. |
| `/app/.cache` | The folder for storing rclone caches and [aria2 DHT files](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-dht-file-path) |
## Auto HTTPS enabling
Make sure you have added proper `A` record point to the host you running to your domain `DNS` record list, then just add `e` option to bind the `https` domain when you run the image
+1
View File
@@ -14,6 +14,7 @@ redir /ui/ / 301
redir /rclone /rclone/ 301
redir /files /files/ 301
reverse_proxy /rpc 127.0.0.1:6800
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
+17 -10
View File
@@ -1,21 +1,28 @@
#! /bin/bash -eu
#! /bin/bash -euo
sed -i 's/6800/'"${ARIA2_EXTERNAL_PORT}"'/g' /usr/local/www/aria2/js/aria-ng*.js
RPC_SECRET_BASE64=$(echo -n ${RPC_SECRET}|base64)
RPC_SECRET_BASE64=$(echo -n ${RPC_SECRET} | base64)
sed -i 's/secret:\"\"/secret:\"'"${RPC_SECRET_BASE64}"'\"/g' /usr/local/www/aria2/js/aria-ng*.js
if [ "$ARIA2_SSL" = "true" ]; then
echo "[INFO] Start aria2 with secure config"
echo "[INFO] Start aria2 with secure config and rpc-secret"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
--enable-rpc --rpc-listen-all \
--rpc-certificate=/app/conf/key/aria2.crt \
--rpc-private-key=/app/conf/key/aria2.key \
--rpc-secret="$RPC_SECRET" --rpc-secure \
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
--enable-rpc --rpc-listen-all \
--rpc-certificate=/app/conf/key/aria2.crt \
--rpc-private-key=/app/conf/key/aria2.key \
--rpc-secret="${RPC_SECRET}" --rpc-secure
elif [ "$ARIA2_SSL" = "false" && ${RPC_SECRET} != "" ]; then
echo "[INFO] Start aria2 with rpc-secret"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
--enable-rpc \
--rpc-listen-all \
--rpc-secret="${RPC_SECRET}"
else
echo "[INFO] Start aria2 with standard mode"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" --enable-rpc --rpc-listen-all
echo "[INFO] Start aria2 with standard mode"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" --enable-rpc --rpc-listen-all
fi
+2 -2
View File
@@ -3,7 +3,7 @@
echo "[INFO] Run aria2c and ariaNG"
echo "[INFO] Generate basic auth password for caddy"
ARIA2_PWD_ENCRYPT=$(caddy hash-password -plaintext ${ARIA2_PWD})
ARIA2_PWD_ENCRYPT=$(caddy hash-password --plaintext ${ARIA2_PWD})
case $ENABLE_AUTH in
true)
@@ -28,4 +28,4 @@ heroku)
;;
esac
/usr/local/bin/caddy run -config ${CADDY_FILE} -adapter=caddyfile
/usr/local/bin/caddy run --config ${CADDY_FILE} --adapter=caddyfile
+24 -31
View File
@@ -1,42 +1,35 @@
#!/bin/bash -eu
RCLONE_AUTO_UPLOAD_PROVIDER=google-drive
if [[ $RCLONE_AUTO_UPLOAD_PROVIDER == "" ]]; then
if [[ ${RCLONE_AUTO_UPLOAD_PROVIDER} == "" ]]; then
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Auto upload isn't enabled"
exit 0
fi
if [ $2 -eq 0 ]; then
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') No files detected"
file_count=$2
file_path=$3
downloadsFolder='/data'
if [ ${file_count} -eq 0 ]; then
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') No files detected. Original parameters: Files Count: ${file_count}, Files Path: ${file_path}"
exit 0
fi
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Start to upload files with: Files Count: [$2], Files Path: [$3]"
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Start to upload files with: Files Count: ${file_count}, Files Path: ${file_path}"
path=$3 # File full path
downloadpath='/data' # Aria2 downloading folder
provider_name=$RCLONE_AUTO_UPLOAD_PROVIDER # RClone remote provider
folder=$RCLONE_AUTO_UPLOAD_REMOTE_PATH # Foler path in Rclone remote provider
MinSize=$RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE # Set mininum file size to be uploaded, files smaller than this will be deleted without uploading
MaxSize=$RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE # Set the Max file size to be uploaded
folder=${file_path%/*}
while true; do #提取下载文件根路径,如把/data/a/b/c/d.jpg变成/data/a
file_path=$path
path=${path%/*}
if [ "$path" == "" ]; then #不在下载文件夹
exit 0
elif [ "$path" == "$downloadpath" ] && [ $2 -eq 1 ]; then # To handle single file
rclone move "$file_path" ${provider_name}:${folder}/
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Successfully uploaded file $file_path"
exit 0
elif [ "$path" == "$downloadpath" ]; then # To handle folder
while [[ "$(ls -A "$file_path/")" != "" ]]; do
rclone move "$file_path"/ ${provider_name}:${folder}/"${file_path##*/}"/ --delete-empty-src-dirs --min-size $MinSize --max-size $MaxSize
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Successfully uploaded file $file_path"
rclone delete -v "$file_path" --max-size $MinSize # Delete files smaller than min file.
done
rm -rf "$file_path/"
exit 0
if [ "${folder}" == "" ]; then # Not the actual file, or no files downloaded.
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Fail to find files ${file_path}"
exit 0
else
if [[ "$(ls -A "$folder/")" != "" ]] && [[ ${folder} != ${downloadsFolder} ]] ; then
# Copy files to remote
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Start uploading entire folder ${folder}"
rclone copy "${folder}" ${RCLONE_AUTO_UPLOAD_PROVIDER}:${RCLONE_AUTO_UPLOAD_REMOTE_PATH}${folder}/ --min-size ${RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE} --max-size ${RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE} -P
else
#Handle single file
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Start uploading file file_path"
rclone copy "${file_path}" ${RCLONE_AUTO_UPLOAD_PROVIDER}:${RCLONE_AUTO_UPLOAD_REMOTE_PATH}${folder}/ --min-size ${RCLONE_AUTO_UPLOAD_FILE_MIN_SIZE} --max-size ${RCLONE_AUTO_UPLOAD_FILE_MAX_SIZE} -P
fi
done
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Successfully uploaded ${file_count} files ${file_path}"
fi
+5 -5
View File
@@ -2,10 +2,10 @@
echo "[INFO] Set variables for $(arch)"
caddy_version=2.4.6
filebrowser_version=v2.21.1
rclone_version=v1.58.0
ariang_version=1.2.3
caddy_version=2.6.2
filebrowser_version=v2.23.0
rclone_version=v1.61.1
ariang_version=1.3.2
case "$(arch)" in
@@ -37,7 +37,7 @@ ariang_file=AriaNg-${ariang_version}.zip
adduser -D -u 1000 junv \
&& apk update \
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar mailcap fuse vim --no-cache \
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar mailcap fuse vim libcap --no-cache \
&& wget -N https://github.com/caddyserver/caddy/releases/download/v${caddy_version}/${caddy_file} \
&& tar -zxf ${caddy_file} \
&& mv caddy /usr/local/bin/ \