ezpm2gui 1.4.0 → 1.5.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.
Files changed (39) hide show
  1. package/README.md +295 -295
  2. package/bin/ezpm2gui.js +8 -8
  3. package/bin/ezpm2gui.ts +51 -51
  4. package/bin/generate-ecosystem.js +35 -35
  5. package/bin/generate-ecosystem.ts +56 -56
  6. package/dist/index.js +1 -1
  7. package/dist/server/config/project-configs.json +236 -0
  8. package/dist/server/index.js +212 -25
  9. package/dist/server/routes/deployApplication.js +6 -5
  10. package/dist/server/routes/remoteConnections.js +260 -0
  11. package/dist/server/routes/updates.d.ts +3 -0
  12. package/dist/server/routes/updates.js +135 -0
  13. package/dist/server/utils/remote-connection.d.ts +18 -0
  14. package/dist/server/utils/remote-connection.js +216 -9
  15. package/package.json +73 -71
  16. package/scripts/postinstall.js +36 -36
  17. package/src/client/build/asset-manifest.json +6 -6
  18. package/src/client/build/favicon.ico +2 -2
  19. package/src/client/build/index.html +1 -1
  20. package/src/client/build/logo192.svg +7 -7
  21. package/src/client/build/logo512.svg +7 -7
  22. package/src/client/build/manifest.json +24 -24
  23. package/src/client/build/static/css/main.2d095544.css +5 -0
  24. package/src/client/build/static/css/main.2d095544.css.map +1 -0
  25. package/src/client/build/static/js/main.17e17668.js +3 -0
  26. package/src/client/build/static/js/main.17e17668.js.map +1 -0
  27. package/dist/server/config/cron-jobs.json +0 -1
  28. package/dist/server/config/remote-connections.json +0 -3
  29. package/dist/server/daemon/ezpm2gui.err.log +0 -414
  30. package/dist/server/daemon/ezpm2gui.exe +0 -0
  31. package/dist/server/daemon/ezpm2gui.exe.config +0 -6
  32. package/dist/server/daemon/ezpm2gui.out.log +0 -289
  33. package/dist/server/daemon/ezpm2gui.wrapper.log +0 -172
  34. package/dist/server/daemon/ezpm2gui.xml +0 -32
  35. package/src/client/build/static/css/main.c506cba5.css +0 -5
  36. package/src/client/build/static/css/main.c506cba5.css.map +0 -1
  37. package/src/client/build/static/js/main.5278cddd.js +0 -3
  38. package/src/client/build/static/js/main.5278cddd.js.map +0 -1
  39. /package/src/client/build/static/js/{main.5278cddd.js.LICENSE.txt → main.17e17668.js.LICENSE.txt} +0 -0
