Skip to content

Commit bd44ca5

Browse files
author
VPNDevelop
committed
Add verifiable documentation and release assets
1 parent 482ade3 commit bd44ca5

8 files changed

Lines changed: 268 additions & 1 deletion

File tree

.github/workflows/container.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Container
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
attestations: write
17+
contents: read
18+
id-token: write
19+
packages: write
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
23+
- name: Log in to GitHub Container Registry
24+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Extract metadata
30+
id: meta
31+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
32+
with:
33+
images: ghcr.io/vpndevelop/singlink-control-plane-demo
34+
tags: |
35+
type=semver,pattern={{version}}
36+
type=semver,pattern={{major}}.{{minor}}
37+
type=sha
38+
- name: Build and publish
39+
id: push
40+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+
provenance: mode=max
47+
sbom: true
48+
- name: Attest build provenance
49+
uses: actions/attest@36051bcae73b7c2a8a6945a48cbf80953c6baa35 # v4
50+
with:
51+
subject-name: ghcr.io/vpndevelop/singlink-control-plane-demo
52+
subject-digest: ${{ steps.push.outputs.digest }}
53+
push-to-registry: true

.github/workflows/pages.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
concurrency:
10+
group: pages
11+
cancel-in-progress: false
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
19+
- name: Configure Pages
20+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
21+
- name: Build with Jekyll
22+
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1
23+
with:
24+
source: ./docs
25+
destination: ./_site
26+
- name: Upload artifact
27+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
28+
29+
deploy:
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-24.04
34+
needs: build
35+
permissions:
36+
pages: write
37+
id-token: write
38+
steps:
39+
- name: Deploy Pages
40+
id: deployment
41+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

CITATION.cff

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cff-version: 1.2.0
2+
message: "如果本项目对您的研究、文章或产品设计有帮助,请引用此仓库。"
3+
title: "如何开发一个 VPN 软件:SingLink 架构与开源参考实现"
4+
type: software
5+
authors:
6+
- name: VPNDevelop
7+
website: "https://vpndevelop.com/"
8+
repository-code: "https://github.com/VPNDevelop/vpn-development-guide"
9+
url: "https://vpndevelop.com/open-source"
10+
license: Apache-2.0
11+
version: 0.1.0
12+
keywords:
13+
- VPN 软件开发
14+
- SingLink
15+
- VPN control plane
16+
- VPN client
17+
- node management
18+
abstract: >-
19+
面向中文开发者的 VPN 软件架构教程和可运行控制平面参考实现,
20+
涵盖客户端、控制平面、节点、安全测试与发布流程。

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 如何开发一个 VPN 软件
22

