@underpostnet/underpost 2.96.0 → 2.97.0
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/.dockerignore +1 -2
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.env.test +0 -3
- package/.prettierignore +1 -2
- package/README.md +31 -31
- package/baremetal/commission-workflows.json +64 -17
- package/baremetal/packer-workflows.json +11 -0
- package/cli.md +72 -40
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +4 -4
- package/package.json +3 -2
- package/packer/images/Rocky9Amd64/rocky9.pkr.hcl +6 -2
- package/packer/images/Rocky9Arm64/Makefile +69 -0
- package/packer/images/Rocky9Arm64/README.md +122 -0
- package/packer/images/Rocky9Arm64/http/rocky9.ks.pkrtpl.hcl +114 -0
- package/packer/images/Rocky9Arm64/rocky9.pkr.hcl +171 -0
- package/scripts/disk-clean.sh +128 -187
- package/scripts/ipxe-setup.sh +197 -0
- package/scripts/packer-init-vars-file.sh +16 -6
- package/scripts/packer-setup.sh +270 -33
- package/scripts/ports-ls.sh +31 -0
- package/scripts/quick-tftp.sh +19 -0
- package/src/api/document/document.controller.js +15 -0
- package/src/api/document/document.model.js +14 -0
- package/src/api/document/document.router.js +1 -0
- package/src/api/document/document.service.js +61 -3
- package/src/cli/baremetal.js +1716 -439
- package/src/cli/cloud-init.js +354 -231
- package/src/cli/cluster.js +1 -1
- package/src/cli/db.js +22 -0
- package/src/cli/deploy.js +6 -2
- package/src/cli/image.js +1 -0
- package/src/cli/index.js +40 -36
- package/src/cli/run.js +77 -11
- package/src/cli/ssh.js +1 -1
- package/src/client/components/core/Input.js +3 -1
- package/src/client/components/core/Panel.js +161 -15
- package/src/client/components/core/PanelForm.js +198 -35
- package/src/client/components/core/Translate.js +11 -0
- package/src/client/services/document/document.service.js +19 -0
- package/src/index.js +2 -1
- package/src/server/dns.js +8 -2
- package/src/server/start.js +14 -6
- package/manifests/mariadb/config.yaml +0 -10
- package/manifests/mariadb/secret.yaml +0 -8
package/src/index.js
CHANGED
|
@@ -36,7 +36,7 @@ class Underpost {
|
|
|
36
36
|
* @type {String}
|
|
37
37
|
* @memberof Underpost
|
|
38
38
|
*/
|
|
39
|
-
static version = 'v2.
|
|
39
|
+
static version = 'v2.97.0';
|
|
40
40
|
/**
|
|
41
41
|
* Repository cli API
|
|
42
42
|
* @static
|
|
@@ -193,6 +193,7 @@ export {
|
|
|
193
193
|
UnderpostRootEnv,
|
|
194
194
|
UnderpostFileStorage,
|
|
195
195
|
UnderpostImage,
|
|
196
|
+
UnderpostStatic,
|
|
196
197
|
UnderpostLxd,
|
|
197
198
|
UnderpostMonitor,
|
|
198
199
|
UnderpostRepository,
|
package/src/server/dns.js
CHANGED
|
@@ -36,7 +36,9 @@ class Dns {
|
|
|
36
36
|
static async getPublicIp() {
|
|
37
37
|
return await new Promise(async (resolve) => {
|
|
38
38
|
try {
|
|
39
|
-
return axios
|
|
39
|
+
return axios
|
|
40
|
+
.get(process.env.HTTP_PLAIN_IP_URL ? process.env.HTTP_PLAIN_IP_URL : 'https://api.ipify.org')
|
|
41
|
+
.then((response) => resolve(response.data));
|
|
40
42
|
} catch (error) {
|
|
41
43
|
logger.error('Error fetching public IP:', { error: error.message, stack: error.stack });
|
|
42
44
|
return resolve(null);
|
|
@@ -403,6 +405,7 @@ class Dns {
|
|
|
403
405
|
* @property {boolean} [options.banEgressClear=false] - Clear all banned egress IPs.
|
|
404
406
|
* @property {boolean} [options.banBothAdd=false] - Ban IPs from both ingress and egress.
|
|
405
407
|
* @property {boolean} [options.banBothRemove=false] - Unban IPs from both ingress and egress.
|
|
408
|
+
* @property {boolean} [options.dhcp=false] - Get local DHCP IP instead of public IP.
|
|
406
409
|
* @property {boolean} [options.copy=false] - Copy the public IP to clipboard.
|
|
407
410
|
* @return {Promise<string|void>} The public IP if no ban/unban action is taken.
|
|
408
411
|
*/
|
|
@@ -420,6 +423,7 @@ class Dns {
|
|
|
420
423
|
banBothAdd: false,
|
|
421
424
|
banBothRemove: false,
|
|
422
425
|
copy: false,
|
|
426
|
+
dhcp: false,
|
|
423
427
|
},
|
|
424
428
|
) {
|
|
425
429
|
const ipList = ips
|
|
@@ -468,7 +472,9 @@ class Dns {
|
|
|
468
472
|
});
|
|
469
473
|
}
|
|
470
474
|
|
|
471
|
-
|
|
475
|
+
let ip;
|
|
476
|
+
if (options.dhcp) ip = Dns.getLocalIPv4Address();
|
|
477
|
+
else ip = await Dns.getPublicIp();
|
|
472
478
|
if (options.copy) return pbcopy(ip);
|
|
473
479
|
console.log(ip);
|
|
474
480
|
return ip;
|
package/src/server/start.js
CHANGED
|
@@ -117,20 +117,27 @@ class UnderpostStartUp {
|
|
|
117
117
|
* @param {Object} options - Options for the deployment.
|
|
118
118
|
* @param {boolean} options.build - Whether to build the deployment.
|
|
119
119
|
* @param {boolean} options.run - Whether to run the deployment.
|
|
120
|
+
* @param {boolean} options.underpostQuicklyInstall - Whether to use underpost quickly install.
|
|
120
121
|
*/
|
|
121
|
-
async callback(
|
|
122
|
+
async callback(
|
|
123
|
+
deployId = 'dd-default',
|
|
124
|
+
env = 'development',
|
|
125
|
+
options = { build: false, run: false, underpostQuicklyInstall: false },
|
|
126
|
+
) {
|
|
122
127
|
UnderpostRootEnv.API.set('container-status', `${deployId}-${env}-build-deployment`);
|
|
123
|
-
if (options.build === true) await UnderpostStartUp.API.build(deployId, env);
|
|
128
|
+
if (options.build === true) await UnderpostStartUp.API.build(deployId, env, options);
|
|
124
129
|
UnderpostRootEnv.API.set('container-status', `${deployId}-${env}-initializing-deployment`);
|
|
125
|
-
if (options.run === true) await UnderpostStartUp.API.run(deployId, env);
|
|
130
|
+
if (options.run === true) await UnderpostStartUp.API.run(deployId, env, options);
|
|
126
131
|
},
|
|
127
132
|
/**
|
|
128
133
|
* Run itc-scripts and builds client bundle.
|
|
129
134
|
* @param {string} deployId - The ID of the deployment.
|
|
130
135
|
* @param {string} env - The environment of the deployment.
|
|
136
|
+
* @param {Object} options - Options for the build.
|
|
137
|
+
* @param {boolean} options.underpostQuicklyInstall - Whether to use underpost quickly install.
|
|
131
138
|
* @memberof UnderpostStartUp
|
|
132
139
|
*/
|
|
133
|
-
async build(deployId = 'dd-default', env = 'development') {
|
|
140
|
+
async build(deployId = 'dd-default', env = 'development', options = { underpostQuicklyInstall: false }) {
|
|
134
141
|
const buildBasePath = `/home/dd`;
|
|
135
142
|
const repoName = `engine-${deployId.split('-')[1]}`;
|
|
136
143
|
shellExec(`cd ${buildBasePath} && underpost clone ${process.env.GITHUB_USERNAME}/${repoName}`);
|
|
@@ -140,7 +147,7 @@ class UnderpostStartUp {
|
|
|
140
147
|
shellExec(`cd ${buildBasePath}/engine && underpost clone ${process.env.GITHUB_USERNAME}/${repoName}-private`);
|
|
141
148
|
shellExec(`cd ${buildBasePath}/engine && sudo mv ./${repoName}-private ./engine-private`);
|
|
142
149
|
shellCd(`${buildBasePath}/engine`);
|
|
143
|
-
shellExec(`npm install`);
|
|
150
|
+
shellExec(options?.underpostQuicklyInstall ? `underpost install` : `npm install`);
|
|
144
151
|
shellExec(`node bin/deploy conf ${deployId} ${env}`);
|
|
145
152
|
if (fs.existsSync('./engine-private/itc-scripts')) {
|
|
146
153
|
const itcScripts = await fs.readdir('./engine-private/itc-scripts');
|
|
@@ -153,9 +160,10 @@ class UnderpostStartUp {
|
|
|
153
160
|
* Runs a deployment.
|
|
154
161
|
* @param {string} deployId - The ID of the deployment.
|
|
155
162
|
* @param {string} env - The environment of the deployment.
|
|
163
|
+
* @param {Object} options - Options for the run.
|
|
156
164
|
* @memberof UnderpostStartUp
|
|
157
165
|
*/
|
|
158
|
-
async run(deployId = 'dd-default', env = 'development') {
|
|
166
|
+
async run(deployId = 'dd-default', env = 'development', options = {}) {
|
|
159
167
|
const runCmd = env === 'production' ? 'run prod-img' : 'run dev-img';
|
|
160
168
|
if (fs.existsSync(`./engine-private/replica`)) {
|
|
161
169
|
const replicas = await fs.readdir(`./engine-private/replica`);
|