ezpm2gui 1.3.2 → 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.
- package/README.md +295 -294
- package/bin/ezpm2gui.js +8 -8
- package/bin/ezpm2gui.ts +51 -51
- package/bin/generate-ecosystem.js +35 -35
- package/bin/generate-ecosystem.ts +56 -56
- package/dist/index.js +1 -1
- package/dist/server/config/project-configs.json +236 -236
- package/dist/server/index.js +256 -83
- package/dist/server/routes/deployApplication.js +6 -5
- package/dist/server/routes/logStreaming.js +20 -13
- package/dist/server/routes/modules.js +89 -69
- package/dist/server/routes/remoteConnections.js +279 -40
- package/dist/server/routes/updates.d.ts +3 -0
- package/dist/server/routes/updates.js +135 -0
- package/dist/server/utils/encryption.js +0 -12
- package/dist/server/utils/pm2-connection.d.ts +1 -1
- package/dist/server/utils/pm2-connection.js +1 -3
- package/dist/server/utils/remote-connection.d.ts +36 -3
- package/dist/server/utils/remote-connection.js +307 -79
- package/package.json +73 -69
- package/scripts/postinstall.js +36 -36
- package/src/client/build/asset-manifest.json +6 -6
- package/src/client/build/favicon.ico +2 -2
- package/src/client/build/index.html +1 -1
- package/src/client/build/logo192.svg +7 -7
- package/src/client/build/logo512.svg +7 -7
- package/src/client/build/manifest.json +24 -24
- package/src/client/build/static/css/main.2d095544.css +5 -0
- package/src/client/build/static/css/main.2d095544.css.map +1 -0
- package/src/client/build/static/js/main.17e17668.js +3 -0
- package/src/client/build/static/js/main.17e17668.js.map +1 -0
- package/dist/server/config/cron-jobs.json +0 -18
- package/dist/server/config/cron-scripts/6d8d5e1d-2bc8-463f-82a6-6c294f2b9dbe.sh +0 -2
- package/dist/server/config/remote-connections.json +0 -22
- package/dist/server/logs/deployment.log +0 -12
- package/dist/server/utils/dialog.d.ts +0 -1
- package/dist/server/utils/dialog.js +0 -16
- package/dist/server/utils/upload.d.ts +0 -3
- package/dist/server/utils/upload.js +0 -39
- package/src/client/build/static/css/main.d46bc75c.css +0 -5
- package/src/client/build/static/css/main.d46bc75c.css.map +0 -1
- package/src/client/build/static/js/main.b0e1c9b1.js +0 -3
- package/src/client/build/static/js/main.b0e1c9b1.js.map +0 -1
- /package/src/client/build/static/js/{main.b0e1c9b1.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:
|
|
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 ||
|
|
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;
|