@hideandseeklab/aoox 0.1.0-alpha.10 → 0.1.0-alpha.12

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 (52) hide show
  1. package/README.md +131 -43
  2. package/assets/install/docker-compose.dist.yml +6 -0
  3. package/bin/dev.js +8 -2
  4. package/bin/run.js +6 -2
  5. package/dist/commands/deploy.js +8 -7
  6. package/dist/commands/domain/clear.d.ts +16 -0
  7. package/dist/commands/domain/clear.js +61 -0
  8. package/dist/commands/domain/set.d.ts +1 -0
  9. package/dist/commands/domain/set.js +15 -3
  10. package/dist/commands/env/promote.js +2 -1
  11. package/dist/commands/env/pull.js +4 -3
  12. package/dist/commands/env/push.js +3 -2
  13. package/dist/commands/env/set.js +2 -1
  14. package/dist/commands/env/unset.js +3 -2
  15. package/dist/commands/install.js +13 -12
  16. package/dist/commands/link.js +5 -4
  17. package/dist/commands/login.js +4 -3
  18. package/dist/commands/registry/build.d.ts +3 -1
  19. package/dist/commands/registry/build.js +12 -6
  20. package/dist/commands/registry/domain.js +3 -2
  21. package/dist/commands/registry/push.d.ts +2 -1
  22. package/dist/commands/registry/push.js +6 -3
  23. package/dist/commands/reinstall.js +23 -8
  24. package/dist/commands/run.js +3 -2
  25. package/dist/commands/update/panel.js +4 -3
  26. package/dist/commands/update.js +6 -5
  27. package/dist/commands/whoami.js +2 -1
  28. package/dist/lib/api.js +2 -2
  29. package/dist/lib/compose-version.d.ts +26 -0
  30. package/dist/lib/compose-version.js +61 -0
  31. package/dist/lib/discovery.d.ts +24 -2
  32. package/dist/lib/discovery.js +97 -3
  33. package/dist/lib/env-command.d.ts +1 -1
  34. package/dist/lib/env-command.js +4 -3
  35. package/dist/lib/image-confirm.d.ts +38 -0
  36. package/dist/lib/image-confirm.js +102 -0
  37. package/dist/lib/image-source.d.ts +59 -0
  38. package/dist/lib/image-source.js +261 -0
  39. package/dist/lib/interrupt.d.ts +19 -0
  40. package/dist/lib/interrupt.js +42 -0
  41. package/dist/lib/manifest-parsers.d.ts +23 -0
  42. package/dist/lib/manifest-parsers.js +152 -0
  43. package/dist/lib/registry-image-command.d.ts +20 -3
  44. package/dist/lib/registry-image-command.js +56 -14
  45. package/dist/lib/run-banner.d.ts +3 -12
  46. package/dist/lib/run-banner.js +2 -23
  47. package/dist/lib/style.d.ts +34 -0
  48. package/dist/lib/style.js +75 -0
  49. package/dist/lib/system-ca.d.ts +20 -0
  50. package/dist/lib/system-ca.js +29 -0
  51. package/oclif.manifest.json +138 -61
  52. 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-alpha.10 linux-x64 node-v24.21.0
30
+ @hideandseeklab/aoox/0.1.0-alpha.12 linux-x64 node-v24.21.0
31
31
  $ aoox --help [COMMAND]
32
32
  USAGE
33
33
  $ aoox COMMAND
@@ -81,9 +81,46 @@ npm run build
81
81
  npm link # or: npm install -g .
