Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib: Captive portal for wlan-ap #453

Merged
merged 5 commits into from
Dec 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions contrib/captive-portal/README.md
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 18 additions & 0 deletions contrib/captive-portal/install-nodogsplash.sh
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions contrib/captive-portal/nodogsplash.conf
Original file line number Diff line number Diff line change
@@ -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