codex-task 0.2.10 → 0.2.11
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/.codex-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/README_EN.md +1 -1
- package/package.json +1 -1
- package/scripts/service/install-ubuntu.sh +25 -1
package/README.md
CHANGED
|
@@ -218,7 +218,7 @@ skilltruck install https://github.com/wangyendt/codex-task --global
|
|
|
218
218
|
| 查询进度 | `GET /v1/jobs/:jobId` |
|
|
219
219
|
| 下载产物 | `GET /v1/jobs/:jobId/artifacts/:index` |
|
|
220
220
|
|
|
221
|
-
已经全局安装 CodexTask 后,运行一次 `codex-task setup` 即可自动识别 macOS、Linux 或 Windows,生成随机 token
|
|
221
|
+
已经全局安装 CodexTask 后,运行一次 `codex-task setup` 即可自动识别 macOS、Linux 或 Windows,生成随机 token、创建用户级自启动项并立即启动服务。Linux 会默认启用当前用户的 systemd linger,让服务在机器启动、用户尚未登录时也能运行;首次设置可能要求输入 `sudo` 密码:
|
|
222
222
|
|
|
223
223
|
```bash
|
|
224
224
|
codex-task setup
|
package/README_EN.md
CHANGED
|
@@ -162,7 +162,7 @@ Default stdout is one JSON result; `--stream` produces JSONL item/task progress.
|
|
|
162
162
|
|
|
163
163
|
## Self-hosted service and mobile clients
|
|
164
164
|
|
|
165
|
-
`codex-task serve` exposes text, image, workspace, and resume work as authenticated asynchronous HTTP jobs. After installing CodexTask globally, run `codex-task setup` once to detect macOS, Linux, or Windows, generate a random token, install the native user-level startup entry, and start it immediately.
|
|
165
|
+
`codex-task serve` exposes text, image, workspace, and resume work as authenticated asynchronous HTTP jobs. After installing CodexTask globally, run `codex-task setup` once to detect macOS, Linux, or Windows, generate a random token, install the native user-level startup entry, and start it immediately. On Linux, setup enables systemd user linger by default so the service starts at boot before login; the first setup may request the user's `sudo` password.
|
|
166
166
|
|
|
167
167
|
The default proxy mode is `auto`. Every Direct request checks `ALL_PROXY`, `HTTPS_PROXY`, and `HTTP_PROXY`, then the current operating-system proxy. Toggling the system proxy or changing its port does not require reinstalling the service, and no port such as `7890` is assumed. Use `codex-task setup --proxy socks5h://127.0.0.1:PORT` for a fixed proxy or `codex-task setup --no-proxy` to force direct connections. The command also accepts `--host`, `--port`, and `--max-concurrency`. Running it again updates and restarts the service without replacing its existing token.
|
|
168
168
|
|
package/package.json
CHANGED
|
@@ -13,6 +13,30 @@ unit_file="$user_unit_dir/codex-task.service"
|
|
|
13
13
|
|
|
14
14
|
command -v npm >/dev/null 2>&1 || { echo "npm is required" >&2; exit 1; }
|
|
15
15
|
command -v systemctl >/dev/null 2>&1 || { echo "systemd user services are required" >&2; exit 1; }
|
|
16
|
+
command -v loginctl >/dev/null 2>&1 || { echo "systemd loginctl is required" >&2; exit 1; }
|
|
17
|
+
|
|
18
|
+
current_user="$(id -un)"
|
|
19
|
+
linger_state="$(loginctl show-user "$current_user" -p Linger --value 2>/dev/null || true)"
|
|
20
|
+
if [[ "$linger_state" != "yes" ]]; then
|
|
21
|
+
echo "Enabling systemd user linger for $current_user so CodexTask starts before login."
|
|
22
|
+
if loginctl enable-linger "$current_user"; then
|
|
23
|
+
:
|
|
24
|
+
elif command -v sudo >/dev/null 2>&1 && sudo -n loginctl enable-linger "$current_user"; then
|
|
25
|
+
:
|
|
26
|
+
elif command -v sudo >/dev/null 2>&1 && [[ -t 0 ]]; then
|
|
27
|
+
sudo loginctl enable-linger "$current_user"
|
|
28
|
+
else
|
|
29
|
+
echo "Could not enable systemd user linger for $current_user." >&2
|
|
30
|
+
echo "Run codex-task setup from an interactive terminal with sudo access." >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
linger_state="$(loginctl show-user "$current_user" -p Linger --value 2>/dev/null || true)"
|
|
35
|
+
if [[ "$linger_state" != "yes" ]]; then
|
|
36
|
+
echo "systemd did not report Linger=yes for $current_user after setup." >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
fi
|
|
16
40
|
|
|
17
41
|
if [[ "${CODEX_TASK_SKIP_GLOBAL_INSTALL:-0}" != "1" ]]; then
|
|
18
42
|
npm install -g codex-task@latest
|
|
@@ -66,7 +90,7 @@ echo "URL: http://$service_host:$service_port"
|
|
|
66
90
|
echo "Token: $(<"$token_file")"
|
|
67
91
|
echo "Token file: $token_file"
|
|
68
92
|
echo "Status: systemctl --user status codex-task.service"
|
|
69
|
-
echo "
|
|
93
|
+
echo "User linger: enabled for $current_user (service starts before login)."
|
|
70
94
|
case "$service_proxy" in
|
|
71
95
|
auto|AUTO) echo "Proxy: automatic environment/system detection." ;;
|
|
72
96
|
direct|DIRECT|none|NONE|off|OFF) echo "Proxy: disabled; Direct requests connect directly." ;;
|