underpost 2.8.79 → 2.8.82
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/.github/workflows/ghpkg.yml +23 -21
- package/.github/workflows/npmpkg.yml +16 -11
- package/.github/workflows/pwa-microservices-template.page.yml +12 -3
- package/.github/workflows/pwa-microservices-template.test.yml +20 -17
- package/.vscode/extensions.json +1 -2
- package/.vscode/settings.json +3 -0
- package/Dockerfile +14 -33
- package/README.md +25 -24
- package/bin/db.js +1 -0
- package/bin/deploy.js +88 -796
- package/bin/vs.js +10 -3
- package/cli.md +340 -207
- package/conf.js +4 -0
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +167 -0
- package/manifests/deployment/dd-template-development/proxy.yaml +46 -0
- package/manifests/lxd/lxd-admin-profile.yaml +1 -0
- package/manifests/lxd/lxd-preseed.yaml +9 -37
- package/manifests/lxd/underpost-setup.sh +98 -81
- package/manifests/maas/device-scan.sh +43 -0
- package/manifests/maas/lxd-preseed.yaml +32 -0
- package/manifests/maas/maas-setup.sh +120 -0
- package/manifests/maas/nat-iptables.sh +26 -0
- package/manifests/mariadb/statefulset.yaml +2 -1
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/manifests/mongodb-4.4/service-deployment.yaml +2 -2
- package/manifests/valkey/service.yaml +3 -9
- package/manifests/valkey/statefulset.yaml +10 -12
- package/package.json +1 -1
- package/src/cli/baremetal.js +1248 -0
- package/src/cli/cloud-init.js +528 -0
- package/src/cli/cluster.js +424 -240
- package/src/cli/deploy.js +27 -3
- package/src/cli/env.js +2 -2
- package/src/cli/image.js +57 -9
- package/src/cli/index.js +252 -231
- package/src/cli/lxd.js +314 -81
- package/src/index.js +33 -15
- package/src/runtime/lampp/Dockerfile +41 -47
- package/src/server/conf.js +58 -0
- package/src/server/logger.js +3 -3
- package/src/server/runtime.js +1 -6
- package/src/server/ssl.js +1 -12
- package/src/server/valkey.js +3 -3
- package/supervisord-openssh-server.conf +0 -5
|
@@ -1,65 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
RUN
|
|
11
|
-
|
|
12
|
-
RUN
|
|
13
|
-
RUN
|
|
14
|
-
|
|
15
|
-
RUN
|
|
16
|
-
|
|
17
|
-
RUN
|
|
18
|
-
RUN
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# install ssh
|
|
24
|
-
RUN mkdir -p /var/run/sshd
|
|
25
|
-
# Allow root login via password
|
|
26
|
-
RUN sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
|
27
|
-
|
|
28
|
-
# install open ssl git and others tools
|
|
29
|
-
RUN apt-get install -yq --no-install-recommends libssl-dev curl wget git gnupg
|
|
30
|
-
|
|
31
|
-
# install lampp
|
|
1
|
+
FROM rockylinux:9
|
|
2
|
+
|
|
3
|
+
RUN dnf install -y --allowerasing bzip2
|
|
4
|
+
|
|
5
|
+
RUN dnf update -y
|
|
6
|
+
RUN dnf install -y epel-release
|
|
7
|
+
RUN dnf install -y --allowerasing sudo
|
|
8
|
+
RUN dnf install -y --allowerasing curl
|
|
9
|
+
RUN dnf install -y --allowerasing net-tools
|
|
10
|
+
RUN dnf install -y --allowerasing openssh-server
|
|
11
|
+
RUN dnf install -y --allowerasing nano
|
|
12
|
+
RUN dnf install -y --allowerasing vim-enhanced
|
|
13
|
+
RUN dnf install -y --allowerasing less
|
|
14
|
+
RUN dnf install -y --allowerasing openssl-devel
|
|
15
|
+
RUN dnf install -y --allowerasing wget
|
|
16
|
+
RUN dnf install -y --allowerasing git
|
|
17
|
+
RUN dnf install -y --allowerasing gnupg2
|
|
18
|
+
RUN dnf clean all
|
|
19
|
+
|
|
20
|
+
# Install LAMPP (XAMPP)
|
|
21
|
+
# Download the XAMPP installer for Linux
|
|
32
22
|
RUN curl -Lo xampp-linux-installer.run https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/7.4.33/xampp-linux-x64-7.4.33-0-installer.run?from_af=true
|
|
33
23
|
RUN chmod +x xampp-linux-installer.run
|
|
34
|
-
|
|
24
|
+
# Run the XAMPP installer in silent mode
|
|
25
|
+
RUN bash -c './xampp-linux-installer.run --mode unattended'
|
|
26
|
+
# Create a symbolic link for easy access to lampp command
|
|
35
27
|
RUN ln -sf /opt/lampp/lampp /usr/bin/lampp
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
|
|
29
|
+
# Configure XAMPP
|
|
30
|
+
# Enable XAMPP web interface (remove security checks)
|
|
31
|
+
RUN sed -i.bak 's/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf
|
|
38
32
|
# Enable error display in php
|
|
39
|
-
RUN sed -i.bak s
|
|
40
|
-
# Enable includes of several configuration files
|
|
41
|
-
RUN mkdir /opt/lampp/apache2/conf.d
|
|
33
|
+
RUN sed -i.bak 's/display_errors=Off/display_errors=On/g' /opt/lampp/etc/php.ini
|
|
34
|
+
# Enable includes of several configuration files for Apache
|
|
35
|
+
RUN mkdir -p /opt/lampp/apache2/conf.d
|
|
42
36
|
RUN echo "IncludeOptional /opt/lampp/apache2/conf.d/*.conf" >>/opt/lampp/etc/httpd.conf
|
|
43
|
-
# Create a /www folder and a symbolic link to it in /opt/lampp/htdocs
|
|
44
|
-
# This is convenient because it doesn't interfere with xampp, phpmyadmin or other tools
|
|
45
|
-
# /opt/lampp/etc/httpd.conf
|
|
37
|
+
# Create a /www folder and a symbolic link to it in /opt/lampp/htdocs
|
|
38
|
+
# This is convenient because it doesn't interfere with xampp, phpmyadmin or other tools
|
|
46
39
|
RUN mkdir /www
|
|
47
40
|
RUN ln -s /www /opt/lampp/htdocs
|
|
48
41
|
|
|
49
|
-
#
|
|
50
|
-
RUN curl -fsSL https://
|
|
51
|
-
RUN
|
|
42
|
+
# Install Node.js
|
|
43
|
+
RUN curl -fsSL https://rpm.nodesource.com/setup_23.x | bash -
|
|
44
|
+
RUN dnf install nodejs -y
|
|
45
|
+
RUN dnf clean all
|
|
46
|
+
|
|
47
|
+
# Verify Node.js and npm versions
|
|
52
48
|
RUN node --version
|
|
53
49
|
RUN npm --version
|
|
54
50
|
|
|
51
|
+
# Set working directory
|
|
55
52
|
WORKDIR /home/dd
|
|
56
53
|
|
|
54
|
+
# Expose necessary ports
|
|
57
55
|
EXPOSE 22
|
|
58
|
-
|
|
59
56
|
EXPOSE 80
|
|
60
|
-
|
|
61
57
|
EXPOSE 443
|
|
62
|
-
|
|
63
58
|
EXPOSE 3000-3100
|
|
64
|
-
|
|
65
59
|
EXPOSE 4000-4100
|
package/src/server/conf.js
CHANGED
|
@@ -1171,6 +1171,63 @@ const writeEnv = (envPath, envObj) =>
|
|
|
1171
1171
|
'utf8',
|
|
1172
1172
|
);
|
|
1173
1173
|
|
|
1174
|
+
const buildCliDoc = (program) => {
|
|
1175
|
+
let md = shellExec(`node bin help`, { silent: true, stdout: true }).split('Options:');
|
|
1176
|
+
const baseOptions =
|
|
1177
|
+
`## ${md[0].split(`\n`)[2]}
|
|
1178
|
+
|
|
1179
|
+
### Usage: ` +
|
|
1180
|
+
'`' +
|
|
1181
|
+
md[0].split(`\n`)[0].split('Usage: ')[1] +
|
|
1182
|
+
'`' +
|
|
1183
|
+
`
|
|
1184
|
+
` +
|
|
1185
|
+
'```\n Options:' +
|
|
1186
|
+
md[1] +
|
|
1187
|
+
' \n```';
|
|
1188
|
+
md =
|
|
1189
|
+
baseOptions +
|
|
1190
|
+
`
|
|
1191
|
+
|
|
1192
|
+
## Commands:
|
|
1193
|
+
`;
|
|
1194
|
+
program.commands.map((o) => {
|
|
1195
|
+
md +=
|
|
1196
|
+
`
|
|
1197
|
+
|
|
1198
|
+
` +
|
|
1199
|
+
'### `' +
|
|
1200
|
+
o._name +
|
|
1201
|
+
'` :' +
|
|
1202
|
+
`
|
|
1203
|
+
` +
|
|
1204
|
+
'```\n ' +
|
|
1205
|
+
shellExec(`node bin help ${o._name}`, { silent: true, stdout: true }) +
|
|
1206
|
+
' \n```' +
|
|
1207
|
+
`
|
|
1208
|
+
`;
|
|
1209
|
+
});
|
|
1210
|
+
fs.writeFileSync(`./src/client/public/nexodev/docs/references/Command Line Interface.md`, md, 'utf8');
|
|
1211
|
+
fs.writeFileSync(`./cli.md`, md, 'utf8');
|
|
1212
|
+
const readmeSplit = `pwa-microservices-template</a>`;
|
|
1213
|
+
const readme = fs.readFileSync(`./README.md`, 'utf8').split(readmeSplit);
|
|
1214
|
+
fs.writeFileSync(
|
|
1215
|
+
'./README.md',
|
|
1216
|
+
readme[0] +
|
|
1217
|
+
readmeSplit +
|
|
1218
|
+
`
|
|
1219
|
+
|
|
1220
|
+
` +
|
|
1221
|
+
baseOptions +
|
|
1222
|
+
`
|
|
1223
|
+
|
|
1224
|
+
<a target="_top" href="https://github.com/underpostnet/pwa-microservices-template/blob/master/cli.md">See complete CLI Docs here.</a>
|
|
1225
|
+
|
|
1226
|
+
`,
|
|
1227
|
+
'utf8',
|
|
1228
|
+
);
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1174
1231
|
export {
|
|
1175
1232
|
Cmd,
|
|
1176
1233
|
Config,
|
|
@@ -1214,4 +1271,5 @@ export {
|
|
|
1214
1271
|
deployRangePortFactory,
|
|
1215
1272
|
awaitDeployMonitor,
|
|
1216
1273
|
rebuildConfFactory,
|
|
1274
|
+
buildCliDoc,
|
|
1217
1275
|
};
|
package/src/server/logger.js
CHANGED
|
@@ -176,7 +176,7 @@ const loggerMiddleware = (meta = { url: '' }) => {
|
|
|
176
176
|
);
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
const
|
|
179
|
+
const underpostASCII = () => `
|
|
180
180
|
|
|
181
181
|
██╗░░░██╗███╗░░██╗██████╗░███████╗██████╗░██████╗░░█████╗░░██████╗████████╗
|
|
182
182
|
██║░░░██║████╗░██║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
|
|
@@ -188,10 +188,10 @@ const underpostASCI = () => `
|
|
|
188
188
|
|
|
189
189
|
const actionInitLog = () =>
|
|
190
190
|
console.log(
|
|
191
|
-
|
|
191
|
+
underpostASCII() +
|
|
192
192
|
`
|
|
193
193
|
https://www.nexodev.org/docs
|
|
194
194
|
`,
|
|
195
195
|
);
|
|
196
196
|
|
|
197
|
-
export { loggerFactory, loggerMiddleware, setUpInfo,
|
|
197
|
+
export { loggerFactory, loggerMiddleware, setUpInfo, underpostASCII, actionInitLog };
|
package/src/server/runtime.js
CHANGED
|
@@ -251,11 +251,6 @@ const buildRuntime = async () => {
|
|
|
251
251
|
return next();
|
|
252
252
|
});
|
|
253
253
|
|
|
254
|
-
// https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus.yml
|
|
255
|
-
// https://github.com/grafana/grafana/tree/main/conf
|
|
256
|
-
// https://medium.com/@diego.coder/monitoreo-de-aplicaciones-con-node-js-grafana-y-prometheus-afd2b33e3f91
|
|
257
|
-
// for grafana prometheus server: host.docker.internal:9090
|
|
258
|
-
|
|
259
254
|
app.use((req, res, next) => {
|
|
260
255
|
requestCounter.inc({
|
|
261
256
|
instance: `${host}:${port}${path}`,
|
|
@@ -366,7 +361,7 @@ const buildRuntime = async () => {
|
|
|
366
361
|
if (db && apis) await DataBaseProvider.load({ apis, host, path, db });
|
|
367
362
|
|
|
368
363
|
// valkey server
|
|
369
|
-
await createValkeyConnection({ host, path }, valkey);
|
|
364
|
+
if (valkey) await createValkeyConnection({ host, path }, valkey);
|
|
370
365
|
|
|
371
366
|
if (mailer) {
|
|
372
367
|
const mailerSsrConf = confSSR[getCapVariableName(client)];
|
package/src/server/ssl.js
CHANGED
|
@@ -106,15 +106,4 @@ const sslRedirectMiddleware = (req, res, port, proxyRouter) => {
|
|
|
106
106
|
return res.status(302).redirect(sslRedirectUrl);
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
switch (process.platform) {
|
|
111
|
-
case 'win32':
|
|
112
|
-
break;
|
|
113
|
-
case 'linux':
|
|
114
|
-
break;
|
|
115
|
-
default:
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export { buildSSL, buildSecureContext, validateSecureContext, createSslServer, sslRedirectMiddleware, installCertbot };
|
|
109
|
+
export { buildSSL, buildSecureContext, validateSecureContext, createSslServer, sslRedirectMiddleware };
|
package/src/server/valkey.js
CHANGED
|
@@ -34,14 +34,14 @@ const selectDtoFactory = (payload, select) => {
|
|
|
34
34
|
const valkeyClientFactory = async (options) => {
|
|
35
35
|
const valkey = new Valkey({
|
|
36
36
|
// port: 6379,
|
|
37
|
-
// host: 'service
|
|
37
|
+
// host: 'valkey-service.default.svc.cluster.local',
|
|
38
38
|
port: options?.port ? options.port : undefined,
|
|
39
|
-
host: options?.
|
|
39
|
+
host: options?.host ? options.host : undefined,
|
|
40
40
|
retryStrategy: (attempt) => {
|
|
41
41
|
if (attempt === 1) {
|
|
42
42
|
valkey.disconnect();
|
|
43
43
|
valkeyEnabled = false;
|
|
44
|
-
logger.warn('Valkey service not enabled', { valkeyEnabled });
|
|
44
|
+
logger.warn('Valkey service not enabled', { ...options, valkeyEnabled });
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
return 1000; // 1 second interval attempt
|