Skip to content

langningchen/FileShare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileShare

Introduction

Share files using Cloudflare Workers and GitHub Private Repositories!

Usage

  1. Clone this repository
  2. Create a new GitHub Personal Access Token with the repo scope
  3. Create a private repository to store your files
  4. Make sure you have npm and wrangler installed and configured
  5. Create a new KV namespace by running wrangler kv namespace create file-share-data
  6. 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
  1. Run npm install to install dependencies
  2. Run wrangler deploy to publish your project
  3. 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
  4. Your file share is now live! 🎉

License

This project is licensed under the terms of the GNU General Public License v3.0.