 kevinandClaude
|
52da224a19
|
refactor(config): console_log 提到顶层并细分 web/mqtt/llm/sql;data_dir 归入 ai
- 新增顶层 ConsoleLogConfig{Web, MQTT, LLM, SQL},默认全 true,方便后续按模块扩展
- WebConfig.ConsoleLog 移除;NewRouter/NewHTTPServer 改为显式接 consoleLog 参数
- AIConfig 增加 DataDir,原 Config.DataDir(仅 ai 模块使用)下沉到 ai.data_dir
- OpenStore(cfg, consoleLog) 通过 console_log.sql 控制 gorm logger 级别(Warn/Silent)
- gorm logger 始终设 IgnoreRecordNotFoundError=true,修掉 GetBoolRuntimeSetting
正常缺省路径仍刷屏 'record not found' 的噪声
- 同步更新 install.sh 模板、win/etc 默认 yaml 与所有测试调用点
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-19 16:13:18 +08:00 |
|
 kevinandClaude
|
98d5e9e117
|
feat(web): 新增 web.console_log 开关;data_dir 默认改为 srv/mesh_mqtt_go
- WebConfig 增加 console_log 字段,关闭后 gin 不再向控制台打印 HTTP 访问日志(保留 Recovery)
- 默认值 true;旧配置加载时自动补齐并写回
- defaultDataDirForGOOS 默认目录由 var/lib/mesh_mqtt_go 调整为 srv/mesh_mqtt_go,与 install.sh 中 DATA_DIR=/srv/${SERVICE_NAME} 保持一致
- install.sh 模板同步加入 console_log: true
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-19 15:43:38 +08:00 |
|
 kevinandClaude
|
d57dff58f3
|
重构:把剩余 12 个顶层包全部迁到 internal/
继续之前的重构:把根目录残留的非数据/资源类子目录(agents、agenttool、ai、
autoreply、completion、conversation、llm、message、mqtpp、stream、
toolmanager、toolrouter)一并搬到 internal/ 下,并把全工程引用它们的
import 路径从 "meshtastic_mqtt_server/<x>" 重写为
"meshtastic_mqtt_server/internal/<x>"。
变更
- git mv 12 个顶层目录进 internal/,无函数体改动。
- 全工程 sed 把 import path 加上 internal/ 前缀,包括 main.go、
internal/bot/bot_service.go、internal/store/bot_store.go 中对 mqtpp
的引用,以及 ai 子系统内部 agents/agenttool/autoreply/conversation/
llm/toolmanager/toolrouter 之间的相互引用。
验证
- go build ./... 通过;go test ./... 全部包通过。
- AI 自动回复链路(main → ai.NewService → autoreply.Service → botSender)
保持不变,仅 import 路径调整。
- 根目录最终只剩 main.go / main_test.go / internal/ 加 go.mod / go.sum
与数据资源目录(dist、doc、firmware、py、win、meshmap_frontend)。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 18:43:42 +08:00 |
|
 kevinandClaude
|
02b445884d
|
合并 refactor/internal-packages:把根目录 46 个 .go 文件按功能拆到 internal/ 下
把工程根目录全部 package main 文件按业务边界搬到 internal/ 子包下。
根目录从 46 个文件 12.6k 行降到 2 个文件 480 行;新增 13 个 internal 子包:
auth、blocking、bot、config、help、llmadmin、mapsource、mqttforward、
runtimesettings、sign、store、store/testutil、web、webutil。
共 4 个 commit 渐进迁移,每个 commit 单独 build/test 通过:
- eff4972 拆出 internal/config 与 internal/store
- c527a9f 拆出 auth / blocking / runtimesettings / help / mqttforward
- 9394aa0 拆出 bot / sign / mapsource / llmadmin / web
- 46916d9 main.go 直接 import 子包并删除全部 bridge
go build ./... 与 go test ./... 全部通过,测试数量与重构前一致。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 18:34:14 +08:00 |
|
 kevinandClaude
