Files
MemRelay/projects/6553b53c-bf14-49e3-a3de-1ee2f3533d51/curated/development/HanteleWorkTime 部署指南.md
T

84 lines
5.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: HanteleWorkTime 部署指南
type: curated
permalink: main/projects/6553b53c-bf14-49e3-a3de-1ee2f3533d51/curated/development/hantele-work-time-部署指南
stable_id: 5d0e9587-c39b-4f66-b84a-9259d3a22a05
scope: project
project_id: 6553b53c-bf14-49e3-a3de-1ee2f3533d51
workspace_type: development
usage_profile_id: null
preference_context: development
document_type: deployment
revision: 1
source_memory_ids: []
source_checkpoint_ids: []
source_file_ids: []
source_git_commit: null
source_git_commits: []
source_agent_sync_ids: []
model_connection: Sub2API
model_name: git-restore
source_count: 13
source_revisions: {}
source_dispositions:
processed: 13
unchanged: 0
unsupported: 0
skipped: 0
cited_source_ids: []
job_cited_source_ids: []
conflicts: []
supersedes: []
preferences: []
source_cursor: 207
source_hash: 5a2bf7e4aa8a90513e133f70e1737cdaf99fddd9888166c7645ba4700934109c
prompt_version: 2026-08-12.3
schema_version: '3'
curation_job_id: null
created_at: '2026-08-31T03:10:12.978059+00:00'
updated_at: '2026-09-23T14:56:48.160923+00:00'
tags:
- deployment
- development
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
---
# HanteleWorkTime 部署指南
本文档面向 **HanteleWorkTime** 项目(工作区类型:development),提供当前可执行的部署步骤与注意事项。
## 1. 环境要求
- 操作系统:Windows(使用 **WSL2 + Docker Desktop**)  [来源: `global_guidance_document:d3a20d44-6001-4c88-8772-65dbfac75e6e`]
- Docker 代理:手动模式,HTTP 与 HTTPS 均指向 `http://127.0.0.1:7897`,重启 Docker 后验证 `docker pull` 正常工作  [来源: `global_guidance_document:8a861a5f-35c3-4f95-bd5b-6b2297888f56`]
- 网络访问:容器内部访问宿主代理使用 `host.docker.internal:7897`,如需直接访问宿主 IP 采用 `172.17.0.1`(桥接网络)  [来源: `global_guidance_document:8a861a5f-35c3-4f95-bd5b-6b2297888f56`]
## 2. 基本部署原则
- **KISS 与 YAGNI**:只实现最简且正确的功能,不为猜测的未来需求添加依赖或抽象层  [来源: `global_guidance_memory:bf88c265-4749-4c50-85bc-4bae25298cd5`]
- **复用已有框架**:优先使用项目已有的服务、约定和工具,避免重复实现  [同上]
## 3. AI 与 Git 同步(可选)
- 默认 **关闭** AI 驱动的记忆同步与 Git 集成;系统在未显式开启时不会尝试加载模型、创建 `.git` 目录或进行自动 push  [来源: `global_guidance_memory:3f91189b-11a1-45bb-8357-4f413dc1609d`]
- 如需启用,请在部署脚本中显式配置相应的 MemRelay 插件并确认 `.git` 目录已创建  [来源: `global_guidance_memory:3f91189b-11a1-45bb-8357-4f413dc1609d`]
## 4. 凭证与安全
- 所有登录、SSH、数据库或 API 调用 **前** 必须在 Vaultwarden 中搜索对应条目;若唯一匹配则自动使用,否则提示人工选择  [来源: `global_guidance_memory:105b328f-4bda-4641-90a7-7282ef156316`]
- 新增或修改的密码、Token、API‑Key、TOTP 种子 **立即** 写入密码库;记忆中仅记录条目名称、用途与使用方式,绝不保存密文  [同上]
- 项目当前使用的基础设施条目包括 BDYG18Pro、OpenWrt、MySQL、MemRelay、Gitea OAuth、FRP Token 与公网 FRPS 服务器  [同上]
## 5. 部署步骤概览
1. **准备环境**:确认 Windows + WSL2 + Docker Desktop 已安装并符合上文的代理与网络设置。
2. **拉取代码**:在本地工作区执行 `git clone <repo>`(仅克隆代码,不会自动创建 `.git` 除非显式请求)。
3. **配置凭证**:运行部署脚本前,确保所有必需的凭证已在 Vaultwarden 中存在且唯一。
4. **构建容器**:使用 `docker compose build`,期间 Docker 将通过 `host.docker.internal:7897` 访问外部代理。
5. **启动服务**:`docker compose up -d`,检查容器日志确保无凭证加载错误。
6. **验证**:访问服务的 UI(如有),确认页面顶部标题在滚动时保持可见,表单布局符合 **“标题在左、控件在右”** 的紧凑横向规范  [来源: `global_guidance_memory:bf88c265-4749-4c50-85bc-4bae25298cd5`]
7. **记录部署**:在 `aidocs/project_context.md` 追加部署记录(时间戳、操作、验证结果),该文件不被提交至 Git  [来源: `global_guidance_memory:5ed86f53-b53e-4534-8e51-d3a010069d5e`]
## 6. 常见问题
- **Docker 拉取超时**:确认代理已正确配置并在系统代理中开启。若仍失败,检查 `settings-store.json` 中 `ProxyHTTPMode=manual` 是否生效。  [来源: `global_guidance_document:8a861a5f-35c3-4f95-bd5b-6b2297888f56`]
- **AI 模型意外加载**:检查环境变量 `MEMRELAY_AI_ENABLED` 是否被误设为 `true`,否则系统会尝试加载默认模型并报错。  [来源: `global_guidance_memory:3f91189b-11a1-45bb-8357-4f413dc1609d`]
- **凭证未自动使用**:确保 Vaultwarden 中的条目名称唯一;多个匹配会导致系统提示手动选择。  [来源: `global_guidance_memory:105b328f-4bda-4641-90a7-7282ef156316`]
---
**标签**: ["deployment","development"]