Linux vmi2545633.contaboserver.net 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64
Apache/2.4.62 (Debian)
Server IP : 127.0.0.1 & Your IP : 127.0.0.1
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
node_modules /
pm2 /
lib /
Delete
Unzip
Name
Size
Permission
Date
Action
API
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
God
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
binaries
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
templates
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
tools
[ DIR ]
drwxr-xr-x
2025-04-08 13:05
API.js
58.73
KB
-rw-r--r--
2025-04-08 13:05
Client.js
19.97
KB
-rw-r--r--
2025-04-08 13:05
Common.js
25.9
KB
-rw-r--r--
2025-04-08 13:05
Configuration.js
6.4
KB
-rw-r--r--
2025-04-08 13:05
Daemon.js
12.65
KB
-rw-r--r--
2025-04-08 13:05
Event.js
1.1
KB
-rw-r--r--
2025-04-08 13:05
God.js
18.56
KB
-rw-r--r--
2025-04-08 13:05
HttpInterface.js
2.25
KB
-rw-r--r--
2025-04-08 13:05
ProcessContainer.js
8.61
KB
-rw-r--r--
2025-04-08 13:05
ProcessContainerBun.js
10.57
KB
-rw-r--r--
2025-04-08 13:05
ProcessContainerFork.js
1.25
KB
-rw-r--r--
2025-04-08 13:05
ProcessContainerForkBun.js
987
B
-rw-r--r--
2025-04-08 13:05
ProcessUtils.js
1.39
KB
-rw-r--r--
2025-04-08 13:05
TreeKill.js
2.73
KB
-rw-r--r--
2025-04-08 13:05
Utility.js
8.31
KB
-rw-r--r--
2025-04-08 13:05
VersionCheck.js
1022
B
-rw-r--r--
2025-04-08 13:05
Watcher.js
2.91
KB
-rw-r--r--
2025-04-08 13:05
Worker.js
4.86
KB
-rw-r--r--
2025-04-08 13:05
completion.js
6.71
KB
-rw-r--r--
2025-04-08 13:05
completion.sh
1.16
KB
-rw-r--r--
2025-04-08 13:05
motd
1.22
KB
-rw-r--r--
2025-04-08 13:05
Save
Rename
/** * Copyright 2013-2022 the PM2 project authors. All rights reserved. * Use of this source code is governed by a license that * can be found in the LICENSE file. */ const eachLimit = require('async/eachLimit'); const debug = require('debug')('pm2:worker'); const domain = require('domain'); const Cron = require('croner'); const pkg = require('../package.json'); var cst = require('../constants.js'); var vCheck = require('./VersionCheck.js') module.exports = function(God) { var timer = null; God.CronJobs = new Map(); God.Worker = {}; God.Worker.is_running = false; God.getCronID = function(pm_id) { return `cron-${pm_id}` } God.registerCron = function(pm2_env) { if (!pm2_env || pm2_env.pm_id === undefined || !pm2_env.cron_restart || pm2_env.cron_restart == '0' || God.CronJobs.has(God.getCronID(pm2_env.pm_id))) return; var pm_id = pm2_env.pm_id console.log('[PM2][WORKER] Registering a cron job on:', pm_id); var job = Cron(pm2_env.cron_restart, function() { God.restartProcessId({id: pm_id}, function(err, data) { if (err) console.error(err.stack || err); return; }); }); God.CronJobs.set(God.getCronID(pm_id), job); } /** * Deletes the cron job on deletion of process */ God.deleteCron = function(id) { if (typeof(id) !== 'undefined' && God.CronJobs.has(God.getCronID(id)) === false) return; console.log('[PM2] Deregistering a cron job on:', id); var job = God.CronJobs.get(God.getCronID(id)); if (job) job.stop(); God.CronJobs.delete(God.getCronID(id)); }; var _getProcessById = function(pm_id) { var proc = God.clusters_db[pm_id]; return proc ? proc : null; }; var maxMemoryRestart = function(proc_key, cb) { var proc = _getProcessById(proc_key.pm2_env.pm_id); if (!(proc && proc.pm2_env && proc_key.monit)) return cb(); if (proc_key.monit.memory !== undefined && proc.pm2_env.max_memory_restart !== undefined && proc.pm2_env.max_memory_restart < proc_key.monit.memory && proc.pm2_env.axm_options && proc.pm2_env.axm_options.pid === undefined) { console.log('[PM2][WORKER] Process %s restarted because it exceeds --max-memory-restart value (current_memory=%s max_memory_limit=%s [octets])', proc.pm2_env.pm_id, proc_key.monit.memory, proc.pm2_env.max_memory_restart); God.reloadProcessId({ id : proc.pm2_env.pm_id }, function(err, data) { if (err) console.error(err.stack || err); return cb(); }); } else { return cb(); } }; var tasks = function() { if (God.Worker.is_running === true) { debug('[PM2][WORKER] Worker is already running, skipping this round'); return false; } God.Worker.is_running = true; God.getMonitorData(null, function(err, data) { if (err || !data || typeof(data) !== 'object') { God.Worker.is_running = false; return console.error(err); } eachLimit(data, 1, function(proc, next) { if (!proc || !proc.pm2_env || proc.pm2_env.pm_id === undefined) return next(); debug('[PM2][WORKER] Processing proc id:', proc.pm2_env.pm_id); // Reset restart delay if application has an uptime of more > 30secs if (proc.pm2_env.exp_backoff_restart_delay !== undefined && proc.pm2_env.prev_restart_delay && proc.pm2_env.prev_restart_delay > 0) { var app_uptime = Date.now() - proc.pm2_env.pm_uptime if (app_uptime > cst.EXP_BACKOFF_RESET_TIMER) { var ref_proc = _getProcessById(proc.pm2_env.pm_id); ref_proc.pm2_env.prev_restart_delay = 0 console.log(`[PM2][WORKER] Reset the restart delay, as app ${proc.name} has been up for more than ${cst.EXP_BACKOFF_RESET_TIMER}ms`) } } // Check if application has reached memory threshold maxMemoryRestart(proc, function() { return next(); }); }, function(err) { God.Worker.is_running = false; debug('[PM2][WORKER] My job here is done, next job in %d seconds', parseInt(cst.WORKER_INTERVAL / 1000)); }); }); }; var wrappedTasks = function() { var d = domain.create(); d.once('error', function(err) { console.error('[PM2][WORKER] Error caught by domain:\n' + (err.stack || err)); God.Worker.is_running = false; }); d.run(function() { tasks(); }); }; God.Worker.start = function() { timer = setInterval(wrappedTasks, cst.WORKER_INTERVAL); if (!process.env.PM2_DISABLE_VERSION_CHECK) { setInterval(() => { vCheck({ state: 'check', version: pkg.version, }); }, 1000 * 60 * 60 * 24); } }; God.Worker.stop = function() { if (timer !== null) clearInterval(timer); }; };