82
82
  ```
83
83
 
84
+ ## Image name and version from the project
85
+
86
+ `aoox registry build` and `aoox registry push` do not need `name:version` typed in full. With no argument (or a name without a version) the CLI fills the gaps, in this order, from the build context (`push`: the current directory); the first source that has the value wins and is named in the output:
87
+
88
+ | # | Source | Name | Version |
89
+ | - | ------ | ---- | ------- |
90
+ | 1 | `package.json` | `name`, npm scope removed (`@acme/web` becomes `web`) | `version` |
91
+ | 2 | `pyproject.toml` | `[project]` or `[tool.poetry]` name | version (skipped when `dynamic`) |
92
+ | 3 | `Cargo.toml` | `[package]` name | `[package]` version (not a workspace one) |
93
+ | 4 | `composer.json` | `name`, vendor removed | `version`, if present |
94
+ | 5 | `pubspec.yaml` | `name` | `version` |
95
+ | 6 | `*.csproj` (exactly one) | `AssemblyName`, else the file name | `Version`, or `VersionPrefix`-`VersionSuffix` |
96
+ | 7 | `pom.xml` | project `artifactId` | project `version` (not the parent's) |
97
+ | 8 | `VERSION` | - | first non-empty line |
98
+ | 9 | git tag | - | the tag HEAD is exactly on, leading `v` removed |
99
+ | 10 | folder name | the folder, lowercased | - |
100
+
101
+ Names are lowercased; a `+` in a version becomes `_` (tags cannot contain it). A value that cannot be read with certainty (an MSBuild `$(...)` or Maven `${...}` variable, `version.workspace`) is skipped. If HEAD is past the last tag the CLI refuses instead of guessing (tag it, type `name:version`, or `--force` to use the `git describe` form `1.4.2-3-gabc1234`). Because the result is derived, the CLI prints where it came from and asks `Build web:1.4.2? (Y/n/e)` first (`Y` continue, `n` abort, `e` edit); `--yes` skips the question, and without a terminal (or with `CI` set) it refuses and asks for `name:version` or `--yes`. A fully typed `name:version` never asks. The "version already exists" check still applies, so forgetting to bump the version never overwrites an image.
102
+
103
+ ## Colours
104
+
105
+ Step lines (`==> ...`), results, warnings and hints are coloured when the output is a terminal. `NO_COLOR=1` turns colour off, `FORCE_COLOR=1` turns it on without a terminal (for example in some CI logs). Output meant for pipes (`aoox env pull` to stdout) and docker's own output are never coloured by the CLI.
106
+
107
+ ## Behind an antivirus or corporate proxy
108
+
109
+ Antivirus HTTPS scanning (AVG, Avast, Kaspersky, ESET, Bitdefender) and corporate proxies (Zscaler,
110
+ Netskope, Fortinet, Palo Alto) re-sign HTTPS traffic with their own root certificate, which is
111
+ installed in the operating system's store but unknown to Node. On Node 22.19+ / 24.5+ aoox trusts
112
+ the system store in addition to Node's bundled list, so this works without any setup. Certificate
113
+ verification is never turned off.
114
+
115
+ - `AOOX_SYSTEM_CA=0` opts out (Node's bundled list only).
116
+ - `NODE_EXTRA_CA_CERTS=<root.pem>` still works and is kept.
117
+ - On older Node, set `NODE_OPTIONS=--use-system-ca` (Node 22.15+/23.10+), or upgrade Node, or add the panel's domain to the antivirus HTTPS-scanning exclusions.
118
+ - If verification still fails because of an unknown issuer, the error names the issuer it saw.
119
+
84
120
  # Commands
85
121
  <!-- commands -->
86
122
  * [`aoox deploy`](#aoox-deploy)
123
+ * [`aoox domain clear`](#aoox-domain-clear)
87
124
  * [`aoox domain set`](#aoox-domain-set)
88
125
  * [`aoox env diff`](#aoox-env-diff)
89
126
  * [`aoox env history`](#aoox-env-history)
@@ -111,9 +148,9 @@ npm link # or: npm install -g .
111
148
  * [`aoox plugins uninstall [PLUGIN]`](#aoox-plugins-uninstall-plugin)
112
149
  * [`aoox plugins unlink [PLUGIN]`](#aoox-plugins-unlink-plugin)
113
150
  * [`aoox plugins update`](#aoox-plugins-update)
114
- * [`aoox registry build IMAGE`](#aoox-registry-build-image)
151
+ * [`aoox registry build [IMAGE]`](#aoox-registry-build-image)
115
152
  * [`aoox registry domain`](#aoox-registry-domain)
116
- * [`aoox registry push IMAGE`](#aoox-registry-push-image)
153
+ * [`aoox registry push [IMAGE]`](#aoox-registry-push-image)
117
154
  * [`aoox reinstall`](#aoox-reinstall)
118
155
  * [`aoox run`](#aoox-run)
119
156
  * [`aoox update`](#aoox-update)
@@ -147,7 +184,32 @@ EXAMPLES
147
184
  $ aoox deploy --tag v1.2.3
148
185
  ```
149
186
 
