RoseNet Access Portal is a comprehensive, self-contained voucher authentication system designed for Wi-Fi users on OpenWrt routers. It provides a robust and lightweight solution for managing internet access through a captive portal, leveraging a Go backend, a vanilla JavaScript frontend, and seamless integration with NoDogSplash.
- Features
- System Architecture
- Components
- Installation & Deployment
- Usage
- Configuration
- API Endpoints
- Contributing
- License
- Lightweight & Efficient: Optimized for resource-constrained OpenWrt environments.
- CGO-Free Go Backend: Easy cross-compilation and deployment without external C dependencies.
- Vanilla JavaScript Frontend: Fast loading and minimal dependencies for captive portal environments.
- Integrated Captive Portal: Seamlessly works with NoDogSplash for user redirection and authentication.
- Voucher Management: Administrators can generate, manage, and revoke time-limited access vouchers.
- Secure Admin Panel: Dedicated interface for voucher administration with password protection.
- Customizable: The frontend can be easily themed and adapted.
The RoseNet Access Portal operates entirely on the OpenWrt router, comprising three core components that work in concert to deliver the captive portal experience:
- Go Backend (
voucher_server): Serves as the central logic hub, handling HTTP requests, database interactions, and voucher authentication. - Frontend: Provides the user interface for voucher entry and the administrative interface for managing vouchers.
- NoDogSplash: The captive portal software responsible for intercepting unauthenticated traffic and redirecting users to the RoseNet Access Portal.
- Language: Go (Golang)
- Database: JSON-based Persistence (Thread-safe document store)
- Database Location (on router):
/data/voucher.jsonand/data/settings.json - Log File (on router):
/tmp/voucher.log
Designed for extreme lightness and performance, crucial for captive portal environments.
index.html(User Voucher Page): The themed entry page users encounter. Support for multiple visual styles including corporate, modern, and retro-music.- Administrator Panel (
/admin/): A React 18 + Vite single-page application (source infrontend-admin/, compiled tofrontend/admin/) for comprehensive voucher management, system statistics, and theme configuration. The legacy/admin.htmlURL redirects here.
The integration with NoDogSplash is fundamental to the captive portal functionality:
- A user connects to the Wi-Fi network.
- NoDogSplash intercepts the user's initial HTTP request and redirects them to its
splash.htmlpage (/etc/nodogsplash/htdocs/splash.html). - This
splash.htmlcontains a meta-refresh that immediately redirects the user to the RoseNet Access Portal's Go-powered voucher page (e.g.,http://<router-lan-ip>:7891), forwarding essential parameters likeip,mac, andtoken. The router's LAN IP is detected automatically during installation, so the portal works on any subnet without manual edits. - The user enters a valid voucher code on the portal page.
- The frontend JavaScript validates the voucher and stages the session via
/binauth-stage. - Upon successful validation, the user is redirected to the NoDogSplash authentication URL.
- NoDogSplash calls
binauth.sh, which queries the backend's/binauth-checkto finalize the connection. - The user is granted internet access for the duration specified by the voucher.
RoseNet Access Portal can be deployed on your OpenWrt router either by using a pre-compiled binary release (recommended) or by building from source. Everything is installed directly on the router — no separate Go toolchain or local machine staging is required.
This is the easiest method. You do everything over SSH on the router itself.
-
SSH into your router:
ssh root@<router-lan-ip>
-
Check your router's architecture: Releases are published per architecture. Identify yours with:
opkg print-architecture # or, alternatively: uname -mMap the result to the correct release archive:
uname -m/ archRelease archive aarch64/arm64RoseNet-Portal-linux-arm64.ziparmv7l,armv6l/ armRoseNet-Portal-linux-arm.zipmips,mipselRoseNet-Portal-linux-mipsle.zipx86_64RoseNet-Portal-linux-amd64.zip -
Download the latest release with
wget(replace the filename with the one for your architecture):wget https://github.com/nhAsif/RoseNet-Access-Portal/releases/latest/download/RoseNet-Portal-linux-arm64.zip
-
Unzip the archive: If
unzipis not installed, install it first withopkg update && opkg install unzip.unzip RoseNet-Portal-linux-arm64.zip cd RoseNet-Portal-linux-arm64 -
Run the installation script:
chmod +x scripts/install.sh sh scripts/install.sh
The
install.shscript automates the following:- Installs NoDogSplash automatically via
opkgif it is not already present. - Detects the router's LAN IP automatically (from
network.lan.ipaddr, falling back to thebr-laninterface address). To override detection, run the script with an explicit IP:LAN_IP=192.168.1.1 sh scripts/install.sh. - Creates necessary directories (
/opt/voucher,/www/voucher,/data) and copies application files to their final destinations. - Sets up an
init.dservice to ensure the voucher server starts on boot. - Configures NoDogSplash with the correct authentication service and rules, and generates the custom
splash.htmlredirect page. - Restarts relevant services to apply changes.
- Installs NoDogSplash automatically via
For developers who want to build the binary themselves.
-
Build the Server Binary: On Windows, run
build.bat; on Linux/macOS, runscripts/build.sh. AdjustGOARCHto match your router (arm64,arm,mipsle,amd64). This cross-compiles the Go application and produces thevoucher_serverbinary in the project root../scripts/build.sh
Admin UI (required for source builds): The admin dashboard is a React 18 + Vite app in
frontend-admin/. Its compiled output (frontend/admin/) is not committed — you must build it before deploying from source so the panel is included infrontend/. Node.js is required on your dev machine only, never on the router. (Pre-compiled releases already include it, built automatically by CI.)cd frontend-admin npm install npm run build # emits static files into ../frontend/admin # dev loop: run the Go backend (cd backend && go run .), then `npm run dev`
-
Copy the project to the router (including
voucher_server,frontend/, andscripts/):scp -r RoseNet-Captive-Portal root@<router-lan-ip>:/root/
-
Run the installation script on the router:
ssh root@<router-lan-ip> cd /root/RoseNet-Captive-Portal chmod +x scripts/install.sh sh scripts/install.sh
This performs the same setup steps as described in Method 1.
Users connecting to your Wi-Fi network will be redirected to the voucher entry page. The visual style is determined by the "Portal Theme" setting in the admin panel.
Access the administrator panel at /admin/ (e.g., http://<router-lan-ip>:7891/admin/). The installation script prints the exact URL with your router's detected IP when it finishes. The old /admin.html link still works and redirects to /admin/.
- Default Password:
rosepinepink - Features:
- Secure login and password management.
- Real-time dashboard with revenue and user statistics.
- Voucher generation with customizable names, durations, and prices.
- Theme management (Choose between Default, Modern, Corporate, or Music).
- Global settings (Currency symbols, system configuration).
- Default Admin Password: The default administrator password is
rosepinepink. - Server Port: The Go backend listens on port
7891by default. - LAN IP: Detected automatically at install time and wired into the captive-portal redirects, so no IP is hardcoded. The frontend resolves the router address from the browser's location, and
splash.htmluses the IP detected byinstall.sh(override withLAN_IP=<ip> ./scripts/install.sh). - Persistence: Data is stored in
/data/as JSON files. This ensures portability and easy backups without needing database drivers.
The Go backend exposes the following API endpoints:
GET /: Serves the themed user voucher entry page.GET /auth: Legacy authentication endpoint.GET /binauth-stage: Validates a voucher and stages a client MAC for NDS authentication.GET /binauth-check: Used bybinauth.shto verify if a client is authorized and return the remaining duration.POST /admin/login: Authenticates administrator access.GET /admin/vouchers: (Protected) Retrieves a list of all vouchers.POST /admin/add: (Protected) Adds a new voucher to the system.POST /admin/delete: (Protected) Deletes a voucher by its ID.GET /admin/settings: (Protected) Retrieves system settings.POST /admin/update-settings: (Protected) Updates system settings (e.g., active theme, currency).GET /admin/stats: (Protected) Provides dashboard statistics and chart data.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the GNU General Public License v3.