feat(isolir): URL halaman isolir & port redirector di Pengaturan
All checks were successful
CI / test (push) Successful in 1m34s

- isolir_portal_url, isolir_redirect_port
- redirector baca setting per request (tanpa restart)
- generator cloud memakai URL tersebut
- versi 0.6.8
This commit is contained in:
oxpoe
2026-11-06 05:52:02 +07:00
parent 094c47c15d
commit 5361c3a1c1
6 changed files with 31 additions and 13 deletions

View File

@@ -2,6 +2,13 @@
Format mengikuti [Keep a Changelog](https://keepachangelog.com/) dan [Semantic Versioning](https://semver.org/). Format mengikuti [Keep a Changelog](https://keepachangelog.com/) dan [Semantic Versioning](https://semver.org/).
## [0.6.8] — 2026-11-06 — "isolir-url-setting"
### Ditambahkan
- Pengaturan **URL Halaman Isolir** (`isolir_portal_url`) dan **Port Redirector Isolir** (`isolir_redirect_port`) di Info Aplikasi.
- Redirector isolir membaca URL dari pengaturan **setiap request**, jadi perubahan URL langsung berlaku tanpa restart.
- Generator script cloud memakai URL halaman isolir dari pengaturan tersebut.
## [0.6.7] — 2026-11-06 — "isolir-cloud" ## [0.6.7] — 2026-11-06 — "isolir-cloud"
### Ditambahkan ### Ditambahkan

View File

@@ -11,7 +11,7 @@
<p align="center"> <p align="center">
<img src="https://img.shields.io/badge/lisensi-ISC-ADFF2F" alt="Lisensi: ISC"> <img src="https://img.shields.io/badge/lisensi-ISC-ADFF2F" alt="Lisensi: ISC">
<img src="https://img.shields.io/badge/versi-0.6.7_isolir--cloud-ADFF2F" alt="Versi 0.6.7 (isolir-cloud)"> <img src="https://img.shields.io/badge/versi-0.6.8_isolir--url-ADFF2F" alt="Versi 0.6.8 (isolir-url-setting)">
<img src="https://img.shields.io/badge/Node.js-%E2%89%A520-339933" alt="Node.js >= 20"> <img src="https://img.shields.io/badge/Node.js-%E2%89%A520-339933" alt="Node.js >= 20">
<img src="https://img.shields.io/badge/docker-ready-2496ED?logo=docker&logoColor=white" alt="Docker"> <img src="https://img.shields.io/badge/docker-ready-2496ED?logo=docker&logoColor=white" alt="Docker">
<a href="https://demo-openisp.oxpoe.xyz"><img src="https://img.shields.io/badge/demo-live-ADFF2F?logo=googlechrome&logoColor=black" alt="Demo"></a> <a href="https://demo-openisp.oxpoe.xyz"><img src="https://img.shields.io/badge/demo-live-ADFF2F?logo=googlechrome&logoColor=black" alt="Demo"></a>

View File

@@ -10,18 +10,19 @@
const http = require('http'); const http = require('http');
const PORT = parseInt(process.env.ISOLIR_REDIRECT_PORT || '8099', 10); const PORT = parseInt(process.env.ISOLIR_REDIRECT_PORT || '8099', 10);
let TARGET = process.env.ISOLIR_REDIRECT_URL || '';
// Coba ambil target dari settings.json bila tersedia // Target dibaca ulang dari settings (bisa diubah dari dashboard tanpa restart).
try { function currentTarget() {
const { getSetting } = require('./config/settingsManager'); try {
const s = getSetting('isolir_portal_url', '') || ''; const { getSetting } = require('./config/settingsManager');
if (s) TARGET = s; const s = String(getSetting('isolir_portal_url', '') || '').trim();
} catch (_) { /* abaikan */ } if (s) return s;
} catch (_) {}
if (!TARGET) TARGET = 'http://localhost:3001/isolated'; return String(process.env.ISOLIR_REDIRECT_URL || '').trim() || 'http://localhost:3001/isolated';
}
const server = http.createServer((req, res) => { const server = http.createServer((req, res) => {
const TARGET = currentTarget();
// Jangan cache supaya pelanggan selalu diarahkan ke portal terbaru // Jangan cache supaya pelanggan selalu diarahkan ke portal terbaru
res.writeHead(302, { res.writeHead(302, {
Location: TARGET, Location: TARGET,
@@ -40,7 +41,7 @@ const server = http.createServer((req, res) => {
server.on('error', (e) => console.error('[isolir-redirect] listen error:', e.message)); server.on('error', (e) => console.error('[isolir-redirect] listen error:', e.message));
server.listen(PORT, '0.0.0.0', () => { server.listen(PORT, '0.0.0.0', () => {
console.log(`[isolir-redirect] listening on 0.0.0.0:${PORT} -> ${TARGET}`); console.log(`[isolir-redirect] listening on 0.0.0.0:${PORT} -> ${currentTarget()}`);
}); });
process.on('SIGTERM', () => { server.close(() => process.exit(0)); }); process.on('SIGTERM', () => { server.close(() => process.exit(0)); });

View File

@@ -1,6 +1,6 @@
{ {
"name": "open-isp", "name": "open-isp",
"version": "0.6.7", "version": "0.6.8",
"description": "OPEN-ISP \u2014 sistem billing & manajemen ISP open-source (PWA pelanggan, multi-OLT, RADIUS, WhatsApp, QRIS)", "description": "OPEN-ISP \u2014 sistem billing & manajemen ISP open-source (PWA pelanggan, multi-OLT, RADIUS, WhatsApp, QRIS)",
"main": "app-customer.js", "main": "app-customer.js",
"scripts": { "scripts": {

View File

@@ -1 +1 @@
0.6.7 0.6.8

View File

@@ -283,6 +283,16 @@
<input class="fc" name="public_base_url" value="<%= settings.public_base_url || '' %>" placeholder="https://portal.domain-anda.com"> <input class="fc" name="public_base_url" value="<%= settings.public_base_url || '' %>" placeholder="https://portal.domain-anda.com">
<div style="font-size:10px; color:var(--muted); margin-top:4px"><%= t('admin.set.link_hint','Digunakan untuk menyusun tautan login pelanggan yang dikirim via WhatsApp. Contoh: ') %><span class="mono">https://portal.domain-anda.com</span></div> <div style="font-size:10px; color:var(--muted); margin-top:4px"><%= t('admin.set.link_hint','Digunakan untuk menyusun tautan login pelanggan yang dikirim via WhatsApp. Contoh: ') %><span class="mono">https://portal.domain-anda.com</span></div>
</div> </div>
<div class="fg">
<label class="fl">URL Halaman Isolir</label>
<input class="fc" name="isolir_portal_url" value="<%= settings.isolir_portal_url || '' %>" placeholder="https://domain-anda/isolated">
<div style="font-size:10px;color:var(--muted);margin-top:4px">Tujuan redirect pelanggan terisolir (dipakai redirector &amp; generator script cloud).</div>
</div>
<div class="fg">
<label class="fl">Port Redirector Isolir</label>
<input class="fc" type="number" min="1" max="65535" name="isolir_redirect_port" value="<%= settings.isolir_redirect_port || 8099 %>">
<div style="font-size:10px;color:var(--muted);margin-top:4px">Port server redirector di billing (default 8099). Ubah NAT MikroTik bila port diganti.</div>
</div>
<div class="fg"> <div class="fg">
<label class="fl"><%= t('admin.set.id_prefix','Prefix ID Pelanggan') %></label> <label class="fl"><%= t('admin.set.id_prefix','Prefix ID Pelanggan') %></label>
<input class="fc" name="customer_id_prefix" value="<%= settings.customer_id_prefix || 'SKY' %>" placeholder="SKY" style="text-transform:uppercase" maxlength="12"> <input class="fc" name="customer_id_prefix" value="<%= settings.customer_id_prefix || 'SKY' %>" placeholder="SKY" style="text-transform:uppercase" maxlength="12">