Files
Deep-Package-Inspection/scripts/quick-diag.js
T
rafif dd4c8f6876 feat(source2): push all latest files - device labeling, help system, proxy docs, database isolation fix
- Added DOKUMENTASI-FILTER-PER-SITE.md (site isolation docs)
- Fixed start-with-env.js to force-load .env.production
- Fixed MONGODB_URI hostname from mongodb-netify to mongodb.prod.proit.id
- Updated .gitignore to exclude sensitive scripts and credential files
- Minor UI and labeling improvements
2026-07-29 14:14:29 +07:00

27 lines
1.3 KiB
JavaScript

// scripts/quick-diag.js
'use strict';
const { Client } = require('ssh2');
const conn = new Client();
conn.on('ready', () => {
const cmds = [
'echo "=== Port 3000 test ==" && curl -sk -o /dev/null -w "HTTP %{http_code}" http://127.0.0.1:3000/login',
'echo "" && echo "=== Nginx conf_custom ===" && cat /home/adminbackend/conf/web/demoplace.my.id/nginx.conf_custom 2>/dev/null || echo MISSING',
'echo "=== Nginx ssl conf_custom ===" && cat /home/adminbackend/conf/web/demoplace.my.id/nginx.ssl.conf_custom 2>/dev/null || echo MISSING',
'echo "=== .htaccess ===" && cat /home/adminbackend/web/demoplace.my.id/public_html/.htaccess',
'echo "=== PM2 status ===" && /home/adminbackend/.npm-global/bin/pm2 list 2>/dev/null | grep -E "(name|backone)"',
];
let i = 0;
function run() {
if (i >= cmds.length) { conn.end(); console.log('\nDone.'); return; }
const cmd = cmds[i++];
conn.exec(cmd, (err, s) => {
if (err) { console.error(err.message); run(); return; }
s.on('data', d => process.stdout.write(d.toString()))
.stderr.on('data', d => process.stdout.write(d.toString()))
.on('close', run);
});
}
run();
}).on('error', e => console.error(e.message))
.connect({ host: '103.185.47.52', port: 2222, username: 'adminbackend', password: 'htEo7x6LsBQiEHHH', readyTimeout: 30000 });