Skip to content

Commit 802a2d5

Browse files
committed
chore: v2.0 docs, deps, build config, and gitignore for open-source release
- README.md / README_CN.md: updated with v2.0 features (AES-256-GCM vault, load balancer, audit bus, browser extension SDK, installers) - README config tables: added UPSTREAM_LLM_URLS, UPSTREAM_LB_STRATEGY, MAPPING_TTL, STATELESS_MODE environment variables - website-astro: Astro 4→6, TypeScript 5→6, @astrojs/sitemap 1→3 - Dockerfile: added load_balancer.py, audit.py, vault_crypto.py to COPY - PrivacyGateway.spec: added missing modules to PyInstaller datas - Version bump v1.1.0→v2.0.0 across main.py, start.py, build.bat, installer/setup.iss, packaging/macos/Info.plist, admin.py, website pages - .gitignore: added installer/Output/, website-astro/dist/, website-astro/site.zip, payment QR codes
1 parent f51f388 commit 802a2d5

14 files changed

Lines changed: 58 additions & 24 deletions

File tree

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,14 @@ sdk/js/coverage/
7676
# PyInstaller配置
7777
*.spec
7878
!PrivacyGateway.spec
79+
80+
# 安装程序构建产物
81+
installer/Output/
82+
83+
# Astro 构建产物
84+
website-astro/dist/
85+
website-astro/site.zip
86+
87+
# 支付二维码(本地文件,不提交)
88+
website-astro/public/wechat-pay-qr.jpg
89+
website-astro/public/wechat-qr-alt.jpg

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ RUN pip install --no-cache-dir -r requirements.txt
1919

2020
# 复制源码
2121
COPY config.py mask_engine.py ner_engine.py stream_buffer.py gateway_core.py database.py main.py ./
22+
COPY load_balancer.py audit.py vault_crypto.py ./
2223

2324
# 复制路由模块和静态文件
2425
COPY routers ./routers

