Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.08 KB

README_MACOS.md

File metadata and controls

69 lines (49 loc) · 2.08 KB

macOS 版本

macOS 版本与 Windows 版本共用 Light v0.3.0 代码,支持服务器管理、 SSH Config/Agent、密码或私钥认证、ProxyJump、反向端口转发、自动重连、 远程代理配置、联网检测和菜单栏后台运行。

系统要求

  • macOS 11 Big Sur 或更高版本
  • Python 3.10 或更高版本;建议使用 python.org 的 universal2 Python 3.11+
  • 系统自带的 /usr/bin/ssh
  • 本地代理已启动,例如 127.0.0.1:7897

密码不会写入 JSON。APP 只在 JSON 中保存随机引用,实际密码由 macOS 登录钥匙串 保管。首次访问时 macOS 可能显示钥匙串授权提示。

从源码运行

git clone https://github.com/eeeric-code/ssh-reverse-tunnel-manager.git
cd ssh-reverse-tunnel-manager
python3 -m pip install -r requirements-macos.txt
python3 app.py

配置文件位于:

~/Library/Application Support/SshReverseTunnelManagerLight/servers.json

构建 .app、ZIP 和 DMG

python3 -m pip install -r requirements-macos.txt
bash packaging/macos/build_macos.sh

产物位于:

dist/SSH反向代理管理器.app
dist/SshTunnelManagerLight-macOS-arm64.zip
dist/SshTunnelManagerLight-macOS-arm64.dmg

Intel Mac 的文件名为 x86_64。使用 universal2 Python 且所有依赖均包含双架构时:

TARGET_ARCH=universal2 bash packaging/macos/build_macos.sh

签名与分发

未设置签名身份时,PyInstaller 会进行 ad-hoc 签名,适合本机测试。正式分发可使用 Apple Developer ID:

CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" \
  bash packaging/macos/build_macos.sh

正式对外分发还应使用 xcrun notarytool 公证 ZIP 或 DMG,并对公证后的应用执行 stapling。未公证版本在其他 Mac 上首次启动时可能需要在 Finder 中右键选择“打开”。

从 Windows 迁移配置

可以复制服务器字段,但 Windows DPAPI 密码不能被 macOS 解密。请在 macOS 版本中 重新编辑使用“密码”认证的服务器并输入密码;之后密码会保存到 macOS 钥匙串。