@underpostnet/underpost 2.99.5 → 2.99.6
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 +3 -3
- package/baremetal/commission-workflows.json +43 -6
- package/bin/deploy.js +3 -0
- package/cli.md +39 -15
- package/examples/static-page/README.md +80 -13
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +40 -0
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +40 -0
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
- package/package.json +2 -3
- package/scripts/maas-setup.sh +13 -9
- package/scripts/rocky-kickstart.sh +294 -0
- package/src/cli/baremetal.js +229 -233
- package/src/cli/cloud-init.js +25 -43
- package/src/cli/index.js +40 -5
- package/src/cli/kickstart.js +149 -0
- package/src/cli/run.js +43 -10
- package/src/cli/static.js +27 -1
- package/src/client/components/core/Docs.js +22 -3
- package/src/index.js +12 -1
- package/src/server/backup.js +11 -4
- package/src/server/client-build-docs.js +1 -1
- package/src/server/conf.js +0 -22
- package/src/server/cron.js +339 -130
- package/src/server/dns.js +10 -0
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.99.6) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,7 +66,7 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.99.
|
|
69
|
+
## underpost ci/cd cli v2.99.6
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
|
@@ -93,7 +93,7 @@ Commands:
|
|
|
93
93
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
94
94
|
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
95
95
|
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
96
|
-
cron [options] [deploy-list] [job-list] Manages cron jobs
|
|
96
|
+
cron [options] [deploy-list] [job-list] Manages cron jobs: execute jobs directly or generate and apply K8s CronJob manifests.
|
|
97
97
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
98
98
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
99
99
|
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
7
7
|
"tftpPrefix": "rpi4mb",
|
|
8
8
|
"bootstrapHttpServerPort": 8888,
|
|
9
|
-
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-RAM commissioning (ARM64)",
|
|
9
|
+
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-RAM Ubuntu 24.04 ephemeral commissioning (ARM64)",
|
|
10
10
|
"networkInterfaceName": "enabcm6e4ei0",
|
|
11
11
|
"chronyc": {
|
|
12
12
|
"timezone": "America/Santiago",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"architecture": "arm64",
|
|
36
36
|
"tftpPrefix": "rpi4mb",
|
|
37
37
|
"bootstrapHttpServerPort": 8888,
|
|
38
|
-
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 CHROOT commissioning (ARM64)",
|
|
38
|
+
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 CHROOT Ubuntu 24.04 ephemeral commissioning (ARM64)",
|
|
39
39
|
"networkInterfaceName": "enabcm6e4ei0",
|
|
40
40
|
"firmwares": [
|
|
41
41
|
{
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"isoUrl": "https://cdimage.ubuntu.com/releases/24.04/release/ubuntu-24.04.3-live-server-arm64.iso",
|
|
72
72
|
"tftpPrefix": "rpi4mb",
|
|
73
73
|
"bootstrapHttpServerPort": 8888,
|
|
74
|
-
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-NFS commissioning (ARM64)",
|
|
74
|
+
"menuentryStr": "UNDERPOST.NET UEFI/GRUB/MAAS RPi4 ISO-NFS Ubuntu 24.04 ephemeral commissioning (ARM64)",
|
|
75
75
|
"networkInterfaceName": "enabcm6e4ei0",
|
|
76
76
|
"chronyc": {
|
|
77
77
|
"timezone": "America/Santiago",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"architecture": "arm64",
|
|
101
101
|
"tftpPrefix": "rpi4mb",
|
|
102
102
|
"bootstrapHttpServerPort": 8888,
|
|
103
|
-
"menuentryStr": "UNDERPOST.NET
|
|
103
|
+
"menuentryStr": "UNDERPOST.NET Container CHROOT Rocky Linux 9 ephemeral commissioning (ARM64)",
|
|
104
104
|
"networkInterfaceName": "eth0",
|
|
105
105
|
"firmwares": [
|
|
106
106
|
{
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"isoUrl": "https://releases.ubuntu.com/releases/24.04/ubuntu-24.04.3-live-server-amd64.iso",
|
|
130
130
|
"tftpPrefix": "envy",
|
|
131
131
|
"bootstrapHttpServerPort": 8888,
|
|
132
|
-
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-NFS commissioning (AMD64)",
|
|
132
|
+
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-NFS Ubuntu 24.04 ephemeral commissioning (AMD64)",
|
|
133
133
|
"networkInterfaceName": "eth0",
|
|
134
134
|
"chronyc": {
|
|
135
135
|
"timezone": "America/Santiago",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"isoUrl": "https://releases.ubuntu.com/releases/24.04/ubuntu-24.04.3-live-server-amd64.iso",
|
|
154
154
|
"tftpPrefix": "envy",
|
|
155
155
|
"bootstrapHttpServerPort": 8888,
|
|
156
|
-
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-RAM commissioning (AMD64)",
|
|
156
|
+
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/MAAS hp-envy ISO-RAM Ubuntu 24.04 ephemeral commissioning (AMD64)",
|
|
157
157
|
"networkInterfaceName": "eth0",
|
|
158
158
|
"chronyc": {
|
|
159
159
|
"timezone": "America/Santiago",
|
|
@@ -169,5 +169,42 @@
|
|
|
169
169
|
"keyboard": {
|
|
170
170
|
"layout": "es"
|
|
171
171
|
}
|
|
172
|
+
},
|
|
173
|
+
"hp-envy-iso-ram-rocky9": {
|
|
174
|
+
"type": "iso-ram",
|
|
175
|
+
"osIdLike": "rhel centos fedora",
|
|
176
|
+
"architecture": "amd64",
|
|
177
|
+
"isoUrl": "https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9-latest-x86_64-boot.iso",
|
|
178
|
+
"tftpPrefix": "envy-rocky9",
|
|
179
|
+
"bootstrapHttpServerPort": 8888,
|
|
180
|
+
"menuentryStr": "UNDERPOST.NET UEFI/ISO-IPXE/KICKSTART-ANACONDA hp-envy ISO-RAM Rocky Linux 9 ephemeral commissioning (AMD64)",
|
|
181
|
+
"networkInterfaceName": "eth0",
|
|
182
|
+
"chronyc": {
|
|
183
|
+
"timezone": "America/Santiago",
|
|
184
|
+
"chronyConfPath": "/etc/chrony/chrony.conf"
|
|
185
|
+
},
|
|
186
|
+
"firmwares": [],
|
|
187
|
+
"container": {
|
|
188
|
+
"image": "quay.io/rockylinux/rockylinux:9",
|
|
189
|
+
"architecture": "amd64",
|
|
190
|
+
"packages": [
|
|
191
|
+
"kernel",
|
|
192
|
+
"kernel-core",
|
|
193
|
+
"kernel-modules",
|
|
194
|
+
"linux-firmware",
|
|
195
|
+
"dracut",
|
|
196
|
+
"dracut-network",
|
|
197
|
+
"dracut-config-generic",
|
|
198
|
+
"dracut-live",
|
|
199
|
+
"nfs-utils",
|
|
200
|
+
"tar",
|
|
201
|
+
"iproute",
|
|
202
|
+
"openssh-server",
|
|
203
|
+
"openssh-clients"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"keyboard": {
|
|
207
|
+
"layout": "es"
|
|
208
|
+
}
|
|
172
209
|
}
|
|
173
210
|
}
|
package/bin/deploy.js
CHANGED
|
@@ -468,6 +468,9 @@ try {
|
|
|
468
468
|
shellExec(`node bin new --deploy-id dd-default`);
|
|
469
469
|
console.log(fs.existsSync(`./engine-private/conf/dd-default`));
|
|
470
470
|
shellExec(`sudo rm -rf ./engine-private/conf/dd-default`);
|
|
471
|
+
shellExec(
|
|
472
|
+
`node bin cron --cmd 'cd /home/dd/engine && node bin run secret && node bin env dd-cron production' --git --kubeadm --dev --setup-start`,
|
|
473
|
+
);
|
|
471
474
|
shellExec(`node bin/deploy build-envs`);
|
|
472
475
|
break;
|
|
473
476
|
}
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.99.
|
|
1
|
+
## underpost ci/cd cli v2.99.6
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -25,7 +25,7 @@ Commands:
|
|
|
25
25
|
install Quickly imports Underpost npm dependencies by copying them.
|
|
26
26
|
db [options] [deploy-list] Manages database operations with support for MariaDB and MongoDB, including import/export, multi-pod targeting, and Git integration.
|
|
27
27
|
metadata [options] [deploy-id] [host] [path] Manages cluster metadata operations, including import and export.
|
|
28
|
-
cron [options] [deploy-list] [job-list] Manages cron jobs
|
|
28
|
+
cron [options] [deploy-list] [job-list] Manages cron jobs: execute jobs directly or generate and apply K8s CronJob manifests.
|
|
29
29
|
fs [options] [path] Manages file storage, defaulting to file upload operations.
|
|
30
30
|
test [options] [deploy-list] Manages and runs tests, defaulting to the current Underpost default test suite.
|
|
31
31
|
monitor [options] <deploy-id> [env] Manages health server monitoring for specified deployments.
|
|
@@ -255,6 +255,8 @@ Options:
|
|
|
255
255
|
--lang <lang> HTML lang attribute (default: en).
|
|
256
256
|
--dir <dir> HTML dir attribute (default: ltr).
|
|
257
257
|
--dev Sets the development cli context
|
|
258
|
+
--run-sv [port] Start a standalone Express static server to
|
|
259
|
+
preview the static build (default port: 5000).
|
|
258
260
|
-h, --help display help for command
|
|
259
261
|
|
|
260
262
|
```
|
|
@@ -630,22 +632,39 @@ Options:
|
|
|
630
632
|
```
|
|
631
633
|
Usage: underpost cron [options] [deploy-list] [job-list]
|
|
632
634
|
|
|
633
|
-
Manages cron jobs
|
|
634
|
-
|
|
635
|
+
Manages cron jobs: execute jobs directly or generate and apply K8s CronJob
|
|
636
|
+
manifests.
|
|
635
637
|
|
|
636
638
|
Arguments:
|
|
637
|
-
deploy-list
|
|
638
|
-
|
|
639
|
-
job-list
|
|
640
|
-
|
|
639
|
+
deploy-list A comma-separated list of deployment IDs (e.g.,
|
|
640
|
+
"default-a,default-b").
|
|
641
|
+
job-list A comma-separated list of job IDs. Options:
|
|
642
|
+
dns,backup. Defaults to all available jobs.
|
|
641
643
|
|
|
642
644
|
Options:
|
|
643
|
-
--
|
|
644
|
-
|
|
645
|
-
--
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
645
|
+
--generate-k8s-cronjobs Generates Kubernetes CronJob YAML manifests from
|
|
646
|
+
cron configuration.
|
|
647
|
+
--apply Applies generated K8s CronJob manifests to the
|
|
648
|
+
cluster via kubectl.
|
|
649
|
+
--setup-start [deploy-id] Updates deploy-id package.json start script and
|
|
650
|
+
generates+applies its K8s CronJob manifests.
|
|
651
|
+
--namespace <namespace> Kubernetes namespace for the CronJob resources
|
|
652
|
+
(default: "default").
|
|
653
|
+
--image <image> Custom container image for the CronJob pods.
|
|
654
|
+
--git Pass --git flag to cron job execution.
|
|
655
|
+
--cmd <cmd> Optional pre-script commands to run before cron
|
|
656
|
+
execution.
|
|
657
|
+
--dev Use local ./ base path instead of global underpost
|
|
658
|
+
installation.
|
|
659
|
+
--k3s Use k3s cluster context (apply directly on host).
|
|
660
|
+
--kind Use kind cluster context (apply via kind-worker
|
|
661
|
+
container).
|
|
662
|
+
--kubeadm Use kubeadm cluster context (apply directly on
|
|
663
|
+
host).
|
|
664
|
+
--dry-run Preview cron jobs without executing them.
|
|
665
|
+
--create-job-now After applying manifests, immediately create a Job
|
|
666
|
+
from each CronJob (requires --apply).
|
|
667
|
+
-h, --help display help for command
|
|
649
668
|
|
|
650
669
|
```
|
|
651
670
|
|
|
@@ -834,7 +853,8 @@ Options:
|
|
|
834
853
|
--expose Enables service exposure for the runner execution.
|
|
835
854
|
--conf-server-path <conf-server-path> Sets a custom configuration server path.
|
|
836
855
|
--underpost-root <underpost-root> Sets a custom Underpost root path.
|
|
837
|
-
--cron-jobs <jobs>
|
|
856
|
+
--cmd-cron-jobs <cmd-cron-jobs> Pre-script commands to run before cron job execution.
|
|
857
|
+
--deploy-id-cron-jobs <deploy-id-cron-jobs> Specifies deployment IDs to synchronize cron jobs with during execution.
|
|
838
858
|
--timezone <timezone> Sets the timezone for the runner execution.
|
|
839
859
|
--kubeadm Sets the kubeadm cluster context for the runner execution.
|
|
840
860
|
--k3s Sets the k3s cluster context for the runner execution.
|
|
@@ -855,6 +875,8 @@ Options:
|
|
|
855
875
|
--monitor-status-kind-type <kind-type> Sets the Kubernetes resource kind type to monitor (default: "pods").
|
|
856
876
|
--monitor-status-delta-ms <milliseconds> Sets the polling interval in milliseconds for status monitoring (default: 1000).
|
|
857
877
|
--monitor-status-max-attempts <attempts> Sets the maximum number of status check attempts (default: 600).
|
|
878
|
+
--dry-run Preview operations without executing them.
|
|
879
|
+
--create-job-now After applying cron manifests, immediately create a Job from each CronJob (forwarded to cron runner).
|
|
858
880
|
-h, --help display help for command
|
|
859
881
|
|
|
860
882
|
```
|
|
@@ -943,11 +965,13 @@ Options:
|
|
|
943
965
|
--remove-machines <system-ids> Removes baremetal machines by comma-separated system IDs, or use "all"
|
|
944
966
|
--clear-discovered Clears all discovered baremetal machines from the database.
|
|
945
967
|
--commission Init workflow for commissioning a physical machine.
|
|
968
|
+
--bootstrap-http-server-run Runs a temporary bootstrap HTTP server for generic purposes such as serving iPXE scripts or ISO images during commissioning.
|
|
946
969
|
--bootstrap-http-server-path <path> Sets a custom bootstrap HTTP server path for baremetal commissioning.
|
|
947
970
|
--bootstrap-http-server-port <port> Sets a custom bootstrap HTTP server port for baremetal commissioning.
|
|
948
971
|
--iso-url <url> Uses a custom ISO URL for baremetal machine commissioning.
|
|
949
972
|
--nfs-build Builds an NFS root filesystem for a workflow id config architecture using QEMU emulation.
|
|
950
973
|
--nfs-mount Mounts the NFS root filesystem for a workflow id config architecture.
|
|
974
|
+
--nfs-reset Resets the NFS server completely, closing all connections before reloading exports.
|
|
951
975
|
--nfs-unmount Unmounts the NFS root filesystem for a workflow id config architecture.
|
|
952
976
|
--nfs-build-server Builds the NFS server for a workflow id config architecture.
|
|
953
977
|
--nfs-sh Copies QEMU emulation root entrypoint shell command to the clipboard.
|
|
@@ -26,6 +26,30 @@ underpost static --generate-config ./static-config.json
|
|
|
26
26
|
underpost static --config-file ./examples/static-page/static-config-example.json
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
## Preview with Static Server
|
|
30
|
+
|
|
31
|
+
Use `--run-sv` to start a standalone Express static file server that serves the build output directory, so you can preview your generated pages in a browser.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
# Build and serve on default port 5000:
|
|
35
|
+
underpost static --page ./examples/static-page/ssr-components/CustomPage.js \
|
|
36
|
+
--output-path ./dist/index.html \
|
|
37
|
+
--run-sv
|
|
38
|
+
|
|
39
|
+
# Build and serve on a custom port:
|
|
40
|
+
underpost static --page ./examples/static-page/ssr-components/CustomPage.js \
|
|
41
|
+
--output-path ./dist/index.html \
|
|
42
|
+
--run-sv 3000
|
|
43
|
+
|
|
44
|
+
# Serve an existing build directory without rebuilding:
|
|
45
|
+
underpost static --output-path ./dist/index.html --run-sv
|
|
46
|
+
|
|
47
|
+
# Serve the current working directory:
|
|
48
|
+
underpost static --run-sv 8080
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
When `--output-path` is provided, the server serves the directory containing the output file (e.g. `./dist/`). Otherwise it serves the current working directory.
|
|
52
|
+
|
|
29
53
|
## Config File Reference
|
|
30
54
|
|
|
31
55
|
See [`static-config-example.json`](./static-config-example.json) for a complete working example.
|
|
@@ -34,6 +58,7 @@ See [`static-config-example.json`](./static-config-example.json) for a complete
|
|
|
34
58
|
|-------|------|-------------|
|
|
35
59
|
| `page` | `string` | Path to the SSR component to render |
|
|
36
60
|
| `outputPath` | `string` | Output HTML file path |
|
|
61
|
+
| `buildPath` | `string` | Base path for static documents or assets (default: `"/"`) |
|
|
37
62
|
| `env` | `string` | `"production"` or `"development"` |
|
|
38
63
|
| `minify` | `boolean` | Minify HTML output |
|
|
39
64
|
| `lang` | `string` | HTML `lang` attribute |
|
|
@@ -51,20 +76,62 @@ See [`static-config-example.json`](./static-config-example.json) for a complete
|
|
|
51
76
|
|
|
52
77
|
Flags override config file values when both are provided.
|
|
53
78
|
|
|
79
|
+
### Build & Output
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
underpost static --page <path> # SSR component path
|
|
83
|
+
--output-path <path> # Output file
|
|
84
|
+
--build-path <path> # Base path for assets (default: "/")
|
|
85
|
+
--config-file <path> # JSON config file
|
|
86
|
+
--generate-config [path] # Generate a template config file
|
|
87
|
+
--env <env> # production | development
|
|
88
|
+
--minify / --no-minify # Toggle minification
|
|
89
|
+
--lang <lang> # HTML lang attribute (default: en)
|
|
90
|
+
--dir <dir> # HTML dir attribute (default: ltr)
|
|
91
|
+
--dev # Development mode
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Metadata & SEO
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
--title <title> # Page title (deprecated: use --config-file)
|
|
98
|
+
--description <text> # Meta description
|
|
99
|
+
--keywords <a,b,c> # Comma-separated keywords
|
|
100
|
+
--author <name> # Meta author
|
|
101
|
+
--theme-color <color> # Theme color for mobile browsers
|
|
102
|
+
--canonical-url <url> # Canonical URL for SEO
|
|
103
|
+
--thumbnail <url> # Open Graph thumbnail image URL
|
|
104
|
+
--locale <locale> # Page locale (default: en-US)
|
|
105
|
+
--site-name <name> # Site name for Open Graph
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Scripts & Styles
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
--head-scripts <paths> # Comma-separated script paths for <head>
|
|
112
|
+
--body-scripts <paths> # Comma-separated script paths for <body>
|
|
113
|
+
--styles <paths> # Comma-separated stylesheet paths
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Icons
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
--favicon <path> # Favicon path
|
|
120
|
+
--apple-touch-icon <path> # Apple touch icon path
|
|
121
|
+
--manifest <path> # Web manifest path
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### SSR Components
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
--head-components <paths> # Comma-separated SSR head component paths
|
|
128
|
+
--body-components <paths> # Comma-separated SSR body component paths
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Static Server
|
|
132
|
+
|
|
54
133
|
```sh
|
|
55
|
-
|
|
56
|
-
--output-path <path> # Output file
|
|
57
|
-
--config-file <path> # JSON config file
|
|
58
|
-
--env <env> # production | development
|
|
59
|
-
--minify / --no-minify # Toggle minification
|
|
60
|
-
--title <title> # Page title
|
|
61
|
-
--description <text> # Meta description
|
|
62
|
-
--keywords <a,b,c> # Comma-separated keywords
|
|
63
|
-
--author <name> # Meta author
|
|
64
|
-
--favicon <path> # Favicon path
|
|
65
|
-
--lang <lang> # HTML lang attribute
|
|
66
|
-
--dir <dir> # HTML dir attribute
|
|
67
|
-
--dev # Development mode
|
|
134
|
+
--run-sv [port] # Start Express static server (default port: 5000)
|
|
68
135
|
```
|
|
69
136
|
|
|
70
137
|
## SSR Component
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
apiVersion: batch/v1
|
|
2
|
+
kind: CronJob
|
|
3
|
+
metadata:
|
|
4
|
+
name: dd-cron-backup
|
|
5
|
+
namespace: default
|
|
6
|
+
labels:
|
|
7
|
+
app: dd-cron-backup
|
|
8
|
+
managed-by: underpost
|
|
9
|
+
spec:
|
|
10
|
+
schedule: "0 1 * * *"
|
|
11
|
+
concurrencyPolicy: Forbid
|
|
12
|
+
startingDeadlineSeconds: 200
|
|
13
|
+
successfulJobsHistoryLimit: 3
|
|
14
|
+
failedJobsHistoryLimit: 1
|
|
15
|
+
suspend: false
|
|
16
|
+
jobTemplate:
|
|
17
|
+
spec:
|
|
18
|
+
template:
|
|
19
|
+
metadata:
|
|
20
|
+
labels:
|
|
21
|
+
app: dd-cron-backup
|
|
22
|
+
managed-by: underpost
|
|
23
|
+
spec:
|
|
24
|
+
containers:
|
|
25
|
+
- name: dd-cron-backup
|
|
26
|
+
image: underpost/underpost-engine:v2.99.6
|
|
27
|
+
command:
|
|
28
|
+
- /bin/sh
|
|
29
|
+
- -c
|
|
30
|
+
- >
|
|
31
|
+
cd /home/dd/engine && node bin run secret && node bin env dd-cron production && node bin cron --git --dev dd-lampp,dd-cyberia,dd-core,dd-test backup
|
|
32
|
+
volumeMounts:
|
|
33
|
+
- mountPath: /home/dd/engine
|
|
34
|
+
name: underpost-cron-container-volume
|
|
35
|
+
volumes:
|
|
36
|
+
- hostPath:
|
|
37
|
+
path: /home/dd/engine
|
|
38
|
+
type: Directory
|
|
39
|
+
name: underpost-cron-container-volume
|
|
40
|
+
restartPolicy: OnFailure
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
apiVersion: batch/v1
|
|
2
|
+
kind: CronJob
|
|
3
|
+
metadata:
|
|
4
|
+
name: dd-cron-dns
|
|
5
|
+
namespace: default
|
|
6
|
+
labels:
|
|
7
|
+
app: dd-cron-dns
|
|
8
|
+
managed-by: underpost
|
|
9
|
+
spec:
|
|
10
|
+
schedule: "* * * * *"
|
|
11
|
+
concurrencyPolicy: Forbid
|
|
12
|
+
startingDeadlineSeconds: 200
|
|
13
|
+
successfulJobsHistoryLimit: 3
|
|
14
|
+
failedJobsHistoryLimit: 1
|
|
15
|
+
suspend: false
|
|
16
|
+
jobTemplate:
|
|
17
|
+
spec:
|
|
18
|
+
template:
|
|
19
|
+
metadata:
|
|
20
|
+
labels:
|
|
21
|
+
app: dd-cron-dns
|
|
22
|
+
managed-by: underpost
|
|
23
|
+
spec:
|
|
24
|
+
containers:
|
|
25
|
+
- name: dd-cron-dns
|
|
26
|
+
image: underpost/underpost-engine:v2.99.6
|
|
27
|
+
command:
|
|
28
|
+
- /bin/sh
|
|
29
|
+
- -c
|
|
30
|
+
- >
|
|
31
|
+
cd /home/dd/engine && node bin run secret && node bin env dd-cron production && node bin cron --git --dev dd-cron dns
|
|
32
|
+
volumeMounts:
|
|
33
|
+
- mountPath: /home/dd/engine
|
|
34
|
+
name: underpost-cron-container-volume
|
|
35
|
+
volumes:
|
|
36
|
+
- hostPath:
|
|
37
|
+
path: /home/dd/engine
|
|
38
|
+
type: Directory
|
|
39
|
+
name: underpost-cron-container-volume
|
|
40
|
+
restartPolicy: OnFailure
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.99.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.99.6
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.99.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.99.6
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -18,7 +18,7 @@ spec:
|
|
|
18
18
|
spec:
|
|
19
19
|
containers:
|
|
20
20
|
- name: dd-test-development-blue
|
|
21
|
-
image: localhost/rockylinux9-underpost:v2.99.
|
|
21
|
+
image: localhost/rockylinux9-underpost:v2.99.6
|
|
22
22
|
|
|
23
23
|
command:
|
|
24
24
|
- /bin/sh
|
|
@@ -103,7 +103,7 @@ spec:
|
|
|
103
103
|
spec:
|
|
104
104
|
containers:
|
|
105
105
|
- name: dd-test-development-green
|
|
106
|
-
image: localhost/rockylinux9-underpost:v2.99.
|
|
106
|
+
image: localhost/rockylinux9-underpost:v2.99.6
|
|
107
107
|
|
|
108
108
|
command:
|
|
109
109
|
- /bin/sh
|
package/package.json
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
"type": "module",
|
|
3
3
|
"main": "src/index.js",
|
|
4
4
|
"name": "@underpostnet/underpost",
|
|
5
|
-
"version": "2.99.
|
|
5
|
+
"version": "2.99.6",
|
|
6
6
|
"description": "pwa api rest template",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
9
9
|
"build": "node bin/deploy build-full-client",
|
|
10
10
|
"test": "env-cmd -f .env.test c8 mocha",
|
|
11
|
-
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine -- dd-default",
|
|
12
11
|
"dev": "env-cmd -f .env.development nodemon src/server",
|
|
13
12
|
"dev-img": "env-cmd -f .env.development node src/server",
|
|
14
13
|
"prod-img": "env-cmd -f .env.production node src/server",
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
"dev-client": "env-cmd -f .env.development node src/client.dev",
|
|
17
16
|
"dev-proxy": "env-cmd -f .env.development node src/proxy proxy",
|
|
18
17
|
"docs": "jsdoc -c jsdoc.json",
|
|
19
|
-
"install-global": "npm install -g
|
|
18
|
+
"install-global": "npm install -g jsdoc && npm install -g prettier && npm install -g env-cmd",
|
|
20
19
|
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g coveralls",
|
|
21
20
|
"install-underpost": "cp -a $(npm root -g)/underpost/node_modules ./node_modules && npm install --only=dev --ignore-scripts",
|
|
22
21
|
"install": "npm run install-global && npm run install-test",
|
package/scripts/maas-setup.sh
CHANGED
|
@@ -93,12 +93,16 @@ echo "MAAS setup script completed with new configurations."
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
echo "Configuring DHCP for fabric
|
|
96
|
+
echo "Configuring DHCP for the subnet's fabric (untagged VLAN)..."
|
|
97
97
|
|
|
98
|
-
#
|
|
98
|
+
# Derive FABRIC_ID and VLAN_VID from the subnet that matches our CIDR
|
|
99
99
|
SUBNET_CIDR="192.168.1.0/24"
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
SUBNET_JSON=$(maas "$MAAS_ADMIN_USERNAME" subnets read | jq -r '.[] | select(.cidr == "'"$SUBNET_CIDR"'")')
|
|
101
|
+
SUBNET_ID=$(echo "$SUBNET_JSON" | jq -r '.id')
|
|
102
|
+
FABRIC_ID=$(echo "$SUBNET_JSON" | jq -r '.vlan.fabric_id')
|
|
103
|
+
VLAN_VID=$(echo "$SUBNET_JSON" | jq -r '.vlan.vid')
|
|
104
|
+
FABRIC_NAME=$(echo "$SUBNET_JSON" | jq -r '.vlan.fabric')
|
|
105
|
+
echo "Detected subnet $SUBNET_CIDR on $FABRIC_NAME (fabric ID: $FABRIC_ID, VLAN VID: $VLAN_VID)"
|
|
102
106
|
RACK_CONTROLLER_ID=$(maas "$MAAS_ADMIN_USERNAME" rack-controllers read | jq -r '[.[] | select(.ip_addresses[] == "'"$IP_ADDRESS"'") | .system_id] | .[0]')
|
|
103
107
|
|
|
104
108
|
if [ -z "$RACK_CONTROLLER_ID" ] || [ "$RACK_CONTROLLER_ID" == "null" ]; then
|
|
@@ -114,8 +118,8 @@ fi
|
|
|
114
118
|
START_IP="192.168.1.191"
|
|
115
119
|
END_IP="192.168.1.254"
|
|
116
120
|
|
|
117
|
-
if [ -z "$FABRIC_ID" ]; then
|
|
118
|
-
echo "Error: Could not find FABRIC_ID for '
|
|
121
|
+
if [ -z "$FABRIC_ID" ] || [ "$FABRIC_ID" == "null" ]; then
|
|
122
|
+
echo "Error: Could not find FABRIC_ID for subnet '$SUBNET_CIDR'. Please ensure the subnet exists in MAAS."
|
|
119
123
|
exit 1
|
|
120
124
|
fi
|
|
121
125
|
|
|
@@ -123,9 +127,9 @@ fi
|
|
|
123
127
|
echo "Creating dynamic IP range from $START_IP to $END_IP..."
|
|
124
128
|
maas "$MAAS_ADMIN_USERNAME" ipranges create type=dynamic start_ip="$START_IP" end_ip="$END_IP" || echo "Dynamic IP range likely already exists or conflicts. Proceeding..."
|
|
125
129
|
|
|
126
|
-
# Enable DHCP on the
|
|
127
|
-
echo "Enabling DHCP on VLAN
|
|
128
|
-
maas "$MAAS_ADMIN_USERNAME" vlan update "$FABRIC_ID"
|
|
130
|
+
# Enable DHCP on the VLAN associated with the subnet
|
|
131
|
+
echo "Enabling DHCP on VLAN $VLAN_VID for $FABRIC_NAME (fabric ID: $FABRIC_ID)..."
|
|
132
|
+
maas "$MAAS_ADMIN_USERNAME" vlan update "$FABRIC_ID" "$VLAN_VID" dhcp_on=true primary_rack="$RACK_CONTROLLER_ID"
|
|
129
133
|
|
|
130
134
|
echo "Setting gateway IP for subnet $SUBNET_CIDR (ID: $SUBNET_ID) to $IP_ADDRESS..."
|
|
131
135
|
maas "$MAAS_ADMIN_USERNAME" subnet update $SUBNET_ID gateway_ip=$IP_ADDRESS
|