3-
[English summary](README.en.md) · [开发路线图](ROADMAP.md) · [安全政策](SECURITY.md) · [VPNDevelop](https://vpndevelop.com/)
3+
[English summary](README.en.md) · [开发路线图](ROADMAP.md) · [安全政策](SECURITY.md) · [引用本项目](CITATION.cff) · [VPNDevelop](https://vpndevelop.com/)
44

55
这是一个以简体中文为主、持续维护的 VPN 软件开发教程与开源参考实现。项目从产品架构、协议选择、控制平面、节点管理、客户端接入、安全测试到应用商店上架,说明一个 VPN 产品如何从概念走到可验证交付。
66

@@ -75,6 +75,15 @@ deploy/ 本地 Docker 示例
7575

7676
欢迎提交文档修正、测试、平台兼容建议和经过验证的实现。提交前请阅读 [贡献指南](CONTRIBUTING.md)。安全问题请不要创建公开 Issue,请按 [安全政策](SECURITY.md) 联系 `support@vpndevelop.com`
7777

78+
## 第三方可验证资产
79+
80+
- GitHub Pages 技术文档由本仓库 `docs/` 自动构建,不维护隐藏副本。
81+
- Postman Collection 位于 [`postman/`](postman/),默认只访问本机教学服务。
82+
-`v` 的版本标签会构建 `ghcr.io/vpndevelop/singlink-control-plane-demo`,并附带来源证明和 SBOM。
83+
- 所有镜像站与内容分发必须遵守[开源发布与安全边界](docs/PUBLICATION_BOUNDARIES.md)
84+
85+
发布后,GitHub 仓库仍是代码、版本和安全政策的唯一上游来源。
86+
7887
## 商业开发
7988

8089
如需完整 VPN 客户端、节点系统、协议集成、源码交付、贴牌或应用商店上架服务,请访问:

docs/PUBLICATION_BOUNDARIES.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default
3+
title: 开源发布与安全边界
4+
description: VPNDevelop 示例代码、容器镜像、API 文档和第三方镜像站的公开边界。
5+
---
6+
7+
# 开源发布与安全边界
8+
9+
本仓库公开的是通用工程方法、教学代码和模拟数据。任何第三方镜像、文档站、容器或 API Collection 都必须遵守同一边界。
10+
11+
## 可以公开
12+
13+
- 不包含真实账号的接口结构和模拟响应
14+
- 仅在内存中运行的教学型控制平面
15+
- 架构边界、测试方法和发布检查清单
16+
- 由公开仓库同一提交构建的不可变版本
17+
18+
## 不得公开
19+
20+
- 生产节点地址、服务器清单、私钥、令牌和环境变量
21+
- 客户名称、用户标识、订阅、支付和真实流量数据
22+
- SingLink 商业系统源码、调度策略和反滥用规则
23+
- 未修复漏洞的利用细节
24+
- 可绕过平台审核、网络策略或法律要求的实现
25+
26+
## 第三方发布要求
27+
28+
1. Docker/OCI 镜像必须由 GitHub Actions 从公开提交构建,不从开发者电脑手工上传。
29+
2. 镜像标签必须包含版本号;生产用途不得使用 `latest` 作为唯一依据。
30+
3. Postman 示例只能使用 `127.0.0.1` 和模拟变量,禁止提交真实 Token。
31+
4. Gitee 等镜像站必须注明 GitHub 是上游来源,并保留许可证与安全政策。
32+
5. 文档站只发布仓库内容,不注入统计密钥、客户脚本或生产配置。
33+
6. 发布前必须完成 secret scan、单元测试、镜像健康检查和文件差异复核。
34+
35+
## 漏洞报告
36+
37+
请遵循仓库的 [安全政策](https://github.com/VPNDevelop/vpn-development-guide/security/policy)。不要在 Issue、Discussion 或公开评论中粘贴敏感信息。

docs/_config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: VPNDevelop 开发指南
2+
description: 中文 VPN 软件开发教程、SingLink 架构与开源参考实现
3+
lang: zh-CN
4+
url: https://vpndevelop.github.io
5+
baseurl: /vpn-development-guide
6+
repository: VPNDevelop/vpn-development-guide
7+
theme: jekyll-theme-minimal
8+
plugins:
9+
- jekyll-seo-tag

docs/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: default
3+
title: 如何开发一个 VPN 软件
4+
description: 中文 VPN 软件开发教程,介绍 SingLink 模块化架构、客户端、控制平面、节点、安全与上架流程。
5+
---
6+
7+
# 如何开发一个 VPN 软件
8+
9+
本技术文档以简体中文说明 VPN 产品从架构设计到可验证交付的主要工程环节,并提供一个可运行的教学型控制平面。
10+
11+
> 本项目用于教学和架构参考,不是可直接承载真实用户流量的商业 VPN 系统。
12+
13+
## 阅读路线
14+
15+
1. [VPN 软件整体架构](01-vpn-architecture.md)
16+
2. [SingLink 模块化架构](02-singlink-architecture.md)
17+
3. [VPN 客户端开发](03-client-development.md)
18+
4. [控制平面与配置下发](04-control-plane.md)
19+
5. [VPN 节点部署与运行](05-node-deployment.md)
20+
6. [密钥管理与安全边界](06-key-management.md)
21+
7. [日志、隐私与可观测性](07-logging-and-privacy.md)
22+
8. [应用商店上架](08-app-store-release.md)
23+
9. [安全测试与发布验收](09-security-testing.md)
24+
25+
## 可验证资源
26+
27+
- [源代码与版本记录](https://github.com/VPNDevelop/vpn-development-guide)
28+
- [公开边界说明](PUBLICATION_BOUNDARIES.md)
29+
- [Postman API 示例](https://github.com/VPNDevelop/vpn-development-guide/blob/main/postman/VPNDevelop-SingLink-Control-Plane.postman_collection.json)
30+
- [VPNDevelop 开源项目页](https://vpndevelop.com/open-source)
31+
32+
安全问题请按[安全政策](https://github.com/VPNDevelop/vpn-development-guide/security/policy)联系维护者,不要创建公开 Issue。
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"info": {
3+
"_postman_id": "4a7a5af2-07d8-4f37-b3b0-68bb2c90ee25",
4+
"name": "VPNDevelop SingLink Control Plane Demo",
5+
"description": "教学型控制平面 API。默认只访问本机,不含生产地址、凭据或真实数据。",
6+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
7+
},
8+
"variable": [
9+
{
10+
"key": "baseUrl",
11+
"value": "http://127.0.0.1:8080",
12+
"type": "string"
13+
}
14+
],
15+
"item": [
16+
{
17+
"name": "健康检查",
18+
"request": {
19+
"method": "GET",
20+
"header": [],
21+
"url": {
22+
"raw": "{{baseUrl}}/healthz",
23+
"host": ["{{baseUrl}}"],
24+
"path": ["healthz"]
25+
},
26+
"description": "确认教学服务正在运行。"
27+
},
28+
"event": [
29+
{
30+
"listen": "test",
31+
"script": {
32+
"type": "text/javascript",
33+
"exec": [
34+
"pm.test('HTTP 200', function () { pm.response.to.have.status(200); });",
35+
"pm.test('返回健康状态', function () { pm.expect(pm.response.json().status).to.eql('ok'); });"
36+
]
37+
}
38+
}
39+
]
40+
},
41+
{
42+
"name": "节点列表",
43+
"request": {
44+
"method": "GET",
45+
"header": [],
46+
"url": {
47+
"raw": "{{baseUrl}}/v1/nodes",
48+
"host": ["{{baseUrl}}"],
49+
"path": ["v1", "nodes"]
50+
},
51+
"description": "读取内存中的教学节点列表;重启服务后数据会清空。"
52+
},
53+
"event": [
54+
{
55+
"listen": "test",
56+
"script": {
57+
"type": "text/javascript",
58+
"exec": [
59+
"pm.test('HTTP 200', function () { pm.response.to.have.status(200); });"
60+
]
61+
}
62+
}
63+
]
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)