chore(v2): 从兴邦预审v2白名单抽取独立可运行基座
按 docs/v2/05-implementation-plan.md §1 候选迁移表与 claude_use/T00 白名单, 从 55e2cdb 抽取 224 个文件(2.48 MB)到独立目录 F:/mini-OpenClaw-v2。 - 排除:凭据(.env/server-deploy.conf/旧DELIVERY.md)、运行数据(xingbang_data 等 4 个 SQLite)、依赖(venv/node_modules 符号链接)、归档(_backup*/test-evidence/ ori_file)、Office 临时文件 - 目标目录独立 git 仓库,初始恢复点;Gitea 远程与分支待 OQ-06 Q2 定案 - 未部署、未启动服务、未调用模型 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
"""Release configuration safeguards; no credentials or cloud access required."""
|
||||
import subprocess
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class DeploymentReleaseTests(unittest.TestCase):
|
||||
def test_container_entrypoint_normalizes_windows_line_endings(self):
|
||||
self.assertIn("sed -i 's/\\r$//' /app/docker-entrypoint.sh", (ROOT / "Dockerfile").read_text(encoding="utf-8"))
|
||||
|
||||
def test_cloud_ports_remain_loopback_only(self):
|
||||
compose = (ROOT / "deploy/docker-compose.aliyun.yml").read_text(encoding="utf-8")
|
||||
self.assertIn('"127.0.0.1:${FRONTEND_PORT:-80}:3000"', compose)
|
||||
self.assertIn('"127.0.0.1:${BACKEND_PORT:-8002}:8002"', compose)
|
||||
|
||||
def test_chat_compatibility_is_forwarded_without_forcing_a_provider(self):
|
||||
for filename in ("docker-compose.yml", "deploy/docker-compose.aliyun.yml"):
|
||||
with self.subTest(filename=filename):
|
||||
self.assertIn("CHAT_THINKING_MODE: ${CHAT_THINKING_MODE:-}",
|
||||
(ROOT / filename).read_text(encoding="utf-8"))
|
||||
|
||||
def test_runtime_data_and_private_configuration_are_not_packaged(self):
|
||||
excluded = set((ROOT / ".dockerignore").read_text(encoding="utf-8").splitlines())
|
||||
required = {"backend/.env", "deploy/*.env", "backend/sessions", "backend/storage",
|
||||
"backend/raw_logs", "backend/backend", "backend/xingbang_data",
|
||||
"backend/xingbang_output", "backend/xingbang_evolution",
|
||||
"test-evidence", "ori_file", "ori_meetingfile", "_backup*"}
|
||||
self.assertTrue(required <= excluded, required - excluded)
|
||||
self.assertNotIn("backend/fixtures", excluded)
|
||||
|
||||
def test_cloud_secrets_and_source_material_are_git_ignored(self):
|
||||
result = subprocess.run(
|
||||
["git", "check-ignore", "deploy/aliyun.env", "ori_file/private.md"],
|
||||
cwd=ROOT, capture_output=True, text=True, check=True,
|
||||
)
|
||||
self.assertEqual(set(result.stdout.splitlines()),
|
||||
{"deploy/aliyun.env", "ori_file/private.md"})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user