150
- _See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/deploy.ts)_
187
+ _See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/deploy.ts)_
188
+
189
+ ## `aoox domain clear`
190
+
191
+ Remove the custom domain of the panel itself and go back to IP access (IP:3000) through the running panel API
192
+
193
+ ```
194
+ USAGE
195
+ $ aoox domain clear [-t <value>] [-u <value>] [-y]
196
+
197
+ FLAGS
198
+ -t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
199
+ -u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
200
+ https://dashboard.example.com); defaults to the value from `aoox login`
201
+ -y, --yes Do not ask for confirmation
202
+
203
+ DESCRIPTION
204
+ Remove the custom domain of the panel itself and go back to IP access (IP:3000) through the running panel API
205
+
206
+ EXAMPLES
207
+ $ aoox domain clear
208
+
209
+ $ aoox domain clear --yes
210
+ ```
211
+
212
+ _See code: [src/commands/domain/clear.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/domain/clear.ts)_
151
213
 
152
214
  ## `aoox domain set`
153
215
 
@@ -155,7 +217,7 @@ Set a custom domain for the panel itself (not an application) through the runnin
155
217
 
156
218
  ```
157
219
  USAGE
158
- $ aoox domain set --api <value> --web <value> [-t <value>] [-u <value>] [--acme-email <value>]
220
+ $ aoox domain set --api <value> --web <value> [-t <value>] [-u <value>] [--acme-email <value>] [--domain-only]
159
221
 
160
222
  FLAGS
161
223
  -t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
@@ -163,6 +225,9 @@ FLAGS
163
225
  https://dashboard.example.com); defaults to the value from `aoox login`
164
226
  --acme-email=<value> Email for the Let's Encrypt certificate
165
227
  --api=<value> (required) Domain for the panel API
228
+ --[no-]domain-only Only allow access through the domain: ports 3000/3001 listen on 127.0.0.1 only (default:
229
+ keep the current setting). Use --no-domain-only to open them again. Make sure the domain
230
+ works first, or you lose IP:port access
166
231
  --web=<value> (required) Domain for the panel dashboard
167
232
 
168
233
  DESCRIPTION
@@ -172,9 +237,11 @@ EXAMPLES
172
237
  $ aoox domain set --web panel.example.com --api api.example.com
173
238
 
174
239
  $ aoox domain set --web panel.example.com --api api.example.com --acme-email you@example.com
240
+
241
+ $ aoox domain set --web panel.example.com --api api.example.com --domain-only
175
242
  ```
176
243
 
177
- _See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/domain/set.ts)_
244
+ _See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/domain/set.ts)_
178
245
 
179
246
  ## `aoox env diff`
180
247
 
@@ -207,7 +274,7 @@ EXAMPLES
207
274
  $ aoox env diff --set shared --from staging --to production
208
275
  ```
209
276
 
210
- _See code: [src/commands/env/diff.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/diff.ts)_
277
+ _See code: [src/commands/env/diff.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/diff.ts)_
211
278
 
212
279
  ## `aoox env history`
213
280
 
@@ -243,7 +310,7 @@ EXAMPLES
243
310
  $ aoox env history --limit 5 --json
244
311
  ```
245
312
 
246
- _See code: [src/commands/env/history.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/history.ts)_
313
+ _See code: [src/commands/env/history.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/history.ts)_
247
314
 
248
315
  ## `aoox env link`
249
316
 
@@ -277,7 +344,7 @@ EXAMPLES
277
344
  $ aoox env link --set defaults --env production --position 1
278
345
  ```
279
346
 
280
- _See code: [src/commands/env/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/link.ts)_
347
+ _See code: [src/commands/env/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/link.ts)_
281
348
 
282
349
  ## `aoox env links`
283
350
 
@@ -307,7 +374,7 @@ EXAMPLES
307
374
  $ aoox env links --stack <id>
308
375
  ```
309
376
 
310
- _See code: [src/commands/env/links.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/links.ts)_
377
+ _See code: [src/commands/env/links.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/links.ts)_
311
378
 
312
379
  ## `aoox env list`
313
380
 
@@ -349,7 +416,7 @@ EXAMPLES
349
416
  $ aoox env list --set shared --env development --reveal
350
417
  ```
351
418
 
352
- _See code: [src/commands/env/list.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/list.ts)_
419
+ _See code: [src/commands/env/list.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/list.ts)_
353
420
 
354
421
  ## `aoox env promote`
355
422
 
@@ -384,7 +451,7 @@ EXAMPLES
384
451
  $ aoox env promote --from development --to staging --all --yes
385
452
  ```
386
453
 
387
- _See code: [src/commands/env/promote.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/promote.ts)_
454
+ _See code: [src/commands/env/promote.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/promote.ts)_
388
455
 
389
456
  ## `aoox env pull`
390
457
 
@@ -428,7 +495,7 @@ EXAMPLES
428
495
  $ aoox env pull --format shell --file -
