underpost 2.8.799 → 2.8.811
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/deploy.js +379 -101
- package/bin/vs.js +10 -3
- package/cli.md +331 -219
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +18 -18
- package/manifests/lxd/underpost-setup.sh +1 -1
- package/manifests/maas/lxd-preseed.yaml +32 -0
- package/manifests/maas/maas-setup.sh +64 -0
- package/manifests/mariadb/statefulset.yaml +2 -1
- package/manifests/mariadb/storage-class.yaml +10 -0
- package/package.json +1 -1
- package/src/cli/baremetal.js +99 -0
- package/src/cli/cluster.js +14 -0
- package/src/cli/deploy.js +1 -1
- package/src/cli/env.js +2 -2
- package/src/cli/image.js +4 -3
- package/src/cli/index.js +244 -239
- package/src/index.js +9 -1
- package/src/runtime/lampp/Dockerfile +68 -38
- package/src/server/conf.js +58 -0
- package/supervisord-openssh-server.conf +0 -5
package/src/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace Underpost
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import UnderpostBaremetal from './cli/baremetal.js';
|
|
7
8
|
import UnderpostCluster from './cli/cluster.js';
|
|
8
9
|
import UnderpostCron from './cli/cron.js';
|
|
9
10
|
import UnderpostDB from './cli/db.js';
|
|
@@ -31,7 +32,7 @@ class Underpost {
|
|
|
31
32
|
* @type {String}
|
|
32
33
|
* @memberof Underpost
|
|
33
34
|
*/
|
|
34
|
-
static version = 'v2.8.
|
|
35
|
+
static version = 'v2.8.811';
|
|
35
36
|
/**
|
|
36
37
|
* Repository cli API
|
|
37
38
|
* @static
|
|
@@ -130,6 +131,13 @@ class Underpost {
|
|
|
130
131
|
* @memberof Underpost
|
|
131
132
|
*/
|
|
132
133
|
static lxd = UnderpostLxd.API;
|
|
134
|
+
/**
|
|
135
|
+
* Baremetal cli API
|
|
136
|
+
* @static
|
|
137
|
+
* @type {UnderpostBaremetal.API}
|
|
138
|
+
* @memberof Underpost
|
|
139
|
+
*/
|
|
140
|
+
static baremetal = UnderpostBaremetal.API;
|
|
133
141
|
}
|
|
134
142
|
|
|
135
143
|
const up = Underpost;
|
|
@@ -1,65 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
# Use Rocky Linux 9 as the base image
|
|
2
|
+
FROM rockylinux:9
|
|
2
3
|
|
|
3
|
-
#
|
|
4
|
+
# Set environment variable for non-interactive mode (though less critical for DNF than APT)
|
|
5
|
+
ENV DNF_ASSUMEYES=1
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ENV DEBIAN_FRONTEND=noninteractive
|
|
8
|
-
|
|
9
|
-
# Set root password to root, format is 'user:password'.
|
|
7
|
+
# Set root password to root
|
|
10
8
|
RUN echo 'root:root' | chpasswd
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
RUN
|
|
16
|
-
|
|
17
|
-
RUN
|
|
18
|
-
RUN
|
|
19
|
-
|
|
20
|
-
RUN
|
|
21
|
-
RUN
|
|
10
|
+
# Update system packages and install EPEL, then essential tools
|
|
11
|
+
# DNF is the package manager for Rocky Linux (RHEL-based)
|
|
12
|
+
RUN dnf update -y
|
|
13
|
+
RUN dnf install -y epel-release
|
|
14
|
+
RUN dnf install -y --allowerasing sudo
|
|
15
|
+
RUN dnf install -y --allowerasing curl
|
|
16
|
+
RUN dnf install -y --allowerasing net-tools
|
|
17
|
+
RUN dnf install -y --allowerasing openssh-server
|
|
18
|
+
RUN dnf install -y --allowerasing supervisor
|
|
19
|
+
RUN dnf install -y --allowerasing nano
|
|
20
|
+
RUN dnf install -y --allowerasing vim-enhanced
|
|
21
|
+
RUN dnf install -y --allowerasing less
|
|
22
|
+
RUN dnf install -y --allowerasing openssl-devel
|
|
23
|
+
RUN dnf install -y --allowerasing wget
|
|
24
|
+
RUN dnf install -y --allowerasing git
|
|
25
|
+
RUN dnf install -y --allowerasing gnupg2
|
|
26
|
+
RUN dnf clean all
|
|
22
27
|
|
|
23
|
-
#
|
|
28
|
+
# Configure SSH
|
|
24
29
|
RUN mkdir -p /var/run/sshd
|
|
25
30
|
# Allow root login via password
|
|
26
31
|
RUN sed -ri 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
|
27
32
|
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# install lampp
|
|
33
|
+
# Install LAMPP (XAMPP)
|
|
34
|
+
# Download the XAMPP installer for Linux
|
|
32
35
|
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
36
|
RUN chmod +x xampp-linux-installer.run
|
|
34
|
-
|
|
37
|
+
# Run the XAMPP installer in silent mode
|
|
38
|
+
RUN bash -c './xampp-linux-installer.run --mode unattended'
|
|
39
|
+
# Create a symbolic link for easy access to lampp command
|
|
35
40
|
RUN ln -sf /opt/lampp/lampp /usr/bin/lampp
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
|
|
42
|
+
# Configure XAMPP
|
|
43
|
+
# Enable XAMPP web interface (remove security checks)
|
|
44
|
+
RUN sed -i.bak 's/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf
|
|
38
45
|
# 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
|
|
46
|
+
RUN sed -i.bak 's/display_errors=Off/display_errors=On/g' /opt/lampp/etc/php.ini
|
|
47
|
+
# Enable includes of several configuration files for Apache
|
|
48
|
+
RUN mkdir -p /opt/lampp/apache2/conf.d
|
|
42
49
|
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
|
|
50
|
+
# Create a /www folder and a symbolic link to it in /opt/lampp/htdocs
|
|
51
|
+
# This is convenient because it doesn't interfere with xampp, phpmyadmin or other tools
|
|
46
52
|
RUN mkdir /www
|
|
47
53
|
RUN ln -s /www /opt/lampp/htdocs
|
|
48
54
|
|
|
49
|
-
#
|
|
50
|
-
|
|
51
|
-
RUN
|
|
55
|
+
# Install Node.js
|
|
56
|
+
# Add NodeSource repository for Node.js 23.x (for RHEL-based systems)
|
|
57
|
+
RUN curl -fsSL https://rpm.nodesource.com/setup_23.x | bash -
|
|
58
|
+
RUN dnf install nodejs -y
|
|
59
|
+
RUN dnf clean all
|
|
60
|
+
|
|
61
|
+
# Verify Node.js and npm versions
|
|
52
62
|
RUN node --version
|
|
53
63
|
RUN npm --version
|
|
54
64
|
|
|
65
|
+
# Set working directory
|
|
55
66
|
WORKDIR /home/dd
|
|
56
67
|
|
|
68
|
+
# Expose necessary ports
|
|
57
69
|
EXPOSE 22
|
|
58
|
-
|
|
59
70
|
EXPOSE 80
|
|
60
|
-
|
|
61
71
|
EXPOSE 443
|
|
62
|
-
|
|
63
72
|
EXPOSE 3000-3100
|
|
64
|
-
|
|
65
73
|
EXPOSE 4000-4100
|
|
74
|
+
|
|
75
|
+
# Default command to start SSH and XAMPP (Apache and MySQL)
|
|
76
|
+
# Using supervisord to manage multiple processes
|
|
77
|
+
CMD ["/usr/bin/supervisord", "-n"]
|
|
78
|
+
|
|
79
|
+
# To run XAMPP services under supervisord, you'll need to add a supervisord configuration file.
|
|
80
|
+
# For example, create a file named /etc/supervisord.d/xampp.ini inside the container:
|
|
81
|
+
#
|
|
82
|
+
# [program:sshd]
|
|
83
|
+
# command=/usr/sbin/sshd -D
|
|
84
|
+
# autostart=true
|
|
85
|
+
# autorestart=true
|
|
86
|
+
#
|
|
87
|
+
# [program:apache]
|
|
88
|
+
# command=/opt/lampp/bin/apachectl start
|
|
89
|
+
# autostart=true
|
|
90
|
+
# autorestart=true
|
|
91
|
+
#
|
|
92
|
+
# [program:mysql]
|
|
93
|
+
# command=/opt/lampp/bin/mysql.server start
|
|
94
|
+
# autostart=true
|
|
95
|
+
# autorestart=true
|
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
|
};
|