YunoHost-Apps / hotspot_ynh

Wifi Hotspot app for YunoHost
GNU Affero General Public License v3.0
39 stars 19 forks source link

[wip] Captive portal #98

Open zamentur opened 1 year ago

zamentur commented 1 year ago

Problem

CLIC need a solution to redirect wifi user onto the homepage (and give access to the internet when the person is on this page).

Other usecase could exists where we want to create captive portal before giving access to the internet (for example accept terms or login with an account before to be able to connect). We could for example giving access to the internet only to yunohost user...

Solution

Integrate a captive portal mechanism using mac filtering. Note that mac filtering can be coturn by sniffing packet and founding an allowed mac address.

This captive portal is able to work even with DoH activated.

To use this new feature a code like this need to be integrated into the home page of yeswiki CLIC (or in the POST action of a login form).

`/usr/local/bin/captiveportal_allow $_SERVER['REMOTE_ADDR']`;

It's also possible to allowed specific mac address just by hand from the IP of the guest: /usr/local/bin/captiveportal_allow 10.0.242.10

IMPORTANT:

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)