Skip to content

PocketShell v1.6.0

Choose a tag to compare

@Big-Pony Big-Pony released this 30 Jul 13:44

PocketShell v1.6.0

新增

  • install 子命令:一条命令装成开机自启的服务

    # 先把二进制装到位
    curl -fsSL https://raw.githubusercontent.com/Big-Pony/pocketshell/main/install.sh | sh
    
    # 再做成开机自启的服务
    sudo pocketshell-agent install --advertise wss://your.domain --name 我的服务器

    该命令写好 systemd 服务配置 → 注册开机自启 → 立刻启动 → 首次安装时直接打印配对串。macOS 写的是 launchd 配置且不要加 sudo(LaunchAgent 属于用户域,加 sudo 会装进 root 的会话里,命令会直接拦下并说明)。

    • 服务身份:默认取 sudo 的发起者而非 root,手机连上后拿到的是你自己的 shell(dotfiles、Claude/Codex 配置、SSH 密钥都在)。用 --user 可指定其他用户。
    • Restart=always / KeepAlive:崩溃自动拉起,也是应用内 OTA 更新能重启成功的前提。
    • macOS PATH:安装时探测本机 tmux 的真实位置写进配置,不假设 Apple Silicon + Homebrew(launchd 环境极简,找不到 tmux 会启动即退出)。
    • 改参数直接重跑:原配置先备份,密钥目录不动,已配对的手机不掉线。
    • 不修改 Caddy/Nginx 配置、不动 DNS、不代装 tmux(缺失时打印对应发行版的安装命令并退出)。
  • uninstall 子命令:停服务、删配置,保留密钥目录(内含密钥与已配对设备;确需清除时命令会告知路径)。

  • 一行安装脚本:校验 SHA256,不匹配立即中止;VERSION=1.5.0 curl -fsSL … | sh 可装指定版本。

修复

  • pair 子命令在服务启动 5 分钟内失效:进程启动时铸的配对码尚未过期,会盖住新生成的码,报错为 bad_code,看起来像配对串抄错。采纳规则改为磁盘上更新的码抢占仍存活的启动码,任何时刻跑 pair 都即刻生效。

PocketShell v1.6.0

Added

  • install subcommand: set up a boot-start service in one command

    # get the binary in place
    curl -fsSL https://raw.githubusercontent.com/Big-Pony/pocketshell/main/install.sh | sh
    
    # turn it into a service that starts on boot
    sudo pocketshell-agent install --advertise wss://your.domain --name my-server

    It writes the systemd unit → registers it to start at boot → starts it now → and prints the pairing string on a first install. macOS writes a launchd config instead, and there you should not use sudo — a LaunchAgent belongs to your user domain, and the command stops and tells you rather than installing into root's session.

    • Which user the service runs as: whoever invoked sudo, not root, so the shell your phone gets is yours (dotfiles, Claude/Codex config, SSH keys). Use --user to pick someone else.
    • Restart=always / KeepAlive: it comes back after a crash, and it's what lets in-app OTA updates restart cleanly into the new binary.
    • PATH on macOS: the installer probes where tmux actually lives instead of assuming Apple Silicon plus Homebrew (launchd's environment is bare, and an agent that can't find tmux exits at startup).
    • Changing a setting: just run it again — the old config is backed up first, your key directory is untouched, and paired phones stay paired.
    • It won't touch your Caddy/Nginx config, your DNS, or your package manager (missing tmux gets you the right install command for your distro and a clean exit).
  • uninstall subcommand: stops the service and deletes the config while keeping your key directory (it holds your keys and paired devices; if you really want it gone the command tells you the path).

  • One-line installer: verifies SHA256 and aborts on a mismatch. Pin a version with VERSION=1.5.0 curl -fsSL … | sh.

Fixed

  • pair did nothing for the first five minutes after the service started: the code minted at boot hadn't expired yet and quietly took precedence over the one you'd just generated, returning bad_code, which reads like you mistyped the pairing string. The adoption rule now prefers whichever code was minted more recently, so pair takes effect immediately no matter when you run it.