429
496
  ```
430
497
 
431
- _See code: [src/commands/env/pull.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/pull.ts)_
498
+ _See code: [src/commands/env/pull.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/pull.ts)_
432
499
 
433
500
  ## `aoox env push`
434
501
 
@@ -462,7 +529,7 @@ EXAMPLES
462
529
  $ aoox env push --file .env.staging --set shared --env staging --yes
463
530
  ```
464
531
 
465
- _See code: [src/commands/env/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/push.ts)_
532
+ _See code: [src/commands/env/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/push.ts)_
466
533
 
467
534
  ## `aoox env set ASSIGNMENTS`
468
535
 
@@ -501,7 +568,7 @@ EXAMPLES
501
568
  $ aoox env set API_TOKEN=abc123 --secret
502
569
  ```
503
570
 
504
- _See code: [src/commands/env/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/set.ts)_
571
+ _See code: [src/commands/env/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/set.ts)_
505
572
 
506
573
  ## `aoox env sets`
507
574
 
@@ -575,7 +642,7 @@ EXAMPLES
575
642
  $ aoox env unlink --position 2
576
643
  ```
577
644
 
578
- _See code: [src/commands/env/unlink.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/unlink.ts)_
645
+ _See code: [src/commands/env/unlink.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/unlink.ts)_
579
646
 
580
647
  ## `aoox env unset KEYS`
581
648
 
@@ -609,7 +676,7 @@ EXAMPLES
609
676
  $ aoox env unset A B --set shared --env staging
610
677
  ```
611
678
 
612
- _See code: [src/commands/env/unset.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/env/unset.ts)_
679
+ _See code: [src/commands/env/unset.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/env/unset.ts)_
613
680
 
614
681
  ## `aoox help [COMMAND]`
615
682
 
@@ -665,11 +732,11 @@ EXAMPLES
665
732
  sudo aoox install --web-domain panel.example.com --api-domain api.panel.example.com --acme-email me@example.com
666
733
  ```
667
734
 
668
- _See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/install.ts)_
735
+ _See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/install.ts)_
669
736
 
670
737
  ## `aoox link`
671
738
 
672
- Link this folder to an application in the panel (used by `aoox deploy`/`aoox logs`)
739
+ Link this folder to an application in the panel (used by `aoox deploy`, `aoox run` without `--set`/`--env`, and the `aoox env` defaults and links)
673
740
 
674
741
  ```
675
742
  USAGE
@@ -683,7 +750,8 @@ FLAGS
683
750
  --project=<value> Project ID; skip the interactive selection
684
751
 
685
752
  DESCRIPTION
686
- Link this folder to an application in the panel (used by `aoox deploy`/`aoox logs`)
753
+ Link this folder to an application in the panel (used by `aoox deploy`, `aoox run` without `--set`/`--env`, and the
754
+ `aoox env` defaults and links)
687
755
 
688
756
  EXAMPLES
689
757
  $ aoox link
@@ -691,7 +759,7 @@ EXAMPLES
691
759
  $ aoox link --project <id> --app <id>
692
760
  ```
693
761
 
694
- _See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/link.ts)_
762
+ _See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/link.ts)_
695
763
 
696
764
  ## `aoox login`
697
765
 
@@ -717,7 +785,7 @@ EXAMPLES
717
785
  $ aoox login --url 203.0.113.10:3000 --token aoox_xxx
718
786
  ```
719
787
 
720
- _See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/login.ts)_
788
+ _See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/login.ts)_
721
789
 
722
790
  ## `aoox plugins`
723
791
 
@@ -1009,34 +1077,45 @@ DESCRIPTION
1009
1077
 
1010
1078
  _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/5.5.2/src/commands/plugins/update.ts)_
1011
1079
 
1012
- ## `aoox registry build IMAGE`
1080
+ ## `aoox registry build [IMAGE]`
1013
1081
 
1014
- Build an image from a Dockerfile, named for the aoox registry (refuses a version that already exists there)
1082
+ Build an image from a Dockerfile, named for the aoox registry (refuses a version that already exists there). A name or version you leave out is taken from the project (you confirm it first, or pass --yes)
1015
1083
 
1016
1084
  ```
1017
1085
  USAGE
1018
- $ aoox registry build IMAGE [-t <value>] [-u <value>] [--force] [--registry <value>] [--context <value>] [-f
1019
- <value>] [--push]
1086
+ $ aoox registry build [IMAGE] [-t <value>] [-u <value>] [--force] [--registry <value>] [-y] [--context <value>]
1087
+ [-f <value>] [--push]
1020
1088
 
