@jiayunxie/aerial 0.2.2 → 0.2.3
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/docs/usage.md +1 -1
- package/package.json +1 -1
- package/src/service/index.js +2 -2
- package/src/service/wrapper-render.js +3 -4
package/docs/usage.md
CHANGED
|
@@ -237,7 +237,7 @@ aerial service uninstall
|
|
|
237
237
|
Aerial ships a thin platform wrapper around the user-mode service primitives provided by the host OS — there is no Aerial-specific daemon. Two platforms are supported:
|
|
238
238
|
|
|
239
239
|
- macOS: a user-level launchd `LaunchAgent` at `~/Library/LaunchAgents/com.jiayunxie.aerial.plist` invokes a generated POSIX shell wrapper at `<config-dir>/bin/aerial-service.sh`. The plist is regenerated on every `aerial service install` with a `<!-- Generated by aerial; do not edit -->` header, `KeepAlive = { SuccessfulExit = false; Crashed = true }` so the agent only restarts on crash (not on a clean exit), `ThrottleInterval = 10` to cap restart cadence, and no `StandardOutPath`/`StandardErrorPath` keys (the wrapper owns stdio redirection so launchd does not hold a write fd that would race with rotation). The launchctl command path is `gui/<uid>` (per-user agent, no privilege escalation). Start/stop go through `launchctl bootstrap` and `launchctl bootout` against that domain — never `launchctl kill`.
|
|
240
|
-
- Windows: a Task Scheduler task named `AerialLocalProxy`, `/SC ONLOGON /RL LIMITED`, executes a PowerShell wrapper at `<config-dir>\bin\aerial-service.ps1` (default `%APPDATA%\aerial\bin\aerial-service.ps1`). The wrapper is regenerated on every `aerial service install`. The `/TR` argument
|
|
240
|
+
- Windows: a Task Scheduler task named `AerialLocalProxy`, `/SC ONLOGON /RL LIMITED`, executes a PowerShell wrapper at `<config-dir>\bin\aerial-service.ps1` (default `%APPDATA%\aerial\bin\aerial-service.ps1`). The wrapper is regenerated on every `aerial service install`. The `/TR` argument quotes the wrapper path with normal double quotes so paths that contain spaces or non-ASCII characters work without manual quoting.
|
|
241
241
|
- Linux: not implemented in this release. `aerial service install|start|stop|restart|uninstall` throws an unsupported-platform error and exits 1; `aerial service status --json` still emits a schema-valid document with `"supported": false` and exits 1. Run `aerial start` directly or wrap it in your own init system.
|
|
242
242
|
|
|
243
243
|
Both wrappers do the same three things before exec-ing the proxy: (1) startup-rotate the captured stdio log (`aerial-stdio.log` → `.1` → `.2` → `.3`) if it has grown beyond the configured cap; (2) export `AERIAL_LOG_FILE=<config-dir>/logs/aerial.log`, plus `AERIAL_LOG_MAX_BYTES` and `AERIAL_LOG_BACKUPS` (default `5242880` / `3`, or whatever value was present in the installer's environment — see below), and — when `AERIAL_CONFIG_DIR` was set at install time — re-export `AERIAL_CONFIG_DIR` so the service sees the same config root as the installer; (3) `exec` `node src/cli/index.js start --host <host> --port <port>` with stdout and stderr appended to `aerial-stdio.log`. By default, the service wrapper uses the same Node.js binary that ran `aerial service install`. Set `AERIAL_SERVICE_NODE` before `aerial service install` to override this explicitly, for example when installing from one Node binary but running the service with another. The structured event log is opt-in via `AERIAL_LOG_FILE`: when this env var is set (always set by the wrapper, never by foreground `aerial start`), structured events go to that file only; when unset, they go to stderr only. There is no double-write.
|
package/package.json
CHANGED
package/src/service/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
aerialLogPath,
|
|
5
5
|
buildSchtasksArgs,
|
|
6
6
|
darwinWrapperPath,
|
|
7
|
+
formatSchtasksTR,
|
|
7
8
|
nodeBinary,
|
|
8
9
|
plistPath,
|
|
9
|
-
quoteSchtasksTR,
|
|
10
10
|
renderDarwinWrapper,
|
|
11
11
|
renderPlist,
|
|
12
12
|
renderWindowsWrapper,
|
|
@@ -32,7 +32,7 @@ export const _internal = {
|
|
|
32
32
|
parseWrapperPaths,
|
|
33
33
|
wrapperBlock,
|
|
34
34
|
buildSchtasksArgs,
|
|
35
|
-
|
|
35
|
+
formatSchtasksTR,
|
|
36
36
|
classifyHealth,
|
|
37
37
|
nodeBinary
|
|
38
38
|
};
|
|
@@ -202,9 +202,8 @@ export function renderWindowsWrapper({ nodePath, cliPath, host, port, stdioLog,
|
|
|
202
202
|
return lines.join("\r\n");
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
export function
|
|
206
|
-
|
|
207
|
-
return `\\"${wrapped}\\"`;
|
|
205
|
+
export function formatSchtasksTR(command) {
|
|
206
|
+
return String(command);
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
export function buildSchtasksCreateArgs({ taskName = WIN_TASK_NAME, wrapperPath: wrapper }) {
|
|
@@ -215,7 +214,7 @@ export function buildSchtasksCreateArgs({ taskName = WIN_TASK_NAME, wrapperPath:
|
|
|
215
214
|
"/SC", "ONLOGON",
|
|
216
215
|
"/RL", "LIMITED",
|
|
217
216
|
"/F",
|
|
218
|
-
"/TR",
|
|
217
|
+
"/TR", formatSchtasksTR(cmd)
|
|
219
218
|
];
|
|
220
219
|
}
|
|
221
220
|
|