Skip to content

jahands/transfer.sh

 
 

Repository files navigation

transfer.sh on Railway, Cloudflare R2, and Cloudflare Workers

transfer.sh is a nice front-end for quickly sharing files, and can be easily self-hosted on https://railway.app. However, having Railway proxy file downloads can be somewhat slow. So I used a Worker to intercept downloads and serve them straight from R2.

  1. Deploy this repo to Railway with the following variables:
LISTENER=8080
PURGE_DAYS=1
PROVIDER=s3
AWS_SECRET_KEY=xyz
RANDOM_TOKEN_LENGTH=12
S3_ENDPOINT=xyz.r2.cloudflarestorage.com
PORT=8080
AWS_ACCESS_KEY=xyz
PURGE_INTERVAL=1
BUCKET=my-bucket
S3_REGION=auto
  1. Add a custom domain to the railway project that is orange-clouded in Cloudflare

  2. In cf-worker, update wrangler.toml with the custom domain you used and your r2 bucket

  3. Deploy cf-worker

cd cf-worker
npx wrangler publish

About

Easy and fast file sharing from the command-line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 81.1%
  • Nix 9.5%
  • Shell 7.1%
  • PowerShell 1.5%
  • Other 0.8%