|
46916d9a93
|
重构:main.go 直接 import 各 internal/ 子包,删除全部 bridge
最后一步:把 main.go 里所有指向桥接小写名的引用(store / config /
blocking / bot / runtimesettings / mqttforward / web 等)改写成直接调用
internal/* 子包的导出 API,从而拆掉所有 *_bridge.go。
变更点
- main.go 顶部 import 区改为引用 11 个 internal/ 子包:auth、blocking、
bot、config、mqttforward、runtimesettings、store、web 等。
- meshtasticFilterHook 字段类型改为 *storepkg.WriteQueue / *blockingpkg.Cache
/ *rspkg.Cache / *mqttforwardpkg.Stats;不再依赖 main 包内别名。
- mqttClientInfoFromClient 返回 storepkg.MQTTClientInfo(之前为 main 包别名)。
- run() 里 newSessionManager → auth.NewManager;newRouter → webpkg.NewRouter;
serveHTTPUnixSocket → webpkg.ServeUnixSocket;mqttRuntimeStatus →
webpkg.MQTTRuntimeStatus;botSendTextRequest → botpkg.SendTextRequest;
newBlockingCache / newRuntimeSettingsCache / newMQTTForwardManager 都改为
对应包的 New / NewManager。
- main_test.go 里的 BlockingViolationForRecord 测试改用 testutil.OpenStore
+ blockingpkg.New,全部通过 store.Store 的公开 API 构造数据,不再需要
根目录 test_helpers_test.go。
删除根目录文件
- config.go、auth.go(已删)、blocking_bridge.go、bot_bridge.go、
help_bridge.go、llmadmin_bridge.go、mapsource_bridge.go、
mqttforward_bridge.go、runtime_settings_bridge.go、sign_bridge.go、
store_bridge.go、web_bridge.go、test_helpers_test.go。
最终结果
- 根目录只剩 main.go (~370 行) 和 main_test.go (~110 行)。
- internal/ 下 13 个独立子包:auth / blocking / bot / config / help /
llmadmin / mapsource / mqttforward / runtimesettings / sign / store /
store/testutil / web / webutil。
- go build ./... / go test ./... 全部通过;测试数量与重构前一致;
go build . 可以产出可执行二进制(约 50 MB)。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 18:30:00 +08:00 |
|
 kevinandClaude
|
9394aa0f4a
|
重构:拆出 bot / sign / mapsource / llmadmin / web 包
第三批(最终批):把 root 中剩下所有领域文件按功能搬到 internal/ 下。
完成后根目录从 46 个 .go 文件降到 14 个,其中 11 个是 bridge(type alias
+ thin wrapper),仅供尚未改造的 main.go 引用。
新增包
- internal/bot/ Service / TextSender / NewPKIKeyResolver /
RegisterRoutes,含 PKI 直连发送、节点信息广播、
outbound DM 持久化等业务逻辑。
- internal/sign/ SignDTO / SignDayCountDTO / RegisterAdminRoutes,
把原来分散在 admin_sign_routes.go 与 web.go 中的
sign DTO/路由收拢到一处。
- internal/mapsource/ AdminDTO / PublicDTO / RegisterAdminRoutes /
RegisterPublicRoutes。
- internal/llmadmin/ LLM 消息队列、Provider、ToolRouter、PrimaryConfig 的
admin 路由。
- internal/web/ 路由总入口(NewRouter/NewHTTPServer/ServeUnixSocket)、
各资源的 GET API、admin 用户/登录/MQTT 状态、所有
DTO 函数。把 auth.go 的 sessionClaims 升级为
auth.SessionClaims;mqtt_status.go 重写成
MQTTRuntimeStatus / AdminMQTTStatus 结构体并把
client info 解析在 web 包内自带,不再依赖 main 包。
map_tile_proxy_routes 与测试一起搬入。
修改
- web.go 中 parseListOptions / writeListResponse / ptrString 等本地 helper
改为对 internal/webutil 的 thin wrapper,避免重复实现。
- internal/auth 在 step 4 已创建,本批中 web 包正式开始引用其 Manager /
RequireAdmin / SessionClaims。
根目录新增 bridge:bot_bridge.go / sign_bridge.go / mapsource_bridge.go /
llmadmin_bridge.go / web_bridge.go。后者把 mqttRuntimeStatus 包成
webpkg.MQTTStatusProvider 适配器,使 main.go 中旧字段名保持可用。
go build ./... / go test ./... 全部通过;测试数量未变。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 18:24:14 +08:00 |
|
 kevinandClaude
|
c527a9fd9a
|
重构:拆出 auth / blocking / runtimesettings / help / mqttforward 包
第二批:把根目录中纯逻辑领域文件(cache、service、admin route)按业务边界
迁到 internal/ 下的子包。各子包暴露 RegisterRoutes 给 web 包调用,根目录
只留下一行 bridge 文件保留旧名字别名。
新增包
- internal/auth/ SessionClaims / Manager / RequireAdmin / HashPassword /
VerifyPassword / AdminUserResponse 等。原 auth.go 中
被两个 admin route 依赖的 sessionClaims 现在以 auth.
SessionClaims 形式被它们 import;不再被锁在 main 包。
- internal/blocking/ Cache + RegisterRoutes,以前散在 blocking_cache.go
和 admin_blocking_routes.go 里。
- internal/runtimesettings/ Cache + RegisterRoutes。
- internal/help/ RenderMarkdown / RegisterPublicRoutes /
RegisterAdminRoutes(拆分原来的 registerHelpRoutes
和 registerAdminHelpRoutes 两条入口)。
- internal/mqttforward/ Manager / Reloader / Stats / RegisterRoutes。
forwarder runner、循环抑制 cache 等运行时逻辑随之迁入。
- internal/webutil/ ParseListOptions / WriteListResponse[WithTotal] /
ParseMapReportListOptions / ParseMapReportViewportOptions
以及 PtrString/PtrInt64/... 等指针解引用 helper。
以前散在 web.go 中,现在被各 admin route 子包共享,
避免 internal/blocking → internal/web → internal/blocking
的循环依赖。
- internal/store/testutil/ OpenStore(t) helper,让其它包测试零样板拿到 store。
根目录新增 bridge 文件
- blocking_bridge.go / runtime_settings_bridge.go / help_bridge.go /
mqttforward_bridge.go:用 type alias + thin wrapper 把上述子包的导出
名映射到旧的小写名(blockingCache、registerAdminBlockingRoutes 等),
让 main.go / web.go 等仍未迁出的文件无须改动。
修改
- auth.go 改为对 internal/auth 的 bridge;web.go 中 sessions.newCookie /
clearCookie 改为 NewCookie / ClearCookie。
- main_test.go 中 BlockingViolationForRecord* 测试不再直接构造未导出字段,
改成走 store.CreateNodeBlocking → newBlockingCache 的真实路径。
- internal/mqttforward 把以前 *_store.go 中没有方法依赖的运行时类型
(forwarder runner、loop cache)和 admin route 一并归位;mqtt_status.go
暂时仍留在根目录(依赖 main 中的 mqttClientInfoFromClient)。
go build ./... / go test ./... 全部通过;测试数量未变。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 14:23:56 +08:00 |
|
 kevinandClaude
|
eff4972668
|
重构:拆出 internal/config 与 internal/store 子包
把工程根目录中和"配置加载"、"数据存储"两个领域相关的全部 Go 文件迁到
internal/ 下的子包,按功能分组的第一阶段成果。
internal/config/
- 从 config.go 抽出 Config / MQTTConfig / WebConfig / DatabaseConfig 等
类型并大写导出,函数改名 Default/Load/Write/Validate/BuildTLS 等。
- 测试随被测代码迁移成 package config 的内部测试。
- 根目录留 config.go 作桥接:用 type alias 让旧的小写名(config /
mqttConfig / databaseConfig 等)继续可用,避免修改 30+ 处调用方。
internal/store/
- 把 db.go、store_query.go、db_write_queue.go 与 13 个 *_store.go 一并
迁入;26 个 *Record 类型与 store 同包以避免循环依赖。
- store -> Store;50+ 标识符从小写未导出改为大写导出(包括 record、
ListOptions、错误变量、bot/llm/runtime 常量、helpers 等)。
- 新增 DB() / Driver() 访问器供 ai 子系统使用,避免直接访问私有字段。
- bot_pki_store.go 独立出来,把 PKI 解密所需的 store 方法集中归类。
- helpers.go 提供 hashPassword / uint32FromRecord / printJSON 等以前在
其他根目录文件中的辅助;test_helpers_test.go 提供 verifyPassword
与 publicMapTileSourceDTO 让测试可以本地运行而不依赖 main 包。
根目录新增:
- store_bridge.go:完整 type-alias / 函数包装层,把 internal/store 的
导出名映射回旧的小写名,让 admin_*_routes.go、web.go、bot_service.go
等仍未迁出的文件继续编译。后续步骤把它们迁到各自领域包后可逐步删除。
- test_helpers_test.go:根目录测试沿用 openTestStore 的入口。
go build ./... 与 go test ./... 全部通过;测试数量与重构前一致。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-18 13:56:36 +08:00 |
|
kevin
|
6f6b06e37d
|
up
|
2026-06-18 12:24:18 +08:00 |
|
kevin
|
4e7aacbc68
|
up
|
2026-06-18 08:52:25 +08:00 |
|
kevin
|
fcd230cb5b
|
写成屎山了
|
2026-06-18 08:35:09 +08:00 |
|
kevin
|
45822fd333
|
工具路由还没实现
|
2026-06-18 08:14:09 +08:00 |
|
kevin
|
dfb3fdd3e5
|
根本原因:PKI 私聊需要接收方的公钥,但 !72d17be4 这个节点从未广播过节点信息,nodeinfo 表中没有它的公钥。这傻x豆包ai突然发什么神经,蠢死了
|
2026-06-18 00:49:42 +08:00 |
|
kevin
|
ce07792c4b
|
up
|
2026-06-17 23:54:38 +08:00 |
|
kevin
|
9f088c265d
|
up
|
2026-06-17 23:10:20 +08:00 |
|
kevin
|
fd0a3bc1fe
|
up
|
2026-06-17 22:14:18 +08:00 |
|
kevin
|
f3ee4035bb
|
up
|
2026-06-17 20:58:01 +08:00 |
|
kevin
|
b0a9f52096
|
实现每机器人独立 LLM 消息队列
主要变更:
- 后端:为 botNodeRecord 添加 llm_queue_enabled 和 llm_include_channel_messages 字段
- 后端:移除全局 LLM 队列开关,完全基于每个机器人的设置
- 后端:重写 enqueueChannelMessageToLLM,为每个启用了「包含频道消息」的机器人创建独立队列记录
- 后端:频道消息不再使用 bot_id=0,每条消息都有明确的机器人归属
- 前端:AdminLLM.vue 完全重写,添加机器人 LLM 设置面板
- 前端:消息列表表格新增「机器人」列,显示机器人名称和节点 ID
- 前端:消息类型判断逻辑改为使用 channel_id 区分频道/私聊
- 前后端类型同步更新
|
2026-06-17 20:51:22 +08:00 |
|
kevin
|
e2bf6aa173
|
up
|
2026-06-17 20:18:37 +08:00 |
|
 kevinandClaude
|
2840aca69b
|
修复签到日历人数显示
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 20:56:50 +08:00 |
|
 kevinandClaude
|
8690265fa0
|
新增签到日历筛选
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 20:49:21 +08:00 |
|
 kevinandClaude
|
d36455ce71
|
修复签到页顶部导航显示
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 20:26:13 +08:00 |
|
 kevinandClaude
|
6084897bdb
|
新增签到管理功能
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 20:16:28 +08:00 |
|
 kevinandClaude
|
eeefdaa180
|
调整轨迹浮窗宽度
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 19:56:42 +08:00 |
|
 kevinandClaude
|
5b873ea059
|
修复轨迹浮窗文字布局
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 19:54:01 +08:00 |
|
kevin
|
3a94cf2c3e
|
Merge branch 'feature/web-listener-toggles'
|
2026-06-16 19:50:28 +08:00 |
|
 kevinandClaude
|
e6a8826a8f
|
显示轨迹全部坐标节点
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 19:45:27 +08:00 |
|
 kevinandClaude
|
0f04047517
|
支持 Web 端口和 Sock 同时启用
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-16 19:36:47 +08:00 |
|
kevin
|
f00f030ef3
|
节点移出地图不消失
|
2026-06-16 18:56:19 +08:00 |
|
kevin
|
02bb31584a
|
修复编译bug
|
2026-06-14 21:21:34 +08:00 |
|
kevin
|
0024841ffb
|
修复机器人聊天记录与修改机器人信息
|
2026-06-14 21:17:49 +08:00 |
|
kevin
|
491876284e
|
优化机器人私聊
|
2026-06-14 20:14:52 +08:00 |
|
kevin
|
67330d4656
|
优化机器人ack
|
2026-06-14 19:56:20 +08:00 |
|
kevin
|
757eb852fd
|
更新机器人接收功能
|
2026-06-14 19:41:52 +08:00 |
|
kevin
|
5d4aced3e0
|
完善私聊
|
2026-06-14 19:26:43 +08:00 |
|
kevin
|
a2d838d556
|
up
|
2026-06-12 20:26:48 +08:00 |
|
kevin
|
6c0285c015
|
私聊功能未完成
|
2026-06-12 20:24:18 +08:00 |
|
kevin
|
e16442f348
|
机器人基本ok
|
2026-06-12 19:57:34 +08:00 |
|
kevin
|
609462252c
|
机器人功能还差发送nodeinfo
|
2026-06-12 19:24:40 +08:00 |
|
kevin
|
0db2b181cc
|
合并
|
2026-06-12 18:16:16 +08:00 |
|
kevin
|
2e96faf5a2
|
Merge branch 'main' of https://git.lmve.net/kevin/meshtastic_mqtt_server
# Conflicts:
# meshmap_frontend/src/App.vue
# web.go
|
2026-06-12 18:15:30 +08:00 |
|
kevin
|
b645907c52
|
新增机器人功能
|
2026-06-12 18:07:53 +08:00 |
|
kevin
|
91fb3612f2
|
up
|
2026-06-08 01:28:20 +08:00 |
|
kevin
|
1624cb0f9b
|
up markdown
|
2026-06-08 01:24:01 +08:00 |
|
kevin
|
32bc572284
|
去掉了“查询轨迹”按钮
|
2026-06-07 00:30:00 +08:00 |
|
kevin
|
1e0aa8f637
|
增加最近按钮
|
2026-06-07 00:27:22 +08:00 |
|
kevin
|
c0ceba93b7
|
限制轨迹数据查询
|
2026-06-07 00:22:18 +08:00 |
|
kevin
|
e1f1ac902a
|
更新readme
|
2026-06-06 15:56:37 +08:00 |
|
kevin
|
1841509622
|
修复文本错误
|
2026-06-06 15:23:01 +08:00 |
|
kevin
|
ddf434ef82
|
隐藏地图的 “Leaflet” 但保留瓦片来源 attribution
|
2026-06-06 13:21:00 +08:00 |
|