MCPcopy Index your code
hub / github.com/aoaostar/v8cdn

github.com/aoaostar/v8cdn @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
63 symbols 217 edges 29 files 14 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://z3.ax1x.com/2021/09/08/h7EZrQ.png" alt="v8cdn Logo" width="200"/>

Release version Build status Downloads License

What's this?

这是一款Cloudflare Partner面板程序,后端基于gin,前端使用vue.js

前端项目地址

演示地址

演示图

部署

配置说明

  • 后端配置
app_name: v8cdn # 应用名称
debug: false # Debug
listen: 0.0.0.0:8080  # 监听 ip + 端口
jwt_secret: v8cdn # jwt秘钥,自己随便设置
static: dist # 前端目录
cloudflare:
  email: email # cloudflare partner邮箱
  host_key: host_key # cloudflare partner host_key,留空将使用用户的Global API Key进行管理
  default_record: v8cdn.cc # 添加域名是默认解析的cname地址
RateLimit:
  enabled: false # 是否启用api请求频率限制
  fill_interval: 30 # 时间周期,单位:秒
  capacity: 30  # 单位时间周期内最大只能请求多少次,超过了返回频率限制error
  • 前端配置
window['V8CDN'] = {
  appName: "V8CDN", // 项目名称
  authType: "partner", // 认证模式 user_api_key or partner,user_api_key模式需要用户的Global API Key
  apiUrl: "//cdn.v8cdn.cc", // 后端api
  instructions: "https://blog.aoaostar.com/10.html", // 使用说明跳转地址
}

使用说明

+ `releases`下载对应的包
+ 然后运行即可
chmod +x v8cdn
nohup ./v8cdn > log.log 2>&1 &
  • 进程守护
    • vi /usr/lib/systemd/system/v8cdn.service
    • 添加以下内容,其中app_pathv8cdn所在的路径
[Unit]
Description=v8cdn
After=network.target

[Service]
Type=simple
WorkingDirectory=app_path
ExecStart=app_path/v8cdn
Restart=on-failure

[Install]
WantedBy=multi-user.target
  • 然后执行systemctl daemon-reload重载配置
启动: systemctl start v8cdn
关闭: systemctl stop v8cdn
自启: systemctl enable v8cdn
状态: systemctl status v8cdn

反向代理

  • 由于项目运行在8080端口,所以需要nginx反向代理
location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
    proxy_pass http://127.0.0.1:8080;
}
  • 使用gin代理静态资源需要注释以下内容,否则静态文件无法加载
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
    expires      30d;
    error_log /dev/null;
    access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
    expires      12h;
    error_log /dev/null;
    access_log /dev/null;
}

配置前端

  • 下载前端 https://github.com/aoaostar/v8cdn-panel/releases
  • dist目录复制到后端根目录
  • 修改前端项目根目录下的config.js内容
  • 没有Cloudflare Partner的可以使用别人的后端api,这样无需搭建后端,只需要配置前端的api就行了
  • 也可以使用Cloudfalre提供的的Global API Key
  • 没看懂看下方目录结构

目录结构

.
├── config.yaml
├── dist
│   ├── config.js
│   ├── css
│   │   ├── app.51c8db65.css
│   │   └── chunk-vendors.3ec84ff3.css
│   ├── favicon.ico
│   ├── fonts
│   │   ├── element-icons.535877f5.woff
│   │   └── element-icons.732389de.ttf
│   ├── img
│   │   ├── logo.2afbdd11.png
│   │   ├── prototype-1.61488008.png
│   │   ├── prototype-2.6cdf2ad6.png
│   │   ├── prototype-3.12a59943.png
│   │   └── prototype-4.723e3a43.png
│   ├── index.html
│   └── js
│       ├── app.d4502f7d.js
│       ├── app.d4502f7d.js.map
│       ├── chunk-vendors.3f91d629.js
│       └── chunk-vendors.3f91d629.js.map
├── logs
│   └── v8cdn.log
└── v8cdn

交叉编译

Core symbols most depended-on inside this repo

JSON
called by 65
app/util/common.go
FomateValidateError
called by 14
app/util/validator.go
Msg
called by 6
app/util/common.go
Get
called by 4
app/controllers/zone.go
GetCacheDrive
called by 3
app/util/cache.go
GetCache
called by 3
app/util/cache.go
SetCache
called by 3
app/util/cache.go
lazyinit
called by 2
pkg/Validator/validator.go

Shape

Function 26
Method 22
Struct 15

Languages

Go100%

Modules by API surface

app/controllers/zone.go8 symbols
app/controllers/dnsrecords.go7 symbols
app/controllers/auth.go7 symbols
pkg/Validator/validator.go5 symbols
app/controllers/setting.go5 symbols
app/util/jwt.go3 symbols
app/util/cache.go3 symbols
app/controllers/cache.go3 symbols
bootstrap/validator.go2 symbols
bootstrap/route.go2 symbols
app/util/http.go2 symbols
app/util/common.go2 symbols

For agents

$ claude mcp add v8cdn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact