@hideandseeklab/aoox 0.1.0-beta.0 → 0.1.0-beta.2
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 +32 -27
- package/assets/install/docker-compose.dist.yml +3 -0
- package/dist/commands/domain/set.js +4 -0
- package/dist/commands/reinstall.js +7 -4
- package/dist/commands/update/panel.js +25 -5
- package/dist/lib/panel-update.d.ts +13 -0
- package/dist/lib/panel-update.js +19 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ $ npm install -g @hideandseeklab/aoox
|
|
|
27
27
|
$ aoox COMMAND
|
|
28
28
|
running command...
|
|
29
29
|
$ aoox (--version)
|
|
30
|
-
@hideandseeklab/aoox/0.1.0-beta.
|
|
30
|
+
@hideandseeklab/aoox/0.1.0-beta.2 linux-x64 node-v24.22.2
|
|
31
31
|
$ aoox --help [COMMAND]
|
|
32
32
|
USAGE
|
|
33
33
|
$ aoox COMMAND
|
|
@@ -68,6 +68,11 @@ Node ≥22 must already be installed on that VPS **before** the step above (`aoo
|
|
|
68
68
|
itself needs Node to run, so it cannot install Node for you first) — or use the install script
|
|
69
69
|
above, which needs no Node.js on the VPS at all.
|
|
70
70
|
|
|
71
|
+
## Requirements for `aoox install`
|
|
72
|
+
|
|
73
|
+
- A Linux server with root access (run it with `sudo`). If Docker is missing or not running, `aoox install` offers to install it with `curl -fsSL https://get.docker.com | sh` (it does so without asking when you pass `--yes`) and stops if Docker still cannot start afterwards.
|
|
74
|
+
- 1 vCPU and 2 GB RAM plus swap as the minimum (the tested size), 4 GB recommended. See [Choosing a VPS](https://aoox.dev/docs/fresh-vps).
|
|
75
|
+
|
|
71
76
|
## From source
|
|
72
77
|
|
|
73
78
|
To install from source (e.g. to contribute, or to get the latest `main` before it is
|
|
@@ -192,7 +197,7 @@ EXAMPLES
|
|
|
192
197
|
$ aoox deploy --tag v1.2.3
|
|
193
198
|
```
|
|
194
199
|
|
|
195
|
-
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
200
|
+
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/deploy.ts)_
|
|
196
201
|
|
|
197
202
|
## `aoox domain clear`
|
|
198
203
|
|
|
@@ -217,7 +222,7 @@ EXAMPLES
|
|
|
217
222
|
$ aoox domain clear --yes
|
|
218
223
|
```
|
|
219
224
|
|
|
220
|
-
_See code: [src/commands/domain/clear.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
225
|
+
_See code: [src/commands/domain/clear.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/domain/clear.ts)_
|
|
221
226
|
|
|
222
227
|
## `aoox domain set`
|
|
223
228
|
|
|
@@ -249,7 +254,7 @@ EXAMPLES
|
|
|
249
254
|
$ aoox domain set --web panel.example.com --api api.example.com --domain-only
|
|
250
255
|
```
|
|
251
256
|
|
|
252
|
-
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
257
|
+
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/domain/set.ts)_
|
|
253
258
|
|
|
254
259
|
## `aoox env diff`
|
|
255
260
|
|
|
@@ -282,7 +287,7 @@ EXAMPLES
|
|
|
282
287
|
$ aoox env diff --set shared --from staging --to production
|
|
283
288
|
```
|
|
284
289
|
|
|
285
|
-
_See code: [src/commands/env/diff.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
290
|
+
_See code: [src/commands/env/diff.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/diff.ts)_
|
|
286
291
|
|
|
287
292
|
## `aoox env history`
|
|
288
293
|
|
|
@@ -318,7 +323,7 @@ EXAMPLES
|
|
|
318
323
|
$ aoox env history --limit 5 --json
|
|
319
324
|
```
|
|
320
325
|
|
|
321
|
-
_See code: [src/commands/env/history.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
326
|
+
_See code: [src/commands/env/history.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/history.ts)_
|
|
322
327
|
|
|
323
328
|
## `aoox env link`
|
|
324
329
|
|
|
@@ -352,7 +357,7 @@ EXAMPLES
|
|
|
352
357
|
$ aoox env link --set defaults --env production --position 1
|
|
353
358
|
```
|
|
354
359
|
|
|
355
|
-
_See code: [src/commands/env/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
360
|
+
_See code: [src/commands/env/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/link.ts)_
|
|
356
361
|
|
|
357
362
|
## `aoox env links`
|
|
358
363
|
|
|
@@ -382,7 +387,7 @@ EXAMPLES
|
|
|
382
387
|
$ aoox env links --stack <id>
|
|
383
388
|
```
|
|
384
389
|
|
|
385
|
-
_See code: [src/commands/env/links.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
390
|
+
_See code: [src/commands/env/links.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/links.ts)_
|
|
386
391
|
|
|
387
392
|
## `aoox env list`
|
|
388
393
|
|
|
@@ -424,7 +429,7 @@ EXAMPLES
|
|
|
424
429
|
$ aoox env list --set shared --env development --reveal
|
|
425
430
|
```
|
|
426
431
|
|
|
427
|
-
_See code: [src/commands/env/list.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
432
|
+
_See code: [src/commands/env/list.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/list.ts)_
|
|
428
433
|
|
|
429
434
|
## `aoox env promote`
|
|
430
435
|
|
|
@@ -459,7 +464,7 @@ EXAMPLES
|
|
|
459
464
|
$ aoox env promote --from development --to staging --all --yes
|
|
460
465
|
```
|
|
461
466
|
|
|
462
|
-
_See code: [src/commands/env/promote.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
467
|
+
_See code: [src/commands/env/promote.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/promote.ts)_
|
|
463
468
|
|
|
464
469
|
## `aoox env pull`
|
|
465
470
|
|
|
@@ -503,7 +508,7 @@ EXAMPLES
|
|
|
503
508
|
$ aoox env pull --format shell --file -
|
|
504
509
|
```
|
|
505
510
|
|
|
506
|
-
_See code: [src/commands/env/pull.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
511
|
+
_See code: [src/commands/env/pull.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/pull.ts)_
|
|
507
512
|
|
|
508
513
|
## `aoox env push`
|
|
509
514
|
|
|
@@ -537,7 +542,7 @@ EXAMPLES
|
|
|
537
542
|
$ aoox env push --file .env.staging --set shared --env staging --yes
|
|
538
543
|
```
|
|
539
544
|
|
|
540
|
-
_See code: [src/commands/env/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
545
|
+
_See code: [src/commands/env/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/push.ts)_
|
|
541
546
|
|
|
542
547
|
## `aoox env set ASSIGNMENTS`
|
|
543
548
|
|
|
@@ -576,7 +581,7 @@ EXAMPLES
|
|
|
576
581
|
$ aoox env set API_TOKEN=abc123 --secret
|
|
577
582
|
```
|
|
578
583
|
|
|
579
|
-
_See code: [src/commands/env/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
584
|
+
_See code: [src/commands/env/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/set.ts)_
|
|
580
585
|
|
|
581
586
|
## `aoox env sets`
|
|
582
587
|
|
|
@@ -650,7 +655,7 @@ EXAMPLES
|
|
|
650
655
|
$ aoox env unlink --position 2
|
|
651
656
|
```
|
|
652
657
|
|
|
653
|
-
_See code: [src/commands/env/unlink.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
658
|
+
_See code: [src/commands/env/unlink.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/unlink.ts)_
|
|
654
659
|
|
|
655
660
|
## `aoox env unset KEYS`
|
|
656
661
|
|
|
@@ -684,7 +689,7 @@ EXAMPLES
|
|
|
684
689
|
$ aoox env unset A B --set shared --env staging
|
|
685
690
|
```
|
|
686
691
|
|
|
687
|
-
_See code: [src/commands/env/unset.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
692
|
+
_See code: [src/commands/env/unset.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/env/unset.ts)_
|
|
688
693
|
|
|
689
694
|
## `aoox help [COMMAND]`
|
|
690
695
|
|
|
@@ -752,7 +757,7 @@ EXAMPLES
|
|
|
752
757
|
sudo aoox install --force --new-secrets --wipe-data # start from scratch (deletes all panel data)
|
|
753
758
|
```
|
|
754
759
|
|
|
755
|
-
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
760
|
+
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/install.ts)_
|
|
756
761
|
|
|
757
762
|
## `aoox link`
|
|
758
763
|
|
|
@@ -779,7 +784,7 @@ EXAMPLES
|
|
|
779
784
|
$ aoox link --project <id> --app <id>
|
|
780
785
|
```
|
|
781
786
|
|
|
782
|
-
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
787
|
+
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/link.ts)_
|
|
783
788
|
|
|
784
789
|
## `aoox login`
|
|
785
790
|
|
|
@@ -805,7 +810,7 @@ EXAMPLES
|
|
|
805
810
|
$ aoox login --url 203.0.113.10:3000 --token aoox_xxx
|
|
806
811
|
```
|
|
807
812
|
|
|
808
|
-
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
813
|
+
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/login.ts)_
|
|
809
814
|
|
|
810
815
|
## `aoox plugins`
|
|
811
816
|
|
|
@@ -1143,7 +1148,7 @@ EXAMPLES
|
|
|
1143
1148
|
$ aoox registry build myapp:1.0.0 --force
|
|
1144
1149
|
```
|
|
1145
1150
|
|
|
1146
|
-
_See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1151
|
+
_See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/registry/build.ts)_
|
|
1147
1152
|
|
|
1148
1153
|
## `aoox registry domain`
|
|
1149
1154
|
|
|
@@ -1169,7 +1174,7 @@ EXAMPLES
|
|
|
1169
1174
|
$ aoox registry domain --clear
|
|
1170
1175
|
```
|
|
1171
1176
|
|
|
1172
|
-
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1177
|
+
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/registry/domain.ts)_
|
|
1173
1178
|
|
|
1174
1179
|
## `aoox registry password`
|
|
1175
1180
|
|
|
@@ -1196,7 +1201,7 @@ EXAMPLES
|
|
|
1196
1201
|
$ aoox registry password --reset --yes
|
|
1197
1202
|
```
|
|
1198
1203
|
|
|
1199
|
-
_See code: [src/commands/registry/password.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1204
|
+
_See code: [src/commands/registry/password.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/registry/password.ts)_
|
|
1200
1205
|
|
|
1201
1206
|
## `aoox registry push [IMAGE]`
|
|
1202
1207
|
|
|
@@ -1236,7 +1241,7 @@ EXAMPLES
|
|
|
1236
1241
|
$ aoox registry push myapp:1.0.0 --force
|
|
1237
1242
|
```
|
|
1238
1243
|
|
|
1239
|
-
_See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1244
|
+
_See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/registry/push.ts)_
|
|
1240
1245
|
|
|
1241
1246
|
## `aoox reinstall`
|
|
1242
1247
|
|
|
@@ -1266,7 +1271,7 @@ EXAMPLES
|
|
|
1266
1271
|
sudo aoox reinstall --yes --terminal-ssh-user root
|
|
1267
1272
|
```
|
|
1268
1273
|
|
|
1269
|
-
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1274
|
+
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/reinstall.ts)_
|
|
1270
1275
|
|
|
1271
1276
|
## `aoox run`
|
|
1272
1277
|
|
|
@@ -1311,7 +1316,7 @@ EXAMPLES
|
|
|
1311
1316
|
$ aoox run --quiet -- npm run dev
|
|
1312
1317
|
```
|
|
1313
1318
|
|
|
1314
|
-
_See code: [src/commands/run.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1319
|
+
_See code: [src/commands/run.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/run.ts)_
|
|
1315
1320
|
|
|
1316
1321
|
## `aoox update`
|
|
1317
1322
|
|
|
@@ -1333,7 +1338,7 @@ EXAMPLES
|
|
|
1333
1338
|
$ aoox update --check
|
|
1334
1339
|
```
|
|
1335
1340
|
|
|
1336
|
-
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1341
|
+
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/update.ts)_
|
|
1337
1342
|
|
|
1338
1343
|
## `aoox update panel`
|
|
1339
1344
|
|
|
@@ -1358,7 +1363,7 @@ EXAMPLES
|
|
|
1358
1363
|
$ aoox update panel --apply
|
|
1359
1364
|
```
|
|
1360
1365
|
|
|
1361
|
-
_See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1366
|
+
_See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/update/panel.ts)_
|
|
1362
1367
|
|
|
1363
1368
|
## `aoox whoami`
|
|
1364
1369
|
|
|
@@ -1385,7 +1390,7 @@ EXAMPLES
|
|
|
1385
1390
|
$ aoox whoami --json
|
|
1386
1391
|
```
|
|
1387
1392
|
|
|
1388
|
-
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.
|
|
1393
|
+
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-beta.2/src/commands/whoami.ts)_
|
|
1389
1394
|
<!-- commandsstop -->
|
|
1390
1395
|
|
|
1391
1396
|
## Versioning
|
|
@@ -135,6 +135,9 @@ services:
|
|
|
135
135
|
# Which proxy hops may set the client IP (X-Forwarded-For). Empty = private networks
|
|
136
136
|
# only (Traefik, the web container); see TRUST_PROXY in .env.dist.example.
|
|
137
137
|
TRUST_PROXY: ${TRUST_PROXY:-}
|
|
138
|
+
# Traefik entrypoint read timeout (whole seconds or a duration like 300s/5m, 1-86400);
|
|
139
|
+
# empty = Traefik's default (60 s). Applied when the proxy is (re)installed.
|
|
140
|
+
PROXY_READ_TIMEOUT: ${PROXY_READ_TIMEOUT:-}
|
|
138
141
|
# The api container runs as the unprivileged `node` user; add the gid that
|
|
139
142
|
# owns the docker socket on the host (stat -c %g /var/run/docker.sock).
|
|
140
143
|
group_add:
|
|
@@ -67,6 +67,10 @@ export default class DomainSet extends Command {
|
|
|
67
67
|
this.logToStderr(warnLine('Access through IP:3000 / IP:3001 is closed once the panel restarts — use the domains above.'));
|
|
68
68
|
this.log(result.restrictPortsNote);
|
|
69
69
|
}
|
|
70
|
+
if (result.proxyRecreated) {
|
|
71
|
+
this.log('');
|
|
72
|
+
this.logToStderr(warnLine('The reverse proxy was recreated once to enable HTTPS certificates (Let\'s Encrypt). Applications routed through it are unreachable for a few seconds.'));
|
|
73
|
+
}
|
|
70
74
|
if (result.proxyAutoProvisioned) {
|
|
71
75
|
this.log('');
|
|
72
76
|
this.logToStderr(warnLine('The reverse proxy was not running before — it has been enabled automatically.'));
|
|
@@ -104,10 +104,11 @@ export default class Reinstall extends Command {
|
|
|
104
104
|
if (!ok)
|
|
105
105
|
this.exit(0);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
// Always snapshot .env.dist + the compose files, even when nothing changes: the folder
|
|
108
|
+
// is the restore point for a full set of files.
|
|
109
|
+
const backupDir = `${dir}/backups/${backupStamp()}`;
|
|
110
|
+
await this.backup(dir, backupDir, present);
|
|
108
111
|
if (anyChange) {
|
|
109
|
-
backupDir = `${dir}/backups/${backupStamp()}`;
|
|
110
|
-
await this.backup(dir, backupDir, present);
|
|
111
112
|
if (composeChanged)
|
|
112
113
|
await this.atomicWrite(`${dir}/${DIST_FILE}`, newCompose, 0o644);
|
|
113
114
|
if (domainChanged && newDomain !== undefined)
|
|
@@ -130,7 +131,7 @@ export default class Reinstall extends Command {
|
|
|
130
131
|
this.log('');
|
|
131
132
|
this.log(successLine(`Done. aoox in ${dir} has been refreshed${version ? ` (version ${version})` : ''}.`));
|
|
132
133
|
this.log(` .env.dist keys added: ${merge.added.length > 0 ? merge.added.join(', ') : '(none)'}`);
|
|
133
|
-
this.log(` Backup of previous files: ${backupDir
|
|
134
|
+
this.log(` Backup of previous files: ${backupDir}`);
|
|
134
135
|
this.log(` Open: ${env.get('WEB_ORIGIN') || 'http://localhost:3000'}`);
|
|
135
136
|
}
|
|
136
137
|
assertPreconditions() {
|
|
@@ -197,6 +198,8 @@ export default class Reinstall extends Command {
|
|
|
197
198
|
this.log(` ~ ${k} (replaced per flag)`);
|
|
198
199
|
for (const w of p.merge.warnings)
|
|
199
200
|
this.logToStderr(warnLine(w));
|
|
201
|
+
this.log(`
|
|
202
|
+
Backup: .env.dist and ${p.files.join(", ")} will be copied to ${p.dir}/backups/<timestamp>/ before anything changes`);
|
|
200
203
|
this.log(`\n${OVERRIDE_FILE}: left untouched`);
|
|
201
204
|
this.log(`Compose files: ${p.files.join(' + ')}${p.running ? ' (same as the running stack)' : ' (api container not found — using default rules)'}`);
|
|
202
205
|
const dropped = runningFileNames(p.running).filter((n) => !p.files.includes(n));
|
|
@@ -3,6 +3,7 @@ import { api, ApiError } from '../../lib/api.js';
|
|
|
3
3
|
import { MissingCredentialsError } from '../../lib/config.js';
|
|
4
4
|
import { connectionFlags, loadCredentials } from '../../lib/flags.js';
|
|
5
5
|
import { warnIfOutdated } from '../../lib/outdated.js';
|
|
6
|
+
import { newerPublishedVersion, pinnedAdvice } from '../../lib/panel-update.js';
|
|
6
7
|
import { successLine, warnLine } from '../../lib/style.js';
|
|
7
8
|
/**
|
|
8
9
|
* Checks the panel's own `aoox-api`/`aoox-web` images against the registry
|
|
@@ -17,6 +18,7 @@ export default class UpdatePanel extends Command {
|
|
|
17
18
|
...connectionFlags,
|
|
18
19
|
apply: Flags.boolean({ description: 'Apply the update if one is available (pull + restart)' }),
|
|
19
20
|
};
|
|
21
|
+
// eslint-disable-next-line complexity -- linear orchestration: check, report, apply
|
|
20
22
|
async run() {
|
|
21
23
|
const { flags } = await this.parse(UpdatePanel);
|
|
22
24
|
let config;
|
|
@@ -43,8 +45,10 @@ export default class UpdatePanel extends Command {
|
|
|
43
45
|
throw error;
|
|
44
46
|
}
|
|
45
47
|
this.log(`Running version: ${status.currentVersion}`);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
const newer = newerPublishedVersion(status.version, status.currentVersion);
|
|
49
|
+
const pinnedBehind = status.version?.tracking === 'pinned' && newer !== null;
|
|
50
|
+
this.printImage('api', status.api, pinnedBehind);
|
|
51
|
+
this.printImage('web', status.web, pinnedBehind);
|
|
48
52
|
const failed = [status.api, status.web].filter((image) => image.error);
|
|
49
53
|
for (const image of failed)
|
|
50
54
|
this.logToStderr(warnLine(image.error ?? 'Registry lookup failed.'));
|
|
@@ -54,6 +58,22 @@ export default class UpdatePanel extends Command {
|
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
const available = status.api.updateAvailable || status.web.updateAvailable;
|
|
61
|
+
if (newer)
|
|
62
|
+
this.log(`Latest published version: ${newer}`);
|
|
63
|
+
// A pinned tag never moves with pull, whatever the digests say (they differ from the baseline of the
|
|
64
|
+
// newer release), so applying cannot reach `newer`.
|
|
65
|
+
if (pinnedBehind && newer) {
|
|
66
|
+
for (const line of pinnedAdvice(newer, status.currentVersion))
|
|
67
|
+
this.logToStderr(warnLine(line));
|
|
68
|
+
if (flags.apply)
|
|
69
|
+
this.error('Not applying: this install is pinned to a version tag, so the update would not change the version.');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!available && newer) {
|
|
73
|
+
// Following `latest` (or tracking unknown) but the digest check sees nothing: be honest, do not say "up to date".
|
|
74
|
+
this.log(`A newer version (${newer}) is published, but the image digests did not change yet. Check again shortly, or run \`aoox reinstall\` if this persists.`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
57
77
|
if (!available) {
|
|
58
78
|
this.log(successLine('Already up to date.'));
|
|
59
79
|
return;
|
|
@@ -71,15 +91,15 @@ export default class UpdatePanel extends Command {
|
|
|
71
91
|
suggestions: ['Make sure INSTALL_DIR is set in the panel .env.dist, then restart the stack and try again.'],
|
|
72
92
|
});
|
|
73
93
|
}
|
|
74
|
-
if (error instanceof ApiError && error.status === 502) {
|
|
94
|
+
if (error instanceof ApiError && (error.status === 502 || error.status === 409)) {
|
|
75
95
|
this.error(error.message);
|
|
76
96
|
}
|
|
77
97
|
throw error;
|
|
78
98
|
}
|
|
79
99
|
this.log(successLine('Update applied — the panel will restart for a few seconds to apply it.'));
|
|
80
100
|
}
|
|
81
|
-
printImage(label, status) {
|
|
82
|
-
const state = status.error ? 'lookup failed' : status.currentDigest === null ? 'new baseline' : status.updateAvailable ? 'update available' : 'up to date';
|
|
101
|
+
printImage(label, status, pinnedBehind = false) {
|
|
102
|
+
const state = pinnedBehind ? 'pinned to a version tag' : status.error ? 'lookup failed' : status.currentDigest === null ? 'new baseline' : status.updateAvailable ? 'update available' : 'up to date';
|
|
83
103
|
this.log(` ${label}: ${status.image} (${state})`);
|
|
84
104
|
}
|
|
85
105
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The `version` block of `GET /instance/update` (absent on older APIs). */
|
|
2
|
+
export interface VersionBlock {
|
|
3
|
+
applying?: boolean;
|
|
4
|
+
currentVersion?: string;
|
|
5
|
+
latestVersion: null | string;
|
|
6
|
+
trackedTag?: null | string;
|
|
7
|
+
tracking: 'latest' | 'pinned' | 'unknown';
|
|
8
|
+
updateAvailable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** The published version when it is strictly newer than the running one; null otherwise (or when unknown). */
|
|
11
|
+
export declare function newerPublishedVersion(version: undefined | VersionBlock, running: string): null | string;
|
|
12
|
+
/** Lines explaining why a pinned install does not move to `latest`, and what to do. */
|
|
13
|
+
export declare function pinnedAdvice(latest: string, running: string): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { compareVersions } from './version.js';
|
|
2
|
+
/** The published version when it is strictly newer than the running one; null otherwise (or when unknown). */
|
|
3
|
+
export function newerPublishedVersion(version, running) {
|
|
4
|
+
const latest = version?.latestVersion;
|
|
5
|
+
if (!latest)
|
|
6
|
+
return null;
|
|
7
|
+
const cmp = compareVersions(latest, running);
|
|
8
|
+
return cmp !== null && cmp > 0 ? latest : null;
|
|
9
|
+
}
|
|
10
|
+
/** Lines explaining why a pinned install does not move to `latest`, and what to do. */
|
|
11
|
+
export function pinnedAdvice(latest, running) {
|
|
12
|
+
return [
|
|
13
|
+
`A newer version is published: ${latest} (running ${running}).`,
|
|
14
|
+
'This install is pinned to a version tag (API_IMAGE / WEB_IMAGE), so `docker compose pull` never moves it and `aoox update panel --apply` would not change the version.',
|
|
15
|
+
'To upgrade: in <install dir>/.env.dist set API_IMAGE and WEB_IMAGE to the new tag',
|
|
16
|
+
` (hideandseeklab/aoox-api:${latest} and hideandseeklab/aoox-web:${latest}),`,
|
|
17
|
+
' or delete those two lines to follow `latest`; then run `sudo aoox reinstall` (it pulls and recreates the containers, which keep their old env until recreated).',
|
|
18
|
+
];
|
|
19
|
+
}
|
package/oclif.manifest.json
CHANGED