Update README.md

This commit is contained in:
joseph 2025-07-17 14:40:31 +10:00
parent ba1a91d623
commit 8997c55123
1 changed files with 50 additions and 22 deletions

View File

@ -1,31 +1,59 @@
🧠 System Overview # 🧠 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) ### Frontend (HTML/JS/CSS)
|
--> Puppeteer for headless login
--> Session auto-refresh every 5 minutes
--> API forwarding with CSRF token + cookie
📁 Project Structure ```
└── `/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/ ├── public/
│ └── index.html ← Frontend UI │ └── index.html ← Frontend UI
├── listApp.txt ← Line-separated JSON data of apps ├── listApp.txt ← Line-separated JSON data of apps
├── server.js ← Express backend + OPNsense bridge ├── 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 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 node server.js
Login will be performed immediately, then auto-refresh every 5 minutes. ```
🔐 Config * Login will be performed immediately.
- Change "SERVER_DOMAIN" in public/index.html * Session will auto-refresh every 5 minutes.
- Change "OPENSENCE_DOMAIN" in server.js
---
# 🔐 Config
* Change `SERVER_DOMAIN` in `public/index.html`
* Change `OPENSENSE_DOMAIN` in `server.js`