Go to file
Joseph Le ba1a91d623 first commit 2025-07-17 11:37:15 +07:00
public first commit 2025-07-17 11:37:15 +07:00
.gitignore first commit 2025-07-17 11:37:15 +07:00
README.md first commit 2025-07-17 11:37:15 +07:00
listApp.txt first commit 2025-07-17 11:37:15 +07:00
package-lock.json first commit 2025-07-17 11:37:15 +07:00
package.json first commit 2025-07-17 11:37:15 +07:00
server.js first commit 2025-07-17 11:37:15 +07:00

README.md

🧠 System Overview Frontend (HTML/JS/CSS) | --> /api/getListApp (reads listApp.txt + fetches init from OPNsense) --> /update (applies app_controls to Zenarmor via fetch)

Backend (Node.js + Express) | --> Puppeteer for headless login --> Session auto-refresh every 5 minutes --> API forwarding with CSRF token + cookie

📁 Project Structure ├── public/ │ └── index.html ← Frontend UI ├── listApp.txt ← Line-separated JSON data of apps ├── server.js ← Express backend + OPNsense bridge ├── README.md ← This file

🛠️ Setup & Run

  1. Install dependencies npm install ⚠️ If using node-fetch@3+, it requires ESM. The script handles this via dynamic import.

  2. Start the server node server.js Login will be performed immediately, then auto-refresh every 5 minutes.

🔐 Config

  • Change "SERVER_DOMAIN" in public/index.html
  • Change "OPENSENCE_DOMAIN" in server.js