package/bin/ezpm2gui.ts CHANGED
@@ -1,51 +1,51 @@
1
- #!/usr/bin/env node
2
- import { spawn, ChildProcess } from 'child_process';
3
- import path from 'path';
4
- import fs from 'fs';
5
-
6
- // Determine the path to the server executable
7
- const serverPath = path.join(__dirname, '../dist/server/index.js');
8
-
9
- // Check if the server file exists
10
- if (!fs.existsSync(serverPath)) {
11
- console.error('Error: Server executable not found. Please make sure the package is built correctly.');
12
- process.exit(1);
13
- }
14
-
15
- // Start the server
16
- const server: ChildProcess = spawn('node', [serverPath], { stdio: 'inherit' });
17
-
18
- // Log startup message
19
- console.log('\x1b[36m%s\x1b[0m', `
20
- ╔════════════════════════════════════╗
21
- ║ ezPM2GUI Started ║
22
- ╚════════════════════════════════════╝
23
-
24
- Web interface available at: \x1b[1mhttp://localhost:3001\x1b[0m
25
-
26
- Press Ctrl+C to stop the server.
27
- `);
28
-
29
- // Handle server process events
30
- server.on('error', (err: Error) => {
31
- console.error('Failed to start server:', err);
32
- process.exit(1);
33
- });
34
-
35
- server.on('exit', (code: number | null) => {
36
- if (code !== 0) {
37
- console.error(`Server process exited with code ${code}`);
38
- }
39
- process.exit(code || 0);
40
- });
41
-
42
- // Handle termination signals
43
- process.on('SIGINT', () => {
44
- console.log('\nShutting down ezPM2GUI...');
45
- server.kill();
46
- });
47
-
48
- process.on('SIGTERM', () => {
49
- console.log('\nShutting down ezPM2GUI...');
50
- server.kill();
51
- });
1
+ #!/usr/bin/env node
2
+ import { spawn, ChildProcess } from 'child_process';
3
+ import path from 'path';
4
+ import fs from 'fs';
5
+
6
+ // Determine the path to the server executable
7
+ const serverPath = path.join(__dirname, '../dist/server/index.js');
8
+
9
+ // Check if the server file exists
10
+ if (!fs.existsSync(serverPath)) {
11
+ console.error('Error: Server executable not found. Please make sure the package is built correctly.');
12
+ process.exit(1);
13
+ }
14
+
15
+ // Start the server
16
+ const server: ChildProcess = spawn('node', [serverPath], { stdio: 'inherit' });
17
+
18
+ // Log startup message
19
+ console.log('\x1b[36m%s\x1b[0m', `
20
+ ╔════════════════════════════════════╗
21
+ ║ ezPM2GUI Started ║
22
+ ╚════════════════════════════════════╝
23
+
24
+ Web interface available at: \x1b[1mhttp://localhost:3101\x1b[0m
25
+
26
+ Press Ctrl+C to stop the server.
27
+ `);
28
+
29
+ // Handle server process events
30
+ server.on('error', (err: Error) => {
31
+ console.error('Failed to start server:', err);
32
+ process.exit(1);
33
+ });
34
+
35
+ server.on('exit', (code: number | null) => {
36
+ if (code !== 0) {
37
+ console.error(`Server process exited with code ${code}`);
38
+ }
39
+ process.exit(code || 0);
40
+ });
41
+
42
+ // Handle termination signals
43
+ process.on('SIGINT', () => {
44
+ console.log('\nShutting down ezPM2GUI...');
45
+ server.kill();
46
+ });
47
+
48
+ process.on('SIGTERM', () => {
49
+ console.log('\nShutting down ezPM2GUI...');
50
+ server.kill();
51
+ });
@@ -6,41 +6,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const ecosystemConfig = `
10
- module.exports = {
11
- apps : [
12
- {
13
- name: "my-api",
14
- script: "./api/index.js",
15
- instances: 2,
16
- exec_mode: "cluster",
17
- watch: false,
18
- env: {
19
- NODE_ENV: "production",
20
- PORT: 3000
21
- }
22
- },
23
- {
24
- name: "worker",
25
- script: "./workers/queue-processor.js",
26
- instances: 1,
27
- watch: false,
28
- env: {
29
- NODE_ENV: "production"
30
- }
31
- },
32
- {
33
- name: "cron-job",
34
- script: "./cron/scheduler.js",
35
- instances: 1,
36
- watch: false,
37
- cron_restart: "0 0 * * *",
38
- env: {
39
- NODE_ENV: "production"
40
- }
41
- }
42
- ]
43
- }
9
+ const ecosystemConfig = `
10
+ module.exports = {
11
+ apps : [
12
+ {
13
+ name: "my-api",
14
+ script: "./api/index.js",
15
+ instances: 2,
16
+ exec_mode: "cluster",
17
+ watch: false,
18
+ env: {
19
+ NODE_ENV: "production",
20
+ PORT: 3000
21
+ }
22
+ },
23
+ {
24
+ name: "worker",
25
+ script: "./workers/queue-processor.js",
26
+ instances: 1,
27
+ watch: false,
28
+ env: {
29
+ NODE_ENV: "production"
30
+ }
31
+ },
32
+ {
33
+ name: "cron-job",
34
+ script: "./cron/scheduler.js",
35
+ instances: 1,
36
+ watch: false,
37
+ cron_restart: "0 0 * * *",
38
+ env: {
39
+ NODE_ENV: "production"
40
+ }
41
+ }
42
+ ]
43
+ }
44
44
  `;
45
45
  // Get the output path
46
46
  const outputPath = process.argv[2] || 'ecosystem.config.js';
@@ -1,56 +1,56 @@
1
- #!/usr/bin/env node
2
- import fs from 'fs';
3
- import path from 'path';
4
-
5
- const ecosystemConfig = `
6
- module.exports = {
7
- apps : [
8
- {
9
- name: "my-api",
10
- script: "./api/index.js",
11
- instances: 2,
12
- exec_mode: "cluster",
13
- watch: false,
14
- env: {
15
- NODE_ENV: "production",
16
- PORT: 3000
17
- }
18
- },
19
- {
20
- name: "worker",
21
- script: "./workers/queue-processor.js",
22
- instances: 1,
23
- watch: false,
24
- env: {
25
- NODE_ENV: "production"
26
- }
27
- },
28
- {
29
- name: "cron-job",
30
- script: "./cron/scheduler.js",
31
- instances: 1,
32
- watch: false,
33
- cron_restart: "0 0 * * *",
34
- env: {
35
- NODE_ENV: "production"
36
- }
37
- }
38
- ]
39
- }
40
- `;
41
-
42
- // Get the output path
43
- const outputPath: string = process.argv[2] || 'ecosystem.config.js';
44
- const fullPath: string = path.resolve(process.cwd(), outputPath);
45
-
46
- try {
47
- // Write file
48
- fs.writeFileSync(fullPath, ecosystemConfig);
49
- console.log(`PM2 ecosystem file generated at: ${fullPath}`);
50
- console.log('\nTo start your PM2 processes with this configuration:');
51
- console.log(' pm2 start ecosystem.config.js');
52
- console.log('\nTo monitor your processes with ezPM2GUI:');
53
- console.log(' ezpm2gui');
54
- } catch (error) {
55
- console.error('Error generating ecosystem file:', error);
56
- }
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ const ecosystemConfig = `
6
+ module.exports = {
7
+ apps : [
8
+ {
9
+ name: "my-api",
10
+ script: "./api/index.js",
11
+ instances: 2,
12
+ exec_mode: "cluster",
13
+ watch: false,
14
+ env: {
15
+ NODE_ENV: "production",
16
+ PORT: 3000
17
+ }
18
+ },
19
+ {
20
+ name: "worker",
21
+ script: "./workers/queue-processor.js",
22
+ instances: 1,
23
+ watch: false,
24
+ env: {
25
+ NODE_ENV: "production"
26
+ }
27
+ },
28
+ {
29
+ name: "cron-job",
30
+ script: "./cron/scheduler.js",
31
+ instances: 1,
32
+ watch: false,
33
+ cron_restart: "0 0 * * *",
34
+ env: {
35
+ NODE_ENV: "production"
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ `;
41
+
42
+ // Get the output path
43
+ const outputPath: string = process.argv[2] || 'ecosystem.config.js';
44
+ const fullPath: string = path.resolve(process.cwd(), outputPath);
45
+
46
+ try {
47
+ // Write file
48
+ fs.writeFileSync(fullPath, ecosystemConfig);
49
+ console.log(`PM2 ecosystem file generated at: ${fullPath}`);
50
+ console.log('\nTo start your PM2 processes with this configuration:');
51
+ console.log(' pm2 start ecosystem.config.js');
52
+ console.log('\nTo monitor your processes with ezPM2GUI:');
53
+ console.log(' ezpm2gui');
54
+ } catch (error) {
55
+ console.error('Error generating ecosystem file:', error);
56
+ }
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ const index_1 = require("./server/index");
9
9
  * @returns The HTTP server instance
10
10
  */
11
11
  function start(options = {}) {
12
- const port = options.port || process.env.PORT || 3001;
12
+ const port = options.port || process.env.PORT || 3101;
13
13
  const host = options.host || process.env.HOST || 'localhost';
14
14
  process.env.PORT = port.toString();
15
15
  process.env.HOST = host;
@@ -0,0 +1,236 @@
1
+ {
2
+ "projectTypes": {
3
+ "node": {
4
+ "name": "Node.js",
5
+ "detection": {
6
+ "files": ["package.json"],
7
+ "extensions": [".js", ".ts", ".jsx", ".tsx"]
8
+ },
9
+ "setup": {
10
+ "steps": [
11
+ {
12
+ "name": "Check Node.js version",
13
+ "command": "node --version",
14
+ "description": "Verifying Node.js installation",
15
+ "required": true
16
+ },
17
+ {
18
+ "name": "Install dependencies",
19
+ "command": "npm install",
20
+ "description": "Installing project dependencies",
21
+ "required": true,
22
+ "workingDirectory": "project"
23
+ },
24
+ {
25
+ "name": "Build project (if build script exists)",
26
+ "command": "npm run build",
27
+ "description": "Building the project",
28
+ "required": false,
29
+ "conditional": "build_script_exists",
30
+ "workingDirectory": "project"
31
+ },
32
+ {
33
+ "name": "Run tests (if test script exists)",
34
+ "command": "npm test",
35
+ "description": "Running tests",
36
+ "required": false,
37
+ "conditional": "test_script_exists",
38
+ "workingDirectory": "project"
39
+ }
40
+ ],
41
+ "environment": {
42
+ "NODE_ENV": "production"
43
+ }
44
+ },
45
+ "validation": {
46
+ "checks": [
47
+ {
48
+ "name": "package.json exists",
49
+ "file": "package.json"
50
+ },
51
+ {
52
+ "name": "node_modules exists after install",
53
+ "directory": "node_modules"
54
+ }
55
+ ]
56
+ },
57
+ "defaultConfig": {
58
+ "interpreter": "node",
59
+ "execMode": "fork",
60
+ "supportsCluster": true,
61
+ "startScript": "npm start"
62
+ }
63
+ },
64
+ "python": {
65
+ "name": "Python",
66
+ "detection": {
67
+ "files": ["requirements.txt", "pyproject.toml", "setup.py", "Pipfile"],
68
+ "extensions": [".py"]
69
+ },
70
+ "setup": {
71
+ "steps": [
72
+ {
73
+ "name": "Check Python version",
74
+ "command": "python --version",
75
+ "description": "Verifying Python installation",
76
+ "required": true
77
+ },
78
+ {
79
+ "name": "Create virtual environment",
80
+ "command": "python -m venv venv",
81
+ "description": "Creating Python virtual environment",
82
+ "required": true,
83
+ "workingDirectory": "project"
84
+ },
85
+ {
86
+ "name": "Activate virtual environment (Windows)",
87
+ "command": ".\\venv\\Scripts\\Activate.ps1",
88
+ "description": "Activating virtual environment",
89
+ "required": true,
90
+ "platform": "win32",
91
+ "workingDirectory": "project"
92
+ },
93
+ {
94
+ "name": "Activate virtual environment (Unix)",
95
+ "command": "source venv/bin/activate",
96
+ "description": "Activating virtual environment",
97
+ "required": true,
98
+ "platform": "unix",
99
+ "workingDirectory": "project"
100
+ },
101
+ {
102
+ "name": "Upgrade pip",
103
+ "command": "python -m pip install --upgrade pip",
104
+ "description": "Upgrading pip",
105
+ "required": true,
106
+ "workingDirectory": "project",
107
+ "useVenv": true
108
+ },
109
+ {
110
+ "name": "Install requirements",
111
+ "command": "pip install -r requirements.txt",
112
+ "description": "Installing Python dependencies",
113
+ "required": true,
114
+ "conditional": "requirements_exists",
115
+ "workingDirectory": "project",
116
+ "useVenv": true
117
+ },
118
+ {
119
+ "name": "Install from pyproject.toml",
120
+ "command": "pip install -e .",
121
+ "description": "Installing from pyproject.toml",
122
+ "required": true,
123
+ "conditional": "pyproject_exists",
124
+ "workingDirectory": "project",
125
+ "useVenv": true
126
+ }
127
+ ],
128
+ "environment": {
129
+ "PYTHONPATH": ".",
130
+ "PYTHON_UNBUFFERED": "1"
131
+ }
132
+ },
133
+ "validation": {
134
+ "checks": [
135
+ {
136
+ "name": "Virtual environment created",
137
+ "directory": "venv"
138
+ },
139
+ {
140
+ "name": "Requirements file exists",
141
+ "file": "requirements.txt",
142
+ "optional": true
143
+ }
144
+ ]
145
+ },
146
+ "defaultConfig": {
147
+ "interpreter": "python",
148
+ "execMode": "fork",
149
+ "supportsCluster": false,
150
+ "interpreterPath": "venv/Scripts/python.exe"
151
+ }
152
+ },
153
+ "dotnet": {
154
+ "name": ".NET",
155
+ "detection": {
156
+ "files": ["*.csproj", "*.fsproj", "*.vbproj", "*.sln"],
157
+ "extensions": [".cs", ".fs", ".vb"]
158
+ },
159
+ "setup": {
160
+ "steps": [
161
+ {
162
+ "name": "Check .NET version",
163
+ "command": "dotnet --version",
164
+ "description": "Verifying .NET installation",
165
+ "required": true
166
+ },
167
+ {
168
+ "name": "Restore packages",
169
+ "command": "dotnet restore",
170
+ "description": "Restoring NuGet packages",
171
+ "required": true,
172
+ "workingDirectory": "project"
173
+ },
174
+ {
175
+ "name": "Build project",
176
+ "command": "dotnet build --configuration Release",
177
+ "description": "Building .NET project",
178
+ "required": true,
179
+ "workingDirectory": "project"
180
+ },
181
+ {
182
+ "name": "Publish project",
183
+ "command": "dotnet publish --configuration Release --output ./publish",
184
+ "description": "Publishing .NET project",
185
+ "required": true,
186
+ "workingDirectory": "project"
187
+ },
188
+ {
189
+ "name": "Run tests",
190
+ "command": "dotnet test",
191
+ "description": "Running .NET tests",
192
+ "required": false,
193
+ "conditional": "test_project_exists",
194
+ "workingDirectory": "project"
195
+ }
196
+ ],
197
+ "environment": {
198
+ "DOTNET_ENVIRONMENT": "Production",
199
+ "ASPNETCORE_ENVIRONMENT": "Production"
200
+ }
201
+ },
202
+ "validation": {
203
+ "checks": [
204
+ {
205
+ "name": "Project file exists",
206
+ "pattern": "*.csproj"
207
+ },
208
+ {
209
+ "name": "Publish directory exists",
210
+ "directory": "publish"
211
+ }
212
+ ]
213
+ },
214
+ "defaultConfig": {
215
+ "interpreter": "dotnet",
216
+ "execMode": "fork",
217
+ "supportsCluster": false,
218
+ "startCommand": "dotnet run"
219
+ }
220
+ }
221
+ },
222
+ "global": {
223
+ "timeouts": {
224
+ "setup": 300000,
225
+ "validation": 30000
226
+ },
227
+ "retries": {
228
+ "setup": 2,
229
+ "validation": 1
230
+ },
231
+ "logging": {
232
+ "level": "info",
233
+ "file": "deployment.log"
234
+ }
235
+ }
236
+ }