基于 EdgeOne Pages Function 的 GitHub 文件下载加速服务,支持终端命令行和浏览器下载。
- 🚀 加速下载 - 通过 EdgeOne 边缘节点加速 GitHub 文件访问
- 🖥️ 命令行支持 - 支持
git clone、wget、curl等工具 - 🔐 私有仓库 - 支持使用 Personal Access Token 访问私有仓库
- 🌐 多域名支持 - 支持
github.com、raw.githubusercontent.com、gist.github.com等 - 📋 友好界面 - 提供可视化的下载界面
github.com- 仓库源码、Releases 等raw.githubusercontent.com- 原始文件gist.github.com/gist.githubusercontent.com- Gist 代码片段codeload.github.com- 源码包下载
访问部署后的域名,通过网页界面输入 GitHub 链接进行下载。
# 公开仓库
git clone https://your-domain.com/https://github.com/user/repo.git
# 私有仓库(需要 Personal Access Token)
git clone https://username:token@your-domain.com/https://github.com/user/private-repo.git# 下载分支源码
wget https://your-domain.com/https://github.com/user/repo/archive/master.zip
# 下载 Raw 文件
wget https://your-domain.com/https://raw.githubusercontent.com/user/repo/main/README.md
# 下载 Releases 文件
wget https://your-domain.com/https://github.com/user/repo/releases/download/v1.0.0/file.tar.gz# 下载文件
curl -O https://your-domain.com/https://github.com/user/repo/archive/master.zip
# 下载 Raw 文件
curl -O https://your-domain.com/https://raw.githubusercontent.com/user/repo/main/file.txt对于私有仓库,需要在 GitHub 创建 Personal Access Token:
- 访问 GitHub Settings - Personal Access Tokens
- 生成新的 Token,选择适当的权限
- 在 URL 中使用格式:
https://username:token@your-domain.com/https://github.com/...
# 安装依赖
npm install
# 启动开发服务器
npm run devEdgeOne 支持直接部署 TypeScript 文件:
- 将
functions/文件夹和edgeone.json上传到 EdgeOne Pages - 或使用 Git 仓库自动部署
⚠️ 不支持 SSH Key 方式的 git clone⚠️ 私有仓库必须使用 Personal Access Token⚠️ 请合理使用,避免滥用服务
- 基于 EdgeOne Pages Functions
- TypeScript 开发,支持类型检查
- 智能路径识别和域名路由
- 完整的错误处理和日志记录