PrivacyGateway.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ a = Analysis(
1313
('stream_buffer.py', '.'),
1414
('gateway_core.py', '.'),
1515
('database.py', '.'),
16+
('load_balancer.py', '.'),
17+
('audit.py', '.'),
18+
('vault_crypto.py', '.'),
1619
],
1720
hiddenimports=[
1821
'uvicorn',

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> Open-source PII masking proxy for ChatGPT, Claude, Cursor, DeepSeek, and any LLM API.
44
> Install a firewall for your AI data in 30 seconds. [MIT Licensed]
55
6-
**v1.1.0** — A high-performance reverse proxy that automatically detects and masks sensitive data (phone numbers, ID cards, emails, bank cards, names, locations, API keys, and 14+ entity types) in AI API requests and responses. Protects PII before it leaves your machine.
6+
**v2.0.0** — A high-performance reverse proxy that automatically detects and masks sensitive data (phone numbers, ID cards, emails, bank cards, names, locations, API keys, and 14+ entity types) in AI API requests and responses. Protects PII before it leaves your machine. New in v2.0: AES-256-GCM vault encryption, multi-upstream load balancer, pub/sub audit bus, browser extension SDK, Windows/macOS installers.
77

88
<p align="center">
99
<a href="https://privacygw.pages.dev"><strong>Website</strong></a> ·
@@ -243,7 +243,11 @@ Download from [Releases](https://github.com/gunxueqiu6/ai-privacy-gateway/releas
243243
| `DB_PATH` | ./vault_data/privacy_vault.db | SQLite database path |
244244
| `ADMIN_PASSWORD` | (auto-generated) | Admin dashboard password |
245245
| `JWT_SECRET` | (auto-generated) | JWT signing secret |
246-
| `VAULT_ENCRYPT_KEY` | (auto-generated) | Vault encryption key |
246+
| `VAULT_ENCRYPT_KEY` | (auto-generated) | AES-256-GCM vault encryption key |
247+
| `UPSTREAM_LLM_URLS` | (empty) | Comma-separated upstream URLs for load balancing |
248+
| `UPSTREAM_LB_STRATEGY` | round_robin | Load balancer strategy: round_robin / random / least_connections |
249+
| `MAPPING_TTL` | 259200 (72h) | Mapping TTL in seconds (0 = delete on request complete) |
250+
| `STATELESS_MODE` | 0 | Set to 1 for in-memory only (no disk writes) |
247251

248252
---
249253

@@ -295,7 +299,14 @@ ai-privacy-gateway/
295299
│ ├── api.py # Mask/restore API
296300
│ ├── admin.py # Admin dashboard
297301
│ └── auth.py # Auth endpoints
302+
├── load_balancer.py # Multi-upstream load balancer
303+
├── audit.py # Pub/sub audit event bus
304+
├── vault_crypto.py # AES-256-GCM vault encryption
298305
├── static/ # Admin dashboard UI
306+
├── sdk/ # Client SDKs
307+
│ ├── browser-extension/ # Chrome/Edge extension
308+
│ ├── js/ # JavaScript/TypeScript SDK
309+
│ └── flutter/ # Flutter/Dart SDK
299310
├── tests/ # Test suite
300311
└── website-astro/ # Public website (Astro)
301312
```

README_CN.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> 你的 AI 数据正在裸奔。30 秒装上防火墙。
44
5-
**v1.1.0** — 开源 AI API 隐私网关。在数据离开你机器之前自动脱敏。
5+
**v2.0.0** — 开源 AI API 隐私网关。在数据离开你机器之前自动脱敏。v2.0 新增:AES-256-GCM Vault 加密、多上游负载均衡、发布/订阅审计总线、浏览器扩展 SDK、Windows/macOS 安装程序
66

77
高性能反向代理,自动脱敏 AI API 请求/响应中的敏感数据(手机号、身份证、邮箱、银行卡、人名、地名等),支持所有 OpenAI 兼容服务,包括 DeepSeek、Claude、ChatGPT 和 Cursor。
88

@@ -235,7 +235,11 @@ WantedBy=multi-user.target
235235
| `DB_PATH` | ./vault_data/privacy_vault.db | SQLite 数据库路径 |
236236
| `ADMIN_PASSWORD` | (自动生成) | 管理后台密码 |
237237
| `JWT_SECRET` | (自动生成) | JWT 签名密钥 |
238-
| `VAULT_ENCRYPT_KEY` | (自动生成) | Vault 加密密钥 |
238+
| `VAULT_ENCRYPT_KEY` | (自动生成) | AES-256-GCM Vault 加密密钥 |
239+
| `UPSTREAM_LLM_URLS` | (空) | 多上游 LLM 地址,逗号分隔,用于负载均衡 |
240+
| `UPSTREAM_LB_STRATEGY` | round_robin | 负载均衡策略:round_robin、random、least_connections |
241+
| `MAPPING_TTL` | 259200(72小时) | 映射条目 TTL 秒数(0 = 请求完成后即删除) |
242+
| `STATELESS_MODE` | 0 | 设为 1 启用无状态模式(纯内存,不落盘) |
239243

240244
---
241245

@@ -287,7 +291,14 @@ ai-privacy-gateway/
287291
│ ├── api.py # 脱敏/还原 API
288292
│ ├── admin.py # 管理后台
289293
│ └── auth.py # 认证
294+
├── load_balancer.py # 多上游负载均衡器
295+
├── audit.py # 发布/订阅审计事件总线
296+
├── vault_crypto.py # AES-256-GCM Vault 加密
290297
├── static/ # 管理后台前端
298+
├── sdk/ # 客户端 SDK
299+
│ ├── browser-extension/ # Chrome/Edge 浏览器扩展
300+
│ ├── js/ # JavaScript/TypeScript SDK
301+
│ └── flutter/ # Flutter/Dart SDK
291302
├── tests/ # 测试用例
292303
└── website-astro/ # 官网 (Astro)
293304
```

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if exist "dist\PrivacyGateway.exe" (
4242
echo 全部构建成功!
4343
echo.
4444
echo EXE: dist\PrivacyGateway.exe
45-
echo 安装程序: installer\Output\AI-Privacy-Gateway-Setup-1.1.0.exe
45+
echo 安装程序: installer\Output\AI-Privacy-Gateway-Setup-2.0.0.exe
4646
echo.
4747
echo 双击安装程序即可安装到 Program Files。
4848
echo 或在 dist\ 中直接运行 PrivacyGateway.exe(需同级放 .env)

installer/setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define MyAppPublisher "AI Privacy Gateway"
66
#define MyAppURL "https://privacygw.pages.dev"
77
#define MyAppExeName "PrivacyGateway.exe"
8-
#define MyAppVersion "1.1.0"
8+
#define MyAppVersion "2.0.0"
99

1010
[Setup]
1111
AppId={{A7B8E9C4-2D3F-4A1B-8E6C-9F0D1A2B3C4E}

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def cleanup_loop():
6262
app = FastAPI(
6363
title="AI隐私网关",
6464
description="边缘侧本地隐私网关 - 拦截AI请求自动脱敏",
65-
version="1.1.0",
65+
version="2.0.0",
6666
lifespan=lifespan,
6767
)
6868

@@ -137,7 +137,7 @@ async def admin_panel_slash():
137137

138138
banner = [
139139
"=" * 56,
140-
" AI Privacy Gateway v1.1.0",
140+
" AI Privacy Gateway v2.0.0",
141141
" Your AI Data Privacy Firewall",
142142
"=" * 56,
143143
f" API: http://localhost:{config.LISTEN_PORT}/v1",

packaging/macos/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<key>CFBundleIdentifier</key>
1010
<string>dev.pages.privacygw</string>
1111
<key>CFBundleVersion</key>
12-
<string>1.1.0</string>
12+
<string>2.0.0</string>
1313
<key>CFBundleShortVersionString</key>
14-
<string>1.1.0</string>
14+
<string>2.0.0</string>
1515
<key>CFBundleExecutable</key>
1616
<string>PrivacyGateway</string>
1717
<key>CFBundlePackageType</key>

start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def print_welcome() -> None:
125125
"""显示欢迎 Logo 和简介。"""
126126
logo = textwrap.dedent("""\
127127
+----------------------------------------------+
128-
| AI Privacy Gateway v1.1.0 |
128+
| AI Privacy Gateway v2.0.0 |
129129
| 你的 AI 数据隐私防火墙 |
130130
+----------------------------------------------+
131131
""")

0 commit comments

Comments
 (0)