Compare commits

...
13 Commits
Author SHA1 Message Date
junvandGitHub 46fd0a842f Dht issue (#211)
* Move .aria2/dht.dat file to /app folder to solve the issue failed to save dht.dat

* Add env CADDY_LOG_LEVEL to allow user override log levels
2022-04-19 11:04:22 +10:00
junv-repo-bot a20300c9ea Update version 2022-04-15 13:20:48 +00:00
junvandGitHub 86252c1961 Add k8s example (#209) 2022-04-15 23:18:04 +10:00
junv-repo-bot 6493c7cc19 Update version 2022-04-15 12:37:28 +00:00
junvandGitHub 1bd477d89e Upgrade file browser to 2.21.1 and rclone to 1.58 (#208)
* Upgrade file browser to 2.21.1

* Upgrade rclone to 1.58
2022-04-15 22:34:17 +10:00
junvandGitHub 337511813d Remove deploy to heroku button, due to this docker image has been banned by Heroku (#205) 2022-04-12 16:47:09 +10:00
junvandGitHub c4a5f82641 Update README.CN.md 2022-04-06 12:05:26 +10:00
junvandGitHub c2adb8c41e Update README.md 2022-04-06 12:03:45 +10:00
junv-repo-bot ff54b5b92c Update version 2022-03-25 08:51:24 +00:00
junvandGitHub c47b5d19e6 Fix forego compile error (#203) 2022-03-25 19:47:52 +11:00
junv-repo-bot 5108254f44 Update version 2022-03-09 07:51:43 +00:00
junvandGitHub d12c6f7ea2 Refine the health point to return current app version, just for debuging issues (#200) 2022-03-09 18:48:23 +11:00
junv-repo-bot aa1db00ca1 Update version 2022-03-08 11:52:43 +00:00
12 changed files with 245 additions and 51 deletions
+1 -1
View File
@@ -1 +1 @@
4.12.0
4.14.1
+10 -12
View File
@@ -1,9 +1,10 @@
#{
# auto_https off
#}
{$DOMAIN}
log {
level {env.CADDY_LOG_LEVEL}
output stderr
}
redir /ui / 301
redir /ui/ / 301
redir /rclone /rclone/ 301
@@ -12,23 +13,20 @@ redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
}
route /ping {
respond "pong"
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
file_server
encode gzip
log {
output stderr
}
+10 -7
View File
@@ -6,9 +6,7 @@ WORKDIR /app
RUN git clone https://github.com/wahyd4/forego.git \
&& cd forego \
&& git checkout 20180216151118 \
&& go mod init \
&& go mod vendor \
&& git checkout fix-go-mod \
&& go mod download \
&& go build -o forego \
&& chmod +x forego
@@ -33,8 +31,10 @@ ENV CADDYPATH=/app
ENV RCLONE_CONFIG=/app/conf/rclone.conf
ENV XDG_DATA_HOME=/app/.caddy/data
ENV XDG_CONFIG_HOME=/app/.caddy/config
ENV XDG_CACHE_HOME=/app/.cache
ENV RCLONE_CONFIG_BASE64=""
ENV ENABLE_APP_CHECKER=true
ENV CADDY_LOG_LEVEL=INFO
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
@@ -46,13 +46,16 @@ RUN ./install.sh
RUN rm ./install.sh
# folder for storing ssl keys
VOLUME /app/conf/key
# For config files
VOLUME /app/conf/
# file downloading folder
# For file downloading
VOLUME /data
EXPOSE 80 443
# For rclone cache and aria2 DHT files
VOLUME /app/.cache
EXPOSE 80 443 6881
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/ping || exit 1
+9 -10
View File
@@ -1,13 +1,12 @@
{
debug
admin off
auto_https off
admin off
auto_https off
}
:PORT
basicauth / {
ARIA2_USER ARIA2_PWD_ENCRYPT
ARIA2_USER ARIA2_PWD_ENCRYPT
}
redir /ui / 301
@@ -18,17 +17,17 @@ redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
}
route /ping {
respond "pong"
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
@@ -36,5 +35,5 @@ file_server
encode gzip
log {
output stderr
output stderr
}
+14 -3
View File
@@ -6,11 +6,11 @@ Aria2 + AriaNg
[![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)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/wahyd4/aria2-ariang-docker/tree/master)
[![Page Views Count](https://badges.toozhao.com/badges/01EJ791D8BB43PDS8D7PP7H0YE/green.svg)](https://badges.toozhao.com/stats/01EJ791D8BB43PDS8D7PP7H0YE "Get your own page views count badge on badges.toozhao.com")
**如果你喜欢这个项目,请考虑微信打赏,让我更有动力来不断更新,谢谢!**
<img src="https://raw.githubusercontent.com/wahyd4/work-in-australia/766592ac6318027d7b3c334d8c50ca80818eeff8/wepay.jpg" alt="buy me a drink" width="120"/>
@@ -27,6 +27,7 @@ Aria2 + AriaNg
- [自动 SSL](#自动-ssl)
- [自行构建镜像](#自行构建镜像)
- [Docker Hub](#docker-hub)
- [在 Kubernetes 里面运行 (我的最爱)](#在-kubernetes-里面运行-我的最爱)
- [使用 Docker compose 来运行](#使用-docker-compose-来运行)
- [常见问题](#常见问题)
@@ -44,7 +45,7 @@ File Browser
* 自动 HTTPS Let's Encrypt
* 支持绑定自定义用户ID,可以主机上的非`root`用户,也可以管理下载的文件
* Basic Auth 用户认证
* 文件管理和视频播放 ([FileBrowser](https://filebrowser.xyz/),注意默认情况下,只能访问和管理 `/data` 目录下的文件)
* 文件管理和视频播放 ([FileBrowser](https://filebrowser.org/),注意默认情况下,只能访问和管理 `/data` 目录下的文件)
* 支持ARM CPU 架构,因此可以在树莓派等设备上运行,
## 推荐使用的docker image tag
@@ -146,6 +147,16 @@ docker build -t aria2-ui .
<https://hub.docker.com/r/wahyd4/aria2-ui/>
## 在 Kubernetes 里面运行 (我的最爱)
首先,在Kubernetes 里面运行本Docker 镜像比在Docker 里面更加复杂,需要更多的相关知识,但是也更加有意思,给你带来更多的折腾之后的满足。
你可以使用`minikube`Docker 桌面应用自带Kubernetes 或者 使用`kubeadm`来安装Kubernetes,然后你需要根据自己的需要修改 [k8s-manifest.yaml](k8s-manifest.yaml) 来满足你的需要的需求。比如:
* NFS PV provider(使用NAS 作为容器存储)
* Ingress 访问, Oauth 登录灯其他访问控制
* VPN (让数据访问更加安全)
* 其他的一些 Sidecars
## 使用 Docker compose 来运行
请参考 <https://github.com/wahyd4/aria2-ariang-x-docker-compose>
+17 -6
View File
@@ -6,13 +6,11 @@ English | [简体中文](https://github.com/wahyd4/aria2-ariang-docker/blob/mast
[![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)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/wahyd4/aria2-ariang-docker/tree/master)
[![Page Views Count](https://badges.toozhao.com/svg/aria2-ariang-docker)](https://badges.toozhao.com/stats/aria2-ariang-docker "Page Views Count")
**If you like this project, please consider support me / 如果喜欢本项目,请考虑打赏,谢谢!**
**If you like this project, please consider [sponsoring me](https://github.com/sponsors/wahyd4) / 如果喜欢本项目,请考虑打赏,谢谢!**
<img src="https://raw.githubusercontent.com/wahyd4/work-in-australia/766592ac6318027d7b3c334d8c50ca80818eeff8/wepay.jpg" alt="buy me a drink" width="120"/>
@@ -27,7 +25,8 @@ English | [简体中文](https://github.com/wahyd4/aria2-ariang-docker/blob/mast
- [Auto HTTPS enabling](#auto-https-enabling)
- [Build the image by yourself](#build-the-image-by-yourself)
- [Docker Hub](#docker-hub)
- [Usage it in Docker compose](#usage-it-in-docker-compose)
- [Running it on Kubernetes (My favorite)](#running-it-on-kubernetes-my-favorite)
- [Running it with Docker compose](#running-it-with-docker-compose)
- [FAQ](#faq)
One Docker image for file downloading, managing, sharing, as well as video playing and evening cloud storage synchronization.
@@ -47,7 +46,7 @@ File Browser
* [Aria2 (SSL support)](https://aria2.github.io)
* [AriaNg](https://github.com/mayswind/AriaNg)
* [Rclone](https://rclone.org/)
* [File Browser](https://filebrowser.xyz/): Files mangement and videos playing
* [File Browser](https://filebrowser.org/): Files mangement and videos playing
* Auto HTTPS Let's Encrypt
* Bind non root user into container, so non root user can also manage downloaded files.
* Basic Auth
@@ -158,10 +157,22 @@ docker run -d --name aria2-ui -p 80:80 -p 443:443 -e DOMAIN=https://toozhao.com
<https://hub.docker.com/r/wahyd4/aria2-ui/>
## Usage it in Docker compose
## Running it on Kubernetes (My favorite)
First of all, I have to say running this docker image on Kubernetes is more challenging and requires more knowledges than running it in raw Docker, but which is more powerful.
I couldn't tell you how to run it in Kubernetes step by step, but once you have a running Kubernetes cluster(You can install Kubernetes via `minikube`, `Docker desktop app`, `kubeadm` and many other tools.), then you can modify the [k8s-manifest.yaml](k8s-manifest.yaml) to satisfy all your requirements. Such as:
* NFS PV provider(Use your NAS as storage)
* Ingress access, Oauth login, more access controls via Nginx etc.
* VPN tunnel (Secure your traffic)
* Sidecars and so on.
## Running it with Docker compose
Please refer <https://github.com/wahyd4/aria2-ariang-x-docker-compose>
## FAQ
1. When you running the docker image with non `80` port or you have HTTPS enabled, you will meet the error says `Aria2 Status Disconnected`, then you will need to set `ARIA2_EXTERNAL_PORT` and recreate your container.
2. If there is no speed at all when you downloading a BitTorrent file, please try to use a popular torrent file first to help the application to cache `DHT` file. Then the speed should get fast and fast, as well as downloading other links.
+11 -10
View File
@@ -1,8 +1,12 @@
{$DOMAIN}
log {
level {env.CADDY_LOG_LEVEL}
output stderr
}
basicauth / {
ARIA2_USER ARIA2_PWD_ENCRYPT
ARIA2_USER ARIA2_PWD_ENCRYPT
}
redir /ui / 301
@@ -13,23 +17,20 @@ redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
}
route /ping {
respond "pong"
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
file_server
encode gzip
log {
output stderr
}
+6
View File
@@ -73,3 +73,9 @@ on-download-complete=/app/conf/aria2-sample-hook.sh
# The script to be run when download fails
on-download-error=/app/conf/aria2-sample-hook.sh
## DHT
dht-entry-point=dht.transmissionbt.com:6881
dht-entry-point=dht.vuze.com:6881
dht-entry-point=dht.libtorrent.org:25401
dht-listen-port=6881
+1
View File
@@ -6,6 +6,7 @@ usermod -o -u "$PUID" junv
mkdir -p /app/.caddy
mkdir -p /app/.cache
mkdir -p /app/.cache/aria2
chown -R junv:junv \
/app \
+2 -2
View File
@@ -3,8 +3,8 @@
echo "[INFO] Set variables for $(arch)"
caddy_version=2.4.6
filebrowser_version=v2.20.1
rclone_version=v1.57.0
filebrowser_version=v2.21.1
rclone_version=v1.58.0
ariang_version=1.2.3
case "$(arch)" in
+161
View File
@@ -0,0 +1,161 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: files
spec:
revisionHistoryLimit: 2
selector:
matchLabels:
app: files
replicas: 1
template:
metadata:
labels:
app: files
spec:
volumes:
# - name: config
# persistentVolumeClaim:
# claimName: configs-pv
- name: downloads
persistentVolumeClaim:
claimName: downloads-pv
containers:
- name: files
image: wahyd4/aria2-ui:latest
imagePullPolicy: Always
ports:
- containerPort: 80
name: files-port
protocol: TCP
env:
## Update this to the final port you would use in the browser
- name: ARIA2_EXTERNAL_PORT
value: "443"
- name: PUID
value: "1000"
- name: PGID
value: "1000"
volumeMounts:
# - name: config
# subPath: aria
# mountPath: /app/conf
# - name: config
# subPath: files/filebrowser.db
# mountPath: /app/filebrowser.db
- name: downloads
mountPath: /data
resources:
requests:
cpu: 150m
memory: 256Mi
limits:
cpu: 400m
memory: 1024Mi
# An example of encrypting the traffic with some vpn providerm, please update the configurations accordingly
# - name: openvpn
# image: qmcgaw/gluetun:latest
# securityContext:
# runAsUser: 0
# privileged: true
# capabilities:
# add: ["NET_ADMIN"]
# imagePullPolicy: Always
# env:
# - name: OPENVPN_USER
# value: xxxx
# - name: OPENVPN_PASSWORD
# valueFrom:
# secretKeyRef:
# name: openvpn-password
# key: password
# - name: VPNSP
# value: "private internet access"
# - name: PIA_ENCRYPTION
# value: normal
# - name: REGION
# value: "AU Sydney"
# - name: TZ
# value: Australia/Melbourne
# resources:
# requests:
# cpu: 100m
# memory: 126Mi
# limits:
# cpu: 100m
# memory: 126Mi
---
apiVersion: v1
kind: Service
metadata:
name: files
labels:
app: files
spec:
type: ClusterIP
ports:
- port: 80
targetPort: files-port
protocol: TCP
name: web
selector:
app: files
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: downloads-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "downloads-pv"
spec:
storageClassName: "manual"
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
# ---
# ingress example
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: files-ingress
# annotations:
# kubernetes.io/ingress.class: "nginx"
# kubernetes.io/tls-acme: "true"
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
# nginx.ingress.kubernetes.io/proxy-body-size: 10240m
# spec:
# tls:
# - hosts:
# - xx.example.com
# secretName: files-tls
# rules:
# - host: xx.example.com
# http:
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: files
# port:
# number: 80
+3
View File
@@ -1,4 +1,7 @@
#!/bin/bash -eu
export APP_VERSION=$(cat /app/APP_VERSION)
if [ "$PGID" != "0" ]; then
$(dirname $0)/init.sh chpst -u junv ./forego start
else