1021
1089
  ARGUMENTS
1022
- IMAGE Image name and version, e.g. myapp:1.0.0
1090
+ [IMAGE] Image name and version, e.g. myapp:1.0.0. Omit it (or the version) to read them from the project in the build
1091
+ context: package.json, pyproject.toml, Cargo.toml, composer.json, pubspec.yaml, *.csproj, pom.xml, a VERSION
1092
+ file or a git tag
1023
1093
 
1024
1094
  FLAGS
1025
1095
  -f, --dockerfile=<value> [default: Dockerfile] Path to the Dockerfile
1026
1096
  -t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
1027
1097
  -u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
1028
1098
  https://dashboard.example.com); defaults to the value from `aoox login`
1099
+ -y, --yes Do not ask to confirm an image name or version taken from the project
1029
1100
  --context=<value> [default: .] Docker build context
1030
- --force Overwrite a version that already exists in the registry
1101
+ --force Overwrite a version that already exists in the registry (also lets a version be taken from a
1102
+ git tag HEAD is past)
1031
1103
  --push Push the image to the registry right after the build
1032
1104
  --registry=<value> Registry ID; defaults to the self-hosted registry
1033
1105
 
1034
1106
  DESCRIPTION
1035
- Build an image from a Dockerfile, named for the aoox registry (refuses a version that already exists there)
1107
+ Build an image from a Dockerfile, named for the aoox registry (refuses a version that already exists there). A name or
1108
+ version you leave out is taken from the project (you confirm it first, or pass --yes)
1036
1109
 
1037
1110
  EXAMPLES
1038
1111
  $ aoox registry build myapp:1.0.0
1039
1112
 
1113
+ $ aoox registry build --push
1114
+
1115
+ $ aoox registry build myapp --context ./app
1116
+
1117
+ $ aoox registry build --push --yes
1118
+
1040
1119
  $ aoox registry build myapp:1.0.0 --push
1041
1120
 
1042
1121
  $ aoox registry build team/api:2.1.0 -f docker/Dockerfile --context .
@@ -1044,7 +1123,7 @@ EXAMPLES
1044
1123
  $ aoox registry build myapp:1.0.0 --force
1045
1124
  ```
1046
1125
 
1047
- _See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/registry/build.ts)_
1126
+ _See code: [src/commands/registry/build.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/registry/build.ts)_
1048
1127
 
1049
1128
  ## `aoox registry domain`
1050
1129
 
@@ -1070,38 +1149,47 @@ EXAMPLES
1070
1149
  $ aoox registry domain --clear
1071
1150
  ```
1072
1151
 
1073
- _See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/registry/domain.ts)_
1152
+ _See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/registry/domain.ts)_
1074
1153
 
1075
- ## `aoox registry push IMAGE`
1154
+ ## `aoox registry push [IMAGE]`
1076
1155
 
1077
- Push a local image to the aoox registry (refuses a version that already exists there)
1156
+ Push a local image to the aoox registry (refuses a version that already exists there). A name or version you leave out is taken from the project (you confirm it first, or pass --yes)
1078
1157
 
1079
1158
  ```
1080
1159
  USAGE
1081
- $ aoox registry push IMAGE [-t <value>] [-u <value>] [--force] [--registry <value>]
1160
+ $ aoox registry push [IMAGE] [-t <value>] [-u <value>] [--force] [--registry <value>] [-y]
1082
1161
 
1083
1162
  ARGUMENTS
1084
- IMAGE Image name and version (short or full), e.g. myapp:1.0.0
1163
+ [IMAGE] Image name and version (short or full), e.g. myapp:1.0.0. Omit it (or the version) to read them from the
1164
+ project in the current directory: package.json, pyproject.toml, Cargo.toml, composer.json, pubspec.yaml,
1165
+ *.csproj, pom.xml, a VERSION file or a git tag
1085
1166
 
1086
1167
  FLAGS
1087
1168
  -t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
1088
1169
  -u, --url=<value> [env: AOOX_URL] Dashboard URL (the address you open the dashboard with, e.g.
1089
1170
  https://dashboard.example.com); defaults to the value from `aoox login`
1090
- --force Overwrite a version that already exists in the registry
1171
+ -y, --yes Do not ask to confirm an image name or version taken from the project
1172
+ --force Overwrite a version that already exists in the registry (also lets a version be taken from a
1173
+ git tag HEAD is past)
1091
1174
  --registry=<value> Registry ID; defaults to the self-hosted registry
1092
1175
 
1093
1176
  DESCRIPTION
1094
- Push a local image to the aoox registry (refuses a version that already exists there)
1177
+ Push a local image to the aoox registry (refuses a version that already exists there). A name or version you leave out
1178
+ is taken from the project (you confirm it first, or pass --yes)
1095
1179
 
1096
1180
  EXAMPLES
1097
1181
  $ aoox registry push myapp:1.0.0
1098
1182
 
1183
+ $ aoox registry push
1184
+
1185
+ $ aoox registry push myapp
1186
+
1099
1187
  $ aoox registry push registry.example.com/myapp:1.0.0
1100
1188
 
1101
1189
  $ aoox registry push myapp:1.0.0 --force
1102
1190
  ```
