From a9914a1b3d38c6b78264435a1568f2c9e5d767d6 Mon Sep 17 00:00:00 2001 From: darkdrgn2k Date: Sat, 7 Dec 2019 21:59:28 -0500 Subject: [PATCH] contrib: Captive portal for wlan-ap (#453) * Create install-nodogsplash.sh * Create nodogsplash.conf * Update install-nodogsplash.sh * Create README.md * Clean up --- contrib/captive-portal/README.md | 22 +++++++++++++++++++ contrib/captive-portal/install-nodogsplash.sh | 18 +++++++++++++++ contrib/captive-portal/nodogsplash.conf | 21 ++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 contrib/captive-portal/README.md create mode 100644 contrib/captive-portal/install-nodogsplash.sh create mode 100644 contrib/captive-portal/nodogsplash.conf diff --git a/contrib/captive-portal/README.md b/contrib/captive-portal/README.md new file mode 100644 index 000000000..b2741ca4c --- /dev/null +++ b/contrib/captive-portal/README.md @@ -0,0 +1,22 @@ +# NoDogSplash captive portal + +Source: https://github.com/nodogsplash/nodogsplash + +Nodogsplash is a Captive Portal that offers a simple way to provide restricted access to the Internet by showing a splash page to the user before Internet access is granted. + +This script install and configured the Nodogsplash captive portal to run on `wlan-ap` interface of the prototype stack. + +## Installation + +``` +chmod +x install-nodogsplash.sh +./install-nodogsplash.sh +``` + +## Issues + +Some people have objections using captive portal because it hijacks traffic and could potentially be a privacy violation. Additionally it prevents headless devices from accessing the internet. + +## Nice to have + +- [ ] Nice tomesh splash screen (/etc/nodogsplash/htdocs/splash.sh) diff --git a/contrib/captive-portal/install-nodogsplash.sh b/contrib/captive-portal/install-nodogsplash.sh new file mode 100644 index 000000000..e972137b2 --- /dev/null +++ b/contrib/captive-portal/install-nodogsplash.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +sudo apt install -y libmicrohttpd-dev + +mkdir tmp +cd tmp +git clone https://github.com/nodogsplash/nodogsplash.git +cd nodogsplash +make +sudo make install +sudo cp debian/nodogsplash.service /etc/systemd/system +cd .. +cd .. +rm -rf tmp + +cp nodogsplash.conf /etc/nodogsplash/nodogsplash.conf +sudo systemctl enable nodogsplash +sudo systemctl start nodogsplash diff --git a/contrib/captive-portal/nodogsplash.conf b/contrib/captive-portal/nodogsplash.conf new file mode 100644 index 000000000..21b8d1e7a --- /dev/null +++ b/contrib/captive-portal/nodogsplash.conf @@ -0,0 +1,21 @@ +GatewayInterface wlan-ap +#login_option_enabled 1 +FirewallRuleSet authenticated-users { + FirewallRule allow all +} +FirewallRuleSet preauthenticated-users { +# FirewallRule allow tcp port 80 to 123.321.123.321 +} +FirewallRuleSet users-to-router { + FirewallRule allow udp port 53 + FirewallRule allow tcp port 53 + FirewallRule allow udp port 67 + FirewallRule allow tcp port 22 +# FirewallRule allow tcp port 80 +# FirewallRule allow tcp port 443 +} +GatewayName ToMeshNode +GatewayAddress 10.0.0.1 +GatewayPort 2050 +MaxClients 250 +AuthIdleTimeout 480