Share files using Cloudflare Workers and GitHub Private Repositories!
- Clone this repository
- Create a new GitHub Personal Access Token with the
repo
scope - Create a private repository to store your files
- Make sure you have
npm
andwrangler
installed and configured - Create a new KV namespace by running
wrangler kv namespace create file-share-data
- Update file
wrangler.toml
:
name = "file-share"
main = "src/index.ts"
compatibility_flags = [ "nodejs_compat" ]
compatibility_date = "2023-10-02"
assets = { directory = "./public" }
[placement]
mode = "smart"
[[kv_namespaces]]
binding = "fileShare"
id = "..." // The ID of the kv you created, output in step 5
- Run
npm install
to install dependencies - Run
wrangler deploy
to publish your project - Run
wrangler secret put GithubPAT
,wrangler secret put GithubOwner
,wrangler secret put GithubRepo
,wrangler secret put GithubBranch
to store your GitHub Personal Access Token, GitHub Owner, GitHub Repository and GitHub Branch respectively - Your file share is now live! 🎉
This project is licensed under the terms of the GNU General Public License v3.0.