|
Download README.md from semprong/dropbox: direct link, hf CLI and curl.
- Browser
- Download file 3.6 kB
-
https://huggingface.co/spaces/semprong/dropbox/resolve/main/README.md
- Command line
-
hf download hf://spaces/semprong/dropbox/README.md
-
curl -L -o README.md https://huggingface.co/spaces/semprong/dropbox/resolve/main/README.md
3.6 kB
metadata
title: Dropbox Rclone
emoji: π¦
colorFrom: blue
colorTo: gray
sdk: docker
app_port: 7860
pinned: false
dropbox-rclone
A Python web app that lets users generate their own rclone Dropbox configs using their own Dropbox app credentials. Multiple users can use the app simultaneously β each session is completely isolated.
How it works
- A user visits the app and enters their Dropbox Client ID (app key) and Client Secret (app secret).
- The app redirects them to Dropbox to authorise access.
- After authorisation, the app exchanges the code for tokens and generates a ready-to-use rclone config block.
- The user copies the config into their rclone config file.
Prerequisites
- Python 3.9+
- A Dropbox app (App Console)
Dropbox app setup
- Create an app in the Dropbox App Console.
- Under OAuth 2 β Redirect URIs, add the callback URL for your deployment, e.g.:
- Local development:
http://localhost:5000/callback - Production:
https://your-domain.com/callback
- Local development:
- Note the App key (Client ID) and App secret (Client Secret).
Running locally
pip install -r requirements.txt
# Optional but recommended in production:
export SECRET_KEY="$(python -c 'import secrets; print(secrets.token_hex(32))')"
python app.py
# β http://localhost:5000
Running with Gunicorn (recommended for production)
export SECRET_KEY="a-long-random-string"
export PORT=7860
gunicorn --bind 0.0.0.0:$PORT --workers 2 --threads 2 app:app
Docker
docker build -t dropbox-rclone .
docker run -p 7860:7860 -e SECRET_KEY="a-long-random-string" dropbox-rclone
Hugging Face Spaces
This repository is ready to deploy on Hugging Face Spaces (free tier) using the Docker SDK.
- Create a new Space on Hugging Face and choose Docker as the SDK.
- Push this repository (or the
copilot/deploy-to-hugging-facebranch) to the Space. - In the Space Settings β Repository secrets, add a
SECRET_KEYsecret with a long random value:python -c "import secrets; print(secrets.token_hex(32))" - In your Dropbox app's OAuth 2 β Redirect URIs, add:
The Space URL is shown on the Space overview page.https://<your-space-owner>-<your-space-name>.hf.space/callback - Hugging Face will build and start the container automatically. The app will be available at
https://<your-space-owner>-<your-space-name>.hf.space.
Environment variables
| Variable | Default | Description |
|---|---|---|
SECRET_KEY |
random (per restart) | Secret key for signing session cookies. Set this in production. |
PORT |
5000 |
Port to listen on when running with python app.py |
Security note: Set a stable
SECRET_KEYin production. Without it, a new random key is generated on every process start, which:
- Invalidates all existing sessions on restart.
- Causes session validation failures when using multiple Gunicorn workers (each worker gets its own random key). This will break the OAuth flow for most users in a multi-worker setup.
Concurrency
The app stores all per-user state in signed, server-side session cookies, so there is no shared mutable state between requests. It scales horizontally β run as many Gunicorn workers or container replicas as you need.