├── Procfile
├── requirements.txt
├── Dockerfile
├── app.json
├── start.sh
├── README.md
└── templates
└── dark.html
/Procfile:
--------------------------------------------------------------------------------
1 | web: bash start.sh
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | requests
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine
2 | RUN apk add bash curl unzip
3 | RUN curl https://rclone.org/install.sh | bash
4 | COPY . .
5 | CMD bash start.sh
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Rclone Index",
3 | "description": "Deploy rclone index for your cloud storages easily",
4 | "repository": "https://github.com/devolart/rclone-index",
5 | "env": {
6 | "CONFIG_BASE64": {
7 | "description": "(Choose one between CONFIG_BASE64 or CONFIG_URL) Rclone config that has been encoded with base64. You can use https://emn178.github.io/online-tools/base64_encode.html to encode your rclone.conf content, copy the encoded config, and paste it to this variable.",
8 | "required": false
9 | },
10 | "CONFIG_URL": {
11 | "description": "(Choose one between CONFIG_BASE64 or CONFIG_URL) Raw rclone config URL. You can use https://gist.github.com, create a hidden gist, paste your rclone.conf content, save it, and copy the raw URL of that gist.",
12 | "required": false
13 | },
14 | "USERNAME": {
15 | "description": "Username for authentication (leave blank for no auth). It must be paired with PASSWORD variable if you want to add authentication.",
16 | "required": false
17 | },
18 | "PASSWORD": {
19 | "description": "Password for authentication (leave blank for no auth). It must be paired with USERNAME variable if you want to add authentication.",
20 | "required": false
21 | },
22 | "DARK_MODE": {
23 | "description": "Set true to enable dark mode, leaving this empty or filling any value other than true will set the template to light mode.",
24 | "required": false
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | if command -v rclone &> /dev/null
2 | then
3 | echo "Rclone executable found (global)"
4 | RCLONE_COMMAND="rclone"
5 | else
6 | RCLONE_COMMAND="./rclone"
7 | if [ ! -f rclone ]; then
8 | echo "No rclone executable found, installing first (binary)"
9 | curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
10 | unzip rclone-current-linux-amd64.zip
11 | cp rclone-*-linux-amd64/rclone .
12 | rm -rf rclone-*
13 | chmod +x rclone
14 | else
15 | echo "Rclone executable found (binary)"
16 | fi
17 | fi
18 |
19 | if [ -z "${PORT}" ]; then
20 | echo "No PORT env var, using 8080 port"
21 | PORT=8080
22 | else
23 | echo "PORT env var found, using $PORT port"
24 | fi
25 |
26 | if [ -n "${CONFIG_BASE64}" ] || [ -n "${CONFIG_URL}" ]; then
27 | echo "Rclone config found"
28 |
29 | if [ -n "${CONFIG_BASE64}" ]; then
30 | echo "${CONFIG_BASE64}" | base64 -d > rclone.conf
31 | echo "Base64-encoded config is used"
32 | elif [ -n "${CONFIG_URL}" ]; then
33 | curl "$CONFIG_URL" > rclone.conf
34 | echo "Gist link config is used"
35 | fi
36 |
37 | contents=$(cat rclone.conf)
38 |
39 | if ! echo "$contents" | grep -q "\[combine\]"; then
40 | remotes=$(echo "$contents" | grep '^\[' | sed 's/\[\(.*\)\]/\1/g')
41 |
42 | upstreams=""
43 | for remote in $remotes; do
44 | upstreams+="$remote=$remote: "
45 | done
46 |
47 | upstreams=${upstreams::-1}
48 |
49 | echo -e "\n\n[combine]\ntype = combine\nupstreams = $upstreams" >> rclone.conf
50 | fi
51 |
52 | else
53 | echo "No Rclone config URL found, serving blank config"
54 | touch rclone.conf
55 | echo -e "[combine]\ntype = alias\nremote = dummy" > rclone.conf
56 | fi
57 |
58 | CMD="${RCLONE_COMMAND} serve http combine: --addr=:$PORT --read-only --config rclone.conf"
59 | if [ -n "${USERNAME}" ] && [ -n "${PASSWORD}" ]; then
60 | CMD="${CMD} --user=\"$USERNAME\" --pass=\"$PASSWORD\""
61 | echo "Authentication is set"
62 | fi
63 | if [ "${DARK_MODE,,}" = "true" ]; then
64 | CMD="${CMD} --template=templates/dark.html"
65 | echo "Template is set to dark"
66 | else
67 | echo "Template is set to light"
68 | fi
69 |
70 | echo "Running rclone index"
71 | eval $CMD
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # rclone-index
2 | Deploy rclone index for your cloud storages easily
3 |
4 | > Keep in mind that there are already some other rclone index repositories out there that you can deploy for yourself, this repository is mainly my own approach for that purpose. To name a few of those repositories: (these repositories may be old, but they should still work)
5 | > 1. https://github.com/developeranaz/RCLONE-SERVE-INDEX
6 | > 2. https://github.com/culturecloud/rclone-index
7 | > 3. https://github.com/iamdjsai9999/Multi-Cloud-Index
8 |
9 | ## Features
10 | - [x] Multiple rclone remotes in one index
11 | - [x] No colons in URL (following [MLTB](https://github.com/anasty17/mirror-leech-telegram-bot) method), unlike the default behavior of other similar repos
12 | - [x] Light mode and dark mode
13 | - [x] Easy deployment
14 | - [x] Docker and VPS supported (even for no-root environment)
15 | - [x] Many PaaS platforms supported (some are even free)
16 | - [x] Loading rclone configs via base64 or GitHub Gist link
17 | - [x] Authentication supported
18 |
19 | ## Demo Site
20 | https://demo.rclone-index.workers.dev/
21 |
22 | ## Environment variables
23 | 1. `CONFIG_BASE64` (mandatory, select one)
24 |
25 | > [!NOTE]
26 | > IMPORTANT: Select one between `CONFIG_BASE64` or `CONFIG_URL`. `CONFIG_BASE64` is recommended because it doesn't expose your rclone config as a link. Use this if you want maximum security.
27 |
28 | Rclone config that has been encoded with base64. You can use https://emn178.github.io/online-tools/base64_encode.html to encode your rclone.conf content, copy the encoded config, and paste it to this variable.
29 |
30 | 2. `CONFIG_URL` (mandatory, select one)
31 |
32 | > [!NOTE]
33 | > IMPORTANT: Select one between `CONFIG_BASE64` or `CONFIG_URL`. `CONFIG_URL` is not recommended because it exposes your config as a link, even though the chance people may stumble into your link is very little as it is a private gist.
34 |
35 | Raw rclone config URL. You can use https://gist.github.com, create a secret gist, paste your rclone.conf content, save it, and copy the raw URL of that gist.
36 |
37 | 3. `PORT` (Optional)
38 |
39 | Server port you want to use for rclone index. If you use PaaS, it's most likely that PORT variable has been assigned by default, so you can leave this blank first to check. If you don't specify and the server you use doesn't assign PORT variable automatically, it will use 8080 port.
40 |
41 | 4. `USERNAME` (Optional)
42 |
43 | Username for authentication (leave blank for no auth). It must be paired with `PASSWORD` variable if you want to add authentication.
44 |
45 | 5. `PASSWORD` (Optional)
46 |
47 | Password for authentication (leave blank for no auth). It must be paired with `USERNAME` variable if you want to add authentication.
48 |
49 | 6. `DARK_MODE` (Optional)
50 |
51 | Set this to `true` to enable dark mode. Leaving this empty or any value other than `true` will set it to light mode. You can also edit the dark mode's template at `templates/dark.html`. Thanks to [@culturecloud](https://github.com/culturecloud) for the dark mode template (I couldn't find it anywhere else)
52 |
53 | Light mode (default):
54 | 
55 |
56 | Dark mode:
57 | 
58 |
59 | ## Deployments
60 | ### Docker
61 | You need to make sure that Docker is installed in your server
62 | 1. Clone this repo
63 | ```
64 | git clone https://github.com/devolart/rclone-index
65 | ```
66 | 2. Open the cloned repo directory
67 | ```
68 | cd rclone-index
69 | ```
70 | 3. Build the docker
71 | ```
72 | sudo docker build . -t rclone-index
73 | ```
74 | 4. Copy this command, modify the environment variables (remove if needed), and run it
75 | ```
76 | sudo docker run -e CONFIG_BASE64= -e CONFIG_URL= -e PORT=8080 -e USERNAME= -e PASSWORD= -e DARK_MODE=false -p 8080:8080 rclone-index
77 | ```
78 | ### VPS (without root)
79 | 1. Copy these commands and modify the environment variables (remove if needed)
80 | ```
81 | export CONFIG_BASE64=
82 | export CONFIG_URL=
83 | export PORT=8080
84 | export USERNAME=
85 | export PASSWORD=
86 | export DARK_MODE=false
87 | ```
88 | 2. Run this command
89 | ```
90 | curl https://raw.githubusercontent.com/devolart/rclone-index/main/start.sh | bash
91 | ```
92 | ### Heroku
93 | [](https://heroku.com/deploy?template=https://github.com/devolart/rclone-index)
94 |
95 | ### Scalingo
96 | [](https://dashboard.scalingo.com/create/app?source=https://github.com/devolart/rclone-index#main)
97 |
98 | ### Render
99 | Make a new web service, use `https://github.com/devolart/rclone-index` as GitHub template, add environment variables (don't add PORT variable), and deploy it
100 |
101 | ### Railway
102 | [](https://railway.app/template/dEP4Kk)
103 |
104 | ### Glitch
105 | Unfortunately, the original project has been suspended on Glitch
106 |
107 | ### Koyeb
108 | [](https://app.koyeb.com/deploy?type=git&repository=github.com/devolart/rclone-index&branch=main&name=rclone-index)
109 |
110 | ### Clever Cloud
111 | Fork this repo, connect your Clever Cloud account to the forked repo, add environment variables (don't add PORT variable), and deploy it
112 |
113 | ### Northflank
114 | Make a new service, use `https://github.com/devolart/rclone-index` as GitHub template, add environment variables (set the port to 8080), expose 8080 port as HTTP to the internet, and deploy it
115 |
116 | ## Support Group
117 | [](https://t.me/tearflakes)
118 |
119 |
120 | [](https://t.me/tearflakeschat)
121 |
122 | ## Credits
123 | 1. [Rclone](https://rclone.org) for the amazing tool
124 | 2. Other users who have created rclone index repos before
125 | 3. [@devolart](https://github.com/devolart) for making this approach of Rclone index
126 |
--------------------------------------------------------------------------------
/templates/dark.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
23 |
24 |
25 |
26 |