Add environment variable to allow user disable new version checking (#187)

This commit is contained in:
2021-12-11 19:47:01 +11:00
committed by GitHub
parent 534b94a31f
commit 8d1a326a23
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -34,6 +34,7 @@ ENV RCLONE_CONFIG=/app/conf/rclone.conf
ENV XDG_DATA_HOME=/app/.caddy/data
ENV XDG_CONFIG_HOME=/app/.caddy/config
ENV RCLONE_CONFIG_BASE64=""
ENV ENABLE_APP_CHECKER=true
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
ADD conf /app/conf
+2
View File
@@ -116,6 +116,8 @@ services:
* `RPC_SECRET` Aria2 RPC 加密 token
* `DOMAIN` 绑定的域名, 当绑定的域名为`HTTPS`时,即为启用`HTTPS` 例: `DOMAIN=https://toozhao.com`
* `RCLONE_CONFIG_BASE64` 通过`base64` 字符串的形式配置rclone.conf。主要给在Heroku平台上运行时使用,请使用命令行 `cat /app/conf/rclone.conf | base64` 或者其他任何在线base64在线工具 [比如这个](https://www.base64encode.org/)来把`rclone.conf`的内容生成`base64`字符串。在使用本环境变量的同时,请确保`ENABLE_RCLONE`设置为`true`
* `ENABLE_APP_CHECKER`,默认情况下本程序会每天向远程服务器发送一次GET请求,以检查是否有新版本的镜像。该功能可以让你及时获取新功能和相关安全隐患的修复的推送提醒。你也可以选择将该环境变量设置为`false`来禁用该功能。注意该功能启用下,依然需要手动更新镜像来完成升级。
### 支持的 Docker volume 属性
* `/data` 用来放置所有下载的文件的目录
+1
View File
@@ -127,6 +127,7 @@ Then simply run `docker-compose up -d`, that's it!
* `RPC_SECRET` The Aria2 RPC secret token
* `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.
### Supported Volumes
+8 -1
View File
@@ -1,6 +1,13 @@
#! /bin/bash -u
sleep 5
if [ "$ENABLE_APP_CHECKER" = "false" ]; then
echo "[INFO] Skip checking new version"
# Do nothing and just sleep 10 years
sleep 315360000
exit 0
fi
set -e
APP_VERSION=$(cat APP_VERSION)
set +e
@@ -19,6 +26,6 @@ while true; do
sleep 86400
continue
fi
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Good job, you are using the latest version docker image"
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Congrats, you are using the latest version docker image"
sleep 86400
done