1103
1191
 
1104
- _See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/registry/push.ts)_
1192
+ _See code: [src/commands/registry/push.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/registry/push.ts)_
1105
1193
 
1106
1194
  ## `aoox reinstall`
1107
1195
 
@@ -1131,7 +1219,7 @@ EXAMPLES
1131
1219
  sudo aoox reinstall --yes --terminal-ssh-user root
1132
1220
  ```
1133
1221
 
1134
- _See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/reinstall.ts)_
1222
+ _See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/reinstall.ts)_
1135
1223
 
1136
1224
  ## `aoox run`
1137
1225
 
@@ -1176,7 +1264,7 @@ EXAMPLES
1176
1264
  $ aoox run --quiet -- npm run dev
1177
1265
  ```
1178
1266
 
1179
- _See code: [src/commands/run.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/run.ts)_
1267
+ _See code: [src/commands/run.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/run.ts)_
1180
1268
 
1181
1269
  ## `aoox update`
1182
1270
 
@@ -1198,7 +1286,7 @@ EXAMPLES
1198
1286
  $ aoox update --check
1199
1287
  ```
1200
1288
 
1201
- _See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/update.ts)_
1289
+ _See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/update.ts)_
1202
1290
 
1203
1291
  ## `aoox update panel`
1204
1292
 
@@ -1223,7 +1311,7 @@ EXAMPLES
1223
1311
  $ aoox update panel --apply
1224
1312
  ```
1225
1313
 
1226
- _See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/update/panel.ts)_
1314
+ _See code: [src/commands/update/panel.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/update/panel.ts)_
1227
1315
 
1228
1316
  ## `aoox whoami`
1229
1317
 
@@ -1250,7 +1338,7 @@ EXAMPLES
1250
1338
  $ aoox whoami --json
