@hideandseeklab/aoox 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +75 -72
- package/dist/commands/deploy.js +18 -18
- package/dist/commands/domain/set.d.ts +1 -1
- package/dist/commands/domain/set.js +14 -14
- package/dist/commands/install.d.ts +4 -1
- package/dist/commands/install.js +66 -38
- package/dist/commands/link.js +18 -18
- package/dist/commands/login.js +11 -11
- package/dist/commands/registry/domain.js +9 -9
- package/dist/commands/reinstall.js +33 -33
- package/dist/commands/update.js +9 -9
- package/dist/commands/whoami.js +3 -3
- package/dist/lib/api.js +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.js +4 -4
- package/dist/lib/docker.js +2 -2
- package/dist/lib/flags.js +2 -2
- package/dist/lib/install-env.d.ts +20 -1
- package/dist/lib/install-env.js +18 -0
- package/dist/lib/link.js +2 -2
- package/dist/lib/reinstall.js +3 -3
- package/dist/lib/system.js +1 -1
- package/dist/lib/terminal-key.d.ts +74 -0
- package/dist/lib/terminal-key.js +147 -0
- package/oclif.manifest.json +56 -51
- 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.
|
|
30
|
+
@hideandseeklab/aoox/0.1.0-alpha.7 linux-x64 node-v24.21.0
|
|
31
31
|
$ aoox --help [COMMAND]
|
|
32
32
|
USAGE
|
|
33
33
|
$ aoox COMMAND
|
|
@@ -108,7 +108,7 @@ npm link # or: npm install -g .
|
|
|
108
108
|
|
|
109
109
|
## `aoox deploy`
|
|
110
110
|
|
|
111
|
-
Build image
|
|
111
|
+
Build a local image, push it to the aoox registry, then deploy (the repo must be linked with `aoox link` first)
|
|
112
112
|
|
|
113
113
|
```
|
|
114
114
|
USAGE
|
|
@@ -116,15 +116,15 @@ USAGE
|
|
|
116
116
|
<value>]
|
|
117
117
|
|
|
118
118
|
FLAGS
|
|
119
|
-
-f, --dockerfile=<value> [default: Dockerfile] Path
|
|
120
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
121
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
119
|
+
-f, --dockerfile=<value> [default: Dockerfile] Path to the Dockerfile
|
|
120
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
121
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
122
122
|
--context=<value> [default: .] Docker build context
|
|
123
|
-
--registry=<value> ID
|
|
124
|
-
--tag=<value>
|
|
123
|
+
--registry=<value> Registry ID to push to; defaults to the self-hosted registry
|
|
124
|
+
--tag=<value> Image tag; defaults to the git short SHA (+ -dirty)
|
|
125
125
|
|
|
126
126
|
DESCRIPTION
|
|
127
|
-
Build image
|
|
127
|
+
Build a local image, push it to the aoox registry, then deploy (the repo must be linked with `aoox link` first)
|
|
128
128
|
|
|
129
129
|
EXAMPLES
|
|
130
130
|
$ aoox deploy
|
|
@@ -132,25 +132,25 @@ EXAMPLES
|
|
|
132
132
|
$ aoox deploy --tag v1.2.3
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
135
|
+
_See code: [src/commands/deploy.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/deploy.ts)_
|
|
136
136
|
|
|
137
137
|
## `aoox domain set`
|
|
138
138
|
|
|
139
|
-
Set domain
|
|
139
|
+
Set a custom domain for the panel itself (not an application) through the running panel API
|
|
140
140
|
|
|
141
141
|
```
|
|
142
142
|
USAGE
|
|
143
143
|
$ aoox domain set --api <value> --web <value> [-t <value>] [-u <value>] [--acme-email <value>]
|
|
144
144
|
|
|
145
145
|
FLAGS
|
|
146
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
147
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
148
|
-
--acme-email=<value> Email
|
|
149
|
-
--api=<value> (required) Domain
|
|
150
|
-
--web=<value> (required) Domain
|
|
146
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
147
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
148
|
+
--acme-email=<value> Email for the Let's Encrypt certificate
|
|
149
|
+
--api=<value> (required) Domain for the panel API
|
|
150
|
+
--web=<value> (required) Domain for the panel dashboard
|
|
151
151
|
|
|
152
152
|
DESCRIPTION
|
|
153
|
-
Set domain
|
|
153
|
+
Set a custom domain for the panel itself (not an application) through the running panel API
|
|
154
154
|
|
|
155
155
|
EXAMPLES
|
|
156
156
|
$ aoox domain set --web panel.example.com --api api.example.com
|
|
@@ -158,7 +158,7 @@ EXAMPLES
|
|
|
158
158
|
$ aoox domain set --web panel.example.com --api api.example.com --acme-email you@example.com
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
161
|
+
_See code: [src/commands/domain/set.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/domain/set.ts)_
|
|
162
162
|
|
|
163
163
|
## `aoox help [COMMAND]`
|
|
164
164
|
|
|
@@ -182,28 +182,31 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.3.0/
|
|
|
182
182
|
|
|
183
183
|
## `aoox install`
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Install aoox (postgres + api + web) on a fresh VPS with Docker Compose
|
|
186
186
|
|
|
187
187
|
```
|
|
188
188
|
USAGE
|
|
189
189
|
$ aoox install [--acme-email <value>] [--admin-name <value> --admin-email <value>] [--admin-password
|
|
190
|
-
<value> ] [--api-domain <value> --web-domain <value>] [--dir <value>] [--force] [--terminal-
|
|
190
|
+
<value> ] [--api-domain <value> --web-domain <value>] [--dir <value>] [--force] [--no-terminal-authorize]
|
|
191
|
+
[--terminal-ssh-user <value>] [-y]
|
|
191
192
|
|
|
192
193
|
FLAGS
|
|
193
|
-
-y, --yes
|
|
194
|
-
--acme-email=<value>
|
|
195
|
-
--admin-email=<value>
|
|
196
|
-
--admin-name=<value>
|
|
197
|
-
--admin-password=<value> Password owner
|
|
198
|
-
--api-domain=<value> Domain
|
|
199
|
-
--dir=<value> [default: /opt/aoox]
|
|
200
|
-
--force
|
|
201
|
-
--terminal-
|
|
202
|
-
|
|
203
|
-
--
|
|
194
|
+
-y, --yes Do not ask for any confirmation
|
|
195
|
+
--acme-email=<value> Required with --web-domain/--api-domain (Let’s Encrypt)
|
|
196
|
+
--admin-email=<value> Create the first owner without going through /setup in the browser
|
|
197
|
+
--admin-name=<value> Name of the first owner
|
|
198
|
+
--admin-password=<value> Password of the first owner (min. 8 characters)
|
|
199
|
+
--api-domain=<value> Domain for the API, served through the bundled proxy
|
|
200
|
+
--dir=<value> [default: /opt/aoox] Installation directory
|
|
201
|
+
--force Overwrite an existing installation in --dir
|
|
202
|
+
--no-terminal-authorize Do not create/authorize the web Terminal SSH key automatically (do it in Settings >
|
|
203
|
+
Terminal instead)
|
|
204
|
+
--terminal-ssh-user=<value> SSH user the web Terminal uses to log in to this host (default: the user running
|
|
205
|
+
sudo, or root if there is none)
|
|
206
|
+
--web-domain=<value> Domain for the web panel, served through the bundled proxy
|
|
204
207
|
|
|
205
208
|
DESCRIPTION
|
|
206
|
-
|
|
209
|
+
Install aoox (postgres + api + web) on a fresh VPS with Docker Compose
|
|
207
210
|
|
|
208
211
|
EXAMPLES
|
|
209
212
|
sudo aoox install
|
|
@@ -211,24 +214,24 @@ EXAMPLES
|
|
|
211
214
|
sudo aoox install --web-domain panel.example.com --api-domain api.panel.example.com --acme-email me@example.com
|
|
212
215
|
```
|
|
213
216
|
|
|
214
|
-
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
217
|
+
_See code: [src/commands/install.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/install.ts)_
|
|
215
218
|
|
|
216
219
|
## `aoox link`
|
|
217
220
|
|
|
218
|
-
|
|
221
|
+
Link this folder to an application in the panel (used by `aoox deploy`/`aoox logs`)
|
|
219
222
|
|
|
220
223
|
```
|
|
221
224
|
USAGE
|
|
222
225
|
$ aoox link [-t <value>] [-u <value>] [--app <value>] [--project <value>]
|
|
223
226
|
|
|
224
227
|
FLAGS
|
|
225
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
226
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
227
|
-
--app=<value> ID
|
|
228
|
-
--project=<value> ID
|
|
228
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
229
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
230
|
+
--app=<value> Application ID; skip the interactive selection
|
|
231
|
+
--project=<value> Project ID; skip the interactive selection
|
|
229
232
|
|
|
230
233
|
DESCRIPTION
|
|
231
|
-
|
|
234
|
+
Link this folder to an application in the panel (used by `aoox deploy`/`aoox logs`)
|
|
232
235
|
|
|
233
236
|
EXAMPLES
|
|
234
237
|
$ aoox link
|
|
@@ -236,22 +239,22 @@ EXAMPLES
|
|
|
236
239
|
$ aoox link --project <id> --app <id>
|
|
237
240
|
```
|
|
238
241
|
|
|
239
|
-
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
242
|
+
_See code: [src/commands/link.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/link.ts)_
|
|
240
243
|
|
|
241
244
|
## `aoox login`
|
|
242
245
|
|
|
243
|
-
|
|
246
|
+
Save the panel URL and API token for other commands
|
|
244
247
|
|
|
245
248
|
```
|
|
246
249
|
USAGE
|
|
247
250
|
$ aoox login [-t <value>] [-u <value>]
|
|
248
251
|
|
|
249
252
|
FLAGS
|
|
250
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
251
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
253
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
254
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
252
255
|
|
|
253
256
|
DESCRIPTION
|
|
254
|
-
|
|
257
|
+
Save the panel URL and API token for other commands
|
|
255
258
|
|
|
256
259
|
EXAMPLES
|
|
257
260
|
$ aoox login
|
|
@@ -259,7 +262,7 @@ EXAMPLES
|
|
|
259
262
|
$ aoox login --url https://panel.example.com --token aoox_xxx
|
|
260
263
|
```
|
|
261
264
|
|
|
262
|
-
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
265
|
+
_See code: [src/commands/login.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/login.ts)_
|
|
263
266
|
|
|
264
267
|
## `aoox plugins`
|
|
265
268
|
|
|
@@ -553,20 +556,20 @@ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
|
553
556
|
|
|
554
557
|
## `aoox registry domain`
|
|
555
558
|
|
|
556
|
-
Set
|
|
559
|
+
Set or remove the custom domain for the self-hosted registry
|
|
557
560
|
|
|
558
561
|
```
|
|
559
562
|
USAGE
|
|
560
563
|
$ aoox registry domain [-t <value>] [-u <value>] [--clear] [--set <value>]
|
|
561
564
|
|
|
562
565
|
FLAGS
|
|
563
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
564
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
565
|
-
--clear
|
|
566
|
-
--set=<value> Domain
|
|
566
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
567
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
568
|
+
--clear Remove the domain, falling back to host:port
|
|
569
|
+
--set=<value> Domain for the self-hosted registry
|
|
567
570
|
|
|
568
571
|
DESCRIPTION
|
|
569
|
-
Set
|
|
572
|
+
Set or remove the custom domain for the self-hosted registry
|
|
570
573
|
|
|
571
574
|
EXAMPLES
|
|
572
575
|
$ aoox registry domain --set registry.example.com
|
|
@@ -574,27 +577,27 @@ EXAMPLES
|
|
|
574
577
|
$ aoox registry domain --clear
|
|
575
578
|
```
|
|
576
579
|
|
|
577
|
-
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
580
|
+
_See code: [src/commands/registry/domain.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/registry/domain.ts)_
|
|
578
581
|
|
|
579
582
|
## `aoox reinstall`
|
|
580
583
|
|
|
581
|
-
|
|
584
|
+
Repair/refresh an existing aoox installation without losing data: rewrite compose, merge .env.dist (secrets are never regenerated), then pull + recreate
|
|
582
585
|
|
|
583
586
|
```
|
|
584
587
|
USAGE
|
|
585
588
|
$ aoox reinstall [--dir <value>] [--dry-run] [--no-pull] [--terminal-ssh-user <value>] [-y]
|
|
586
589
|
|
|
587
590
|
FLAGS
|
|
588
|
-
-y, --yes
|
|
589
|
-
--dir=<value> [default: /opt/aoox]
|
|
590
|
-
--dry-run
|
|
591
|
-
|
|
592
|
-
--no-pull
|
|
593
|
-
--terminal-ssh-user=<value>
|
|
591
|
+
-y, --yes Do not ask for confirmation
|
|
592
|
+
--dir=<value> [default: /opt/aoox] Installation directory
|
|
593
|
+
--dry-run Print the plan (changed files, keys to add, compose commands) without changing
|
|
594
|
+
anything
|
|
595
|
+
--no-pull Skip docker compose pull (use the images already present)
|
|
596
|
+
--terminal-ssh-user=<value> Set/overwrite TERMINAL_SSH_USER in .env.dist during repair
|
|
594
597
|
|
|
595
598
|
DESCRIPTION
|
|
596
|
-
|
|
597
|
-
|
|
599
|
+
Repair/refresh an existing aoox installation without losing data: rewrite compose, merge .env.dist (secrets are never
|
|
600
|
+
regenerated), then pull + recreate
|
|
598
601
|
|
|
599
602
|
EXAMPLES
|
|
600
603
|
sudo aoox reinstall --dry-run
|
|
@@ -604,23 +607,23 @@ EXAMPLES
|
|
|
604
607
|
sudo aoox reinstall --yes --terminal-ssh-user root
|
|
605
608
|
```
|
|
606
609
|
|
|
607
|
-
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
610
|
+
_See code: [src/commands/reinstall.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/reinstall.ts)_
|
|
608
611
|
|
|
609
612
|
## `aoox update`
|
|
610
613
|
|
|
611
|
-
|
|
614
|
+
Check for or apply updates to the aoox panel itself
|
|
612
615
|
|
|
613
616
|
```
|
|
614
617
|
USAGE
|
|
615
618
|
$ aoox update [-t <value>] [-u <value>] [--apply]
|
|
616
619
|
|
|
617
620
|
FLAGS
|
|
618
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
619
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
620
|
-
--apply
|
|
621
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
622
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
623
|
+
--apply Apply the update if one is available (pull + restart)
|
|
621
624
|
|
|
622
625
|
DESCRIPTION
|
|
623
|
-
|
|
626
|
+
Check for or apply updates to the aoox panel itself
|
|
624
627
|
|
|
625
628
|
EXAMPLES
|
|
626
629
|
$ aoox update
|
|
@@ -628,25 +631,25 @@ EXAMPLES
|
|
|
628
631
|
$ aoox update --apply
|
|
629
632
|
```
|
|
630
633
|
|
|
631
|
-
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
634
|
+
_See code: [src/commands/update.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/update.ts)_
|
|
632
635
|
|
|
633
636
|
## `aoox whoami`
|
|
634
637
|
|
|
635
|
-
|
|
638
|
+
Show the account and panel in use
|
|
636
639
|
|
|
637
640
|
```
|
|
638
641
|
USAGE
|
|
639
642
|
$ aoox whoami [--json] [-t <value>] [-u <value>]
|
|
640
643
|
|
|
641
644
|
FLAGS
|
|
642
|
-
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…);
|
|
643
|
-
-u, --url=<value> [env: AOOX_URL]
|
|
645
|
+
-t, --token=<value> [env: AOOX_TOKEN] API token (aoox_…); defaults to the value from `aoox login`
|
|
646
|
+
-u, --url=<value> [env: AOOX_URL] aoox panel URL; defaults to the value from `aoox login`
|
|
644
647
|
|
|
645
648
|
GLOBAL FLAGS
|
|
646
649
|
--json Format output as json.
|
|
647
650
|
|
|
648
651
|
DESCRIPTION
|
|
649
|
-
|
|
652
|
+
Show the account and panel in use
|
|
650
653
|
|
|
651
654
|
EXAMPLES
|
|
652
655
|
$ aoox whoami
|
|
@@ -654,7 +657,7 @@ EXAMPLES
|
|
|
654
657
|
$ aoox whoami --json
|
|
655
658
|
```
|
|
656
659
|
|
|
657
|
-
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.
|
|
660
|
+
_See code: [src/commands/whoami.ts](https://github.com/hideandseeklab/aoox-cli/blob/v0.1.0-alpha.7/src/commands/whoami.ts)_
|
|
658
661
|
<!-- commandsstop -->
|
|
659
662
|
|
|
660
663
|
## Versioning
|
package/dist/commands/deploy.js
CHANGED
|
@@ -10,21 +10,21 @@ import { readLink } from '../lib/link.js';
|
|
|
10
10
|
/** How often to poll GET /deployments/:id while a deploy is in progress. */
|
|
11
11
|
const POLL_MS = 1500;
|
|
12
12
|
export default class Deploy extends Command {
|
|
13
|
-
static description = 'Build image
|
|
13
|
+
static description = 'Build a local image, push it to the aoox registry, then deploy (the repo must be linked with `aoox link` first)';
|
|
14
14
|
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --tag v1.2.3'];
|
|
15
15
|
static flags = {
|
|
16
16
|
...connectionFlags,
|
|
17
17
|
context: Flags.string({ default: '.', description: 'Docker build context' }),
|
|
18
|
-
dockerfile: Flags.string({ char: 'f', default: 'Dockerfile', description: 'Path
|
|
19
|
-
registry: Flags.string({ description: 'ID
|
|
20
|
-
tag: Flags.string({ description: '
|
|
18
|
+
dockerfile: Flags.string({ char: 'f', default: 'Dockerfile', description: 'Path to the Dockerfile' }),
|
|
19
|
+
registry: Flags.string({ description: 'Registry ID to push to; defaults to the self-hosted registry' }),
|
|
20
|
+
tag: Flags.string({ description: 'Image tag; defaults to the git short SHA (+ -dirty)' }),
|
|
21
21
|
};
|
|
22
22
|
async run() {
|
|
23
23
|
const { flags } = await this.parse(Deploy);
|
|
24
24
|
const cwd = process.cwd();
|
|
25
25
|
const link = await readLink(cwd);
|
|
26
26
|
if (!link) {
|
|
27
|
-
this.error('
|
|
27
|
+
this.error('This repo is not linked yet.', { suggestions: ['Run `aoox link` first.'] });
|
|
28
28
|
}
|
|
29
29
|
let config;
|
|
30
30
|
try {
|
|
@@ -32,7 +32,7 @@ export default class Deploy extends Command {
|
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
34
|
if (error instanceof MissingCredentialsError) {
|
|
35
|
-
this.error(error.message, { suggestions: ['
|
|
35
|
+
this.error(error.message, { suggestions: ['Run `aoox login`.'] });
|
|
36
36
|
}
|
|
37
37
|
throw error;
|
|
38
38
|
}
|
|
@@ -49,7 +49,7 @@ export default class Deploy extends Command {
|
|
|
49
49
|
}
|
|
50
50
|
this.log(`==> Push ${imageRef}`);
|
|
51
51
|
await dockerInherit(['push', imageRef], cwd);
|
|
52
|
-
this.log('==>
|
|
52
|
+
this.log('==> Updating the application & triggering a deploy');
|
|
53
53
|
await api(config, `/applications/${app.id}`, {
|
|
54
54
|
body: { imageRef, imageRegistryId: registry.id, sourceType: 'image' },
|
|
55
55
|
method: 'PATCH',
|
|
@@ -74,7 +74,7 @@ export default class Deploy extends Command {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (dep.status === 'failed') {
|
|
77
|
-
this.error(dep.errorMessage ?? 'Deployment
|
|
77
|
+
this.error(dep.errorMessage ?? 'Deployment failed.');
|
|
78
78
|
}
|
|
79
79
|
await new Promise((resolve) => {
|
|
80
80
|
setTimeout(resolve, POLL_MS);
|
|
@@ -87,10 +87,10 @@ export default class Deploy extends Command {
|
|
|
87
87
|
}
|
|
88
88
|
catch (error) {
|
|
89
89
|
if (error instanceof ApiError && error.status === 401) {
|
|
90
|
-
this.error('
|
|
90
|
+
this.error('The token is no longer valid.', { suggestions: ['Run `aoox login`.'] });
|
|
91
91
|
}
|
|
92
92
|
if (error instanceof ApiError && error.status === 404) {
|
|
93
|
-
this.error('
|
|
93
|
+
this.error('The linked application no longer exists.', { suggestions: ['Run `aoox link` again.'] });
|
|
94
94
|
}
|
|
95
95
|
throw error;
|
|
96
96
|
}
|
|
@@ -100,12 +100,12 @@ export default class Deploy extends Command {
|
|
|
100
100
|
if (registryId) {
|
|
101
101
|
const found = registries.find((r) => r.id === registryId);
|
|
102
102
|
if (!found)
|
|
103
|
-
this.error(`Registry ${registryId}
|
|
103
|
+
this.error(`Registry ${registryId} not found.`);
|
|
104
104
|
return found;
|
|
105
105
|
}
|
|
106
106
|
if (registries.length === 0) {
|
|
107
|
-
this.error('
|
|
108
|
-
suggestions: ['Provision registry
|
|
107
|
+
this.error('No registry in the panel yet.', {
|
|
108
|
+
suggestions: ['Provision a local registry under Infrastructure, or add an external registry.'],
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
const selfHosted = registries.find((r) => r.type === 'self-hosted');
|
|
@@ -114,13 +114,13 @@ export default class Deploy extends Command {
|
|
|
114
114
|
if (registries.length === 1)
|
|
115
115
|
return registries[0];
|
|
116
116
|
if (!process.stdin.isTTY) {
|
|
117
|
-
this.error('
|
|
118
|
-
suggestions: ['
|
|
117
|
+
this.error('There are several registries and none is self-hosted; cannot pick one automatically.', {
|
|
118
|
+
suggestions: ['Pass --registry <id>.'],
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
return select({
|
|
122
122
|
choices: registries.map((r) => ({ name: `${r.name} (${r.url})`, value: r })),
|
|
123
|
-
message: '
|
|
123
|
+
message: 'Select a registry',
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
/** `POST /:id/deploy` returns 409 while another deployment is already running. */
|
|
@@ -130,8 +130,8 @@ export default class Deploy extends Command {
|
|
|
130
130
|
}
|
|
131
131
|
catch (error) {
|
|
132
132
|
if (error instanceof ApiError && error.status === 409) {
|
|
133
|
-
this.error('
|
|
134
|
-
suggestions: ['
|
|
133
|
+
this.error('A deployment is already running for this application.', {
|
|
134
|
+
suggestions: ['Wait for that deployment to finish, then try again.'],
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
throw error;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
/**
|
|
3
3
|
* Post-install alternative to hand-editing docker-compose.domain.yml/.env.dist
|
|
4
|
-
* over SSH (see
|
|
4
|
+
* over SSH (see the aoox-api AGENTS.md "Domains for the panel itself"):
|
|
5
5
|
* calls the panel's own `PATCH /instance/domain`, which recreates its web/api
|
|
6
6
|
* containers. Requires INSTALL_DIR to already be set in the panel's .env.dist.
|
|
7
7
|
*/
|
|
@@ -4,21 +4,21 @@ import { MissingCredentialsError } from '../../lib/config.js';
|
|
|
4
4
|
import { connectionFlags, loadCredentials } from '../../lib/flags.js';
|
|
5
5
|
/**
|
|
6
6
|
* Post-install alternative to hand-editing docker-compose.domain.yml/.env.dist
|
|
7
|
-
* over SSH (see
|
|
7
|
+
* over SSH (see the aoox-api AGENTS.md "Domains for the panel itself"):
|
|
8
8
|
* calls the panel's own `PATCH /instance/domain`, which recreates its web/api
|
|
9
9
|
* containers. Requires INSTALL_DIR to already be set in the panel's .env.dist.
|
|
10
10
|
*/
|
|
11
11
|
export default class DomainSet extends Command {
|
|
12
|
-
static description = "Set domain
|
|
12
|
+
static description = "Set a custom domain for the panel itself (not an application) through the running panel API";
|
|
13
13
|
static examples = [
|
|
14
14
|
'<%= config.bin %> <%= command.id %> --web panel.example.com --api api.example.com',
|
|
15
15
|
'<%= config.bin %> <%= command.id %> --web panel.example.com --api api.example.com --acme-email you@example.com',
|
|
16
16
|
];
|
|
17
17
|
static flags = {
|
|
18
18
|
...connectionFlags,
|
|
19
|
-
'acme-email': Flags.string({ description: "Email
|
|
20
|
-
api: Flags.string({ description: 'Domain
|
|
21
|
-
web: Flags.string({ description: 'Domain
|
|
19
|
+
'acme-email': Flags.string({ description: "Email for the Let's Encrypt certificate" }),
|
|
20
|
+
api: Flags.string({ description: 'Domain for the panel API', required: true }),
|
|
21
|
+
web: Flags.string({ description: 'Domain for the panel dashboard', required: true }),
|
|
22
22
|
};
|
|
23
23
|
async run() {
|
|
24
24
|
const { flags } = await this.parse(DomainSet);
|
|
@@ -28,7 +28,7 @@ export default class DomainSet extends Command {
|
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
if (error instanceof MissingCredentialsError) {
|
|
31
|
-
this.error(error.message, { suggestions: ['
|
|
31
|
+
this.error(error.message, { suggestions: ['Run `aoox login` against this panel first.'] });
|
|
32
32
|
}
|
|
33
33
|
throw error;
|
|
34
34
|
}
|
|
@@ -46,20 +46,20 @@ export default class DomainSet extends Command {
|
|
|
46
46
|
catch (error) {
|
|
47
47
|
if (error instanceof ApiError && error.status === 400) {
|
|
48
48
|
this.error(error.message, {
|
|
49
|
-
suggestions: ['
|
|
49
|
+
suggestions: ['Make sure INSTALL_DIR is set in the panel .env.dist, then restart the stack and try again.'],
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
throw error;
|
|
53
53
|
}
|
|
54
|
-
this.log(`Domain
|
|
55
|
-
this.log('
|
|
54
|
+
this.log(`Domain saved: ${flags.web} (dashboard), ${flags.api} (API).`);
|
|
55
|
+
this.log('The panel will restart for a few seconds to apply it — the connection to this API will drop briefly.');
|
|
56
56
|
if (result.proxyAutoProvisioned) {
|
|
57
57
|
this.log('');
|
|
58
|
-
this.warn('
|
|
59
|
-
this.log('
|
|
60
|
-
this.log(` 1. DNS A
|
|
61
|
-
this.log(' 2.
|
|
62
|
-
this.log(" 3.
|
|
58
|
+
this.warn('The reverse proxy was not running before — it has been enabled automatically.');
|
|
59
|
+
this.log('The new domains will be reachable only if these three things are also correct:');
|
|
60
|
+
this.log(` 1. DNS A records for ${flags.web} and ${flags.api} point to this server's IP.`);
|
|
61
|
+
this.log(' 2. Ports 80 and 443 are open to the public (both the OS firewall and the VPS provider security group).');
|
|
62
|
+
this.log(" 3. Wait up to a minute — the HTTPS certificate (Let's Encrypt) is issued when the first domain is accessed.");
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -10,12 +10,15 @@ export default class Install extends Command {
|
|
|
10
10
|
'api-domain': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
dir: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
'terminal-
|
|
13
|
+
'no-terminal-authorize': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'terminal-ssh-user': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
'web-domain': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
16
|
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
};
|
|
17
18
|
run(): Promise<void>;
|
|
18
19
|
private assertPreconditions;
|
|
20
|
+
/** Never fails the install: a problem becomes a warning (the Settings button is the fallback). */
|
|
21
|
+
private authorizeTerminal;
|
|
19
22
|
/** `numeric:numeric` works even without a matching /etc/passwd entry on the host. */
|
|
20
23
|
private chownNode;
|
|
21
24
|
private confirmPlan;
|