underpost 2.8.798 → 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/src/cli/lxd.js CHANGED
@@ -43,7 +43,7 @@ class UnderpostLxd {
43
43
  createAdminProfile: false,
44
44
  control: false,
45
45
  worker: false,
46
- k3s: false, // New k3s option
46
+ k3s: false,
47
47
  initVm: '',
48
48
  createVm: '',
49
49
  infoVm: '',
@@ -96,7 +96,6 @@ ipv6.address=none`);
96
96
  let flag = '';
97
97
  if (options.control === true) {
98
98
  if (options.k3s === true) {
99
- // New K3s flag for control plane
100
99
  flag = ' -s -- --k3s';
101
100
  } else {
102
101
  // Default to kubeadm if not K3s
@@ -107,7 +106,6 @@ ipv6.address=none`);
107
106
  shellExec(`lxc file push /home/dd/engine/manifests ${options.initVm}/home/dd/engine --recursive`);
108
107
  } else if (options.worker == true) {
109
108
  if (options.k3s === true) {
110
- // New K3s flag for worker
111
109
  flag = ' -s -- --worker --k3s';
112
110
  } else {
113
111
  // Default to kubeadm worker
@@ -263,7 +261,6 @@ ipv6.address=none`);
263
261
  }
264
262
  }
265
263
 
266
- // New 'test' option implementation
267
264
  if (options.test && typeof options.test === 'string') {
268
265
  const vmName = options.test;
269
266
  console.log(`Starting comprehensive test for VM: ${vmName}`);
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.798';
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
- ARG BASE_DEBIAN=buster
1
+ # Use Rocky Linux 9 as the base image
2
+ FROM rockylinux:9
2
3
 
3
- # USER root
4
+ # Set environment variable for non-interactive mode (though less critical for DNF than APT)
5
+ ENV DNF_ASSUMEYES=1
4
6
 
5
- FROM debian:${BASE_DEBIAN}
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
- RUN apt-get update --fix-missing
13
- RUN apt-get upgrade -y
14
- # install sudo
15
- RUN apt-get -y install sudo
16
- # net-tools provides netstat commands
17
- RUN apt-get -y install curl net-tools
18
- RUN apt-get -yq install openssh-server supervisor
19
- # Few handy utilities which are nice to have
20
- RUN apt-get -y install nano vim less --no-install-recommends
21
- RUN apt-get clean
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
- # install ssh
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
- # 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
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
- RUN bash -c './xampp-linux-installer.run'
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
- # Enable XAMPP web interface(remove security checks)
37
- RUN sed -i.bak s'/Require local/Require all granted/g' /opt/lampp/etc/extra/httpd-xampp.conf
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'/display_errors=Off/display_errors=On/g' /opt/lampp/etc/php.ini
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. It'll be accessible via http://localhost:[port]/www/
44
- # This is convenient because it doesn't interfere with xampp, phpmyadmin or other tools in /opt/lampp/htdocs
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
- # install nodejs https://github.com/nodesource/distributions/blob/master/README.md#deb
50
- RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash -
51
- RUN apt-get install -y nodejs build-essential
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
@@ -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
  };
@@ -1,5 +0,0 @@
1
- [program:openssh-server]
2
- command=/usr/sbin/sshd -D
3
- numprocs=1
4
- autostart=true
5
- autorestart=true