lavedonio.download is where I keep the files my other projects use, and serve them from addresses that don't change. It's a site to organize them and a REST API to upload and download them from code, made with Python, Django and Django REST Framework, in the design of this site.
What it does
- Uploads and links. An item is either an uploaded file or a link to a file that's somewhere else. A link's addresses redirect to it, and it doesn't use any space.
- Folders and tags. Each user has their own folder in the storage, which follows their folders: renaming or moving a file or a folder moves it in the storage too.
- Addresses for other projects. Every item has a permanent address (
/f/<id>/), which survives renames and moves, one that follows the folders (/d/<user>/<folders>/<name>), and one in the API. Files open in the browser when that's safe (images, PDFs, text...), and?downloadsaves them instead. - Private, shared or public. Each item is seen only by its user, also by the users it's shared with, or by anyone with its address, without logging in.
- Limits. By default, each file has at most 10 MB and each user stores at most 5 GB.
Accounts
There's no sign-up: accounts are created by an admin. Owners can do everything, including changing the limits and each user's quota; admins create users and manage their accounts and data; and users manage their own files, links and folders.
The API
Files, links, folders, tags and accounts can also be managed through the API, with a token created on the account page. For example, to upload a public file:
curl -H "Authorization: Token $TOKEN" -F [email protected] \
-F visibility=public https://api.lavedonio.download/v1/items/
Every endpoint is in the interactive documentation, generated from the code (OpenAPI).
How it's made
- The files are kept in private Cloudflare R2 buckets. Every download goes through Django, which checks who can see the file and then redirects to a signed address that expires in 5 minutes.
- It runs on the same servers as this site: Django under uWSGI on a CloudPanel VPS, with PostgreSQL on another one, behind Cloudflare.
- The tests run on every pull request, on SQLite and on PostgreSQL, and GitHub Actions deploys every push to the staging and production branches.