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
This commit is contained in:
rafif committed 2026-07-29 14:14:29 +07:00
1 parent a403f752f3
commit dd4c8f6876
385 files changed
+31016 -8268

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
// check-mongo.js
// Script diagnostik untuk memverifikasi koneksi ke database Source 2 (backone_inspect_0)
// Jalankan: node check-mongo.js
const path = require('path');
require('dotenv').config({ path: path.join(__dirname, '.env.local') });
const mongoose = require('mongoose');
const MONGODB_URI = process.env.MONGODB_URI;
if (!MONGODB_URI) {
console.error('[ERROR] MONGODB_URI tidak ditemukan di .env.local');
process.exit(1);
}
console.log('\n╔════════════════════════════════════════════════╗');
console.log('║ Source 2 — MongoDB Connection Diagnostic ║');
console.log('╚════════════════════════════════════════════════╝\n');
console.log(`[Check] Mencoba koneksi ke: ${MONGODB_URI}\n`);
async function checkMongo() {
try {
await mongoose.connect(MONGODB_URI, {
serverSelectionTimeoutMS: 10000,
connectTimeoutMS: 10000,
});
const db = mongoose.connection.db;
const dbName = db.databaseName;
console.log(`[OK] Berhasil terhubung ke MongoDB!`);
console.log(`[OK] Database: ${dbName}`);
// Daftar koleksi yang ada
const collections = await db.listCollections().toArray();
if (collections.length === 0) {
console.log('[INFO] Database masih kosong — belum ada koleksi.');
} else {
console.log(`[INFO] Koleksi yang ada (${collections.length}):`);
for (const col of collections) {
const count = await db.collection(col.name).countDocuments();
console.log(` - ${col.name}: ${count} dokumen`);
}
}
console.log('\n[RESULT] ✅ STEP 8 PASS — Koneksi ke database Source 2 berhasil.\n');
process.exit(0);
} catch (err) {
console.error(`[ERROR] Gagal terhubung ke MongoDB: ${err.message}`);
console.error('\nPossible causes:');
console.error(' 1. Host "mongodb-netify" tidak bisa dijangkau (butuh VPN/SSH tunnel)');
console.error(' 2. Kredensial backone_inspect:backone_inspect salah');
console.error(' 3. MongoDB belum berjalan di server tujuan');
console.error('\n[RESULT] ❌ STEP 8 FAIL — Hubungi atasan untuk verifikasi koneksi.\n');
process.exit(1);
}
}
checkMongo();