Skip to content

Commit 6c04b6a

Browse files
authored
Merge pull request #112 from wahyd4/rclone
Rclone
2 parents d64c15d + c36e68f commit 6c04b6a

10 files changed

+114
-29
lines changed

Caddyfile

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
root /usr/local/www/aria2
2222
timeouts none
2323
gzip
24-
log stdout
25-
errors stdout
24+
errors stderr
25+
}
26+
27+
{$DOMAIN}/rclone {
28+
redir / /rclone/ 301
29+
}
30+
31+
{$DOMAIN}/rclone/ {
32+
proxy / 127.0.0.1:5572/ {
33+
transparent
34+
}
35+
gzip
36+
errors stderr
2637
}

Dockerfile

+11-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ENV ARIA2_EXTERNAL_PORT=80
1414
ENV PUID=1000
1515
ENV PGID=1000
1616
ENV CADDYPATH=/app
17+
ENV RCLONE_CONFIG=/app/conf/rclone.conf
1718

1819
RUN adduser -D -u 1000 junv \
1920
&& apk update \
@@ -34,9 +35,17 @@ RUN adduser -D -u 1000 junv \
3435
&& rm -rf forego-stable-${platform}.tgz \
3536
&& mkdir -p /usr/local/www \
3637
&& mkdir -p /usr/local/www/aria2 \
37-
&& rm -rf init /app/*.txt
38+
&& rm -rf init /app/*.txt \
39+
&& curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip \
40+
&& unzip rclone-*.zip \
41+
&& cd rclone-*-linux-amd64 \
42+
&& cp rclone /usr/local/bin/ \
43+
&& chown junv:junv /usr/local/bin/rclone \
44+
&& chmod 755 /usr/local/bin/rclone \
45+
&& rm /app/rclone-*.zip \
46+
&& rm -rf /app/rclone-*
3847

39-
ADD aria2c.sh caddy.sh Procfile init.sh start.sh /app/
48+
ADD aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh /app/
4049
ADD conf /app/conf
4150
ADD Caddyfile SecureCaddyfile /usr/local/caddy/
4251

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
filebrowser: /app/filebrowser -p 8080 -d /app/filebrowser.db -r /data
22
caddy: /app/caddy.sh
33
aria2c: /app/aria2c.sh
4+
rclone: /app/rclone.sh

README.CN.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ File Browser
3232

3333
## 功能特性
3434

35-
* Aria2 (SSL 支持)
36-
* AriaNg 通过 UI 来操作,下载文件
35+
* [Aria2](https://aria2.github.io) 文件下载工具(支持SSL )
36+
* [AriaNg](https://github.com/mayswind/AriaNg) 通过 UI 来操作,下载文件
37+
* [Rclone](https://rclone.org) 同步文件到云盘
3738
* 自动 HTTPS (Let's Encrypt)
3839
* 支持绑定自定义用户ID,可以主机上的非`root`用户,也可以管理下载的文件
3940
* Basic Auth 用户认证
@@ -58,7 +59,8 @@ File Browser
5859

5960
* Aria2: <http://yourip/ui/>
6061
* FileManger: <http://yourip>
61-
* 请使用 admin/admin 进行登录
62+
* Rclone: <http://yourip/rclone>
63+
* 请使用 admin/admin 进行登录, 在如果没有修改`ARIA2_USER`,`ARIA2_PWD`的情况下,请使用`user`/`password`登录`Rclone`
6264
### 开启所有功能
6365
```bash
6466
docker run -d --name ariang \
@@ -76,7 +78,7 @@ File Browser
7678
-v /yourdata:/data \
7779
-v /app/a.db:/app/filebrowser.db \
7880
-v /yoursslkeys/:/app/conf/key \
79-
-v <the folder of aria2.conf and aria2.session>:/app/conf \
81+
-v <conf files folder>:/app/conf \
8082
wahyd4/aria2-ui
8183
```
8284
### 使用docker-compose 运行
@@ -101,8 +103,8 @@ services:
101103
### 支持的 Docker 环境变量
102104

103105
* ENABLE_AUTH 启用 Basic auth(网页简单认证) 用户认证
104-
* ARIA2_USER Basic Auth 用户认证用户名
105-
* ARIA2_PWD Basic Auth 密码
106+
* ARIA2_USER Basic Auth 用户认证用户名,Rclone也使用该参数
107+
* ARIA2_PWD Basic Auth 密码,Rclone也使用该参数
106108
* ARIA2_EXTERNAL_PORT 从外部可以访问到的 Aria2 端口,默认为 HTTP 的`80`
107109
* PUID 需要绑定主机的Linux用户ID,可以通过`cat /etc/passwd` 查看用户列表, 默认UID 是`1000`
108110
* PGID 需要绑定的主机的Linux 用户组ID,默认GID 是`1000`
@@ -113,7 +115,10 @@ services:
113115
### 支持的 Docker volume 属性
114116
* `/data` 用来放置所有下载的文件的目录
115117
* `/app/conf/key` 用户来放置 Aria2 SSL `certificate`证书和 `key` 文件. `注意`: 证书的名字必须是 `aria2.crt`, Key 文件的名字必须是 `aria2.key`
116-
* `/app/conf` 该目录下可以放置你的自定义`aria2.conf`配置文件,`aria2.session`,且必须包含这两个文件。第一次使用`aria2.session`时,创建一个空文件即可,该文件会包含aria2当前的下载列表,这样即使容器被销毁也不用担心文件列表丢失了。你也可以直接拷贝当前项目下`conf`目录中的两个文件并使用。
118+
* `/app/conf` 该目录下可以放置你的自定义`aria2.conf`配置文件,`aria2.session`,且必须包含这两个文件。第一次使用`aria2.session`时,创建一个空文件即可,该文件会包含aria2当前的下载列表,这样即使容器被销毁也不用担心文件列表丢失了。你也可以直接拷贝当前项目下`conf`目录中的两个文件并使用。如需映射rclone.conf到容器内,请将其就放置于该目录下。因此配置文件目录支持的所有配置文件为:
119+
* aria2.conf
120+
* aria2.session
121+
* rclone.conf
117122
* `/app/filebrowser.db` File Browser 的内嵌数据库,升级Docker 镜像也不用担心之前的设置丢失。请确保在宿主机先创建一个空文件再使用。
118123

119124
## 自动 SSL

README.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ File Browser
3939

4040
## Features
4141

42-
* Aria2 (SSL support)
43-
* AriaNg
42+
* [Aria2 (SSL support)](https://aria2.github.io)
43+
* [AriaNg](https://github.com/mayswind/AriaNg)
44+
* [Rclone](https://rclone.org/)
4445
* Auto HTTPS (Let's Encrypt)
4546
* Bind non root user into container, so non root user can also manage downloaded files.
4647
* Basic Auth
@@ -65,7 +66,8 @@ File Browser
6566

6667
* Aria2: <http://yourip/ui/>
6768
* FileManger: <http://yourip>
68-
* Please use `admin`/`admin` as username and password to login for the first time.
69+
* Rclone: <http://yourip/rclone>
70+
* Please use `admin`/`admin` as username and password to login for the first time, and `user`/`password` to login `Rclone` if you don't update `ARIA2_USER` and `ARIA2_PWD`
6971

7072
### Full features run
7173

@@ -84,8 +86,8 @@ File Browser
8486
-e ARIA2_EXTERNAL_PORT=443 \
8587
-v /yourdata:/data \
8688
-v /app/a.db:/app/filebrowser.db \
87-
-v /yoursslkeys/:/app/conf/key \
88-
-v <the folder of aria2.conf and aria2.session>:/app/conf \
89+
-v /to_yoursslkeys/:/app/conf/key \
90+
-v <conf files folder>:/app/conf \
8991
wahyd4/aria2-ui
9092
```
9193
### Run with docker-compose
@@ -112,8 +114,8 @@ Then just run `docker-compose up -d`, that's it!
112114
### Supported Environment Variables
113115

114116
* ENABLE_AUTH whether to enable Basic auth
115-
* ARIA2_USER Basic Auth username
116-
* ARIA2_PWD Basic Auth password
117+
* ARIA2_USER Basic Auth username, Rclone GUI uses it as well.
118+
* ARIA2_PWD Basic Auth password, Rclone GUI uses it as well.
117119
* ARIA2_EXTERNAL_PORT The Aria2 port which exposed to public to access to
118120
* PUID Bind Linux UID into container which means you can use non `root` user to manage downloaded files, default UID is `1000`
119121
* PGID Bind Linux GID into container, default GID is 1000
@@ -124,7 +126,12 @@ Then just run `docker-compose up -d`, that's it!
124126
### Supported Volumes
125127
* `/data` The folder which contains all the files you download.
126128
* `/app/conf/key` The folder which stored Aria2 SSL `certificate` and `key` file. `Notice`: The certificate file should be named `aria2.crt` and the key file should be named `aria2.key`
127-
* `/app/conf` The Aria2 configuration and file session folder. Make sure you have `aria2.conf` and `aria2.session` file. For the first time `aria2.session` just need to be a empty file can be appended. You can also user the templates for these two file in the `conf` folder of this project. **Warning: if you don't mount `/app/conf`, whenever the container restart, you'll lose your downloading progress.**
129+
* `/app/conf` The Aria2 configuration and file session folder. Make sure you have `aria2.conf` and `aria2.session` file. For the first time `aria2.session` just need to be a empty file can be appended. You can also user the templates for these two file in the `conf` folder of this project. Please put your `rclone.conf` in this folder as well if you'd mount it to Rclone. So all the config files supported in this folder are:
130+
* aria2.conf
131+
* aria2.session
132+
* rclone.conf
133+
134+
**Warning: if you don't mount `/app/conf`, whenever the container restarts, you'll lose your downloading progress.**
128135
* `/app/filebrowser.db` File Browser settings database, make sure you make a empty file first on your host.
129136

130137
## Auto SSL enabling

SecureCaddyfile

+18-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
websocket
99
}
1010

11+
proxy /rclone 127.0.0.1:5572 {
12+
transparent
13+
}
14+
1115
gzip
12-
log stdout
13-
errors stdout
16+
errors stderr
1417
}
1518

1619
{$DOMAIN}/ui {
@@ -21,8 +24,19 @@
2124
root /usr/local/www/aria2
2225
timeouts none
2326
gzip
24-
log stdout
25-
errors stdout
27+
errors stderr
2628

2729
basicauth / {$ARIA2_USER} {$ARIA2_PWD}
2830
}
31+
32+
{$DOMAIN}/rclone {
33+
redir / /rclone/ 301
34+
}
35+
36+
{$DOMAIN}/rclone/ {
37+
proxy / 127.0.0.1:5572/ {
38+
transparent
39+
}
40+
gzip
41+
errors stderr
42+
}

arm32.Dockerfile

+17-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ ENV ARIA2_EXTERNAL_PORT=80
1414
ENV PUID=1000
1515
ENV PGID=1000
1616
ENV CADDYPATH=/app
17+
ENV RCLONE_CONFIG=/app/conf/rclone.conf
1718

1819
RUN adduser -D -u 1000 junv \
1920
&& apk update \
2021
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar --no-cache \
21-
&& curl https://getcaddy.com | bash -s personal \
22+
&& caddy_tag=v1.0.4 \
23+
&& wget -N https://github.com/caddyserver/caddy/releases/download/${caddy_tag}/caddy_${caddy_tag}_linux_arm7.tar.gz \
24+
&& tar -zxvf caddy_*.tar.gz \
25+
&& mv caddy /usr/local/bin/ \
26+
&& rm -rf caddy_*.tar.gz \
2227
&& filebrowser_version=v2.2.0 \
2328
&& platform=linux-armv6 \
2429
&& wget -N https://github.com/filebrowser/filebrowser/releases/download/${filebrowser_version}/${platform}-filebrowser.tar.gz \
@@ -29,9 +34,18 @@ RUN adduser -D -u 1000 junv \
2934
&& tar -zxvf forego-stable-linux-arm.tgz \
3035
&& rm -rf forego-stable-linux-arm.tgz \
3136
&& mkdir -p /usr/local/www \
32-
&& mkdir -p /usr/local/www/aria2
37+
&& mkdir -p /usr/local/www/aria2 \
38+
&& rm -rf init /app/*.txt \
39+
&& curl -O https://downloads.rclone.org/v1.53.0/rclone-v1.53.0-linux-arm.zip \
40+
&& unzip rclone-*.zip \
41+
&& cd rclone-* \
42+
&& cp rclone /usr/local/bin/ \
43+
&& chown junv:junv /usr/local/bin/rclone \
44+
&& chmod 755 /usr/local/bin/rclone \
45+
&& rm /app/rclone-*.zip \
46+
&& rm -rf /app/rclone-*
3347

34-
ADD aria2c.sh caddy.sh Procfile init.sh start.sh /app/
48+
ADD aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh /app/
3549
ADD conf /app/conf
3650
ADD Caddyfile SecureCaddyfile /usr/local/caddy/
3751

arm64.Dockerfile

+17-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ ENV ARIA2_EXTERNAL_PORT=80
1414
ENV PUID=1000
1515
ENV PGID=1000
1616
ENV CADDYPATH=/app
17+
ENV RCLONE_CONFIG=/app/conf/rclone.conf
1718

1819
RUN adduser -D -u 1000 junv \
1920
&& apk update \
2021
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar --no-cache \
21-
&& curl https://getcaddy.com | bash -s personal \
22+
&& caddy_tag=v1.0.4 \
23+
&& wget -N https://github.com/caddyserver/caddy/releases/download/${caddy_tag}/caddy_${caddy_tag}_linux_arm64.tar.gz \
24+
&& tar -zxvf caddy_*.tar.gz \
25+
&& mv caddy /usr/local/bin/ \
26+
&& rm -rf caddy_*.tar.gz \
2227
&& filebrowser_version=v2.2.0 \
2328
&& platform=linux-arm64 \
2429
&& wget -N https://github.com/filebrowser/filebrowser/releases/download/${filebrowser_version}/${platform}-filebrowser.tar.gz \
@@ -29,9 +34,18 @@ RUN adduser -D -u 1000 junv \
2934
&& tar -zxvf forego-stable-linux-arm64.tgz \
3035
&& rm -rf forego-stable-linux-arm64.tgz \
3136
&& mkdir -p /usr/local/www \
32-
&& mkdir -p /usr/local/www/aria2
37+
&& mkdir -p /usr/local/www/aria2 \
38+
&& rm -rf init /app/*.txt \
39+
&& curl -O https://downloads.rclone.org/v1.53.0/rclone-v1.53.0-linux-arm.zip \
40+
&& unzip rclone-*.zip \
41+
&& cd rclone-* \
42+
&& cp rclone /usr/local/bin/ \
43+
&& chown junv:junv /usr/local/bin/rclone \
44+
&& chmod 755 /usr/local/bin/rclone \
45+
&& rm /app/rclone-*.zip \
46+
&& rm -rf /app/rclone-*
3347

34-
ADD aria2c.sh caddy.sh Procfile init.sh start.sh /app/
48+
ADD aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh /app/
3549
ADD conf /app/conf
3650
ADD Caddyfile SecureCaddyfile /usr/local/caddy/
3751

init.sh

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ chown -R junv:junv \
1111
/data
1212

1313
chmod +x /app/caddy.sh \
14+
/app/rclone.sh \
1415
/app/aria2c.sh
1516

1617
echo "**** give caddy permissions to use low ports ****"

rclone.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /bin/bash -eu
2+
3+
echo "Start Rclone"
4+
rclone rcd --rc-web-gui \
5+
--rc-web-gui-no-open-browser \
6+
--rc-addr :5572 \
7+
--rc-user $ARIA2_USER \
8+
--rc-pass $ARIA2_PWD \
9+
--cache-dir /app/.cache

0 commit comments

Comments
 (0)