herdr-remote 0.3.31 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/README.zh-CN.md +2 -2
- package/dist/chunks/3FQAXVGC.js +3 -0
- package/dist/chunks/{KRSURB5L.js → 44IGVPMA.js} +1 -1
- package/dist/chunks/{353DMT35.js → 5LZFJ6UZ.js} +1 -1
- package/dist/chunks/{WSACSE45.js → AX4EPJCP.js} +1 -1
- package/dist/chunks/{AM3OEMFK.js → B76DFI4H.js} +1 -1
- package/dist/chunks/{OJPBI7KB.js → BYGDPZZD.js} +1 -1
- package/dist/chunks/{M4AFZHKH.js → CVJ4HBMP.js} +1 -1
- package/dist/chunks/{YXDQ62BB.js → FONUO5O5.js} +1 -1
- package/dist/chunks/{YD3MIP7B.js → K5RFPHSF.js} +1 -1
- package/dist/chunks/KGOQKOHH.js +5 -0
- package/dist/chunks/{M3NRPJK2.js → LPR662JH.js} +52 -52
- package/dist/chunks/{XJKWLK43.js → LY2ZGCXN.js} +1 -1
- package/dist/chunks/{U27JJKJ6.js → MCUVFSSK.js} +1 -1
- package/dist/chunks/{7AUQHB3O.js → MEFDV375.js} +1 -1
- package/dist/chunks/{ANNJESOL.js → MKAEXKXG.js} +1 -1
- package/dist/chunks/{OMN6C7J6.js → QCSILMFB.js} +1 -1
- package/dist/chunks/{AWB4A65P.js → RMHH3IAX.js} +1 -1
- package/dist/chunks/{PFFVGFPL.js → VD54DF7R.js} +1 -1
- package/dist/cli.js +4 -4
- package/dist/connector/main.js +1 -1
- package/herdr-plugin.toml +1 -1
- package/node_modules/herdr-remote-relay/package.json +1 -1
- package/package.json +2 -2
- package/dist/chunks/UEOQE77N.js +0 -4
- package/dist/chunks/XN6D5S55.js +0 -3
package/README.md
CHANGED
|
@@ -13,7 +13,9 @@ herdr-remote
|
|
|
13
13
|
|
|
14
14
|
Running `herdr-remote` without arguments launches the setup wizard and configuration TUI.
|
|
15
15
|
Releases go to [GitHub Releases](https://github.com/dibin666/herdr-remote/releases) first and to
|
|
16
|
-
npm as a fallback (`npm install -g herdr-remote`)
|
|
16
|
+
npm as a fallback (`npm install -g herdr-remote`). `herdr-remote update` downloads the release from
|
|
17
|
+
GitHub and swaps it in without npm; npm is only used when a release changes the native `node-pty`
|
|
18
|
+
dependency, or when GitHub cannot be reached.
|
|
17
19
|
|
|
18
20
|
Native Windows 10/11 is supported with Node.js 22+; install Herdr from PowerShell with
|
|
19
21
|
`powershell -ExecutionPolicy Bypass -c "irm https://herdr.dev/install.ps1 | iex"`.
|
|
@@ -25,7 +27,7 @@ through Windows Defender Firewall on private networks.
|
|
|
25
27
|
- **This machine only** *(default)*: Local workstation browser (127.0.0.1).
|
|
26
28
|
- **Local network / Tailscale**: Accessible over LAN or Tailnet (0.0.0.0).
|
|
27
29
|
- **Official relay**: Public relay at `wss://herdr-remote.564616.xyz`.
|
|
28
|
-
- **Self-hosted relay**: External access via standalone [`herdr-remote-relay`](
|
|
30
|
+
- **Self-hosted relay**: External access via a standalone [`herdr-remote-relay`](../relay/README.md) (container image or release tarball).
|
|
29
31
|
|
|
30
32
|
## CLI Commands
|
|
31
33
|
|
package/README.zh-CN.md
CHANGED
|
@@ -12,7 +12,7 @@ herdr-remote
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
直接运行 `herdr-remote` 即可启动向导并进入配置 TUI。
|
|
15
|
-
新版本先发布到 [GitHub Releases](https://github.com/dibin666/herdr-remote/releases),npm 作为备用渠道(`npm install -g herdr-remote
|
|
15
|
+
新版本先发布到 [GitHub Releases](https://github.com/dibin666/herdr-remote/releases),npm 作为备用渠道(`npm install -g herdr-remote`)。`herdr-remote update` 从 GitHub 下载新版本并直接替换安装目录,不经过 npm;只有新版本改变了原生依赖 `node-pty`,或无法连接 GitHub 时才会用 npm。
|
|
16
16
|
|
|
17
17
|
已支持 Windows 10/11 原生运行(需 Node.js 22+),请在 PowerShell 中执行
|
|
18
18
|
`powershell -ExecutionPolicy Bypass -c "irm https://herdr.dev/install.ps1 | iex"` 安装 Herdr。
|
|
@@ -24,7 +24,7 @@ Defender 防火墙提示中允许 `node.exe` 通过专用网络通信。
|
|
|
24
24
|
- **仅本机** *(默认)*:仅本机浏览器可访问 (127.0.0.1)。
|
|
25
25
|
- **局域网 / Tailscale**:局域网或 Tailnet 内设备可访问 (0.0.0.0)。
|
|
26
26
|
- **官方 Relay**:使用官方公开 Relay (`wss://herdr-remote.564616.xyz`)。
|
|
27
|
-
- **自建 Relay**:连接独立部署的 [`herdr-remote-relay`](
|
|
27
|
+
- **自建 Relay**:连接独立部署的 [`herdr-remote-relay`](../relay/README.zh-CN.md) 服务(容器镜像或 release 压缩包)。
|
|
28
28
|
|
|
29
29
|
## 常用命令
|
|
30
30
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
|
+
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
+
var m={"app.name":"Herdr Remote","app.tagline":"Remote browser access to Herdr workspaces","common.yes":"Yes","common.no":"No","common.on":"on","common.off":"off","common.none":"none","common.auto":"auto","common.unknown":"unknown","common.running":"running","common.stopped":"stopped","common.connected":"connected","common.disconnected":"disconnected","common.installed":"installed","common.notInstalled":"not installed","common.enabled":"enabled","common.disabled":"disabled","common.loading":"Working\u2026","common.save":"Save settings","common.saved":"Configuration saved to {path}","common.back":"Back","common.cancel":"Cancel","common.confirm":"Confirm","common.pid":"pid {pid}","common.notApplicable":"n/a","nav.overview":"Overview","nav.pair":"Pair a device","nav.services":"Services","nav.relay":"Relay","nav.keepalive":"Keep-alive","nav.herdr":"Herdr","nav.about":"Language & about","mode.local":"This machine only","mode.lan":"Local network / Tailscale","mode.official":"Official relay","mode.remote":"Self-hosted relay","mode.local.description":"Relay listens on 127.0.0.1. Local browser only.","mode.lan.description":"Relay listens on 0.0.0.0. Accessible over LAN or Tailscale.","mode.official.description":"Connect via official relay. No server needed.","mode.remote.description":"Connect via self-hosted relay for external access.","overview.title":"Status","overview.mode":"Access mode","overview.relay":"Relay","overview.host":"Host connector","overview.socket":"Herdr socket","overview.webUrl":"Web UI","overview.keepalive":"Keep-alive","overview.devices":"Browsers","overview.hosts":"Workstations","overview.uptime":"Relay uptime","overview.relayLocal":"local, {bind}:{port}","overview.relayRemote":"remote, {url}","overview.socketMissing":"not found \u2014 is Herdr running?","overview.unreachable":"unreachable: {message}","overview.notStarted":"Services not running. Open Services tab to start.","pair.title":"Pair a device","pair.generate":"Generate pairing code","pair.regenerate":"Regenerate code","pair.working":"Generating pairing code\u2026","pair.code":"Pairing code","pair.url":"Access URL","pair.expires":"Expires in {minutes} (at {time})","pair.expired":"Code expired. Generate a new one.","pair.instructions":"Open URL and enter code to pair.","pair.qrHint":"Scan QR code to open URL.","pair.qrUnavailable":"Terminal too narrow for QR code; use URL above.","pair.failed":"Could not create pairing code: {message}","pair.hostOffline":"Relay has no workstation connected. Start services first.","services.title":"Services","services.start":"Start services","services.stop":"Stop services","services.restart":"Restart services","services.started":"Services started.","services.stopped":"Services stopped.","services.restarted":"Services restarted.","services.startFailed":"Could not start services: {message}","services.stopFailed":"Could not stop services: {message}","services.unsavedBlocked":"Unsaved changes. Save before restarting.","services.managedNotice":"Managed by {manager}; applied via keep-alive service.","services.logs":"Recent logs","services.logEmpty":"No logs.","services.logRelay":"Relay","services.logHost":"Host connector","adminBroker.windowsOnly":"The administrator terminal broker only runs on Windows.","adminBroker.needsElevation":"Open the Windows TUI and choose Set up admin terminal access. Approve the one-time Windows prompt under the same account as Herdr Remote.","adminBroker.busy":"An admin terminal is open; close it before restarting the broker.","adminBroker.title":"Admin terminal broker","adminBroker.checking":"Checking\u2026","adminBroker.ready":"Ready","adminBroker.notReady":"Not configured or stopped","adminBroker.install":"Set up admin terminal access","adminBroker.uninstall":"Remove admin terminal access","adminBroker.installDone":"Admin terminal broker setup task registered.","adminBroker.uninstallDone":"Admin terminal broker setup task removed.","adminBroker.elevationCancelled":"Administrator approval was declined; no changes were made.","adminBroker.setupFailed":"Could not configure the administrator terminal broker.","adminBroker.tuiHint":"Set this up once. Windows asks for administrator approval; later WebUI admin terminals open without UAC.","adminShell.needsTerminal":"admin-shell must run in a terminal.","adminShell.brokerUnavailable":"The administrator terminal broker is not running. Open the herdr-remote TUI, go to Keep-alive, and choose Set up admin terminal access.","adminShell.tabLabel":"Admin","relay.title":"Relay settings","relay.settings":"Settings","relay.locked":"fixed","relay.officialFixed":"The official relay address is fixed and cannot be edited.","relay.officialHint":"Official relay: address is fixed and no password is needed.","relay.password":"Relay password","relay.passwordHint":"Must match RELAY_PASSWORD on relay. Leave empty if public.","relay.passwordSet":"set","relay.passwordEmpty":"not set (public)","relay.passwordSaved":"Relay password saved. Restart services to apply.","relay.showPassword":"Show password","relay.hidePassword":"Hide password","relay.identity":"Workstation ID","relay.regenerate":"Generate new ID","relay.regenerated":"New workstation identity generated. Restart services to re-register.","relay.envSnippet":"Relay startup command","relay.envHint":"Run this command on the relay host.","relay.test":"Test relay connection","relay.testOk":"Relay reachable: version {version}, {hosts} workstation(s) connected.","relay.testFailed":"Relay unreachable: {message}","relay.selectAddress":"Choose advertised address","relay.listenAddress":"Listen address","relay.listenAddressHint":"Server bind address. Browsers use advertised address below.","relay.addressTailscale":"Tailscale","relay.addressLan":"LAN","relay.addressVirtual":"virtual","relay.addressLoopback":"loopback","relay.noAddresses":"No non-loopback addresses found.","relay.docsHint":"Self-hosting guide: docs/self-hosted-relay.md","keepalive.title":"Keep-alive service","keepalive.manager":"Manager","keepalive.state":"State","keepalive.install":"Install and start","keepalive.uninstall":"Stop and remove","keepalive.restart":"Restart service","keepalive.installed":"Keep-alive installed with {manager}.","keepalive.uninstalled":"Keep-alive removed.","keepalive.restarted":"Keep-alive service restarted.","keepalive.failed":"Keep-alive operation failed: {message}","keepalive.unitPath":"Unit file","keepalive.logsHint":"View logs: {command}","keepalive.linger":"Start at boot","keepalive.lingerEnabled":"Start at boot enabled.","keepalive.lingerDisabled":"Start at boot disabled (runs while logged in).","keepalive.enableLinger":"Enable start at boot","keepalive.lingerDone":"Start at boot enabled for {username}.","keepalive.fallbackNote":"No system service manager found; background process will not survive reboot.","keepalive.windowsTaskNote":"Starts after you sign in as your account. It needs no password or administrator rights and does not run before sign-in.","keepalive.serviceNote":"Runs as a Windows service under your account and starts before sign-in. Installing or removing it asks for administrator rights, and Windows may require your account password.","keepalive.serviceWindowHint":"Finish the installation in the administrator window that opens.","keepalive.elevationCancelled":"Administrator rights were not granted; nothing was installed.","keepalive.passwordPrompt":"Windows account password for {account} (not a PIN; press Enter if there is no password):","keepalive.passwordRejected":"Windows could not start the service with those credentials. Check the account password and service logon policy.","keepalive.serviceInstalled":"Service {id} is installed and running.","keepalive.wrongAccount":"Run this as the account that will use herdr-remote, not another administrator account.","keepalive.pressEnter":"Press Enter to close this window.","herdr.title":"Herdr integration","herdr.socketPath":"Socket path","herdr.args":"Extra arguments","herdr.autoStartHint":"Off: Herdr starts only when you run it, or when you confirm it from a browser. On: herdr-remote also starts it every time it starts, at boot included. Takes effect the next time herdr-remote starts.","herdr.cliMissing":"Command herdr not found. Set HERDR_BIN_PATH to its full path.","herdr.version":"Herdr version","herdr.versionOutdated":'Herdr {version} is older than {minimum}. Run "herdr update": window titles, large pastes, taps on a pane and Alt shortcuts misbehave in browser windows before that release.',"about.title":"Language & about","about.language":"Interface language","about.languageAuto":"Follow system ({detected})","about.languageZh":"\u4E2D\u6587","about.languageEn":"English","about.version":"Version","about.configPath":"Config file","about.statePath":"State directory","about.relayPackage":"Relay package","about.docs":"Self-hosting guide: docs/self-hosted-relay.md","wizard.title":"First-time setup","wizard.step":"Step {current} of {total}","wizard.languageTitle":"Choose language","wizard.accessTitle":"Access mode","wizard.accessHint":"Can be changed later in Relay settings.","wizard.addressTitle":"Browser access address","wizard.relayTitle":"Relay server","wizard.relayUrlLabel":"Relay URL (wss://\u2026)","wizard.relayHint":"Relay must be running. See docs/self-hosted-relay.md.","wizard.passwordTitle":"Relay password","wizard.passwordHint":"RELAY_PASSWORD of the relay. Leave empty if unset.","wizard.finishTitle":"Finish","wizard.finishHint":"Configuration will be saved to {path}.","wizard.startNow":"Start services now","wizard.installKeepalive":"Run in background","wizard.finish":"Save and finish","field.mode":"Access mode","field.port":"Relay port","field.lanHost":"Browser address","field.remoteUrl":"Relay URL","field.publicUrl":"Browser URL override","field.socketPath":"Herdr socket path","field.herdrArgs":"Herdr arguments","field.herdrAutoStart":"Auto-start Herdr","field.language":"Language","field.keepalive":"Keep-alive manager","placeholder.autoDiscovered":"auto-discovered","placeholder.none":"none","error.invalidMode":"Unknown access mode.","error.invalidPort":"Port must be a number between 1 and 65535.","error.invalidLanHost":"Browser address must be a reachable LAN or Tailscale address, not loopback or 0.0.0.0.","error.invalidRelayUrl":"Relay URL must start with wss://, ws://, https:// or http://.","error.invalidPublicUrl":"Browser URL must start with https:// or http:// and cannot use 0.0.0.0 or ::.","error.invalidLanguage":"Unknown language.","error.invalidKeepalive":"Unknown keep-alive manager.","error.unknownField":"Unknown setting.","error.remoteUrlRequired":"Relay URL is required for self-hosted relay mode.","error.removedHerdrArg":"Herdr 0.9.0 removed --no-session; remove it from the extra arguments.","error.saveFailed":"Could not save configuration: {message}","hint.navigate":"\u2191\u2193 move","hint.select":"\u21B5 select","hint.edit":"\u21B5 edit","hint.tabs":"\u2190 \u2192 switch tab","hint.back":"esc back","hint.quit":"q quit","hint.mouseOn":"m mouse off","hint.mouseOff":"m mouse on","hint.mouseUnsupported":"mouse unsupported","hint.restartRequired":"Restart services to apply changes.","hint.unsavedChanges":"Unsaved changes (press s to save).","hint.save":"s save","hint.editing":"\u21B5 confirm \xB7 esc cancel","update.title":"Updates","update.banner":"herdr-remote {latest} is out (running {current}). Press 7 and Enter on the update row to install.","update.check":"Check for updates","update.checking":"Checking GitHub Releases\u2026","update.upToDate":"Up to date ({version})","update.available":"Update {version} available (press Enter to install)","update.updating":"Installing {version}\u2026","update.updatingRetry":"Installing {version}\u2026 (npm has not caught up yet, attempt {attempt})","update.done":"Updated to {version}","update.restartHint":"Update installed. Restart herdr-remote to apply.","update.errorNetwork":"Could not reach GitHub Releases, nor any npm registry as a fallback","update.errorNetworkDetail":"Nothing answered: {message}","update.errorFailed":"Update failed. Run: npm install -g {url}","update.errorFailedDetail":"Installer: {message}","update.errorNotYetPublished":"npm has not caught up with {version} yet (common in the first minutes after a release). Press Enter to try again shortly.","update.errorNotApplied":"The install reported success, but {installed} is still installed","update.cannot.source":"Source checkout \u2014 update with git","update.cannot.linked":"Linked package \u2014 managed by npm link","update.stoppingServices":"Stopping services while their files are replaced\u2026","update.restarting":"Restarting services on the new release\u2026","update.notRunning":"Services were not running and were left stopped. Start them with: herdr-remote start","update.restartFailed":"Installed, but the services did not restart: {message}","update.brokerRestarted":"Admin terminal broker restarted.","update.brokerRestartFailed":"The admin terminal broker did not start again. Sign out of Windows and back in, or run herdr-remote admin-broker restart.","update.brokerBusy":"An admin terminal is open, so the broker keeps running the previous release. Close admin terminals, then run herdr-remote admin-broker restart.","update.errorBusy":"A process still holds the herdr-remote folder; an admin terminal broker set up by an older release does. In an administrator PowerShell run: Get-ScheduledTask -TaskName 'HerdrRemoteAdminBroker-*' | Stop-ScheduledTask. Then run herdr-remote update again here, and afterwards herdr-remote admin-broker install as administrator."},l=m;var u={"app.name":"Herdr Remote","app.tagline":"\u5728\u6D4F\u89C8\u5668\u4E2D\u4F7F\u7528 Herdr \u5DE5\u4F5C\u533A","common.yes":"\u662F","common.no":"\u5426","common.on":"\u5F00","common.off":"\u5173","common.none":"\u65E0","common.auto":"\u81EA\u52A8","common.unknown":"\u672A\u77E5","common.running":"\u8FD0\u884C\u4E2D","common.stopped":"\u5DF2\u505C\u6B62","common.connected":"\u5DF2\u8FDE\u63A5","common.disconnected":"\u672A\u8FDE\u63A5","common.installed":"\u5DF2\u5B89\u88C5","common.notInstalled":"\u672A\u5B89\u88C5","common.enabled":"\u5DF2\u542F\u7528","common.disabled":"\u5DF2\u505C\u7528","common.loading":"\u5904\u7406\u4E2D\u2026","common.save":"\u4FDD\u5B58\u8BBE\u7F6E","common.saved":"\u914D\u7F6E\u5DF2\u4FDD\u5B58\u81F3 {path}","common.back":"\u8FD4\u56DE","common.cancel":"\u53D6\u6D88","common.confirm":"\u786E\u8BA4","common.pid":"PID {pid}","common.notApplicable":"\u4E0D\u9002\u7528","nav.overview":"\u6982\u89C8","nav.pair":"\u914D\u5BF9\u8BBE\u5907","nav.services":"\u670D\u52A1","nav.relay":"Relay","nav.keepalive":"\u4FDD\u6D3B","nav.herdr":"Herdr","nav.about":"\u8BED\u8A00\u4E0E\u5173\u4E8E","mode.local":"\u4EC5\u672C\u673A","mode.lan":"\u5C40\u57DF\u7F51 / Tailscale","mode.official":"\u5B98\u65B9 Relay","mode.remote":"\u81EA\u5EFA Relay","mode.local.description":"\u76D1\u542C 127.0.0.1\uFF0C\u4EC5\u672C\u673A\u53EF\u8BBF\u95EE\u3002","mode.lan.description":"\u76D1\u542C 0.0.0.0\uFF0C\u5C40\u57DF\u7F51\u4E0E Tailscale \u8BBE\u5907\u53EF\u8BBF\u95EE\u3002","mode.official.description":"\u4F7F\u7528\u5B98\u65B9 Relay \u8DE8\u7F51\u8BBF\u95EE\uFF0C\u65E0\u9700\u81EA\u5EFA\u670D\u52A1\u5668\u3002","mode.remote.description":"\u8FDE\u63A5\u81EA\u5EFA Relay \u8DE8\u7F51\u8BBF\u95EE\u3002","overview.title":"\u72B6\u6001","overview.mode":"\u8BBF\u95EE\u65B9\u5F0F","overview.relay":"Relay","overview.host":"\u4E3B\u673A\u8FDE\u63A5\u5668","overview.socket":"Herdr \u5957\u63A5\u5B57","overview.webUrl":"Web \u754C\u9762","overview.keepalive":"\u4FDD\u6D3B\u670D\u52A1","overview.devices":"\u6D4F\u89C8\u5668","overview.hosts":"\u5DE5\u4F5C\u7AD9","overview.uptime":"Relay \u8FD0\u884C\u65F6\u95F4","overview.relayLocal":"\u672C\u5730\uFF0C{bind}:{port}","overview.relayRemote":"\u8FDC\u7A0B\uFF0C{url}","overview.socketMissing":"\u672A\u627E\u5230\uFF0C\u8BF7\u786E\u8BA4 Herdr \u662F\u5426\u8FD0\u884C","overview.unreachable":"\u65E0\u6CD5\u8BBF\u95EE\uFF1A{message}","overview.notStarted":"\u670D\u52A1\u672A\u8FD0\u884C\uFF0C\u53EF\u524D\u5F80\u300C\u670D\u52A1\u300D\u542F\u52A8\u3002","pair.title":"\u914D\u5BF9\u8BBE\u5907","pair.generate":"\u751F\u6210\u914D\u5BF9\u7801","pair.regenerate":"\u91CD\u65B0\u751F\u6210","pair.working":"\u751F\u6210\u914D\u5BF9\u7801\u4E2D\u2026","pair.code":"\u914D\u5BF9\u7801","pair.url":"\u8BBF\u95EE\u5730\u5740","pair.expires":"\u5269\u4F59 {minutes}\uFF08\u81F3 {time}\uFF09","pair.expired":"\u914D\u5BF9\u7801\u5DF2\u8FC7\u671F\uFF0C\u9700\u91CD\u65B0\u751F\u6210\u3002","pair.instructions":"\u6253\u5F00\u94FE\u63A5\u5E76\u8F93\u5165\u914D\u5BF9\u7801\u3002","pair.qrHint":"\u626B\u63CF\u4E8C\u7EF4\u7801\u6253\u5F00\u94FE\u63A5\u3002","pair.qrUnavailable":"\u7EC8\u7AEF\u5BBD\u5EA6\u4E0D\u8DB3\uFF0C\u65E0\u6CD5\u663E\u793A\u4E8C\u7EF4\u7801\u3002","pair.failed":"\u751F\u6210\u914D\u5BF9\u7801\u5931\u8D25\uFF1A{message}","pair.hostOffline":"Relay \u672A\u8FDE\u63A5\u5DE5\u4F5C\u7AD9\uFF0C\u9700\u5148\u542F\u52A8\u670D\u52A1\u3002","services.title":"\u670D\u52A1","services.start":"\u542F\u52A8\u670D\u52A1","services.stop":"\u505C\u6B62\u670D\u52A1","services.restart":"\u91CD\u542F\u670D\u52A1","services.started":"\u670D\u52A1\u5DF2\u542F\u52A8\u3002","services.stopped":"\u670D\u52A1\u5DF2\u505C\u6B62\u3002","services.restarted":"\u670D\u52A1\u5DF2\u91CD\u542F\u3002","services.startFailed":"\u542F\u52A8\u670D\u52A1\u5931\u8D25\uFF1A{message}","services.stopFailed":"\u505C\u6B62\u670D\u52A1\u5931\u8D25\uFF1A{message}","services.unsavedBlocked":"\u914D\u7F6E\u672A\u4FDD\u5B58\uFF0C\u8BF7\u5148\u4FDD\u5B58\u518D\u91CD\u542F\u3002","services.managedNotice":"\u7531 {manager} \u6258\u7BA1\uFF0C\u5DF2\u901A\u8FC7\u4FDD\u6D3B\u670D\u52A1\u6267\u884C\u3002","services.logs":"\u6700\u8FD1\u65E5\u5FD7","services.logEmpty":"\u6682\u65E0\u65E5\u5FD7\u3002","services.logRelay":"Relay","services.logHost":"\u4E3B\u673A\u8FDE\u63A5\u5668","adminBroker.windowsOnly":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u53EA\u652F\u6301 Windows\u3002","adminBroker.needsElevation":"\u8BF7\u6253\u5F00 Windows TUI \u5E76\u9009\u62E9\u201C\u8BBE\u7F6E\u7BA1\u7406\u5458\u7EC8\u7AEF\u201D\uFF0C\u4F7F\u7528\u8FD0\u884C Herdr Remote \u7684\u540C\u4E00\u8D26\u6237\u6279\u51C6\u4E00\u6B21 Windows \u63D0\u6743\u63D0\u793A\u3002","adminBroker.busy":"\u6709\u7BA1\u7406\u5458\u7EC8\u7AEF\u5F00\u7740\uFF0C\u8BF7\u5148\u5173\u95ED\u518D\u91CD\u542F broker\u3002","adminBroker.title":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker","adminBroker.checking":"\u6B63\u5728\u68C0\u67E5\u2026","adminBroker.ready":"\u5DF2\u5C31\u7EEA","adminBroker.notReady":"\u5C1A\u672A\u8BBE\u7F6E\u6216\u672A\u8FD0\u884C","adminBroker.install":"\u8BBE\u7F6E\u7BA1\u7406\u5458\u7EC8\u7AEF","adminBroker.uninstall":"\u79FB\u9664\u7BA1\u7406\u5458\u7EC8\u7AEF\u8BBE\u7F6E","adminBroker.installDone":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u4EFB\u52A1\u5DF2\u6CE8\u518C\u3002","adminBroker.uninstallDone":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u4EFB\u52A1\u5DF2\u79FB\u9664\u3002","adminBroker.elevationCancelled":"\u672A\u6279\u51C6\u7BA1\u7406\u5458\u6743\u9650\uFF0C\u672A\u8FDB\u884C\u66F4\u6539\u3002","adminBroker.setupFailed":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u8BBE\u7F6E\u5931\u8D25\u3002","adminBroker.tuiHint":"\u53EA\u9700\u8BBE\u7F6E\u4E00\u6B21\u3002Windows \u4F1A\u8BF7\u6C42\u7BA1\u7406\u5458\u6388\u6743\uFF1B\u4E4B\u540E WebUI \u65B0\u5EFA\u7BA1\u7406\u5458\u7EC8\u7AEF\u4E0D\u518D\u5F39\u51FA UAC\u3002","adminShell.needsTerminal":"admin-shell \u5FC5\u987B\u5728\u7EC8\u7AEF\u4E2D\u8FD0\u884C\u3002","adminShell.brokerUnavailable":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u5C1A\u672A\u8FD0\u884C\u3002\u8BF7\u6253\u5F00 herdr-remote TUI\uFF0C\u8FDB\u5165\u300C\u4FDD\u6D3B\u300D\u5E76\u9009\u62E9\u300C\u8BBE\u7F6E\u7BA1\u7406\u5458\u7EC8\u7AEF\u300D\u3002","adminShell.tabLabel":"\u7BA1\u7406\u5458","relay.title":"Relay \u8BBE\u7F6E","relay.settings":"\u8BBE\u7F6E","relay.locked":"\u56FA\u5B9A","relay.officialFixed":"\u5B98\u65B9 relay \u5730\u5740\u56FA\u5B9A\uFF0C\u4E0D\u53EF\u4FEE\u6539\u3002","relay.officialHint":"\u5B98\u65B9 relay\uFF1A\u5730\u5740\u56FA\u5B9A\uFF0C\u65E0\u9700\u5BC6\u7801\u3002","relay.password":"Relay \u5BC6\u7801","relay.passwordHint":"\u987B\u4E0E Relay \u7AEF\u7684 RELAY_PASSWORD \u4E00\u81F4\u3002\u7559\u7A7A\u4E3A\u516C\u7528 Relay\u3002","relay.passwordSet":"\u5DF2\u8BBE\u7F6E","relay.passwordEmpty":"\u672A\u8BBE\u7F6E\uFF08\u516C\u7528\uFF09","relay.passwordSaved":"Relay \u5BC6\u7801\u5DF2\u4FDD\u5B58\uFF0C\u91CD\u542F\u670D\u52A1\u751F\u6548\u3002","relay.showPassword":"\u663E\u793A\u5BC6\u7801","relay.hidePassword":"\u9690\u85CF\u5BC6\u7801","relay.identity":"\u5DE5\u4F5C\u7AD9\u6807\u8BC6","relay.regenerate":"\u91CD\u65B0\u751F\u6210\u6807\u8BC6","relay.regenerated":"\u5DF2\u751F\u6210\u65B0\u6807\u8BC6\uFF0C\u91CD\u542F\u540E\u91CD\u65B0\u6CE8\u518C\u3002","relay.envSnippet":"Relay \u542F\u52A8\u547D\u4EE4","relay.envHint":"\u5728 Relay \u4E3B\u673A\u6267\u884C\u6B64\u547D\u4EE4\u3002","relay.test":"\u6D4B\u8BD5 Relay \u8FDE\u63A5","relay.testOk":"Relay \u53EF\u8BBF\u95EE\uFF1A\u7248\u672C {version}\uFF0C\u5DF2\u8FDE\u63A5 {hosts} \u53F0\u5DE5\u4F5C\u7AD9\u3002","relay.testFailed":"Relay \u65E0\u6CD5\u8BBF\u95EE\uFF1A{message}","relay.selectAddress":"\u9009\u62E9\u516C\u5E03\u5730\u5740","relay.listenAddress":"\u76D1\u542C\u5730\u5740","relay.listenAddressHint":"\u670D\u52A1\u5668\u7ED1\u5B9A\u5730\u5740\uFF1B\u6D4F\u89C8\u5668\u8BBF\u95EE\u4E0B\u65B9\u516C\u5E03\u5730\u5740\u3002","relay.addressTailscale":"Tailscale","relay.addressLan":"\u5C40\u57DF\u7F51","relay.addressVirtual":"\u865A\u62DF\u7F51\u5361","relay.addressLoopback":"\u56DE\u73AF","relay.noAddresses":"\u672A\u627E\u5230\u975E\u56DE\u73AF\u5730\u5740\u3002","relay.docsHint":"\u81EA\u5EFA\u6307\u5357\uFF1Adocs/self-hosted-relay.zh-CN.md","keepalive.title":"\u540E\u53F0\u4FDD\u6D3B\u670D\u52A1","keepalive.manager":"\u7BA1\u7406\u65B9\u5F0F","keepalive.state":"\u72B6\u6001","keepalive.install":"\u5B89\u88C5\u5E76\u542F\u52A8","keepalive.uninstall":"\u505C\u6B62\u5E76\u79FB\u9664","keepalive.restart":"\u91CD\u542F\u4FDD\u6D3B\u670D\u52A1","keepalive.installed":"\u5DF2\u901A\u8FC7 {manager} \u5B89\u88C5\u4FDD\u6D3B\u670D\u52A1\u3002","keepalive.uninstalled":"\u4FDD\u6D3B\u670D\u52A1\u5DF2\u79FB\u9664\u3002","keepalive.restarted":"\u4FDD\u6D3B\u670D\u52A1\u5DF2\u91CD\u542F\u3002","keepalive.failed":"\u4FDD\u6D3B\u64CD\u4F5C\u5931\u8D25\uFF1A{message}","keepalive.unitPath":"\u5355\u5143\u6587\u4EF6","keepalive.logsHint":"\u67E5\u770B\u65E5\u5FD7\uFF1A{command}","keepalive.linger":"\u5F00\u673A\u81EA\u542F","keepalive.lingerEnabled":"\u5DF2\u5F00\u542F\u5F00\u673A\u81EA\u542F\u3002","keepalive.lingerDisabled":"\u672A\u5F00\u542F\u5F00\u673A\u81EA\u542F\uFF08\u4EC5\u767B\u5F55\u671F\u95F4\u8FD0\u884C\uFF09\u3002","keepalive.enableLinger":"\u5F00\u542F\u5F00\u673A\u81EA\u542F","keepalive.lingerDone":"\u5DF2\u4E3A {username} \u5F00\u542F\u5F00\u673A\u81EA\u542F\u3002","keepalive.fallbackNote":"\u65E0\u7CFB\u7EDF\u670D\u52A1\u7BA1\u7406\u5668\uFF0C\u4F7F\u7528\u540E\u53F0\u5B88\u62A4\u8FDB\u7A0B\uFF0C\u91CD\u542F\u540E\u4E0D\u81EA\u52A8\u6062\u590D\u3002","keepalive.windowsTaskNote":"\u5728\u4F60\u7684\u8D26\u6237\u767B\u5F55\u540E\u542F\u52A8\uFF0C\u65E0\u9700\u5BC6\u7801\u6216\u7BA1\u7406\u5458\u6743\u9650\uFF1B\u767B\u5F55\u524D\u4E0D\u4F1A\u8FD0\u884C\u3002","keepalive.serviceNote":"\u4EE5\u4F60\u7684\u8D26\u6237\u4F5C\u4E3A Windows \u670D\u52A1\u8FD0\u884C\uFF0C\u5728\u767B\u5F55\u524D\u542F\u52A8\u3002\u5B89\u88C5\u6216\u79FB\u9664\u9700\u8981\u7BA1\u7406\u5458\u6743\u9650\uFF0CWindows \u4E5F\u53EF\u80FD\u8981\u6C42\u8D26\u6237\u5BC6\u7801\u3002","keepalive.serviceWindowHint":"\u8BF7\u5728\u968F\u540E\u6253\u5F00\u7684\u7BA1\u7406\u5458\u7A97\u53E3\u4E2D\u5B8C\u6210\u5B89\u88C5\u3002","keepalive.elevationCancelled":"\u672A\u6388\u4E88\u7BA1\u7406\u5458\u6743\u9650\uFF0C\u672A\u5B89\u88C5\u670D\u52A1\u3002","keepalive.passwordPrompt":"\u8BF7\u8F93\u5165 {account} \u7684 Windows \u8D26\u6237\u5BC6\u7801\uFF08\u4E0D\u662F PIN\uFF1B\u8D26\u6237\u65E0\u5BC6\u7801\u65F6\u76F4\u63A5\u6309 Enter\uFF09\uFF1A","keepalive.passwordRejected":"Windows \u672A\u80FD\u4F7F\u7528\u8FD9\u4E9B\u51ED\u636E\u542F\u52A8\u670D\u52A1\u3002\u8BF7\u68C0\u67E5\u8D26\u6237\u5BC6\u7801\u548C\u201C\u4F5C\u4E3A\u670D\u52A1\u767B\u5F55\u201D\u7B56\u7565\u3002","keepalive.serviceInstalled":"\u670D\u52A1 {id} \u5DF2\u5B89\u88C5\u5E76\u6B63\u5728\u8FD0\u884C\u3002","keepalive.wrongAccount":"\u8BF7\u4F7F\u7528\u5C06\u8FD0\u884C herdr-remote \u7684\u8D26\u6237\u6267\u884C\u6B64\u64CD\u4F5C\uFF0C\u4E0D\u8981\u6362\u7528\u5176\u4ED6\u7BA1\u7406\u5458\u8D26\u6237\u3002","keepalive.pressEnter":"\u6309 Enter \u5173\u95ED\u6B64\u7A97\u53E3\u3002","herdr.title":"Herdr \u96C6\u6210","herdr.socketPath":"\u5957\u63A5\u5B57\u8DEF\u5F84","herdr.args":"\u9644\u52A0\u53C2\u6570","herdr.autoStartHint":"\u5173\uFF1AHerdr \u53EA\u5728\u4F60\u624B\u52A8\u8FD0\u884C\uFF0C\u6216\u5728\u6D4F\u89C8\u5668\u91CC\u786E\u8BA4\u540E\u624D\u542F\u52A8\u3002\u5F00\uFF1Aherdr-remote \u6BCF\u6B21\u542F\u52A8\uFF08\u5305\u62EC\u5F00\u673A\uFF09\u65F6\u4E00\u5E76\u542F\u52A8 Herdr\u3002\u4E0B\u6B21 herdr-remote \u542F\u52A8\u65F6\u751F\u6548\u3002","herdr.cliMissing":"\u672A\u627E\u5230 herdr \u547D\u4EE4\uFF0C\u53EF\u5C06 HERDR_BIN_PATH \u8BBE\u4E3A\u5176\u5B8C\u6574\u8DEF\u5F84\u3002","herdr.version":"Herdr \u7248\u672C","herdr.versionOutdated":"Herdr {version} \u4F4E\u4E8E {minimum}\uFF0C\u8BF7\u8FD0\u884C \u201Cherdr update\u201D\uFF1A\u5728\u8BE5\u7248\u672C\u4E4B\u524D\uFF0C\u6D4F\u89C8\u5668\u7A97\u53E3\u7684\u6807\u9898\u3001\u5927\u6BB5\u7C98\u8D34\u3001\u70B9\u6309\u7A97\u683C\u4E0E Alt \u5FEB\u6377\u952E\u90FD\u4F1A\u51FA\u95EE\u9898\u3002","about.title":"\u8BED\u8A00\u4E0E\u5173\u4E8E","about.language":"\u754C\u9762\u8BED\u8A00","about.languageAuto":"\u8DDF\u968F\u7CFB\u7EDF\uFF08{detected}\uFF09","about.languageZh":"\u4E2D\u6587","about.languageEn":"English","about.version":"\u7248\u672C","about.configPath":"\u914D\u7F6E\u6587\u4EF6","about.statePath":"\u72B6\u6001\u76EE\u5F55","about.relayPackage":"Relay \u5305","about.docs":"\u81EA\u5EFA\u6307\u5357\uFF1Adocs/self-hosted-relay.zh-CN.md","wizard.title":"\u9996\u6B21\u8BBE\u7F6E","wizard.step":"\u7B2C {current} / {total} \u6B65","wizard.languageTitle":"\u9009\u62E9\u8BED\u8A00","wizard.accessTitle":"\u9009\u62E9\u8BBF\u95EE\u65B9\u5F0F","wizard.accessHint":"\u540E\u7EED\u53EF\u5728 Relay \u9875\u9762\u4FEE\u6539\u3002","wizard.addressTitle":"\u9009\u62E9\u8BBF\u95EE\u5730\u5740","wizard.relayTitle":"Relay \u670D\u52A1\u5668","wizard.relayUrlLabel":"Relay \u5730\u5740\uFF08wss://\u2026\uFF09","wizard.relayHint":"Relay \u9700\u5148\u8FD0\u884C\u3002\u642D\u5EFA\u6307\u5357\u89C1 docs/self-hosted-relay.zh-CN.md\u3002","wizard.passwordTitle":"Relay \u5BC6\u7801","wizard.passwordHint":"Relay \u7684 RELAY_PASSWORD\u3002\u672A\u8BBE\u7559\u7A7A\u3002","wizard.finishTitle":"\u5B8C\u6210","wizard.finishHint":"\u914D\u7F6E\u5C06\u4FDD\u5B58\u81F3 {path}\u3002","wizard.startNow":"\u7ACB\u5373\u542F\u52A8\u670D\u52A1","wizard.installKeepalive":"\u540E\u53F0\u4FDD\u6D3B","wizard.finish":"\u4FDD\u5B58\u5E76\u5B8C\u6210","field.mode":"\u8BBF\u95EE\u65B9\u5F0F","field.port":"Relay \u7AEF\u53E3","field.lanHost":"\u6D4F\u89C8\u5668\u5730\u5740","field.remoteUrl":"Relay \u5730\u5740","field.publicUrl":"\u6D4F\u89C8\u5668\u5730\u5740\uFF08\u8986\u76D6\uFF09","field.socketPath":"Herdr \u5957\u63A5\u5B57\u8DEF\u5F84","field.herdrArgs":"Herdr \u53C2\u6570","field.herdrAutoStart":"\u968F\u670D\u52A1\u542F\u52A8 Herdr","field.language":"\u8BED\u8A00","field.keepalive":"\u4FDD\u6D3B\u7BA1\u7406\u65B9\u5F0F","placeholder.autoDiscovered":"\u81EA\u52A8\u63A2\u6D4B","placeholder.none":"\u65E0","error.invalidMode":"\u672A\u77E5\u7684\u8BBF\u95EE\u65B9\u5F0F\u3002","error.invalidPort":"\u7AEF\u53E3\u987B\u4E3A 1 \u5230 65535 \u4E4B\u95F4\u7684\u6570\u5B57\u3002","error.invalidLanHost":"\u6D4F\u89C8\u5668\u5730\u5740\u987B\u4E3A\u53EF\u8BBF\u95EE\u5C40\u57DF\u7F51\u6216 Tailscale \u5730\u5740\uFF0C\u4E0D\u80FD\u4E3A\u56DE\u73AF\u6216 0.0.0.0\u3002","error.invalidRelayUrl":"Relay \u5730\u5740\u987B\u4EE5 wss://\u3001ws://\u3001https:// \u6216 http:// \u5F00\u5934\u3002","error.invalidPublicUrl":"\u6D4F\u89C8\u5668\u5730\u5740\u987B\u4EE5 https:// \u6216 http:// \u5F00\u5934\uFF0C\u4E0D\u80FD\u4E3A 0.0.0.0 \u6216 ::\u3002","error.invalidLanguage":"\u672A\u77E5\u7684\u8BED\u8A00\u3002","error.invalidKeepalive":"\u672A\u77E5\u7684\u4FDD\u6D3B\u7BA1\u7406\u65B9\u5F0F\u3002","error.unknownField":"\u672A\u77E5\u7684\u8BBE\u7F6E\u9879\u3002","error.remoteUrlRequired":"\u81EA\u5EFA Relay \u6A21\u5F0F\u987B\u586B\u5199 Relay \u5730\u5740\u3002","error.removedHerdrArg":"Herdr 0.9.0 \u5DF2\u79FB\u9664 --no-session\uFF0C\u8BF7\u4ECE\u9644\u52A0\u53C2\u6570\u4E2D\u79FB\u9664\u3002","error.saveFailed":"\u4FDD\u5B58\u914D\u7F6E\u5931\u8D25\uFF1A{message}","hint.navigate":"\u2191\u2193 \u79FB\u52A8","hint.select":"\u21B5 \u9009\u62E9","hint.edit":"\u21B5 \u7F16\u8F91","hint.tabs":"\u2190 \u2192 \u5207\u6362\u9875\u9762","hint.back":"esc \u8FD4\u56DE","hint.quit":"q \u9000\u51FA","hint.mouseOn":"m \u5173\u95ED\u9F20\u6807","hint.mouseOff":"m \u5F00\u542F\u9F20\u6807","hint.mouseUnsupported":"\u4E0D\u652F\u6301\u9F20\u6807","hint.restartRequired":"\u91CD\u542F\u670D\u52A1\u751F\u6548\u3002","hint.unsavedChanges":"\u6709\u672A\u4FDD\u5B58\u4FEE\u6539\uFF08\u6309 s \u4FDD\u5B58\uFF09\u3002","hint.save":"s \u4FDD\u5B58","hint.editing":"\u21B5 \u786E\u8BA4 \xB7 esc \u53D6\u6D88","update.title":"\u66F4\u65B0","update.banner":"herdr-remote {latest} \u5DF2\u53D1\u5E03\uFF08\u5F53\u524D {current}\uFF09\uFF0C\u6309 7 \u8FDB\u5165\u300C\u8BED\u8A00\u4E0E\u5173\u4E8E\u300D\uFF0C\u5728\u66F4\u65B0\u4E00\u884C\u6309 Enter \u5B89\u88C5\u3002","update.check":"\u68C0\u67E5\u66F4\u65B0","update.checking":"\u67E5\u8BE2 GitHub Releases \u4E2D\u2026","update.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{version}\uFF09","update.available":"\u65B0\u7248\u672C {version} \u53EF\u7528\uFF08\u6309 Enter \u5B89\u88C5\uFF09","update.updating":"\u5B89\u88C5 {version} \u4E2D\u2026","update.updatingRetry":"\u5B89\u88C5 {version} \u4E2D\u2026\uFF08npm \u5C1A\u672A\u540C\u6B65\uFF0C\u7B2C {attempt} \u6B21\u5C1D\u8BD5\uFF09","update.done":"\u5DF2\u66F4\u65B0\u81F3 {version}","update.restartHint":"\u66F4\u65B0\u5DF2\u5B89\u88C5\uFF0C\u91CD\u542F herdr-remote \u751F\u6548\u3002","update.errorNetwork":"\u65E0\u6CD5\u8FDE\u63A5 GitHub Releases\uFF0C\u4F5C\u4E3A\u5907\u7528\u7684 npm registry \u4E5F\u65E0\u6CD5\u8FDE\u63A5","update.errorNetworkDetail":"\u5747\u65E0\u5E94\u7B54\uFF1A{message}","update.errorFailed":"\u66F4\u65B0\u5931\u8D25\uFF0C\u53EF\u624B\u52A8\u6267\u884C\uFF1Anpm install -g {url}","update.errorFailedDetail":"\u5B89\u88C5\u8F93\u51FA\uFF1A{message}","update.errorNotYetPublished":"npm \u8FD8\u6CA1\u540C\u6B65\u5230 {version}\uFF08\u521A\u53D1\u5E03\u7684\u51E0\u5206\u949F\u5185\u5E38\u89C1\uFF09\uFF0C\u7A0D\u540E\u6309 Enter \u91CD\u8BD5\u3002","update.errorNotApplied":"\u5B89\u88C5\u62A5\u544A\u6210\u529F\uFF0C\u4F46\u5B89\u88C5\u7684\u4ECD\u662F {installed}","update.cannot.source":"\u6E90\u7801\u76EE\u5F55\u8FD0\u884C\uFF0C\u8BF7\u4F7F\u7528 git \u66F4\u65B0","update.cannot.linked":"npm link \u5DE5\u4F5C\u526F\u672C\uFF0C\u7531 npm link \u7BA1\u7406","update.stoppingServices":"\u66FF\u6362\u6587\u4EF6\u671F\u95F4\u5148\u505C\u6B62\u670D\u52A1\u2026","update.restarting":"\u6B63\u5728\u7528\u65B0\u7248\u672C\u91CD\u542F\u670D\u52A1\u2026","update.notRunning":"\u670D\u52A1\u4E4B\u524D\u6CA1\u6709\u8FD0\u884C\uFF0C\u4FDD\u6301\u505C\u6B62\u3002\u9700\u8981\u65F6\u6267\u884C\uFF1Aherdr-remote start","update.restartFailed":"\u5DF2\u5B89\u88C5\uFF0C\u4F46\u670D\u52A1\u6CA1\u80FD\u91CD\u542F\uFF1A{message}","update.brokerRestarted":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u5DF2\u91CD\u542F\u3002","update.brokerRestartFailed":"\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u6CA1\u6709\u91CD\u65B0\u542F\u52A8\u3002\u91CD\u65B0\u767B\u5F55 Windows\uFF0C\u6216\u8FD0\u884C herdr-remote admin-broker restart\u3002","update.brokerBusy":"\u6709\u7BA1\u7406\u5458\u7EC8\u7AEF\u5F00\u7740\uFF0Cbroker \u7EE7\u7EED\u8FD0\u884C\u65E7\u7248\u672C\u3002\u5173\u95ED\u6240\u6709\u7BA1\u7406\u5458\u7EC8\u7AEF\u540E\u8FD0\u884C herdr-remote admin-broker restart\u3002","update.errorBusy":"\u4ECD\u6709\u8FDB\u7A0B\u5360\u7528 herdr-remote \u7684\u5B89\u88C5\u76EE\u5F55\uFF0C\u65E7\u7248\u672C\u8BBE\u7F6E\u7684\u7BA1\u7406\u5458\u7EC8\u7AEF broker \u4F1A\u8FD9\u6837\u3002\u5148\u5728\u7BA1\u7406\u5458 PowerShell \u4E2D\u6267\u884C\uFF1AGet-ScheduledTask -TaskName 'HerdrRemoteAdminBroker-*' | Stop-ScheduledTask\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u91CD\u65B0\u8FD0\u884C herdr-remote update\uFF0C\u6700\u540E\u4EE5\u7BA1\u7406\u5458\u8EAB\u4EFD\u8FD0\u884C herdr-remote admin-broker install\u3002"},d=u;var o={en:l,zh:d},n="en";function s(e){return typeof e=="string"&&Object.hasOwn(o,e)}function y({env:e=process.env,preference:r="auto"}={}){if(r&&r!=="auto"&&s(r))return r;if(s(e.HERDR_REMOTE_LANG))return e.HERDR_REMOTE_LANG;let a=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE||"";return String(a).split(/[:.@]/)[0].toLowerCase().startsWith("zh")?"zh":n}function v(e,r){return r?e.replace(/\{(\w+)\}/g,(a,i)=>Object.hasOwn(r,i)?String(r[i]):a):e}function b(e=n){let r=s(e)?o[e]:o[n],a=o[n];return Object.assign((t,c)=>{let p=r[t]??a[t]??t;return v(p,c)},{locale:e,has:t=>Object.hasOwn(r,t)})}export{y as a,b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{a as f,b as I,c as N,d as w,e as k,h as R}from"./DGUZCGQN.js";import{c as E}from"./JJGEV4EZ.js";import{h as U}from"./H24ZP5D5.js";import{o as F}from"./PBRQ3HEG.js";import{a as v,b as H,c as D,d as A,g,h as u}from"./U6QAYG3E.js";import{k as x,l as C,m as Y,o as M}from"./
|
|
3
|
+
import{a as f,b as I,c as N,d as w,e as k,h as R}from"./DGUZCGQN.js";import{c as E}from"./JJGEV4EZ.js";import{h as U}from"./H24ZP5D5.js";import{o as F}from"./PBRQ3HEG.js";import{a as v,b as H,c as D,d as A,g,h as u}from"./U6QAYG3E.js";import{k as x,l as C,m as Y,o as M}from"./KGOQKOHH.js";import{d as l,e as p,f as h,g as L,h as O,o as c}from"./M52LJEES.js";import{a as P}from"./QRGNEKME.js";import{a as T,c as m,f as S}from"./TNLCNVA2.js";import{spawn as b}from"node:child_process";import _ from"node:fs";import{createRequire as j}from"node:module";import y from"node:path";function G(){let e=j(import.meta.url).resolve("herdr-remote-relay/package.json");return y.join(y.dirname(e),"bin","herdr-remote-relay.js")}function J(){return y.join(m(),"relay-auth.json")}function V(e=c(),t=A()){let r=[],s=h(e,R());l(e)&&r.push({name:"relay",command:process.execPath,args:[G()],cwd:m(),env:{RELAY_DEPLOYMENT_MODE:"local",RELAY_BIND:p(e),RELAY_PORT:String(e.relay.port),RELAY_PUBLIC_URL:s,RELAY_PASSWORD:t.hostToken,RELAY_AUTH_STATE_FILE:J(),RELAY_ALLOWED_ORIGINS:(e.relay.allowedOrigins||[]).join(","),RELAY_MAX_CLIENTS_PER_HOST:String(e.relay.maxClientsPerHost),RELAY_MAX_HOSTS:String(e.relay.maxHosts),RELAY_MAX_PENDING_HANDSHAKES:String(e.relay.maxPendingHandshakes),RELAY_MAX_BUFFERED_BYTES_PER_CLIENT:String(e.relay.maxBufferedBytesPerClient),RELAY_HOST_RECONNECT_GRACE_MS:String(e.relay.hostReconnectGraceMs)}});let n=F(),a=U();return r.push({name:"host",command:process.execPath,args:[y.join(T,"dist","connector","main.js")],cwd:m(),env:{...n?{HERDR_TERM_PALETTE_JSON:JSON.stringify(n)}:{},...a?{HERDR_TERM_FONT_JSON:JSON.stringify(a)}:{},RELAY_URL:O(e),RELAY_HOST_ID:t.hostId,RELAY_HOST_TOKEN:t.hostToken,RELAY_PASSWORD:l(e)?t.hostToken:t.relayPassword||"",HERDR_SOCKET_PATH:E(e.herdr.socketPath),HERDR_ARGS_JSON:JSON.stringify(e.herdr.args),HERDR_CWD:e.herdr.cwd,HERDR_BIN_PATH:Y()}}),r}function K(){return{...process.env,HERDR_REMOTE_SERVICE:"1"}}function W(e){P(m());let t=_.openSync(S(e.name),"a");try{let r=b(e.command,e.args,{cwd:e.cwd,env:{...K(),...e.env},detached:!0,windowsHide:!0,stdio:["ignore",t,t]});return r.unref(),r.pid}finally{_.closeSync(t)}}var X={relay:"relayPid",host:"hostPid"};function B(){let e=c(),t=A(),r={...t},s=V(e,t),n=u(r),a=o=>n.some(i=>i.pid===o);for(let o of s){let i=X[o.name];a(r[i])||(r[i]=W(o)??null,g(r,o.name,r[i]))}if(!s.some(o=>o.name==="relay")&&a(r.relayPid)){try{process.kill(r.relayPid,"SIGTERM")}catch{}r.relayPid=null}r.startedAt=r.startedAt||new Date().toISOString(),r.mode=e.relay.mode,H(r);let d=u(r);return{ok:!0,mode:e.relay.mode,relay:{local:l(e),pid:r.relayPid||null,alive:d.some(({pid:o})=>o===r.relayPid),bind:l(e)?p(e):null,port:e.relay.port,remoteUrl:e.relay.remoteUrl||null},host:{pid:r.hostPid||null,alive:d.some(({pid:o})=>o===r.hostPid),socketPath:E(e.herdr.socketPath)},publicUrl:h(e,R())}}function $(){let e=[];return P(m()),D(t=>{let r=u(t).sort((s,n)=>(s.name==="supervisor"?0:1)-(n.name==="supervisor"?0:1));for(let{pid:s,name:n}of r)try{process.kill(s,"SIGTERM"),e.push({name:n,pid:s})}catch(a){process.stderr.write(`herdr-remote: could not stop ${n} (pid ${s}): ${a.message}
|
|
4
4
|
`)}t.hostPid=null,t.relayPid=null,t.supervisorPid=null,t.managedPids=[],t.startedAt=null}),{ok:!0,stopped:e}}function ce(){return $(),B()}async function ue(){let e=c(),t=v(),r=u(t),s=R(),n;try{n=await f(I(e),{timeout:1200})}catch(i){n={ok:!1,message:i.message}}let a=E(e.herdr.socketPath),d=C(),o=d.found?M({command:d.command}):{version:null,supported:!0};return{ok:!0,mode:e.relay.mode,relay:{local:l(e),pid:t.relayPid||null,alive:l(e)?r.some(({pid:i})=>i===t.relayPid):null,bind:l(e)?p(e):null,port:e.relay.port,remoteUrl:e.relay.remoteUrl||null,health:n},host:{pid:t.hostPid||null,alive:r.some(({pid:i})=>i===t.hostPid),hostId:t.hostId||null,socketPath:a,socketExists:!!a&&_.existsSync(a),herdrCommand:d.command,herdrCommandFound:d.found,herdrCommandSource:d.source,herdrVersion:o.version,herdrVersionSupported:o.supported,herdrVersionMinimum:x},publicUrl:h(e,s),startedAt:t.startedAt||null}}async function pe(){let e=c();return l(e)&&B(),await w(e),await k(e),f(`${L(e)}/api/pair/start`,{method:"POST",headers:N(),timeout:5e3})}function he(e,t=40){try{return _.readFileSync(S(e),"utf8").split(`
|
|
5
5
|
`).filter(Boolean).slice(-t)}catch{return[]}}export{G as a,V as b,K as c,B as d,$ as e,ce as f,ue as g,pe as h,he as i};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g}from"./
|
|
3
|
+
import{a,b,c,d,e,f,g}from"./MCUVFSSK.js";import"./44IGVPMA.js";import"./DGUZCGQN.js";import"./JJGEV4EZ.js";import"./H24ZP5D5.js";import"./PBRQ3HEG.js";import"./U6QAYG3E.js";import"./VD54DF7R.js";import"./RMHH3IAX.js";import"./CVJ4HBMP.js";import"./KGOQKOHH.js";import"./M52LJEES.js";import"./KRVF37OW.js";import"./QRGNEKME.js";import"./PBMBFWLQ.js";import"./TNLCNVA2.js";import"./I6NRCYLI.js";export{g as fullStatus,a as managerInUse,d as restartAll,e as servicesRunning,b as startAll,c as stopAll,f as whileServicesStopped};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{b as
|
|
3
|
+
import{b as T,c as F,e as S}from"./MCUVFSSK.js";import{i as U,j as K,k as x}from"./42KARAL4.js";import"./44IGVPMA.js";import"./DGUZCGQN.js";import"./JJGEV4EZ.js";import"./H24ZP5D5.js";import"./PBRQ3HEG.js";import"./U6QAYG3E.js";import"./VD54DF7R.js";import"./RMHH3IAX.js";import{a as h}from"./CVJ4HBMP.js";import{a as A,h as R,j as v}from"./KGOQKOHH.js";import{o as B}from"./M52LJEES.js";import"./KRVF37OW.js";import"./QRGNEKME.js";import{q as b}from"./PBMBFWLQ.js";import"./TNLCNVA2.js";import"./I6NRCYLI.js";import{spawnSync as N}from"node:child_process";var O=12e4;function W(){let e=N(process.execPath,[h(),"restart","--json"],{encoding:"utf8",timeout:O,windowsHide:!0});if(!e.error&&e.status===0)return{ok:!0,message:""};let i=String(e.stderr||e.stdout||"").trim();return{ok:!1,message:e.error?.message||i||`exit ${e.status}`}}async function Z(e,i={}){let u=()=>i.config??B(),{platform:l=process.platform,checkCli:C=()=>R(),installCli:D=(r,p)=>v({source:r.source,version:r.latest,onAttempt:p}),isRunning:E=()=>S(u()),stop:I=()=>F(u()),start:P=()=>T(u()),restartInstalled:_=W,stopBroker:M=U,startBroker:$=async()=>{try{K(e)}catch{}return x()},report:t=r=>process.stdout.write(`${r}
|
|
4
4
|
`)}=i;t(e("update.checking"));let o=await C(),{current:a}=o;if(!o.ok)return t(e("update.errorNetworkDetail",{message:o.message??""})),{ok:!1,current:a,updated:null,restarted:!1,errorKey:o.errorKey};if(!o.updateAvailable)return t(e("update.upToDate",{version:a})),{ok:!0,current:a,updated:null,restarted:!1};let c="cli",n=o.latest??"",m=E(),f=l==="win32"&&m;f&&(t(e("update.stoppingServices")),I());let d=l==="win32"?await M():"unavailable",k=async()=>{if(d!=="stopped")return d==="busy"?"busy":null;let r=await $();return t(e(r?"update.brokerRestarted":"update.brokerRestartFailed")),r?"restarted":"failed"};t(e("update.updating",{version:n}));let s=await D(o,({attempt:r})=>{r>1&&t(e("update.updatingRetry",{version:n,attempt:r}))});if(!s.ok){f&&P();let r=await k();t(e(s.errorKey??"update.errorFailed",{version:n,installed:s.installed??"",url:b(n)})),s.summary&&t(e("update.errorFailedDetail",{message:s.summary})),l==="win32"&&A(s.output)&&t(e("update.errorBusy"));let{errorKey:p,summary:H}=s;return{ok:!1,current:a,updated:c,restarted:!1,adminBroker:r,errorKey:p,summary:H}}let g=s.installed??n;t(e("update.done",{version:g}));let y=!0,w=!1;if(!m)t(e("update.notRunning"));else{t(e("update.restarting"));let r=_();y=r.ok,w=r.ok,t(r.ok?e("services.restarted"):e("update.restartFailed",{message:r.message}))}d==="busy"&&t(e("update.brokerBusy"));let j=await k();return{ok:y,current:a,updated:c,installed:g,restarted:w,adminBroker:j}}export{Z as runUpdate};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{e as m,f as S,g as l,h as v,i as h,j as $,k as g,l as x,m as A}from"./
|
|
3
|
+
import{e as m,f as S,g as l,h as v,i as h,j as $,k as g,l as x,m as A}from"./RMHH3IAX.js";import"./CVJ4HBMP.js";import"./KGOQKOHH.js";import"./QRGNEKME.js";import"./PBMBFWLQ.js";import"./TNLCNVA2.js";import"./I6NRCYLI.js";import{spawnSync as f}from"node:child_process";import P from"node:fs";var y=3;function I({id:n,account:t}){let r=l(n),e=l(t);return`$ErrorActionPreference = 'Stop'
|
|
4
4
|
$password = [Console]::In.ReadLine()
|
|
5
5
|
$service = Get-CimInstance -ClassName Win32_Service -Filter "Name='${r}'"
|
|
6
6
|
$result = Invoke-CimMethod -InputObject $service -MethodName Change -Arguments @{ StartName = '${e}'; StartPassword = $password }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f,g,h,i}from"./
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i}from"./44IGVPMA.js";import"./DGUZCGQN.js";import"./JJGEV4EZ.js";import"./H24ZP5D5.js";import"./PBRQ3HEG.js";import"./U6QAYG3E.js";import"./KGOQKOHH.js";import"./M52LJEES.js";import"./KRVF37OW.js";import"./QRGNEKME.js";import"./PBMBFWLQ.js";import"./TNLCNVA2.js";import"./I6NRCYLI.js";export{c as baseEnvironment,h as pair,i as readLogTail,a as relayBinPath,f as restartServices,b as serviceSpecs,d as startServices,g as statusServices,e as stopServices};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{l as c}from"./
|
|
3
|
+
import{l as c}from"./KGOQKOHH.js";import{a as s}from"./TNLCNVA2.js";import f from"node:os";import i from"node:path";function h(){return i.join(s,"bin","herdr-remote.js")}function p({env:o=process.env,herdrCommand:e=null}={}){let n=String(o.PATH||"").split(i.delimiter).map(r=>r.trim()).filter(Boolean);return e&&n.push(i.dirname(e)),[...new Set(n)].join(i.delimiter)}function P({env:o=process.env,home:e=f.homedir(),directories:n}={}){let r={},t=c({env:o,home:e,...n?{directories:n}:{}});t.found&&(r.HERDR_BIN_PATH=t.command);let m=p({env:o,herdrCommand:t.found?t.command:null});return m&&(r.PATH=m),r}export{h as a,p as b,P as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import{a as m,c as w}from"./
|
|
3
|
+
import{a as m,c as w}from"./MEFDV375.js";import"./3FQAXVGC.js";import{b as u,c as p,d as h}from"./42KARAL4.js";import"./JJGEV4EZ.js";import"./CVJ4HBMP.js";import"./KGOQKOHH.js";import"./PBMBFWLQ.js";import"./TNLCNVA2.js";import"./I6NRCYLI.js";var E=5e3,f=class{socket=null;input="";connected=!1;started=!1;finished=!1;killed=!1;early=[];dataListener=null;exitListener=null;errorListener=null;options;constructor(e){this.options=e}start({cols:e,rows:r,onData:l,onExit:t,onError:n}){this.dataListener=l,this.exitListener=t,this.errorListener=n;let c;try{c=p()}catch(o){this.fail(o);return}let{socket:i,token:a}=c;this.socket=i,i.setEncoding("utf8"),i.setTimeout(E,()=>{i.destroy(Object.assign(new Error("Administrator terminal broker connection timed out"),{code:"ETIMEDOUT"}))}),i.on("connect",()=>{this.connected=!0,i.setTimeout(0),h(i,{type:"start",token:a,...this.options,cols:e,rows:r})}),i.on("data",o=>this.receive(o)),i.on("error",o=>this.fail(o)),i.on("close",()=>{this.started&&!this.finished&&!this.killed&&(this.finished=!0,this.exitListener?.({exitCode:1}))})}write(e){if(!this.finished){if(!this.started){this.early.push(Buffer.from(e));return}this.socket?.writable&&h(this.socket,{type:"input",dataBase64:Buffer.from(e).toString("base64")})}}resize(e,r){this.started&&this.socket?.writable&&h(this.socket,{type:"resize",cols:e,rows:r})}kill(){this.killed=!0,this.socket&&(this.connected&&this.socket.writable?(h(this.socket,{type:"kill"}),this.socket.end()):this.socket.destroy())}receive(e){if(this.input+=e,Buffer.byteLength(this.input,"utf8")>u){this.socket?.destroy(new Error("Administrator terminal broker message exceeded the limit"));return}for(;;){let r=this.input.indexOf(`
|
|
4
4
|
`);if(r<0)return;let l=this.input.slice(0,r);this.input=this.input.slice(r+1);let t;try{t=JSON.parse(l)}catch{this.socket?.destroy(new Error("Administrator terminal broker sent invalid JSON"));return}if(t.type==="started"){this.started=!0;let n=Buffer.concat(this.early);this.early=[],n.length>0&&this.write(n)}else t.type==="data"&&typeof t.dataBase64=="string"?this.dataListener?.(Buffer.from(t.dataBase64,"base64").toString("utf8")):t.type==="exit"?(this.finished=!0,this.exitListener?.({exitCode:Number(t.exitCode)||0,...typeof t.signal=="number"?{signal:t.signal}:{}}),this.socket?.end()):t.type==="error"&&this.fail(new Error(typeof t.message=="string"?t.message:"Admin PTY failed"))}}fail(e){if(this.started){!this.finished&&!this.killed&&(this.finished=!0,this.exitListener?.({exitCode:1}));return}this.finished||this.killed||(this.finished=!0,this.errorListener?.(e))}};var k=["ENOENT","ECONNREFUSED","ETIMEDOUT"];async function y(){let s=process.env.HERDR_SOCKET_PATH,e=process.env.HERDR_PANE_ID;if(!(process.env[w]!=="1"||!s||!e))try{await m(s,"pane.close",{pane_id:e})}catch{}}async function O(s,{stdin:e=process.stdin,stdout:r=process.stdout,platform:l=process.platform}={}){if(l!=="win32")throw new Error(s("adminBroker.windowsOnly"));if(!e.isTTY||!r.isTTY)throw new Error(s("adminShell.needsTerminal"));let t=new f({command:"powershell.exe",args:["-NoLogo","-NoProfile"],cwd:process.cwd()}),n=i=>t.write(i),c=()=>t.resize(r.columns,r.rows);e.setRawMode(!0),e.on("data",n),e.resume(),r.on("resize",c);try{let i=await new Promise((a,o)=>{t.start({cols:r.columns,rows:r.rows,onData:d=>r.write(d),onExit:d=>a(d.exitCode),onError:o})});return await y(),i}catch(i){let{code:a}=i;throw a&&k.includes(a)?new Error(s("adminShell.brokerUnavailable")):i}finally{e.off("data",n),r.off("resize",c),e.setRawMode(!1),e.pause()}}export{O as runAdminShell};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
2
|
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
-
import"./C2UUZY6J.js";import{b as P,c as I}from"./
|
|
3
|
+
import"./C2UUZY6J.js";import{b as P,c as I}from"./44IGVPMA.js";import"./DGUZCGQN.js";import"./JJGEV4EZ.js";import"./H24ZP5D5.js";import"./PBRQ3HEG.js";import{c as a,d as w,g as l,h as M}from"./U6QAYG3E.js";import"./KGOQKOHH.js";import{o as u}from"./M52LJEES.js";import{a as y,c as n}from"./KRVF37OW.js";import{a as g}from"./QRGNEKME.js";import"./PBMBFWLQ.js";import{c as f,f as m}from"./TNLCNVA2.js";import"./I6NRCYLI.js";import S from"node:fs";import{spawn as v}from"node:child_process";var T=500,k=3e4,A=3e4,d=class{config;state;logToFiles;onEvent;specs;children=new Map;stopping=!1;constructor({config:t=u(),state:s=w(),logToFiles:i=!1,onEvent:e=null,specs:r=null}={}){this.config=t,this.state=s,this.logToFiles=i,this.onEvent=e,this.specs=r}emit(t){this.onEvent&&this.onEvent(t);let s=`[${new Date().toISOString()}] herdr-remote supervisor: ${t.message}
|
|
4
4
|
`;process.stdout.write(s)}async reclaimStrays({timeoutMs:t=5e3}={}){let s=M().filter(e=>e.pid!==process.pid);if(s.length===0)return s;for(let{pid:e,name:r}of s){this.emit({type:"reclaim",name:r,pid:e,message:`stopping stray ${r} from an earlier start (pid ${e})`});try{process.kill(e,"SIGTERM")}catch{}}let i=Date.now()+t;for(;Date.now()<i;){if(s.every(({pid:e})=>!y(e)))return s;await new Promise(e=>{setTimeout(e,100)})}for(let{pid:e,name:r}of n(s)){this.emit({type:"reclaim",name:r,pid:e,message:`stray ${r} (pid ${e}) ignored SIGTERM, killing`});try{process.kill(e,"SIGKILL")}catch{}}return s}async start(){if(this.stopping=!1,g(f()),await this.reclaimStrays(),!this.stopping){for(let t of this.specs??P(this.config,this.state))this.children.set(t.name,{spec:t,child:null,pid:null,restarts:0,backoffMs:T,timer:null}),this.spawnChild(t.name);this.persistPids()}}spawnChild(t){if(this.stopping)return;let s=this.children.get(t);if(!s||s.child)return;let i=["ignore","inherit","inherit"],e=null;this.logToFiles&&(e=S.openSync(m(t),"a"),i=["ignore",e,e]);let r;try{r=v(s.spec.command,s.spec.args,{cwd:s.spec.cwd,env:{...I(),...s.spec.env},windowsHide:!0,stdio:i})}catch(o){this.emit({type:"spawn_failed",name:t,message:`could not start ${t}: ${o.message}`}),this.scheduleRestart(t);return}finally{if(e!==null)try{S.closeSync(e)}catch{}}s.child=r,s.pid=r.pid,s.startedAt=Date.now(),this.emit({type:"started",name:t,pid:r.pid,message:`${t} started (pid ${r.pid})`}),this.persistPids(),r.on("exit",(o,c)=>{let h=Date.now()-(s.startedAt??Date.now());if(s.child=null,s.pid=null,this.persistPids(),!this.stopping){if(o===12){this.emit({type:"replaced",name:t,message:`${t} stood down: another instance owns this workstation. Not restarting it.`});return}if(o===13){this.emit({type:"fatal",name:t,message:`${t} stopped: relay authentication failed. Update credentials before restarting it.`});return}h>=A&&(s.backoffMs=T),this.emit({type:"exited",name:t,code:o,signal:c,message:`${t} exited (${c||`code ${o}`}) after ${Math.round(h/1e3)}s, restarting in ${s.backoffMs}ms`}),this.scheduleRestart(t)}}),r.on("error",o=>{this.emit({type:"error",name:t,message:`${t} error: ${o.message}`})})}scheduleRestart(t){if(this.stopping)return;let s=this.children.get(t);if(!s||s.timer)return;let i=s.backoffMs;s.restarts+=1,s.backoffMs=Math.min(k,Math.round(s.backoffMs*2));let e=setTimeout(()=>{s.timer=null,this.spawnChild(t)},i);s.timer=e,e.unref?.()}persistPids(){try{a(t=>{t.supervisorPid=process.pid,t.relayPid=this.children.get("relay")?.pid||null,t.hostPid=this.children.get("host")?.pid||null,t.startedAt=t.startedAt||new Date().toISOString(),t.mode=this.config.relay.mode,l(t,"supervisor",process.pid);for(let[s,i]of this.children)i.pid&&l(t,s,i.pid)})}catch(t){process.stderr.write(`herdr-remote supervisor: could not persist pids: ${t.message}
|
|
5
5
|
`)}}async stop({graceMs:t=5e3}={}){this.stopping=!0;let s=[];for(let i of this.children.values()){i.timer&&(clearTimeout(i.timer),i.timer=null);let e=i.child;e&&s.push(new Promise(r=>{let o=setTimeout(()=>{try{e.kill("SIGKILL")}catch{}r()},t);o.unref?.(),e.once("exit",()=>{clearTimeout(o),r()});try{e.kill("SIGTERM")}catch{r()}}))}await Promise.all(s);try{a(i=>{i.supervisorPid=null,i.relayPid=null,i.hostPid=null,i.startedAt=null,i.managedPids=n((i.managedPids||[]).filter(Boolean))})}catch{}}};async function x({logToFiles:p=!1}={}){let t=new d({logToFiles:p});return await t.start(),new Promise(s=>{let i=!1,e=async r=>{i||(i=!0,t.emit({type:"shutdown",message:`${r} received, stopping services`}),await t.stop(),s(0))};process.on("SIGINT",()=>{e("SIGINT")}),process.on("SIGTERM",()=>{e("SIGTERM")}),process.on("SIGHUP",()=>{e("SIGHUP")})})}export{T as MIN_BACKOFF_MS,d as Supervisor,x as runForeground};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __herdrCreateRequire } from 'node:module';
|
|
2
|
+
const require = __herdrCreateRequire(import.meta.url);
|
|
3
|
+
import{n as b,o as Q,p as G,q as K}from"./PBMBFWLQ.js";import{a as E,c as Z}from"./TNLCNVA2.js";import h from"node:fs";import w from"node:path";var Ae=["EBUSY","EPERM","EACCES"];function ee(e){return/\b(EBUSY|EPERM)\b/.test(e??"")}function $e(e,t,o){try{o(e,t)}catch(n){if(!Ae.includes(n.code??""))throw n;h.renameSync(t,`${t}.${process.pid}.old`),o(e,t)}}function P(e,t,o=h.copyFileSync,n=new Set){h.mkdirSync(t,{recursive:!0});let s=new Set;for(let r of h.readdirSync(e,{withFileTypes:!0})){s.add(r.name.toLowerCase());let i=w.join(e,r.name),c=w.join(t,r.name),a=h.lstatSync(c,{throwIfNoEntry:!1});a&&a.isDirectory()!==r.isDirectory()&&h.rmSync(c,{recursive:!0,force:!0}),r.isDirectory()?P(i,c,o,n):$e(i,c,o)}for(let r of h.readdirSync(t))if(!(s.has(r.toLowerCase())||n.has(w.join(t,r))))try{h.rmSync(w.join(t,r),{recursive:!0,force:!0})}catch{}}async function re(e,t,{target:o=E,stage:n=w.join(Z(),"update-stage"),platform:s=process.platform}={}){h.rmSync(n,{recursive:!0,force:!0});try{let r=await t([...e,"--prefix",n]);if(!r.ok)return r;let i=s==="win32"?w.join(n,"node_modules"):w.join(n,"lib","node_modules");try{P(w.join(i,w.basename(o)),o)}catch(c){return{ok:!1,output:`${r.output}
|
|
4
|
+
${c.message}`}}return r}finally{try{h.rmSync(n,{recursive:!0,force:!0})}catch{}}}import H from"node:fs";import z from"node:path";import{spawn as Fe}from"node:child_process";import{createRequire as Me}from"node:module";import Te from"node:fs";import te from"node:path";function ve({args:e,platform:t=process.platform,env:o=process.env,execPath:n=process.execPath,exists:s=Te.existsSync}){if(t!=="win32")return{command:"npm",args:e};let r=o.npm_execpath;if(r&&/npm-cli\.js$/i.test(r)&&s(r))return{command:n,args:[r,...e]};let i=te.join(te.dirname(n),"node_modules","npm","bin","npm-cli.js");return s(i)?{command:n,args:[i,...e]}:null}function Y(e,t,o,n={}){return new Promise(s=>{let r;try{let l=ve({args:t,...n});if(!l){s({ok:!1,spawnFailed:!0,output:"npm-cli.js was not found next to this Node.js; run npm install -g herdr-remote yourself."});return}r=e(l.command,l.args,{timeout:o,windowsHide:!0})}catch(l){s({ok:!1,spawnFailed:!0,output:String(l?.message||l)});return}let i="",c=!1,a=l=>{c||(c=!0,s(l))},u=l=>{i+=String(l)};r.stdout?.on("data",u),r.stderr?.on("data",u),r.on("error",l=>a({ok:!1,spawnFailed:!0,output:l.message})),r.on("close",l=>a({ok:l===0,output:i.trim()}))})}import p from"node:fs";import{createRequire as Pe}from"node:module";import y from"node:path";import N from"node:fs";import O from"node:path";import xe from"node:zlib";var _=512;function A(e,t,o){let n=e.subarray(t,t+o),s=n.indexOf(0);return n.subarray(0,s===-1?o:s).toString("utf8")}function ne(e,t,o){let n=A(e,t,o).trim();return n?Number.parseInt(n,8):0}function je(e){let t=null,o=0;for(;o<e.length;){let n=e.indexOf(32,o);if(n===-1)break;let s=Number.parseInt(e.subarray(o,n).toString("utf8"),10);if(!(s>0))break;let r=e.subarray(n+1,o+s-1).toString("utf8"),i=r.indexOf("=");r.slice(0,i)==="path"&&(t=r.slice(i+1)),o+=s}return t}function oe(e,t){let o=xe.gunzipSync(e),n=O.resolve(t);N.mkdirSync(n,{recursive:!0});let s=null,r=0;for(;r+_<=o.length;){let i=o.subarray(r,r+_);if(i.every(f=>f===0))break;let c=ne(i,124,12),a=String.fromCharCode(i[156]||48),u=o.subarray(r+_,r+_+c);if(u.length<c)throw new Error("truncated release archive");if(r+=_+Math.ceil(c/_)*_,a==="x"){s=je(u);continue}if(a==="L"){s=A(u,0,u.length);continue}if(a==="g")continue;let l=A(i,345,155),g=s??(l?`${l}/${A(i,0,100)}`:A(i,0,100));s=null;let x=g.replace(/^package\//,"");if(x===g)throw new Error(`unexpected path in release archive: ${g}`);let m=O.resolve(n,x);if(m!==n&&!m.startsWith(`${n}${O.sep}`))throw new Error(`path escapes the release archive: ${g}`);if(a==="5")N.mkdirSync(m,{recursive:!0});else if(a==="0"){N.mkdirSync(O.dirname(m),{recursive:!0});let f=ne(i,100,8)&73?493:420;N.writeFileSync(m,u,{mode:f})}else throw new Error(`unsupported entry type '${a}' in release archive: ${g}`)}}var Ne=["EBUSY","EPERM","EACCES"];function U(e){try{return JSON.parse(p.readFileSync(y.join(e,"package.json"),"utf8"))}catch{return null}}function ie(e){let t=new Set(e.bundleDependencies??[]);return Object.entries(e.dependencies??{}).filter(([o])=>!t.has(o))}function Oe(e,t,o){if(JSON.stringify(e.bin)!==JSON.stringify(t.bin))return!1;let n=Pe(y.join(o,"package.json")).resolve;return ie(t).every(([s,r])=>{if(e.dependencies?.[s]!==r)return!1;try{return n(`${s}/package.json`),!0}catch{return!1}})}function Ce(e,t){let o=[],n=ie(e).map(([s])=>s);for(;n.length>0;){let s=n.shift(),r=y.join(t,"node_modules",s);if(o.includes(s)||!p.existsSync(r))continue;o.push(s);let i=U(r);n.push(...Object.keys({...i?.dependencies,...i?.optionalDependencies}))}return o}async function He(e,t,o){let n=new AbortController,s=setTimeout(()=>n.abort(),o);try{let r=await t(e,{signal:n.signal,headers:{Accept:"application/octet-stream"}});if(!r.ok)throw new Error(`${e}: HTTP ${r.status??"?"}`);return Buffer.from(await r.arrayBuffer())}catch(r){throw r.name==="AbortError"?new Error(`${e}: timed out`):r}finally{clearTimeout(s)}}function se(e,t,o){for(let n of e){let s=y.join(o,"node_modules",n);p.mkdirSync(y.dirname(s),{recursive:!0}),p.renameSync(y.join(t,"node_modules",n),s)}}function Ie(e,t,o,n){let s=`${t}.previous-${process.pid}`;try{p.renameSync(t,s)}catch(r){let i=r.code??"";if(n!=="win32"||!Ne.includes(i))throw r;let c=new Set(o.map(a=>y.join(t,"node_modules",a)));P(e,t,p.copyFileSync,c);return}try{se(o,s,e),p.renameSync(e,t)}catch(r){try{for(let i of o)p.existsSync(y.join(e,"node_modules",i))&&se([i],e,s);p.renameSync(s,t)}catch{}throw r}try{p.rmSync(s,{recursive:!0,force:!0})}catch{}}async function ce({url:e,version:t,target:o=E,fetchImpl:n=globalThis.fetch,timeoutMs:s=18e4,platform:r=process.platform}){let i=y.join(y.dirname(o),`.herdr-remote-update-${process.pid}`);try{p.rmSync(i,{recursive:!0,force:!0}),oe(await He(e,n,s),i);let c=U(i),a=U(o);return c?.name!=="herdr-remote"||t&&c.version!==t?{ok:!1,output:`${e} is not herdr-remote ${t??""}`.trim()}:!a||!Oe(a,c,o)?{ok:!1,needsNpm:!0,output:"the release changes installed dependencies"}:(Ie(i,o,Ce(c,o),r),{ok:!0,output:`installed ${c.version} from ${e}`})}catch(c){return{ok:!1,output:String(c?.message||c)}}finally{try{p.rmSync(i,{recursive:!0,force:!0})}catch{}}}import De from"node:fs";import Le from"node:os";import ae from"node:path";var ue="herdr-remote",fe="https://registry.npmjs.org",pe="https://registry.npmmirror.com";function C(e){if(typeof e!="string")return null;let t=e.trim().replace(/\/+$/,"");return/^https?:\/\//i.test(t)?t:null}function le(e){let t;try{t=De.readFileSync(e,"utf8")}catch{return null}let o=null;for(let n of t.split(/\r?\n/)){let s=n.trim();if(!s||s.startsWith("#")||s.startsWith(";"))continue;let r=/^registry\s*=\s*(.+)$/i.exec(s);r&&(o=C(r[1].replace(/^["']|["']$/g,"")))}return o}function me({env:e=process.env,home:t=Le.homedir(),cwd:o=process.cwd()}={}){let n=[],s=r=>{let i=C(r);i&&!n.includes(i)&&n.push(i)};return s(e.npm_config_registry),s(e.NPM_CONFIG_REGISTRY),s(e.HERDR_REMOTE_REGISTRY),s(le(ae.join(o,".npmrc"))),s(le(ae.join(t,".npmrc"))),s(fe),s(pe),n}async function de(e,{timeoutMs:t,fetchImpl:o}){let n=new AbortController,s=setTimeout(()=>n.abort(),t);try{let r=await o(e,{signal:n.signal,headers:{Accept:"application/json","Cache-Control":"no-cache"}});return r.ok?{ok:!0,body:await r.json()}:{ok:!1,message:`HTTP ${r.status??"?"}`}}catch(r){let i=r;return{ok:!1,message:i?.name==="AbortError"?"timed out":String(i?.message||r)}}finally{clearTimeout(s)}}async function he(e,{timeoutMs:t,fetchImpl:o}){let n=[{url:`${e}/-/package/${ue}/dist-tags`,read:r=>r?.latest},{url:`${e}/${ue}/latest`,read:r=>r?.version}],s=null;for(let r of n){let i=await de(r.url,{timeoutMs:t,fetchImpl:o});if(!i.ok){s=i.message;continue}let c=r.read(i.body);if(typeof c=="string"&&c)return{ok:!0,latest:c};s="registry answered without a version"}return{ok:!1,message:s}}var V=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;async function ye(e,{timeoutMs:t,fetchImpl:o}){let n=await de(e,{timeoutMs:t,fetchImpl:o});if(!n.ok)return n;let s=n.body?.version;return typeof s=="string"&&V.test(s)?{ok:!0,latest:s}:{ok:!1,message:"release manifest has no version"}}var Be="herdr-remote",Ge="herdr-remote-relay";function Ke(){try{return JSON.parse(H.readFileSync(z.join(E,"package.json"),"utf8")).version}catch{return"0.0.0"}}function Nr(){try{let e=Me(import.meta.url).resolve(`${Ge}/package.json`);return JSON.parse(H.readFileSync(e,"utf8")).version}catch{return null}}function we(){let e=E;if(!e.split(z.sep).includes("node_modules"))return"source";try{if(H.lstatSync(e).isSymbolicLink())return"linked"}catch{}return"npm"}function Or(e=process.env){return e.HERDR_REMOTE_UPDATE_CHECK!=="0"}function Cr(){return we()==="npm"}function $(e,t){let o=r=>String(r).split("-")[0].split(".").map(i=>Number.parseInt(i,10)||0),n=o(e),s=o(t);for(let r=0;r<Math.max(n.length,s.length);r+=1){let i=(n[r]||0)-(s[r]||0);if(i>0)return 1;if(i<0)return-1}return 0}async function Hr({timeoutMs:e=6e3,fetchImpl:t=globalThis.fetch,registries:o,releaseManifest:n=Q,current:s=Ke()}={}){let r=(u,l)=>({ok:!0,current:s,latest:u,source:l,updateAvailable:$(u,s)>0}),i=[];if(n){let u=await ye(n,{timeoutMs:e,fetchImpl:t});if(u.ok)return r(u.latest,b);i.push(`${b}: ${u.message??""}`)}let c=await Promise.all((o??me()).map(async u=>({source:u,...await he(u,{timeoutMs:e,fetchImpl:t})}))),a=null;for(let u of c)u.ok?(!a||$(u.latest,a.latest)>0)&&(a=u):i.push(`${u.source}: ${u.message??""}`);return a?r(a.latest,a.source):{ok:!1,current:s,errorKey:"update.errorNetwork",message:i.join("; ")}}function Ye(e){let t=String(e||"").split(/\r?\n/).map(o=>o.trim()).filter(o=>/^npm (error|ERR!)/.test(o)&&!/complete log of this run/i.test(o)).map(o=>o.replace(/^npm (error|ERR!)\s*/,"")).filter(Boolean);return(t.length>0?t.slice(0,3):String(e||"").trim().split(/\r?\n/).slice(-3)).join(" ")}function Ue(e){return/\bETARGET\b|notarget|No matching version found/i.test(String(e||""))}function Ve(){try{return JSON.parse(H.readFileSync(z.join(E,"package.json"),"utf8")).version}catch{return null}}function Se(e,t,o){let n=o();return e&&n&&$(n,e)<0?{ok:!1,errorKey:"update.errorNotApplied",installed:n,output:t.slice(-2e3)}:{ok:!0,installed:n,output:t.slice(-2e3)}}async function Ir({spawnImpl:e=Fe,timeoutMs:t=18e4,installKindImpl:o=we,source:n="",version:s=null,attempts:r=3,retryDelayMs:i=15e3,sleep:c=m=>new Promise(f=>setTimeout(f,m)),readInstalledVersion:a=Ve,onAttempt:u=()=>{},platform:l=process.platform,inPlace:g=re,installReleaseImpl:x=ce}={}){let m=o();if(m!=="npm")return{ok:!1,errorKey:`update.cannot.${m}`};let f=typeof s=="string"&&V.test(s)?s:null,D=C(n),L,X="";if(!D||D===b){u({source:b,attempt:1});let k=f?K(f):G,R=await x({url:k,version:f,platform:l});if(R.ok)return Se(f,R.output,a);L=R.needsNpm?[b,""]:[""],X=`${k}: ${R.output}
|
|
5
|
+
`}else L=[D];let F={ok:!1,output:""},M=!1;for(let k of L){let R=k===b,B=R?["install","-g",f?K(f):G]:["install","-g",`${Be}@${f||"latest"}`,"--prefer-online"];k&&!R&&B.push("--registry",k);for(let j=1;j<=r;j+=1){u({source:k,attempt:j});let d=await Y(e,B,t);if(!d.ok&&l==="win32"&&ee(d.output)&&(d=await g(B,_e=>Y(e,_e,t))),d.ok)return Se(f,d.output,a);if(F=d,d.spawnFailed)return{ok:!1,errorKey:"update.errorFailed",output:d.output,summary:d.output};if(M=Ue(d.output),!M)break;j<r&&await c(i)}}return{ok:!1,errorKey:M?"update.errorNotYetPublished":"update.errorFailed",output:`${X}${String(F.output||"")}`.slice(-2e3),summary:Ye(F.output)}}import J from"node:fs";import q from"node:os";import S from"node:path";import{spawnSync as ze}from"node:child_process";var T="herdr",Ee="0.9.3",Je=["~/.local/bin","~/.cargo/bin","~/bin","/opt/homebrew/bin","/usr/local/bin","/home/linuxbrew/.linuxbrew/bin","/usr/bin"];function qe(e,t){return e==="~"?t:e.startsWith("~/")?S.join(t,e.slice(2)):e}function v(e=T,t=process.platform){return t!=="win32"?[e]:[/\.exe$/i.test(e)?e:`${e}.exe`]}function I(e){try{return J.statSync(e).isFile()?(J.accessSync(e,J.constants.X_OK),!0):!1}catch{return!1}}function W(e,t=v()){if(!e)return null;for(let o of t){let n=S.join(e,o);if(I(n))return n}return null}function ge(e,t=v()){for(let o of String(e||"").split(S.delimiter)){let n=W(o.trim(),t);if(n)return n}return null}function ke(e=q.homedir(),t=process.platform,o=process.env){return t==="win32"?[S.join(o.LOCALAPPDATA||S.join(e,"AppData","Local"),"Programs","Herdr","bin"),S.join(e,".cargo","bin"),S.join(e,"scoop","shims")]:Je.map(n=>qe(n,e))}function Re(e){return e.includes("/")||e.includes(S.sep)}function We(e,t,o){let n=String(e||"").trim();if(!n)return null;if(Re(n)){let s=S.resolve(n);if(I(s))return s;if(o==="win32"&&S.extname(s)===""){let r=`${s}.exe`;if(I(r))return r}return W(s,v(T,o))}return ge(t,v(n,o))}function be({env:e=process.env,home:t=q.homedir(),platform:o=process.platform,directories:n=ke(t,o,e)}={}){let s=v(T,o),r=We(e.HERDR_BIN_PATH,e.PATH,o);if(r)return{command:r,source:"env",found:!0};let i=ge(e.PATH,s);if(i)return{command:i,source:"path",found:!0};for(let c of n){let a=W(c,s);if(a)return{command:a,source:"fallback",found:!0}}return{command:T,source:"unresolved",found:!1}}function Xe(e){return be(e).command}function Kr(e,t={}){return typeof e=="string"&&Re(e)&&I(e)?{command:e,source:"verified",found:!0}:be(t)}function Ze(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(String(e||""));return t?`${t[1]}.${t[2]}.${t[3]}`:null}function Qe(e,t=Ee){return e?$(e,t)>=0:!0}function Yr({command:e,timeout:t=1e4,...o}={}){let n=e||Xe(o),s={command:n,version:null,raw:null,supported:!0,ok:!1},r;try{r=ze(n,["--version"],{encoding:"utf8",timeout:t,windowsHide:!0})}catch{return s}if(r.error||r.status!==0&&r.status!==1)return s;let i=`${r.stdout||""}${r.stderr||""}`.trim(),c=Ze(i);return{command:n,version:c,raw:i||null,supported:Qe(c),ok:!0}}function Ur(e){return`Herdr ${e} is older than ${Ee}, which herdr-remote is written against. Run "herdr update" \u2014 window titles, large pastes, taps on a pane and Alt shortcuts all misbehave in browser windows before that release.`}function Vr({env:e=process.env,home:t=q.homedir(),platform:o=process.platform,directories:n=ke(t,o,e)}={}){let s=String(e.HERDR_BIN_PATH||"").trim(),r=[`Herdr executable "${T}" was not found.`];return s&&r.push(`HERDR_BIN_PATH=${s} does not point at an executable.`),r.push(n.length?`Searched PATH and ${n.join(", ")}.`:"Searched PATH."),r.push("Install Herdr or set HERDR_BIN_PATH to its full path, then restart herdr-remote."),r.join(" ")}export{ee as a,Ke as b,Nr as c,we as d,Or as e,Cr as f,$ as g,Hr as h,Ve as i,Ir as j,Ee as k,be as l,Xe as m,Kr as n,Yr as o,Ur as p,Vr as q};
|