ChatGlance 0.1.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.
- chatglance-0.1.0/LICENSE +21 -0
- chatglance-0.1.0/PKG-INFO +123 -0
- chatglance-0.1.0/README.md +101 -0
- chatglance-0.1.0/pyproject.toml +37 -0
- chatglance-0.1.0/setup.cfg +4 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/PKG-INFO +123 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/SOURCES.txt +20 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/dependency_links.txt +1 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/entry_points.txt +2 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/requires.txt +7 -0
- chatglance-0.1.0/src/ChatGlance.egg-info/top_level.txt +1 -0
- chatglance-0.1.0/src/chatglance/__init__.py +5 -0
- chatglance-0.1.0/src/chatglance/cli.py +221 -0
- chatglance-0.1.0/src/chatglance/glance_config.py +104 -0
- chatglance-0.1.0/src/chatglance/projects.py +224 -0
- chatglance-0.1.0/src/chatglance/runtime.py +122 -0
- chatglance-0.1.0/src/chatglance/systemd.py +150 -0
- chatglance-0.1.0/tests/test_cli.py +26 -0
- chatglance-0.1.0/tests/test_projects.py +104 -0
- chatglance-0.1.0/tests/test_publish_workflow.py +22 -0
- chatglance-0.1.0/tests/test_runtime_systemd.py +79 -0
- chatglance-0.1.0/tests/test_version.py +5 -0
chatglance-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ChatArch
|
|
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,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ChatGlance
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: ChatArch Glance dashboard generation CLI.
|
|
5
|
+
Author-email: ChatArch <1073853456@qq.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ChatArch/ChatGlance
|
|
8
|
+
Project-URL: Repository, https://github.com/ChatArch/ChatGlance
|
|
9
|
+
Keywords: chatglance,chatarch,cli
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: click>=8.0
|
|
16
|
+
Requires-Dist: PyYAML<7.0,>=6.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: build; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest; extra == "dev"
|
|
20
|
+
Requires-Dist: twine; extra == "dev"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
<div align="center">
|
|
24
|
+
<a href="https://pypi.python.org/pypi/ChatGlance">
|
|
25
|
+
<img src="https://img.shields.io/pypi/v/ChatGlance.svg" alt="PyPI version" />
|
|
26
|
+
</a>
|
|
27
|
+
<a href="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml">
|
|
28
|
+
<img src="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml/badge.svg" alt="Tests" />
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
|
|
34
|
+
[English](README.en.md) | [简体中文](README.md)
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
# ChatGlance
|
|
38
|
+
|
|
39
|
+
`ChatGlance` 是 ChatArch/WZHECNU Glance dashboard 的 Python 生成与运维包,提供 `chatglance` CLI。
|
|
40
|
+
|
|
41
|
+
它不是 NPM 项目,也不是重新实现 Glance 后端:上游 Glance 仍然是 Go 单二进制 dashboard server;`ChatGlance` 负责把 ChatArch 项目清单、Glance YAML 页面、inline HTML 表格和安全运维补丁组织成可复用的 Python 包/CLI。
|
|
42
|
+
|
|
43
|
+
## 当前能力
|
|
44
|
+
|
|
45
|
+
- 从 repository inventory JSON 生成 Glance `项目` page。
|
|
46
|
+
- 当前 page tabs 固定为:`最近提交`、`待处理 PR / Issue`、`分类`、`一览表`。
|
|
47
|
+
- `待处理 PR / Issue` 只显示 PR/Issue 非 0 的仓库,并按 `(PR, Issue, 最近提交)` 降序。
|
|
48
|
+
- 生成 config 副本时清理 legacy generated pages:`Projects`、`ChatArch Projects`、`ChatArch Projects List`。
|
|
49
|
+
- 为 Glance `server-stats` 写入 root-only Disk 配置:`hide-mountpoints-by-default: true` + `mountpoints: /`,避免 snap/loop mount 出现在 Disk popover。
|
|
50
|
+
- 维护 durable runtime:一次性 `runtime maintain` 可原子更新 live config、备份、校验,并在内容变化时可选重启 systemd user service。
|
|
51
|
+
- 渲染 systemd user units:主服务仍直接启动 upstream Glance Go binary;维护任务是独立 oneshot/timer,不是 Python wrapper。
|
|
52
|
+
|
|
53
|
+
## 快速开始
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install -e ".[dev]"
|
|
57
|
+
chatglance --help
|
|
58
|
+
chatglance --tree
|
|
59
|
+
chatglance --version
|
|
60
|
+
python -m pytest -q
|
|
61
|
+
python -m build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## CLI 示例
|
|
65
|
+
|
|
66
|
+
只生成 `项目` page YAML:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
chatglance projects render-page \
|
|
70
|
+
--data /path/to/chatarch-projects.json \
|
|
71
|
+
--output playground/projects-page.yml
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
把生成页写入一个 Glance config 副本:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
chatglance projects update-config \
|
|
78
|
+
--data /path/to/chatarch-projects.json \
|
|
79
|
+
--config /path/to/glance.yml \
|
|
80
|
+
--output playground/glance.with-projects.yml
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
把 `server-stats` Disk 改成只显示 root 分区,写入 config 副本:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
chatglance disks root-only \
|
|
87
|
+
--config /path/to/glance.yml \
|
|
88
|
+
--output playground/glance.root-disk.yml
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
维护一个 durable Glance runtime(默认 `~/.chatarch/glance`):
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
chatglance runtime maintain \
|
|
95
|
+
--runtime-home ~/.chatarch/glance \
|
|
96
|
+
--restart-service chatarch-glance.service
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
生成推荐 systemd user units:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
chatglance runtime render-systemd \
|
|
103
|
+
--runtime-home ~/.chatarch/glance \
|
|
104
|
+
--chatglance-bin ~/.chatarch/venv/bin/chatglance \
|
|
105
|
+
--output-dir playground/systemd
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 运行态边界
|
|
109
|
+
|
|
110
|
+
推荐拓扑是 **systemd 直接运行 Glance,chatglance 只做维护**:
|
|
111
|
+
|
|
112
|
+
- 主服务:`chatarch-glance.service` 直接执行 `~/.chatarch/glance/bin/glance -config ~/.chatarch/glance/config/glance.yml`。
|
|
113
|
+
- 内容数据:repository inventory JSON、缓存和生成快照放在 `~/.chatarch/glance/data/` 或 `~/.chatarch/glance/cache/`。
|
|
114
|
+
- live config:`~/.chatarch/glance/config/glance.yml`;更新前写备份到 `~/.chatarch/glance/config/backups/`。
|
|
115
|
+
- 维护:`chatglance runtime maintain` 是 oneshot,可由 `chatarch-glance-maintenance.timer` 周期触发。
|
|
116
|
+
- 不建议加 Python 长驻 wrapper:wrapper 会把 server 生命周期和内容生成耦合,反而不利于 systemd 重启、日志、健康检查和回滚。
|
|
117
|
+
|
|
118
|
+
## 安全边界
|
|
119
|
+
|
|
120
|
+
- CLI 默认写 output file,不默认覆盖 live `glance.yml`。
|
|
121
|
+
- 不保存或输出 Glance auth、password hash、GitHub token、proxy credential。
|
|
122
|
+
- live runtime、logs、backups、全量实时 JSON 快照默认不进源码仓库。
|
|
123
|
+
- 后续如需动态表格、搜索、中英文切换,再考虑增加小型静态前端层;当前 Python CLI 是基础层。
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://pypi.python.org/pypi/ChatGlance">
|
|
3
|
+
<img src="https://img.shields.io/pypi/v/ChatGlance.svg" alt="PyPI version" />
|
|
4
|
+
</a>
|
|
5
|
+
<a href="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml">
|
|
6
|
+
<img src="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml/badge.svg" alt="Tests" />
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
|
|
12
|
+
[English](README.en.md) | [简体中文](README.md)
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
# ChatGlance
|
|
16
|
+
|
|
17
|
+
`ChatGlance` 是 ChatArch/WZHECNU Glance dashboard 的 Python 生成与运维包,提供 `chatglance` CLI。
|
|
18
|
+
|
|
19
|
+
它不是 NPM 项目,也不是重新实现 Glance 后端:上游 Glance 仍然是 Go 单二进制 dashboard server;`ChatGlance` 负责把 ChatArch 项目清单、Glance YAML 页面、inline HTML 表格和安全运维补丁组织成可复用的 Python 包/CLI。
|
|
20
|
+
|
|
21
|
+
## 当前能力
|
|
22
|
+
|
|
23
|
+
- 从 repository inventory JSON 生成 Glance `项目` page。
|
|
24
|
+
- 当前 page tabs 固定为:`最近提交`、`待处理 PR / Issue`、`分类`、`一览表`。
|
|
25
|
+
- `待处理 PR / Issue` 只显示 PR/Issue 非 0 的仓库,并按 `(PR, Issue, 最近提交)` 降序。
|
|
26
|
+
- 生成 config 副本时清理 legacy generated pages:`Projects`、`ChatArch Projects`、`ChatArch Projects List`。
|
|
27
|
+
- 为 Glance `server-stats` 写入 root-only Disk 配置:`hide-mountpoints-by-default: true` + `mountpoints: /`,避免 snap/loop mount 出现在 Disk popover。
|
|
28
|
+
- 维护 durable runtime:一次性 `runtime maintain` 可原子更新 live config、备份、校验,并在内容变化时可选重启 systemd user service。
|
|
29
|
+
- 渲染 systemd user units:主服务仍直接启动 upstream Glance Go binary;维护任务是独立 oneshot/timer,不是 Python wrapper。
|
|
30
|
+
|
|
31
|
+
## 快速开始
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install -e ".[dev]"
|
|
35
|
+
chatglance --help
|
|
36
|
+
chatglance --tree
|
|
37
|
+
chatglance --version
|
|
38
|
+
python -m pytest -q
|
|
39
|
+
python -m build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## CLI 示例
|
|
43
|
+
|
|
44
|
+
只生成 `项目` page YAML:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
chatglance projects render-page \
|
|
48
|
+
--data /path/to/chatarch-projects.json \
|
|
49
|
+
--output playground/projects-page.yml
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
把生成页写入一个 Glance config 副本:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
chatglance projects update-config \
|
|
56
|
+
--data /path/to/chatarch-projects.json \
|
|
57
|
+
--config /path/to/glance.yml \
|
|
58
|
+
--output playground/glance.with-projects.yml
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
把 `server-stats` Disk 改成只显示 root 分区,写入 config 副本:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
chatglance disks root-only \
|
|
65
|
+
--config /path/to/glance.yml \
|
|
66
|
+
--output playground/glance.root-disk.yml
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
维护一个 durable Glance runtime(默认 `~/.chatarch/glance`):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
chatglance runtime maintain \
|
|
73
|
+
--runtime-home ~/.chatarch/glance \
|
|
74
|
+
--restart-service chatarch-glance.service
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
生成推荐 systemd user units:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
chatglance runtime render-systemd \
|
|
81
|
+
--runtime-home ~/.chatarch/glance \
|
|
82
|
+
--chatglance-bin ~/.chatarch/venv/bin/chatglance \
|
|
83
|
+
--output-dir playground/systemd
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 运行态边界
|
|
87
|
+
|
|
88
|
+
推荐拓扑是 **systemd 直接运行 Glance,chatglance 只做维护**:
|
|
89
|
+
|
|
90
|
+
- 主服务:`chatarch-glance.service` 直接执行 `~/.chatarch/glance/bin/glance -config ~/.chatarch/glance/config/glance.yml`。
|
|
91
|
+
- 内容数据:repository inventory JSON、缓存和生成快照放在 `~/.chatarch/glance/data/` 或 `~/.chatarch/glance/cache/`。
|
|
92
|
+
- live config:`~/.chatarch/glance/config/glance.yml`;更新前写备份到 `~/.chatarch/glance/config/backups/`。
|
|
93
|
+
- 维护:`chatglance runtime maintain` 是 oneshot,可由 `chatarch-glance-maintenance.timer` 周期触发。
|
|
94
|
+
- 不建议加 Python 长驻 wrapper:wrapper 会把 server 生命周期和内容生成耦合,反而不利于 systemd 重启、日志、健康检查和回滚。
|
|
95
|
+
|
|
96
|
+
## 安全边界
|
|
97
|
+
|
|
98
|
+
- CLI 默认写 output file,不默认覆盖 live `glance.yml`。
|
|
99
|
+
- 不保存或输出 Glance auth、password hash、GitHub token、proxy credential。
|
|
100
|
+
- live runtime、logs、backups、全量实时 JSON 快照默认不进源码仓库。
|
|
101
|
+
- 后续如需动态表格、搜索、中英文切换,再考虑增加小型静态前端层;当前 Python CLI 是基础层。
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ChatGlance"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "ChatArch Glance dashboard generation CLI."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
dependencies = ["click>=8.0", "PyYAML>=6.0,<7.0"]
|
|
13
|
+
authors = [{name = "ChatArch", email = "1073853456@qq.com"}]
|
|
14
|
+
keywords = ["chatglance", "chatarch", "cli"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://github.com/ChatArch/ChatGlance"
|
|
22
|
+
Repository = "https://github.com/ChatArch/ChatGlance"
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
chatglance = "chatglance.cli:main"
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dev = ["build", "pytest", "twine"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.dynamic]
|
|
31
|
+
version = {attr = "chatglance.__version__"}
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
35
|
+
|
|
36
|
+
[tool.setuptools]
|
|
37
|
+
include-package-data = true
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ChatGlance
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: ChatArch Glance dashboard generation CLI.
|
|
5
|
+
Author-email: ChatArch <1073853456@qq.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ChatArch/ChatGlance
|
|
8
|
+
Project-URL: Repository, https://github.com/ChatArch/ChatGlance
|
|
9
|
+
Keywords: chatglance,chatarch,cli
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: click>=8.0
|
|
16
|
+
Requires-Dist: PyYAML<7.0,>=6.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: build; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest; extra == "dev"
|
|
20
|
+
Requires-Dist: twine; extra == "dev"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
<div align="center">
|
|
24
|
+
<a href="https://pypi.python.org/pypi/ChatGlance">
|
|
25
|
+
<img src="https://img.shields.io/pypi/v/ChatGlance.svg" alt="PyPI version" />
|
|
26
|
+
</a>
|
|
27
|
+
<a href="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml">
|
|
28
|
+
<img src="https://github.com/ChatArch/ChatGlance/actions/workflows/ci.yml/badge.svg" alt="Tests" />
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
|
|
34
|
+
[English](README.en.md) | [简体中文](README.md)
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
# ChatGlance
|
|
38
|
+
|
|
39
|
+
`ChatGlance` 是 ChatArch/WZHECNU Glance dashboard 的 Python 生成与运维包,提供 `chatglance` CLI。
|
|
40
|
+
|
|
41
|
+
它不是 NPM 项目,也不是重新实现 Glance 后端:上游 Glance 仍然是 Go 单二进制 dashboard server;`ChatGlance` 负责把 ChatArch 项目清单、Glance YAML 页面、inline HTML 表格和安全运维补丁组织成可复用的 Python 包/CLI。
|
|
42
|
+
|
|
43
|
+
## 当前能力
|
|
44
|
+
|
|
45
|
+
- 从 repository inventory JSON 生成 Glance `项目` page。
|
|
46
|
+
- 当前 page tabs 固定为:`最近提交`、`待处理 PR / Issue`、`分类`、`一览表`。
|
|
47
|
+
- `待处理 PR / Issue` 只显示 PR/Issue 非 0 的仓库,并按 `(PR, Issue, 最近提交)` 降序。
|
|
48
|
+
- 生成 config 副本时清理 legacy generated pages:`Projects`、`ChatArch Projects`、`ChatArch Projects List`。
|
|
49
|
+
- 为 Glance `server-stats` 写入 root-only Disk 配置:`hide-mountpoints-by-default: true` + `mountpoints: /`,避免 snap/loop mount 出现在 Disk popover。
|
|
50
|
+
- 维护 durable runtime:一次性 `runtime maintain` 可原子更新 live config、备份、校验,并在内容变化时可选重启 systemd user service。
|
|
51
|
+
- 渲染 systemd user units:主服务仍直接启动 upstream Glance Go binary;维护任务是独立 oneshot/timer,不是 Python wrapper。
|
|
52
|
+
|
|
53
|
+
## 快速开始
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install -e ".[dev]"
|
|
57
|
+
chatglance --help
|
|
58
|
+
chatglance --tree
|
|
59
|
+
chatglance --version
|
|
60
|
+
python -m pytest -q
|
|
61
|
+
python -m build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## CLI 示例
|
|
65
|
+
|
|
66
|
+
只生成 `项目` page YAML:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
chatglance projects render-page \
|
|
70
|
+
--data /path/to/chatarch-projects.json \
|
|
71
|
+
--output playground/projects-page.yml
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
把生成页写入一个 Glance config 副本:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
chatglance projects update-config \
|
|
78
|
+
--data /path/to/chatarch-projects.json \
|
|
79
|
+
--config /path/to/glance.yml \
|
|
80
|
+
--output playground/glance.with-projects.yml
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
把 `server-stats` Disk 改成只显示 root 分区,写入 config 副本:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
chatglance disks root-only \
|
|
87
|
+
--config /path/to/glance.yml \
|
|
88
|
+
--output playground/glance.root-disk.yml
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
维护一个 durable Glance runtime(默认 `~/.chatarch/glance`):
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
chatglance runtime maintain \
|
|
95
|
+
--runtime-home ~/.chatarch/glance \
|
|
96
|
+
--restart-service chatarch-glance.service
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
生成推荐 systemd user units:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
chatglance runtime render-systemd \
|
|
103
|
+
--runtime-home ~/.chatarch/glance \
|
|
104
|
+
--chatglance-bin ~/.chatarch/venv/bin/chatglance \
|
|
105
|
+
--output-dir playground/systemd
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 运行态边界
|
|
109
|
+
|
|
110
|
+
推荐拓扑是 **systemd 直接运行 Glance,chatglance 只做维护**:
|
|
111
|
+
|
|
112
|
+
- 主服务:`chatarch-glance.service` 直接执行 `~/.chatarch/glance/bin/glance -config ~/.chatarch/glance/config/glance.yml`。
|
|
113
|
+
- 内容数据:repository inventory JSON、缓存和生成快照放在 `~/.chatarch/glance/data/` 或 `~/.chatarch/glance/cache/`。
|
|
114
|
+
- live config:`~/.chatarch/glance/config/glance.yml`;更新前写备份到 `~/.chatarch/glance/config/backups/`。
|
|
115
|
+
- 维护:`chatglance runtime maintain` 是 oneshot,可由 `chatarch-glance-maintenance.timer` 周期触发。
|
|
116
|
+
- 不建议加 Python 长驻 wrapper:wrapper 会把 server 生命周期和内容生成耦合,反而不利于 systemd 重启、日志、健康检查和回滚。
|
|
117
|
+
|
|
118
|
+
## 安全边界
|
|
119
|
+
|
|
120
|
+
- CLI 默认写 output file,不默认覆盖 live `glance.yml`。
|
|
121
|
+
- 不保存或输出 Glance auth、password hash、GitHub token、proxy credential。
|
|
122
|
+
- live runtime、logs、backups、全量实时 JSON 快照默认不进源码仓库。
|
|
123
|
+
- 后续如需动态表格、搜索、中英文切换,再考虑增加小型静态前端层;当前 Python CLI 是基础层。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/ChatGlance.egg-info/PKG-INFO
|
|
5
|
+
src/ChatGlance.egg-info/SOURCES.txt
|
|
6
|
+
src/ChatGlance.egg-info/dependency_links.txt
|
|
7
|
+
src/ChatGlance.egg-info/entry_points.txt
|
|
8
|
+
src/ChatGlance.egg-info/requires.txt
|
|
9
|
+
src/ChatGlance.egg-info/top_level.txt
|
|
10
|
+
src/chatglance/__init__.py
|
|
11
|
+
src/chatglance/cli.py
|
|
12
|
+
src/chatglance/glance_config.py
|
|
13
|
+
src/chatglance/projects.py
|
|
14
|
+
src/chatglance/runtime.py
|
|
15
|
+
src/chatglance/systemd.py
|
|
16
|
+
tests/test_cli.py
|
|
17
|
+
tests/test_projects.py
|
|
18
|
+
tests/test_publish_workflow.py
|
|
19
|
+
tests/test_runtime_systemd.py
|
|
20
|
+
tests/test_version.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
chatglance
|