├── 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 | ![Light mode](https://cdn.glitch.global/5816d3a4-231f-47f8-8ba8-ef67edfc0885/light%20index.png) 55 | 56 | Dark mode: 57 | ![Dark mode](https://cdn.glitch.global/5816d3a4-231f-47f8-8ba8-ef67edfc0885/dark%20index.png) 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 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/devolart/rclone-index) 94 | 95 | ### Scalingo 96 | [![Deploy on Scalingo](https://cdn.scalingo.com/deploy/button.svg)](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 | [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/dEP4Kk) 103 | 104 | ### Glitch 105 | Unfortunately, the original project has been suspended on Glitch 106 | 107 | ### Koyeb 108 | [![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](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 | [![Telegram Channel](https://img.shields.io/static/v1?label=Join&message=Telegram%20Channel&color=blue&style=for-the-badge&logo=telegram&logoColor=blue)](https://t.me/tearflakes) 118 | 119 | 120 | [![Telegram Group](https://img.shields.io/static/v1?label=Join&message=Telegram%20Group&color=blue&style=for-the-badge&logo=telegram&logoColor=blue)](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 | 27 | {{html .Name}} 28 | 29 | 30 | 31 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 |
234 |

235 | {{range $i, $crumb := .Breadcrumb}}{{html $crumb.Text}}{{if ne $i 0}}/{{end}}{{end}} 236 |

237 |
238 |
239 |
240 |
241 | 242 |
243 |
244 |
245 | 246 | 247 | 248 | 249 | 254 | 257 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 271 | 272 | 273 | 274 | 275 | {{- range .Entries}} 276 | 277 | 278 | 286 | {{- if .IsDir}} 287 | 288 | {{- else}} 289 | 290 | {{- end}} 291 | {{- if .ModTime | afterEpoch }} 292 | 293 | {{- else}} 294 | 295 | {{- end}} 296 | 297 | 298 | {{- end}} 299 | 300 |
250 | 251 | 252 | Name 253 | 255 | Size 256 | 258 | Modified 259 |
267 | 268 | Go up 269 | 270 |
279 | {{- if .IsDir}} 280 | 281 | {{- else}} 282 | 283 | {{- end}} 284 | {{html .Leaf}} 285 | {{.Size}}
301 |
302 |
303 | 387 | 388 | --------------------------------------------------------------------------------