https://github.com/socksthewolf/fileshareworker
A simple fileserving endpoint that uses Cloudflare's R2, Workers and Turnstile to serve up large files.
https://github.com/socksthewolf/fileshareworker
cloudflare cloudflare-workers fileserver filestorage
Last synced: 10 months ago
JSON representation
A simple fileserving endpoint that uses Cloudflare's R2, Workers and Turnstile to serve up large files.
- Host: GitHub
- URL: https://github.com/socksthewolf/fileshareworker
- Owner: SocksTheWolf
- License: mit
- Created: 2025-01-27T22:00:01.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T22:10:34.000Z (10 months ago)
- Last Synced: 2025-03-24T23:22:18.631Z (10 months ago)
- Topics: cloudflare, cloudflare-workers, fileserver, filestorage
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileShareWorker
A simple filesharing endpoint that uses Cloudflare's R2, Workers and Turnstile to serve up large files.
## Setup
Press this fancy button:
[](https://deploy.workers.cloudflare.com/?url=https://github.com/socksthewolf/FileShareWorker)
You will need to update your routes and turnstile keys later.
Or:
1. Create an R2 Bucket
2. Create a turnstile widget. Set your site private key as a secret called `CAPTCHA_PRIV_KEY` via Wrangler
3. Update the toml files with your various settings and endpoints
4. Deploy to Cloudflare
## Usage
### Uploading
You can upload your files directly via wrangler or via the web dashboard on the management portal for your bucket. This has a limit of 300MB upload.
To upload bigger files, you can download and install [rclone](https://rclone.org/install/). Follow [the instructions on this page](https://developers.cloudflare.com/r2/examples/rclone/) to set up your rclone for CloudFlare.
For ease of use and to lower your potential chance of blowing out your limits early, make sure to also add the following lines in your config:
```text
no_check_bucket=true
max_upload_parts=100
chunk_size=100Mi
```
### Downloading
Your files will be accessible via your website + FILES_PATH + file name. Anything that doesn't exist will serve up a failure page.