@flame0510/project-aether 1.1.10 → 1.1.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/README.md +13 -4
- package/app/api/update-check/route.ts +6 -2
- package/bin/rev4a.js +27 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,13 +62,22 @@ rev4a serve --port 8080
|
|
|
62
62
|
|
|
63
63
|
## Environment Variables
|
|
64
64
|
|
|
65
|
+
`rev4a serve` generates `~/.config/rev4a/.env` on first run with the secrets
|
|
66
|
+
already filled in — you normally never set these by hand. See
|
|
67
|
+
[.env.example](./.env.example) for the full reference.
|
|
68
|
+
|
|
65
69
|
| Variable | Default | Required | Description |
|
|
66
70
|
|---|---|---|---|
|
|
67
71
|
| `PORT` | `3740` | No | Dashboard HTTP port |
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
+
| `TERMINAL_WS_PORT` | `3741` | No | Container terminal WebSocket port |
|
|
73
|
+
| `REV4A_PASSWORD` | — | Yes | Dashboard login password (set via the setup wizard) |
|
|
74
|
+
| `REV4A_TOKEN` | auto-generated | Yes | Bearer token for API routes and agent calls |
|
|
75
|
+
| `REV4A_JWT_SECRET` | auto-generated | Yes | Secret for auth cookies |
|
|
76
|
+
| `REV4A_API_KEY` | auto-generated | No | API key for the Gateway provider endpoint |
|
|
77
|
+
| `GATEWAY_TOKEN` | auto-generated | No | Shared token handed to agent containers |
|
|
78
|
+
| `REV4A_DATA_DIR` | `~/.config/rev4a` | No | Root of all persistent data |
|
|
79
|
+
| `REV4A_DB` | `<data dir>/data/events.db` | No | SQLite database path |
|
|
80
|
+
| `REV4A_WORKSPACE_ROOT` | — | No | Root exposed by the local file explorer |
|
|
72
81
|
|
|
73
82
|
---
|
|
74
83
|
|
|
@@ -5,6 +5,10 @@ import { readFileSync } from 'fs';
|
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
import { requireAuthJWT } from '@/lib/rev4a-auth';
|
|
7
7
|
|
|
8
|
+
// Fallback used only when package.json cannot be read — the published npm
|
|
9
|
+
// package name is the single source of truth, so never hardcode it elsewhere.
|
|
10
|
+
const FALLBACK_PKG_NAME = '@flame0510/project-aether';
|
|
11
|
+
|
|
8
12
|
function getPackageInfo() {
|
|
9
13
|
try {
|
|
10
14
|
// Resolve relative to the project root (two levels above .next)
|
|
@@ -12,7 +16,7 @@ function getPackageInfo() {
|
|
|
12
16
|
const raw = readFileSync(pkgPath, 'utf-8');
|
|
13
17
|
return JSON.parse(raw);
|
|
14
18
|
} catch {
|
|
15
|
-
return { version: '0.0.0', name:
|
|
19
|
+
return { version: '0.0.0', name: FALLBACK_PKG_NAME };
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
|
|
@@ -45,7 +49,7 @@ export async function GET(request: Request): Promise<NextResponse> {
|
|
|
45
49
|
updateAvailable = cache.updateAvailable;
|
|
46
50
|
} else {
|
|
47
51
|
try {
|
|
48
|
-
const pkgName = pkg.name ||
|
|
52
|
+
const pkgName = pkg.name || FALLBACK_PKG_NAME;
|
|
49
53
|
latest = execSync(
|
|
50
54
|
`npm view ${pkgName} version --registry https://registry.npmjs.org 2>/dev/null`,
|
|
51
55
|
{ stdio: 'pipe', timeout: 10_000 },
|
package/bin/rev4a.js
CHANGED
|
@@ -39,8 +39,14 @@ const AGENT_IMAGE = 'openclaw-agent-base:latest';
|
|
|
39
39
|
const AGENT_IMAGE_REGISTRY = 'ghcr.io/flame0510/rev4a/openclaw-agent-base:latest';
|
|
40
40
|
const DOCKER_NETWORK = 'rev4a-network';
|
|
41
41
|
|
|
42
|
+
// Fallback used only when package.json cannot be read — the published npm
|
|
43
|
+
// package name is the single source of truth, so never hardcode it elsewhere.
|
|
44
|
+
const FALLBACK_PKG_NAME = '@flame0510/project-aether';
|
|
45
|
+
|
|
42
46
|
let pkg;
|
|
43
|
-
try { pkg = require(PKG_JSON); } catch { pkg = { version: '0.0.0' }; }
|
|
47
|
+
try { pkg = require(PKG_JSON); } catch { pkg = { version: '0.0.0', name: FALLBACK_PKG_NAME }; }
|
|
48
|
+
|
|
49
|
+
const PKG_NAME = pkg.name || FALLBACK_PKG_NAME;
|
|
44
50
|
|
|
45
51
|
const DEFAULT_PORT = 3740;
|
|
46
52
|
|
|
@@ -298,7 +304,7 @@ function ensureEnv() {
|
|
|
298
304
|
|
|
299
305
|
const jwt = randomString(48);
|
|
300
306
|
const token = randomString(32);
|
|
301
|
-
const apiKey = '
|
|
307
|
+
const apiKey = 'rev_' + randomString(48);
|
|
302
308
|
const gatewayToken = randomString(48);
|
|
303
309
|
|
|
304
310
|
const env = [
|
|
@@ -359,23 +365,30 @@ function build() {
|
|
|
359
365
|
// ── Version check ───────────────────────────────────────────────────────────
|
|
360
366
|
|
|
361
367
|
function checkVersion() {
|
|
362
|
-
const pkgName = '@flame0510/project-aether';
|
|
363
368
|
try {
|
|
364
369
|
const latest = execSync(
|
|
365
|
-
`npm view ${
|
|
370
|
+
`npm view ${PKG_NAME} version --registry https://registry.npmjs.org 2>/dev/null`,
|
|
366
371
|
{ stdio: 'pipe', timeout: 8000 },
|
|
367
372
|
).toString().trim();
|
|
368
373
|
if (!latest || latest === pkg.version) return;
|
|
369
374
|
|
|
375
|
+
const rows = [
|
|
376
|
+
'🆕 Rev4a update available!',
|
|
377
|
+
`Latest: v${latest}`,
|
|
378
|
+
`Installed: v${pkg.version}`,
|
|
379
|
+
'',
|
|
380
|
+
`Run: npm install -g ${PKG_NAME}`,
|
|
381
|
+
'Then: restart rev4a',
|
|
382
|
+
];
|
|
383
|
+
// Box is sized to the longest row so the package name can change freely.
|
|
384
|
+
const width = Math.max(...rows.map((r) => r.length));
|
|
385
|
+
|
|
370
386
|
console.log('');
|
|
371
|
-
console.log(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
console.log(
|
|
376
|
-
console.log(' ║ Run: npm install -g @flame0510/project-aether ║');
|
|
377
|
-
console.log(' ║ Then: restart rev4a ║');
|
|
378
|
-
console.log(' ╚══════════════════════════════════════════╝');
|
|
387
|
+
console.log(` ╔══${'═'.repeat(width)}══╗`);
|
|
388
|
+
for (const row of rows) {
|
|
389
|
+
console.log(` ║ ${row}${' '.repeat(width - row.length)} ║`);
|
|
390
|
+
}
|
|
391
|
+
console.log(` ╚══${'═'.repeat(width)}══╝`);
|
|
379
392
|
console.log('');
|
|
380
393
|
} catch {
|
|
381
394
|
// No internet or npm not configured — skip silently
|
|
@@ -650,7 +663,7 @@ if (cmd === 'update') {
|
|
|
650
663
|
console.log(`Checking for updates…`);
|
|
651
664
|
try {
|
|
652
665
|
const latest = execSync(
|
|
653
|
-
|
|
666
|
+
`npm view ${PKG_NAME} version --registry https://registry.npmjs.org 2>/dev/null`,
|
|
654
667
|
{ stdio: 'pipe', timeout: 10_000 },
|
|
655
668
|
).toString().trim();
|
|
656
669
|
if (latest === pkg.version) {
|
|
@@ -668,7 +681,7 @@ if (cmd === 'update') {
|
|
|
668
681
|
});
|
|
669
682
|
} else {
|
|
670
683
|
console.log('Using npm global install…');
|
|
671
|
-
execSync(
|
|
684
|
+
execSync(`npm install -g ${PKG_NAME}@latest`, {
|
|
672
685
|
stdio: 'inherit',
|
|
673
686
|
timeout: 120_000,
|
|
674
687
|
});
|