G-Hotspot
Manage guest Wi-Fi access with a Node.js verification portal and the OPNsense Captive Portal Session API. Test the workflow locally before attaching a guest network.
Features
- Offer voucher access, one-time codes, or administrator approval. Available delivery channels include email, SMS, WhatsApp and Telegram.
- Manage sessions and verification settings from an admin panel with Turkish and English interfaces.
- Integrate guest sessions with OPNsense. Kea DHCP synchronization and Traffic Shaper policies are optional.
Install and test locally
Install Node.js 24 or newer and Git. The server uses the SQLite module bundled with Node.js.
G-Hotspot installation commands
git clone https://github.com/G-grbz/G-Hotspot.git
cd G-Hotspot
node --version
npm start
Install the latest release
.zip Node.js 24 or newer. Unpacks the latest release into your home folder and starts the server.
curl -fsSL https://api.github.com/repos/G-grbz/G-Hotspot/releases/latest \
| jq -r '.assets[] | select(.name | test("^G-Hotspot-v[0-9.]+\\.zip$")) | .browser_download_url' \
| xargs -r curl -fLo /tmp/g-hotspot.zip \
&& unzip -oq /tmp/g-hotspot.zip -d ~ \
&& cd "$(ls -d ~/G-Hotspot-v* | sort -V | tail -n 1)" \
&& npm start
.apk Android app. Download it on the phone and open it; Android may ask you to allow installs from this source.
Linux commands need curl and jq. They always download the latest release from GitHub.
- Open
http://127.0.0.1:8080/installon the server. For remote first-time setup, use the installer address printed in the server console and keep its setup token private. - Create an administrator account, set a unique application secret of at least 32 characters, and leave the gateway in
mockmode for the first test. - Open
/admin, configure a voucher and use it in a guest browser. Mock mode lets you verify login behavior without altering real network access.
G-Hotspot health check
curl http://127.0.0.1:8080/health
Connect OPNsense
- Create a Captive Portal zone for your test guest VLAN or wireless network. Give the G-Hotspot host a fixed address and allow guests to reach its portal before authentication.
- Create a separate OPNsense API user with only the privileges required by the features you use. Generate its API key and secret.
- In the installer or admin settings, select
opnsense-apiand enter the OPNsense base URL, guest zone ID and API credentials. Use a trusted TLS certificate. - Use Create template in the admin panel, set the guest redirect URL, export the ZIP and upload it as the OPNsense Captive Portal template.
- From a guest device, verify login, session duration, and disconnect on the test VLAN. Enable Kea synchronization only if the corresponding Kea DHCP service is in use.
Settings and deployment
Configure live settings in the installer or admin panel. They are stored in data/system.db; older .env files are supported for migration.
| Setting | What it does |
|---|---|
HOST / PORT | Server address and listening port. The default port is 8080. |
PUBLIC_BASE_URL | Public HTTPS URL guests use to reach the portal. |
GATEWAY_MODE | Use mock for test flows and opnsense-api for real sessions. |
OPNSENSE_BASE_URL / OPNSENSE_ZONE_ID | The OPNsense host and Captive Portal zone. Enter API credentials in admin settings. |
SETUP_TOKEN | Process environment value for remote first-time setup. Protect it like a password. |
SYSTEM_ENCRYPTION_KEY_FILE | Optional process environment path to a protected encryption key. Back up the key separately from the database. |
TRUST_PROXY / TRUSTED_PROXY_CIDRS | Enable forwarded headers only behind a trusted proxy. Restrict the trusted list to the proxy’s actual connecting addresses. |

