gitwebhooks 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. gitwebhooks-2.4.0/.editorconfig +12 -0
  2. gitwebhooks-2.4.0/CLAUDE.md +313 -0
  3. gitwebhooks-2.4.0/LICENSE +21 -0
  4. gitwebhooks-2.4.0/MANIFEST.in +8 -0
  5. gitwebhooks-2.4.0/PKG-INFO +575 -0
  6. gitwebhooks-2.4.0/README.md +535 -0
  7. gitwebhooks-2.4.0/README.zh.md +535 -0
  8. gitwebhooks-2.4.0/doc/custom-body.png +0 -0
  9. gitwebhooks-2.4.0/doc/custom-header.png +0 -0
  10. gitwebhooks-2.4.0/doc/custom-response.png +0 -0
  11. gitwebhooks-2.4.0/doc/gitee-success.png +0 -0
  12. gitwebhooks-2.4.0/doc/gitee.png +0 -0
  13. gitwebhooks-2.4.0/doc/github-success.png +0 -0
  14. gitwebhooks-2.4.0/doc/github.png +0 -0
  15. gitwebhooks-2.4.0/doc/gitlab-success.png +0 -0
  16. gitwebhooks-2.4.0/doc/gitlab.png +0 -0
  17. gitwebhooks-2.4.0/doc/install.png +0 -0
  18. gitwebhooks-2.4.0/doc/uninstall.png +0 -0
  19. gitwebhooks-2.4.0/gitwebhooks/__init__.py +18 -0
  20. gitwebhooks-2.4.0/gitwebhooks/__main__.py +10 -0
  21. gitwebhooks-2.4.0/gitwebhooks/auth/__init__.py +20 -0
  22. gitwebhooks-2.4.0/gitwebhooks/auth/custom.py +40 -0
  23. gitwebhooks-2.4.0/gitwebhooks/auth/factory.py +73 -0
  24. gitwebhooks-2.4.0/gitwebhooks/auth/gitee.py +86 -0
  25. gitwebhooks-2.4.0/gitwebhooks/auth/github.py +52 -0
  26. gitwebhooks-2.4.0/gitwebhooks/auth/gitlab.py +29 -0
  27. gitwebhooks-2.4.0/gitwebhooks/auth/verifier.py +34 -0
  28. gitwebhooks-2.4.0/gitwebhooks/cli/__init__.py +148 -0
  29. gitwebhooks-2.4.0/gitwebhooks/cli/config.py +216 -0
  30. gitwebhooks-2.4.0/gitwebhooks/cli/help.py +155 -0
  31. gitwebhooks-2.4.0/gitwebhooks/cli/init_wizard.py +779 -0
  32. gitwebhooks-2.4.0/gitwebhooks/cli/prompts.py +322 -0
  33. gitwebhooks-2.4.0/gitwebhooks/cli/serve.py +152 -0
  34. gitwebhooks-2.4.0/gitwebhooks/cli/service.py +352 -0
  35. gitwebhooks-2.4.0/gitwebhooks/config/__init__.py +17 -0
  36. gitwebhooks-2.4.0/gitwebhooks/config/loader.py +176 -0
  37. gitwebhooks-2.4.0/gitwebhooks/config/models.py +145 -0
  38. gitwebhooks-2.4.0/gitwebhooks/config/registry.py +104 -0
  39. gitwebhooks-2.4.0/gitwebhooks/config/server.py +85 -0
  40. gitwebhooks-2.4.0/gitwebhooks/handlers/__init__.py +22 -0
  41. gitwebhooks-2.4.0/gitwebhooks/handlers/base.py +107 -0
  42. gitwebhooks-2.4.0/gitwebhooks/handlers/custom.py +73 -0
  43. gitwebhooks-2.4.0/gitwebhooks/handlers/factory.py +83 -0
  44. gitwebhooks-2.4.0/gitwebhooks/handlers/gitee.py +113 -0
  45. gitwebhooks-2.4.0/gitwebhooks/handlers/github.py +43 -0
  46. gitwebhooks-2.4.0/gitwebhooks/handlers/gitlab.py +43 -0
  47. gitwebhooks-2.4.0/gitwebhooks/handlers/request.py +253 -0
  48. gitwebhooks-2.4.0/gitwebhooks/logging/__init__.py +10 -0
  49. gitwebhooks-2.4.0/gitwebhooks/logging/setup.py +68 -0
  50. gitwebhooks-2.4.0/gitwebhooks/main/__init__.py +254 -0
  51. gitwebhooks-2.4.0/gitwebhooks/main/__main__.py +12 -0
  52. gitwebhooks-2.4.0/gitwebhooks/main/version.py +24 -0
  53. gitwebhooks-2.4.0/gitwebhooks/models/__init__.py +16 -0
  54. gitwebhooks-2.4.0/gitwebhooks/models/config.py +74 -0
  55. gitwebhooks-2.4.0/gitwebhooks/models/provider.py +22 -0
  56. gitwebhooks-2.4.0/gitwebhooks/models/request.py +61 -0
  57. gitwebhooks-2.4.0/gitwebhooks/models/result.py +40 -0
  58. gitwebhooks-2.4.0/gitwebhooks/server.py +128 -0
  59. gitwebhooks-2.4.0/gitwebhooks/utils/__init__.py +14 -0
  60. gitwebhooks-2.4.0/gitwebhooks/utils/constants.py +104 -0
  61. gitwebhooks-2.4.0/gitwebhooks/utils/exceptions.py +34 -0
  62. gitwebhooks-2.4.0/gitwebhooks/utils/executor.py +34 -0
  63. gitwebhooks-2.4.0/gitwebhooks/utils/systemd.py +274 -0
  64. gitwebhooks-2.4.0/gitwebhooks.egg-info/PKG-INFO +575 -0
  65. gitwebhooks-2.4.0/gitwebhooks.egg-info/SOURCES.txt +156 -0
  66. gitwebhooks-2.4.0/gitwebhooks.egg-info/dependency_links.txt +1 -0
  67. gitwebhooks-2.4.0/gitwebhooks.egg-info/entry_points.txt +2 -0
  68. gitwebhooks-2.4.0/gitwebhooks.egg-info/requires.txt +4 -0
  69. gitwebhooks-2.4.0/gitwebhooks.egg-info/top_level.txt +1 -0
  70. gitwebhooks-2.4.0/gitwebhooks.ini.sample +42 -0
  71. gitwebhooks-2.4.0/pyproject.toml +78 -0
  72. gitwebhooks-2.4.0/setup.cfg +4 -0
  73. gitwebhooks-2.4.0/tests/__init__.py +13 -0
  74. gitwebhooks-2.4.0/tests/__main__.py +96 -0
  75. gitwebhooks-2.4.0/tests/conftest.py +414 -0
  76. gitwebhooks-2.4.0/tests/fixtures/__init__.py +3 -0
  77. gitwebhooks-2.4.0/tests/fixtures/custom_payloads.py +249 -0
  78. gitwebhooks-2.4.0/tests/fixtures/gitee_payloads.py +207 -0
  79. gitwebhooks-2.4.0/tests/fixtures/github_payloads.py +257 -0
  80. gitwebhooks-2.4.0/tests/fixtures/gitlab_payloads.py +243 -0
  81. gitwebhooks-2.4.0/tests/fixtures/signature_builder.py +255 -0
  82. gitwebhooks-2.4.0/tests/integration/__init__.py +3 -0
  83. gitwebhooks-2.4.0/tests/integration/test_command_execution.py +315 -0
  84. gitwebhooks-2.4.0/tests/integration/test_config_discovery.py +336 -0
  85. gitwebhooks-2.4.0/tests/integration/test_config_view_integration.py +272 -0
  86. gitwebhooks-2.4.0/tests/integration/test_custom_webhook.py +135 -0
  87. gitwebhooks-2.4.0/tests/integration/test_edge_cases.py +256 -0
  88. gitwebhooks-2.4.0/tests/integration/test_gitee_webhook.py +187 -0
  89. gitwebhooks-2.4.0/tests/integration/test_github_webhook.py +273 -0
  90. gitwebhooks-2.4.0/tests/integration/test_gitlab_webhook.py +149 -0
  91. gitwebhooks-2.4.0/tests/test_auth/__init__.py +2 -0
  92. gitwebhooks-2.4.0/tests/test_config/__init__.py +2 -0
  93. gitwebhooks-2.4.0/tests/test_handlers/__init__.py +2 -0
  94. gitwebhooks-2.4.0/tests/test_integration/__init__.py +2 -0
  95. gitwebhooks-2.4.0/tests/unit/__init__.py +3 -0
  96. gitwebhooks-2.4.0/tests/unit/cli/__init__.py +1 -0
  97. gitwebhooks-2.4.0/tests/unit/cli/test_config_view.py +396 -0
  98. gitwebhooks-2.4.0/tests/unit/cli/test_init_wizard.py +319 -0
  99. gitwebhooks-2.4.0/tests/unit/test_config_level.py +105 -0
  100. gitwebhooks-2.4.0/tests/unit/test_config_loading.py +264 -0
  101. gitwebhooks-2.4.0/tests/unit/test_data_parsing.py +147 -0
  102. gitwebhooks-2.4.0/tests/unit/test_install_service_logic.py +251 -0
  103. gitwebhooks-2.4.0/tests/unit/test_main.py +341 -0
  104. gitwebhooks-2.4.0/tests/unit/test_prompts_config_level.py +168 -0
  105. gitwebhooks-2.4.0/tests/unit/test_provider_detection.py +228 -0
  106. gitwebhooks-2.4.0/tests/unit/test_request_handler.py +174 -0
  107. gitwebhooks-2.4.0/tests/unit/test_service_install_context.py +145 -0
  108. gitwebhooks-2.4.0/tests/unit/test_signature_verification.py +217 -0
  109. gitwebhooks-2.4.0/tests/utils/__init__.py +3 -0
  110. gitwebhooks-2.4.0/tests/utils/certificate_generator.py +236 -0
  111. gitwebhooks-2.4.0/tests/utils/coverage_runner.py +329 -0
  112. gitwebhooks-2.4.0/tests/utils/http_client.py +304 -0
  113. gitwebhooks-2.4.0/tests/utils/server_manager.py +396 -0
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ indent_style = space
8
+ indent_size = 4
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
@@ -0,0 +1,313 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## 项目概述
6
+
7
+ 这是一个用 Python 3 实现的 Git Webhooks 服务器,用于自动化 Git 仓库部署。支持 Github、Gitee、Gitlab 和自定义仓库的 Webhook 事件处理。
8
+
9
+ **架构特点**:
10
+ - 模块化 Python 包结构 (`gitwebhooks/`)
11
+ - 使用标准库 `http.server` 实现 HTTP 服务器
12
+ - 通过 INI 配置文件管理多个仓库的部署命令
13
+ - 可作为 systemd 服务安装运行
14
+ - 原地运行:CLI 从源码目录加载模块
15
+
16
+ ## 常用命令
17
+
18
+ ### 安装和配置
19
+ ```bash
20
+ # 通过 pip 安装
21
+ pip install .
22
+
23
+ # 初始化配置文件(交互式)
24
+ gitwebhooks-cli config init
25
+
26
+ # 直接指定配置级别(system/local/user)
27
+ gitwebhooks-cli config init user
28
+ sudo gitwebhooks-cli config init system
29
+
30
+ # 查看配置文件内容
31
+ gitwebhooks-cli config view
32
+
33
+ # 安装为 systemd 服务
34
+ sudo gitwebhooks-cli service install
35
+
36
+ # 卸载 systemd 服务
37
+ sudo gitwebhooks-cli service uninstall
38
+ ```
39
+
40
+ ### 运行服务
41
+ ```bash
42
+ # 方式1: 使用模块入口
43
+ python3 -m gitwebhooks.cli -c /path/to/config.ini
44
+
45
+ # 方式2: 使用 CLI 工具(自动查找配置文件)
46
+ gitwebhooks-cli
47
+
48
+ # 方式3: 指定配置文件
49
+ gitwebhooks-cli -c /path/to/config.ini
50
+
51
+ # systemd 服务管理
52
+ systemctl start gitwebhooks
53
+ systemctl stop gitwebhooks
54
+ systemctl restart gitwebhooks
55
+ systemctl status gitwebhooks
56
+ ```
57
+
58
+ **配置文件自动查找**:
59
+ - 不指定 `-c` 参数时,系统按优先级自动查找配置文件:
60
+ 1. `~/.gitwebhooks.ini`(用户级,最高优先级)
61
+ 2. `/usr/local/etc/gitwebhooks.ini`(本地级)
62
+ 3. `/etc/gitwebhooks.ini`(系统级)
63
+ - 启动时会显示正在使用的配置文件路径
64
+ - 找不到配置文件时显示友好的错误消息
65
+
66
+ ### 测试开发
67
+ ```bash
68
+ # 直接运行(开发模式)
69
+ ./gitwebhooks-cli -c gitwebhooks.ini.sample
70
+
71
+ # 或使用模块方式
72
+ python3 -m gitwebhooks.cli -c gitwebhooks.ini.sample
73
+
74
+ # 运行测试套件
75
+ python3 -m pytest tests/
76
+ ```
77
+
78
+ ## 架构说明
79
+
80
+ ### 核心组件
81
+
82
+ **模块化包结构** (`gitwebhooks/`)
83
+ - `__init__.py`: 包入口,导出主要类
84
+ - `__main__.py`: 模块入口,支持 `python3 -m gitwebhooks`
85
+ - `cli.py`: 命令行入口点
86
+ - `server.py`: 主服务器类 `WebhookServer`
87
+
88
+ **子模块**:
89
+ - `models/`: 数据模型(Provider、WebhookRequest、验证结果等)
90
+ - `config/`: 配置加载和注册(ConfigLoader、ConfigurationRegistry)
91
+ - `auth/`: 签名验证模块(各平台的验证器工厂)
92
+ - `handlers/`: Webhook 处理器(按平台分离的处理器)
93
+ - `utils/`: 工具类(常量、异常、命令执行器、systemd 工具)
94
+ - `cli/`: CLI 子命令(service、config、init_wizard)
95
+ - `service.py`: systemd 服务管理
96
+ - `config.py`: 配置查看和管理
97
+ - `init_wizard.py`: 交互式配置初始化向导
98
+ - `logging/`: 日志配置
99
+
100
+ **CLI 工具** (`gitwebhooks-cli`)
101
+ - Bash 包装脚本,自动检测并加载 `gitwebhooks` 包
102
+ - 支持从源码目录运行或已安装的包运行
103
+ - 支持子命令:
104
+ - `gitwebhooks-cli service install/uninstall`: systemd 服务管理
105
+ - `gitwebhooks-cli config init [level]`: 交互式配置初始化向导
106
+ - 支持配置级别:`system`(系统级,需 root)、`local`(本地级,需 root)、`user`(用户级)
107
+ - 交互式收集服务器配置、平台配置(github/gitee/gitlab/custom)、仓库配置
108
+ - 自动生成 INI 配置文件,设置安全权限(0600)
109
+ - 支持配置文件覆盖和备份
110
+ - `gitwebhooks-cli config view`: 查看配置文件内容
111
+ - `gitwebhooks-cli -c <config>`: 运行服务器(兼容原有方式)
112
+
113
+ **Provider 枚举** (`gitwebhooks/models/provider.py`)
114
+ - 定义支持的 Git 平台:Github、Gitee、Gitlab、Custom
115
+
116
+ **请求处理流程**:
117
+ 1. `WebhookRequestHandler.do_POST()`: 接收 POST 请求
118
+ 2. `_parse_provider()`: 通过 HTTP Header 识别平台类型
119
+ 3. `_parse_data()`: 解析 POST 请求体(支持 JSON 和 form-urlencoded)
120
+ 4. 平台处理器验证签名/token
121
+ 5. 从请求数据中提取仓库名称
122
+ 6. 在配置中查找对应的仓库配置
123
+ 7. 执行配置的命令(通过 `subprocess.Popen`)
124
+
125
+ ### 配置结构
126
+
127
+ 配置文件采用 INI 格式,主要分为几部分:
128
+
129
+ ```ini
130
+ [server] # 服务器配置:address、port、log_file
131
+ [ssl] # SSL 配置:enable、key_file、cert_file
132
+ [github] # Github 配置:handle_events、verify、secret
133
+ [gitee] # Gitee 配置
134
+ [gitlab] # Gitlab 配置
135
+ [custom] # 自定义配置:header_name、header_value、identifier_path
136
+ [repo/name] # 仓库配置:cwd、cmd
137
+ ```
138
+
139
+ **仓库配置部分**:
140
+ - 每个仓库一节,节名为 `owner/repo` 格式
141
+ - `cwd`: 工作目录
142
+ - `cmd`: 收到 Webhook 时执行的 shell 命令
143
+
144
+ ### 平台特定处理
145
+
146
+ **Github** (`gitwebhooks/handlers/github.py`)
147
+ - Header: `X-GitHub-Event`
148
+ - 签名验证: `X-Hub-Signature` (HMAC-SHA1)
149
+ - 仓库标识: `repository.full_name`
150
+ - 验证器: `auth/github.py`
151
+
152
+ **Gitee** (`gitwebhooks/handlers/gitee.py`)
153
+ - Header: `X-Gitee-Event`
154
+ - 支持签名验证或密码验证
155
+ - 仓库标识: `repository.full_name`
156
+ - 验证器: `auth/gitee.py`
157
+
158
+ **Gitlab** (`gitwebhooks/handlers/gitlab.py`)
159
+ - Header: `X-Gitlab-Event`
160
+ - Token 验证: `X-Gitlab-Token`
161
+ - 仓库标识: `project.path_with_namespace`
162
+ - 验证器: `auth/gitlab.py`
163
+
164
+ **Custom** (`gitwebhooks/handlers/custom.py`)
165
+ - 自定义 Header 识别
166
+ - 通过 JSON 路径提取仓库标识(如 `project.path_with_namespace`)
167
+ - 验证器: `auth/custom.py`
168
+
169
+ ## 代码规范
170
+
171
+ ### 编辑器配置
172
+ 项目使用 `.editorconfig`:
173
+ - UTF-8 编码
174
+ - LF 换行符
175
+ - 4 空格缩进
176
+ - 末尾插入空行
177
+ - Markdown 文件保留行尾空格
178
+
179
+ ### Python 代码风格
180
+ - 遵循 Python 3.6+ 标准
181
+ - 使用 `logging` 模块记录日志
182
+ - 私有方法使用单下划线前缀(如 `_parse_provider`)
183
+ - 公有 API 不使用下划线前缀
184
+ - 配置通过 `configparser.ConfigParser` 读取
185
+ - 类型提示使用 `typing` 模块
186
+ - 自定义异常继承自 `Exception`
187
+
188
+ ### Shell 脚本
189
+ - `install.sh`: 交互式安装脚本
190
+ - `message.sh`: 提供 ANSI 颜色输出函数(INFO、WARN、ERR、QUES)
191
+
192
+ ## 开发注意事项
193
+
194
+ ### 命令执行
195
+ 当前使用 `subprocess.Popen` 非阻塞执行命令(`gitwebhooks/utils/executor.py`)。命令在后台运行,不阻塞服务器进程。
196
+
197
+ ### 日志配置
198
+ - 日志文件位置在配置文件的 `server.log_file` 指定
199
+ - 日志同时输出到文件和标准输出(如果配置了日志文件)
200
+
201
+ ### SSL 支持
202
+ - 通过配置文件的 `[ssl]` 部分启用
203
+ - 需要提供证书文件和密钥文件路径
204
+
205
+ ### 自定义平台
206
+ 使用 `[custom]` 配置可以支持任意 Webhook 源:
207
+ - `header_name/header_value`: 识别请求来源
208
+ - `header_token`: token 验证的 header 名称
209
+ - `identifier_path`: JSON 路径,用于提取仓库标识
210
+ - `header_event`: 可选,事件类型 header 名称
211
+
212
+ ## 文件结构
213
+
214
+ ```
215
+ gitwebhooks/
216
+ ├── gitwebhooks-cli # CLI 命令行工具
217
+ ├── gitwebhooks/ # 主包目录
218
+ │ ├── __init__.py # 包入口
219
+ │ ├── __main__.py # 模块入口
220
+ │ ├── cli.py # CLI 实现
221
+ │ ├── server.py # 主服务器类
222
+ │ ├── auth/ # 签名验证模块
223
+ │ │ ├── __init__.py
224
+ │ │ ├── factory.py # 验证器工厂
225
+ │ │ ├── verifier.py # 验证器基类
226
+ │ │ ├── github.py # GitHub 验证器
227
+ │ │ ├── gitee.py # Gitee 验证器
228
+ │ │ ├── gitlab.py # GitLab 验证器
229
+ │ │ └── custom.py # 自定义验证器
230
+ │ ├── config/ # 配置模块
231
+ │ │ ├── __init__.py
232
+ │ │ ├── loader.py # 配置加载器
233
+ │ │ ├── registry.py # 配置注册表
234
+ │ │ ├── models.py # 配置数据类
235
+ │ │ └── server.py # 服务器配置
236
+ │ ├── handlers/ # Webhook 处理器
237
+ │ │ ├── __init__.py
238
+ │ │ ├── request.py # 请求处理器基类
239
+ │ │ ├── factory.py # 处理器工厂
240
+ │ │ ├── github.py # GitHub 处理器
241
+ │ │ ├── gitee.py # Gitee 处理器
242
+ │ │ ├── gitlab.py # GitLab 处理器
243
+ │ │ └── custom.py # 自定义处理器
244
+ │ ├── models/ # 数据模型
245
+ │ │ ├── __init__.py
246
+ │ │ ├── provider.py # Provider 枚举
247
+ │ │ ├── request.py # 请求数据类
248
+ │ │ └── result.py # 验证结果类
249
+ │ ├── utils/ # 工具模块
250
+ │ │ ├── __init__.py
251
+ │ │ ├── constants.py # 常量定义
252
+ │ │ ├── exceptions.py # 自定义异常
253
+ │ │ └── executor.py # 命令执行器
254
+ │ └── logging/ # 日志模块
255
+ │ └── setup.py # 日志配置
256
+ ├── tests/ # 测试套件
257
+ │ ├── unit/ # 单元测试
258
+ │ ├── integration/ # 集成测试
259
+ │ ├── utils/ # 测试工具
260
+ │ └── conftest.py # pytest 配置
261
+ ├── gitwebhooks.ini.sample # 配置文件模板
262
+ ├── gitwebhooks.service.sample # systemd 服务模板
263
+ ├── install.sh # 安装/卸载脚本
264
+ ├── message.sh # 颜色输出辅助脚本
265
+ ├── README.md # 项目说明(英文)
266
+ ├── README.zh.md # 项目说明(中文)
267
+ ├── CLAUDE.md # Claude Code 项目指南
268
+ ├── .editorconfig # 编辑器配置
269
+ ├── .gitignore # Git 忽略文件
270
+ ├── doc/ # 文档截图目录
271
+ └── .specify/ # SpecKit 工作流模板目录
272
+ ├── templates/ # 功能规格、计划、任务模板
273
+ ├── scripts/ # 辅助脚本
274
+ └── memory/ # 工作流记忆存储
275
+ ```
276
+
277
+ ## 配置文件位置
278
+
279
+ - 默认配置路径: `/usr/local/etc/gitwebhooks.ini`
280
+ - 日志文件: `/var/log/gitwebhooks.log`
281
+ - 安装后的 CLI: `/usr/local/bin/gitwebhooks-cli`
282
+ - systemd 服务: `/usr/lib/systemd/system/gitwebhooks.service`
283
+
284
+ ## Active Technologies
285
+ - Python 3.6+ + Python 标准库(无外部依赖)
286
+ - 模块化包结构 (`gitwebhooks/`)
287
+ - INI 配置文件 (configparser.ConfigParser)
288
+ - http.server (HTTP 服务器)
289
+ - subprocess (命令执行)
290
+ - ssl (HTTPS 支持)
291
+ - pytest (测试框架)
292
+ - Bash 4.0+ (安装脚本)
293
+ - Python 3.6+ (与项目一致) + Python 标准库(argparse 用于子命令,tempfile 用于文件操作,pathlib 用于路径处理) (001-cli-service-install)
294
+ - INI 配置文件(`~/.gitwebhook.ini`),systemd 服务文件(`/etc/systemd/system/`) (001-cli-service-install)
295
+ - Python 3.7+ (与项目保持一致) + Python 标准库(configparser、pathlib、os、sys) (001-config-view)
296
+ - INI 配置文件(只读) (001-config-view)
297
+ - Python 3.7+ + Python 标准库(dataclasses、configparser、os、re、sys) + 交互式 input() (001-config-init-wizard)
298
+ - INI 配置文件生成(读写) (001-config-init-wizard)
299
+ - Python 3.7+ + Python 标准库(sys, shutil, os, pathlib, argparse) (001-install-method-guidance)
300
+ - INI 配置文件,systemd 服务单元文件 (001-install-method-guidance)
301
+ - Python 3.7+ (项目要求) + Python 标准库仅(无外部依赖) (001-fix-config-init-bug)
302
+ - INI 配置文件 (configparser) (001-fix-config-init-bug)
303
+ - Python 3.7+ (项目要求) + Python 标准库(pathlib, configparser, argparse) (001-config-priority)
304
+ - Python 3.6+ (与项目要求一致,实际支持 3.6-3.14) + argparse (Python 标准库) (002-cli-commands-refactor)
305
+ - N/A (CLI 重构,不涉及存储) (002-cli-commands-refactor)
306
+ - Python 3.6+(项目要求),实际支持 3.6-3.14 + Python 标准库 `argparse`(命令行参数解析) (002-cli-commands-refactor)
307
+ - N/A(CLI 重构,不涉及存储) (002-cli-commands-refactor)
308
+
309
+ ## Recent Changes
310
+ - 001-config-init-wizard: 添加 `config init` 交互式向导,支持配置级别选择、平台配置和仓库配置
311
+ - 001-config-view: 添加 `config view` 子命令,支持查看配置文件内容和敏感字段高亮
312
+ - 001-cli-service-install: 添加 systemd 服务管理子命令(install/uninstall)
313
+ - 001-refactor-codebase: 重构为模块化包结构,保持向后兼容
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Troy Tse <troy@holyhi.net>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include README.md
2
+ include README.zh.md
3
+ include LICENSE
4
+ include CLAUDE.md
5
+ include *.editorconfig
6
+ include *.sample
7
+ recursive-include doc *.png
8
+ recursive-include tests *.py