1251
1339
  ```
1252
1340
 
1253
- _See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.10/src/commands/whoami.ts)_
1341
+ _See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.12/src/commands/whoami.ts)_
1254
1342
  <!-- commandsstop -->
1255
1343
 
1256
1344
  ## Versioning
@@ -102,6 +102,9 @@ services:
102
102
  CONTAINER_LOG_MAX_FILE: ${CONTAINER_LOG_MAX_FILE:-3}
103
103
  # Public IP app domains must point at (DNS check); auto-detected when empty.
104
104
  PUBLIC_IP: ${PUBLIC_IP:-}
105
+ # Host port the web is published on (same value as the `web` port mapping); only used
106
+ # to tell the owner where to reopen the dashboard after removing the panel domain.
107
+ WEB_PORT: ${WEB_PORT:-3000}
105
108
  STORAGE_PATH: ${STORAGE_PATH:-}
106
109
  # Absolute path, on this host, of the folder holding this file — required
107
110
  # only for Settings -> "Domain panel" (lets the API write
@@ -121,6 +124,9 @@ services:
121
124
  # (<app>-pr<N>.<domain>, needs a wildcard DNS record).
122
125
  WEBHOOK_VERIFY_GITHUB_IP: ${WEBHOOK_VERIFY_GITHUB_IP:-}
123
126
  PREVIEW_DOMAIN: ${PREVIEW_DOMAIN:-}
127
+ # Which proxy hops may set the client IP (X-Forwarded-For). Empty = private networks
128
+ # only (Traefik, the web container); see TRUST_PROXY in .env.dist.example.
129
+ TRUST_PROXY: ${TRUST_PROXY:-}
124
130
  # The api container runs as the unprivileged `node` user; add the gid that
125
131
  # owns the docker socket on the host (stat -c %g /var/run/docker.sock).
126
132
  group_add:
package/bin/dev.js CHANGED
@@ -4,12 +4,18 @@
4
4
  // so importing straight from src/ — instead of duplicating
5
5
  // windows-exit-fix.ts here — is fine.
6
6
  // eslint-disable-next-line n/no-unpublished-import
7
+ import {executeCli} from '../src/lib/interrupt.js'
8
+ // eslint-disable-next-line n/no-unpublished-import
9
+ import {applySystemCa} from '../src/lib/system-ca.js'
10
+ // eslint-disable-next-line n/no-unpublished-import
7
11
  import {applyWindowsExitFix} from '../src/lib/windows-exit-fix.js'
8
12
 
9
13
  // Must run before any command (and any fetch()) — see the doc comment on
10
14
  // applyWindowsExitFix for why.
11
15
  applyWindowsExitFix()
12
16
 
13
- const {execute} = await import('@oclif/core')
17
+ // Trust the OS certificate store too (antivirus HTTPS scanning, corporate proxies).
18
+ // Runs before the first fetch(); opt out with AOOX_SYSTEM_CA=0.
19
+ applySystemCa()
14
20
 
15
- await execute({development: true, dir: import.meta.url})
21
+ await executeCli({development: true, dir: import.meta.url})
package/bin/run.js CHANGED
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import {executeCli} from '../dist/lib/interrupt.js'
4
+ import {applySystemCa} from '../dist/lib/system-ca.js'
3
5
  import {applyWindowsExitFix} from '../dist/lib/windows-exit-fix.js'
4
6
 
5
7
  // Must run before any command (and any fetch()) — see the doc comment on
6
8
  // applyWindowsExitFix for why.
7
9
  applyWindowsExitFix()
8
10
 
9
- const {execute} = await import('@oclif/core')
11
+ // Trust the OS certificate store too (antivirus HTTPS scanning, corporate proxies).
12
+ // Runs before the first fetch(); opt out with AOOX_SYSTEM_CA=0.
13
+ applySystemCa()
10
14
 
11
- await execute({dir: import.meta.url})
15
+ await executeCli({dir: import.meta.url})
@@ -9,6 +9,7 @@ import { imageRefFor } from '../lib/image-ref.js';
9
9
  import { readLink } from '../lib/link.js';
10
10
  import { warnIfOutdated } from '../lib/outdated.js';
11
11
  import { chooseRegistry, localhostRegistryHint } from '../lib/registry-select.js';
12
+ import { stepLine, successLine, warnLine } from '../lib/style.js';
12
13
  /** How often to poll GET /deployments/:id while a deploy is in progress. */
13
14
  const POLL_MS = 1500;
14
15
  export default class Deploy extends Command {
@@ -38,13 +39,13 @@ export default class Deploy extends Command {
38
39
  }
39
40
  throw error;
40
41
  }
41
- await warnIfOutdated((m) => this.warn(m), this.config.version, config);
42
+ await warnIfOutdated((m) => this.logToStderr(warnLine(m)), this.config.version, config);
42
43
  const app = await this.getApplication(config, link.applicationId);
43
44
  const registry = await this.pickRegistry(config, flags.registry);
44
45
  const credentials = await api(config, `/registries/${registry.id}/credentials`);
45
46
  const localHint = localhostRegistryHint(registry.url, config.url);
46
47
  if (localHint)
47
- this.warn(localHint);
48
+ this.logToStderr(warnLine(localHint));
48
49
  const tag = flags.tag ?? deployTag(cwd);
49
50
  const imageRef = imageRefFor({ appName: app.appName, projectName: app.project.name, registryUrl: registry.url, tag });
50
51
  const engine = await dockerEngineStatus();
@@ -52,15 +53,15 @@ export default class Deploy extends Command {
52
53
  const [headline, hint] = dockerUnavailableLines(engine);
53
54
  this.error(headline, { suggestions: [hint] });
54
55
  }
55
- this.log(`==> Build ${imageRef}`);
56
+ this.log(stepLine('Build', imageRef));
56
57
  await dockerInherit(['build', '-t', imageRef, '-f', flags.dockerfile, flags.context], cwd);
57
58
  if (credentials.username && credentials.password) {
58
- this.log(`==> docker login ${registry.url}`);
59
+ this.log(stepLine('docker login', registry.url));
59
60
  await dockerLogin(registry.url, credentials.username, credentials.password, cwd);
60
61
  }
61
- this.log(`==> Push ${imageRef}`);
62
+ this.log(stepLine('Push', imageRef));
62
63
  await dockerInherit(['push', imageRef], cwd);
63
- this.log('==> Updating the application & triggering a deploy');
64
+ this.log(stepLine('Updating the application & triggering a deploy'));
64
65
  await api(config, `/applications/${app.id}`, {
65
66
  body: { imageRef, imageRegistryId: registry.id, sourceType: 'image' },
66
67
  method: 'PATCH',
@@ -81,7 +82,7 @@ export default class Deploy extends Command {
81
82
  printed = dep.logs.length;
82
83
  }
83
84
  if (dep.status === 'success') {
84
- this.log(`Deployed: ${dep.imageRef}`);
85
+ this.log(successLine('Deployed:', dep.imageRef ?? undefined));
85
86
  return;
86
87
  }
87
88
  if (dep.status === 'failed') {
@@ -0,0 +1,16 @@
1
+ import { Command } from '@oclif/core';
2
+ /**
3
+ * Counterpart of `aoox domain set`: calls the panel's `DELETE /instance/domain`,
4
+ * which takes the dashboard and API back to plain IP access and recreates the
5
+ * web/api containers. The reverse proxy and application domains are untouched.
6
+ */
7
+ export default class DomainClear extends Command {
8
+ static description: string;
9
+ static examples: string[];
10
+ static flags: {
11
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,61 @@
1
+ import { confirm } from '@inquirer/prompts';
2
+ import { Command, Flags } from '@oclif/core';
3
+ import { api, ApiError } from '../../lib/api.js';
4
+ import { MissingCredentialsError } from '../../lib/config.js';
5
+ import { connectionFlags, loadCredentials } from '../../lib/flags.js';
6
+ import { warnIfOutdated } from '../../lib/outdated.js';
7
+ import { successLine, warnLine } from '../../lib/style.js';
8
+ /**
9
+ * Counterpart of `aoox domain set`: calls the panel's `DELETE /instance/domain`,
10
+ * which takes the dashboard and API back to plain IP access and recreates the
11
+ * web/api containers. The reverse proxy and application domains are untouched.
12
+ */
13
+ export default class DomainClear extends Command {
14
+ static description = 'Remove the custom domain of the panel itself and go back to IP access (IP:3000) through the running panel API';
15
+ static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --yes'];
16
+ static flags = {
17
+ ...connectionFlags,
18
+ yes: Flags.boolean({ char: 'y', default: false, description: 'Do not ask for confirmation' }),
19
+ };
20
+ async run() {
21
+ const { flags } = await this.parse(DomainClear);
22
+ let config;
23
+ try {
24
+ config = await loadCredentials(this.config.configDir, flags);
25
+ }
26
+ catch (error) {
27
+ if (error instanceof MissingCredentialsError) {
28
+ this.error(error.message, { suggestions: ['Run `aoox login` against this panel first.'] });
29
+ }
30
+ throw error;
31
+ }
32
+ await warnIfOutdated((m) => this.logToStderr(warnLine(m)), this.config.version, config);
33
+ if (!flags.yes) {
34
+ const ok = await confirm({
35
+ default: false,
36
+ message: 'Remove the panel domain? The dashboard and API go back to http://<server IP>:3000 / :3001 after a short restart, and this domain stops working. Applications and their domains are not touched.',
37
+ });
38
+ if (!ok)
39
+ this.exit(0);
40
+ }
41
+ let result;
42
+ try {
43
+ result = await api(config, '/instance/domain', { method: 'DELETE' });
44
+ }
45
+ catch (error) {
46
+ if (error instanceof ApiError && error.status === 400) {
47
+ this.error(error.message, {
48
+ suggestions: ['If INSTALL_DIR is missing, set it in the panel .env.dist, restart the stack and try again.'],
49
+ });
50
+ }
51
+ if (error instanceof ApiError && error.status === 502) {
52
+ this.error(error.message, { suggestions: ['Start Docker on the panel host and try again.'] });
53
+ }
54
+ throw error;
55
+ }
56
+ this.log(successLine('Panel domain removed.'));
57
+ this.log('The panel will restart for a few seconds to go back to IP access — the connection to this API will drop briefly.');
58
+ this.log(`Reopen the dashboard at ${result.reopenUrl ?? 'http://<server IP>:3000'} afterwards.`);
59
+ this.log('Run `aoox login` again with that address if you used the domain to sign in.');
60
+ }
61
+ }
@@ -11,6 +11,7 @@ export default class DomainSet extends Command {
11
11
  static flags: {
12
12
  'acme-email': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
13
  api: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'domain-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  web: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
16
  token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
17
  url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;