Commit Graph
17 Commits
Author SHA1 Message Date
kevin 9c16d804d9 修复按钮逻辑bug 2026-07-07 13:34:48 +08:00
kevin e08480f609 整合配置列表 2026-07-07 13:16:07 +08:00
kevin 4420532a66 fix: ensureDaemon 自动检测并重启过期守护进程
问题: 重新构建后 IPv6 等新功能不生效,客户端仍运行旧代码。
根因: ensureDaemon() 通过 IPC socket 拨号时,若旧 daemon 进程仍在
运行(重建后未退出),GUI 会直接复用旧进程,永不启动新二进制。
日志证实旧 daemon 处理连接(init 日志无 ip6 字段),新代码从未执行。

解决方案: 新增版本握手协议,GUI 启动时查询 daemon 构建版本,
版本不匹配则自动关闭旧进程并启动新的。

- 新建 internal/version 包,GUI 与 daemon 共享同一 Version 变量,
  均通过 Makefile ldflags 注入
- IPC 新增 CmdVersion 命令,daemon 返回 version.Version;
  Response 增加 Version 字段,Client 新增 QueryVersion() 方法
- ensureDaemon() 拨号后查询版本,不匹配则发 CmdShutdown、等待
  socket 释放、重新启动 daemon;旧 daemon 不识别 CmdVersion 时
  返回错误,同样触发重启
- Makefile LDFLAGS 改为注入 lmvpn/internal/version.Version
2026-07-07 12:42:23 +08:00
kevin a332857973 up 2026-07-07 12:24:48 +08:00
kevin 8f6daf9f49 feat: 新增 IPv6 双栈支持
- 协议: InitMessage 增加 ip6/prefix6/server_ip6 字段(omitempty,向后兼容)
- TUN: Device 接口新增 ConfigureIPv6, macOS 用 ifconfig inet6, Linux 用 ip -6 addr add
- 路由: full 模式自动添加 ::/1+8000::/1, v6 服务器旁路 /128, resolveHosts 双栈解析
- 会话: setupTUN 解析 v6 字段并配置 TUN+路由, connectOnce 传 v6 给 stats/日志
- 统计: SetConnected(ip,ip6), Snapshot.AssignedIP6
- DB: connection_logs 增加 assigned_ip6 列 + migrateV3 幂等迁移
- UI: 状态卡片新增独立 IPv6 行, 始终可见(未获取显示 IPv6: —)
- 文档: 同步 client-development.md 至服务端 IPv6 版本
2026-07-07 12:24:20 +08:00
kevin e867c8e248 修复滚动问题 2026-07-06 21:17:00 +08:00
kevin 43adeb9684 功能基本实现 2026-07-06 21:08:30 +08:00
kevin 5134290bf2 增加版本显示 2026-07-06 21:04:25 +08:00
kevin 96278fdf37 拆分服务器地址配置为独立字段,支持CDN优选IP故障切换,新增重置数据库按钮
- model: ServerURL → Protocol/Host/ServerIPs/Port/Path 五个字段
- db: 自动迁移旧 server_url 列到新表结构
- ui: 配置窗口改为横向分组布局,保存失败时不再关闭窗口
- transport: 支持 TLS SNI + Host 头覆盖以连接 CDN 边缘节点
- session: CDN IP 列表连接失败自动切换到下一个
- 新增重置数据库按钮,一键清空所有配置
2026-07-06 20:58:11 +08:00
kevin 32471e25b0 修复滚动问题 2026-07-06 20:29:10 +08:00
kevin 12210423f2 修改logo,修改配置页面的窗口 2026-07-06 20:22:25 +08:00
kevin 04d2e6e429 fix: correct connect/disconnect button state on connection lifecycle
- Enable disconnect button immediately when connect is clicked, so the
  user can cancel without waiting for the StateConnecting IPC event.
- Disable disconnect button on all error paths in the connect goroutine
  to restore the default disconnected button state.
- Capture ipcClient once at eventLoop start instead of re-reading every
  iteration, preventing a second onConnect call from making the old
  event loop jump to the new client and consume events concurrently.
- In eventLoop recv error recovery, only reset button states if the
  current ipcClient still matches the captured one, so a stale
  disconnection does not clobber the state of a newer session.
- Disable connect button in StateReconnecting case (was missing).
- Remove WriteOK from daemon startSession: the StateConnecting event
  already serves as the implicit acknowledgment; the OK response was
  being read by eventLoop as a no-op event, adding unnecessary noise.
2026-07-06 19:34:29 +08:00
kevin b0aa386ee2 修复 daemon 启动问题,分离 GUI 和 daemon 二进制
- 分离二进制: cmd/lmvpn (GUI+Fyne) 和 cmd/lmvpnd (daemon, 无 Fyne)
  消除 daemon 启动时的 Fyne locale 初始化错误
- 新增 daemon-launch 子命令: 用 syscall.SysProcAttr{Setsid: true}
  替代 nohup, 解决 osascript 无 TTY 时的 'Inappropriate ioctl' 错误
- daemon 日志写到用户家目录: paths.SetUserHome() 覆盖 root 默认路径
- IPC socket chown 给用户: 解决 root:wheel 0660 导致 GUI 无法连接
- 修复 JWT→密码认证回退: 捕获 ServerError{auth_err} 而非仅 AuthError
- 修复 token URL 编码: 用 url.QueryEscape 替代裸拼接
- 日志去重: LMVPN_DAEMON=1 时 daemon 不再 stderr 镜像到文件
- Makefile 构建双二进制并打包到 .app bundle
2026-07-06 17:46:36 +08:00
kevin 124d6ad363 up 2026-07-06 16:53:24 +08:00
kevin 1f1794fcc7 增加多语言支持 2026-07-06 16:52:04 +08:00
kevin 1e3db0a724 up 2026-07-06 16:26:22 +08:00
kevin bb9f685221 init 2026-07-06 16:21:06 +08:00