The RClone-on-Cloud project aims to provide a secure, scalable, and stateless web service for rclone. It stores the rclone configuration files in a secure, centralized MongoDB storage, encrypted with AES-256-GCM and authenticated with a Google OAuth2 + JWT gateway.
The RClone-on-Cloud project is a full stack web development project. It is comprised of several components: the Web API, Web UI, and the CLI Client.
This project consists of several components, each responsible for performing a certain task to manage your cloud configurations securely. The diagram below illustrates the system architecture of the project.
graph LR
subgraph "User's Terminal"
CLI[CLI Client]
end
subgraph "Cloud / Storage"
MongoDB[(RClone Encrypted Configs \nin MongoDB)]
end
subgraph "Cloud / Web"
WebAPI[Web API]
end
subgraph "User's Browser"
WebUI[Web UI]
end
WebUI -->|"Makes \nHTTP requests"| WebAPI
WebAPI <-->|"Fetches, updates, and watches config changes from DB"| MongoDB
CLI <-->|"Fetches, updates, and watches config changes from DB"| MongoDB
Users can use the front-end web application to browse their cloud files from their remotes directly from their browser.
The application includes a file viewers to easily preview your content stored on the cloud.
Users can also modify content in the cloud, such as uploading new content, renaming files / directories, moving files / directories, and deleting files / directories.
It also provides a mobile-responsive interface for managing your files on the go.
- Go 1.25+
- Node.js & npm
- MongoDB 7.0+ (Local or Atlas)
-
Install MongoDB on your machine or use a MongoDB Atlas instance and remember its connection string.
-
Generate a 32-byte encryption key for the MongoDB configs by running:
openssl rand -base64 32
and remember it.
-
Set up your Google Cloud OAuth2 credentials here.
-
Navigate to the
apps/web-apidirectory. -
Generate an RSA or Ed25519 key pair for JWT signing and add the PEM strings to your
.env(refer to the Web API README for details). -
Create a
.envfile to set the following minimum required environment variables:RCLONE_CONFIG_MONGO_KEY=<your-mongo-key> RCLONE_CONFIG_MONGO_URI=<your-mongo-uri> RCLONE_CONFIG_MONGO_DB=rclone RCLONE_CONFIG_MONGO_COL=configs AUTH_GOOGLE_CLIENT_ID=123 AUTH_GOOGLE_CLIENT_SECRET=<your-google-oauth-client-secret> AUTH_ALLOWED_GOOGLE_IDS=<your-google-id> AUTH_GOOGLE_REDIRECT_URL=http://localhost:4200/auth/v1/google/callback AUTH_JWT_PRIVATE_KEY=<your-jwt-private-key> AUTH_JWT_PUBLIC_KEY=<your-jwt-public-key> LISTEN_ADDR=:3000 CORS_ALLOWED_URLS=http://localhost:4200
-
Download dependencies and run the API:
go mod download go run .or run via Docker:
docker build -t rclone-cloud-web-api . docker run -d --name rclone-web-api --env-file .env rclone-cloud-web-api
-
Navigate to the
apps/web-uidirectory. -
Install the project's dependencies:
npm install
-
Create a
.envfile to store your API endpoints:NG_APP_LOGIN_URL=http://localhost:3000/auth/v1/google NG_APP_WEB_API_ENDPOINT=http://localhost:3000 -
Run the development server:
npm run dev
-
Now, on your browser, go to http://localhost:4200. Log in, and you should get a 403. In the logs, there will be a message like
Unauthorized user: XYZ. Copy-paste XYZ and set it to theAUTH_GOOGLE_CLIENT_IDenvironment variable in your web api's.envfile like:... AUTH_GOOGLE_CLIENT_ID=XYZ ...
-
Restart the server (if you launched your server with Docker, run
docker stop rclone-web-api) and re-login to the web page. You should see a blank page in the Remotes page.
-
Navigate to the
apps/clidirectory. -
Build the binary locally:
go build -o rclone-cloud . -
Set your environment variables (
MONGO_URLandMONGO_KEY) to match those used by the Web API:export MONGO_URL="<your-mongo-url>" export MONGO_KEY="<your-mongo-key>"
-
Migrate your existing
rclone.confto the MongoDB storage by running:./rclone-cloud migrate --from-file <path/to/rclone.conf>
-
Now, you can run any RClone command such as:
./rclone-cloud listremotes ./rclone-cloud config ./rclone-cloud lsd <remote>: ./rclone-cloud ls <remote>: ./rclone-cloud sync . <remote>:Documents ./rclone-cloud copy file.txt <remote>: ...
You can find more available commands at https://rclone.org/commands.
- Note: each time the configs change in MongoDB, the CLI and the Web API automatically picks up the new changes.
Please note that this project is used for educational purposes and is not intended to be used commercially. We are not liable for any damages/changes done by this project.
Emilio Kartono, who made the entire project.
This project is protected under the GNU licence. Please refer to the LICENSE for more information.


