From 8997c55123cb6f307ccbf78ed4f8f366365acc83 Mon Sep 17 00:00:00 2001 From: joseph Date: Thu, 17 Jul 2025 14:40:31 +1000 Subject: [PATCH] Update README.md --- README.md | 72 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 74cf5d5..c4ec7bc 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,59 @@ -🧠 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 +# 🧠 System Overview + +### Frontend (HTML/JS/CSS) + +``` + └── `/api/getListApp` – reads `listApp.txt` and fetches init data from OPNsense + └── `/update` – applies `app_controls` to Zenarmor via `fetch` +``` + +### Backend (Node.js + Express) + +``` + └── Uses 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 +└── README.md ← This file +``` -🛠️ Setup & Run -1. Install dependencies +--- + +# 🛠️ Setup & Run + +### 1. Install dependencies + +```bash npm install -⚠️ If using node-fetch@3+, it requires ESM. The script handles this via dynamic import. +``` -2. Start the server +> ⚠️ If using `node-fetch@3+`, it requires ESM. +> ✅ This script handles it via dynamic import. + +--- + +### 2. Start the server + +```bash 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 \ No newline at end of file +* Login will be performed immediately. +* Session will auto-refresh every 5 minutes. + +--- + +# 🔐 Config + +* Change `SERVER_DOMAIN` in `public/index.html` +* Change `OPENSENSE_DOMAIN` in `server.js`