galaxy-opc 0.3.2 → 0.3.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.
Files changed (2) hide show
  1. package/bin/cli.mjs +11 -5
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -360,9 +360,15 @@ async function cmdSetup() {
360
360
  console.log(yellow(`\n 已跳过,稍后手动编辑: ${gray(CONFIG_PATH)}`));
361
361
  }
362
362
 
363
- // Gateway Token
364
- if (!newEnv["OPENCLAW_GATEWAY_TOKEN"] || newEnv["OPENCLAW_GATEWAY_TOKEN"] === "change-me-to-a-long-random-token") {
365
- newEnv["OPENCLAW_GATEWAY_TOKEN"] = crypto.randomBytes(32).toString("hex");
363
+ // Gateway Token — 写入 openclaw.json(openclaw 从这里读取鉴权 token)
364
+ const existingToken = newConfig.gateway?.auth?.token;
365
+ const gatewayToken = (existingToken && existingToken !== "change-me-to-a-long-random-token")
366
+ ? existingToken
367
+ : crypto.randomBytes(16).toString("hex");
368
+ newConfig = deepMerge(newConfig, {
369
+ gateway: { auth: { mode: "token", token: gatewayToken } },
370
+ });
371
+ if (!existingToken || existingToken === "change-me-to-a-long-random-token") {
366
372
  console.log(green("\n ✓ 已自动生成 Gateway 访问令牌"));
367
373
  }
368
374
 
@@ -377,8 +383,8 @@ async function cmdSetup() {
377
383
  启动命令:
378
384
  ${cyan("openclaw gateway")}
379
385
 
380
- 管理后台:
381
- ${cyan("http://localhost:18789/opc/admin")}
386
+ 管理后台(需带 token):
387
+ ${cyan(`http://localhost:18789/opc/admin?token=${gatewayToken}`)}
382
388
 
383
389
  后台驻守(开机自启):
384
390
  ${cyan("openclaw onboard --install-daemon")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "galaxy-opc",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "星环 Galaxy OPC — 一人公司孵化与赋能平台 AI 员工系统",
5
5
  "keywords": [
6
6
  "ai",