Coder Social home page Coder Social logo

pihomeserver / kupiki-hotspot-script Goto Github PK

View Code? Open in Web Editor NEW
300.0 34.0 119.0 202 KB

Create automatically a full Wifi Hotspot on Raspberry Pi including a Captive Portal

License: Other

Shell 100.00%
raspberry-pi raspberry freeradius pi-hotspot wifi-hotspot captive-portal portal kupiki-hotspot wifi hotspot

kupiki-hotspot-script's People

Contributors

gagan0123 avatar pihomeserver avatar reigelgallarde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kupiki-hotspot-script's Issues

Reinstall issues

Great project!
Since I had to reinstall due to issues I noted that reinstall failed due to some existing git installs and symbolic link.
The portal did not work initially but I figured out that the XXX replacement in portal.js was not happening

#Changed this to the pihotspot.sh code so that reinstall is also functioning, especially chilli files were not overwritten:
#Making sure old configs are deleted:
dpkg --purge coova-chilli
dpkg --purge haserl
dpkg --purge hostapd

#Modifying line below to enable overwrite symlink
#from:
execute_command "ln -s /etc/nginx/sites-available/portal /etc/nginx/sites-enabled/portal" true "Activating portal website"
#to:
execute_command "ln -sfT /etc/nginx/sites-available/portal /etc/nginx/sites-enabled/portal" true "Activating portal website"

#Modifying the portal and daloradius git install so that old files are deleted first:
execute_command "cd /usr/share/nginx/html/ && rm -rf daloradius && git clone $DALORADIUS_ARCHIVE daloradius" true "Cloning daloradius project"
execute_command "cd /usr/share/nginx && rm -rf portal && git clone $HOTSPOTPORTAL_ARCHIVE portal" true "Cloning Pi Hotspot portal project"

#Modified replace line XXX to changes in portal.js as there the hotspot should be configured
sed -i "s/XXXXXX/$HOTSPOT_IP/" /usr/share/nginx/portal/js/portal.js

Exit: Illegal number: -1

Hi,
I have a problem with sur bash script :

** Activating the WAN interface
** Activating the LAN interface
** Installing debconf tools
**
** Something went wrong with the last command. Please check the log file
**
pihotspot.sh: 46: exit: Illegal number: -1

Can you halp me ?
Thanks you

Script sans l'AccessPoint ?

Bonjour,
J'aimerais savoir s'il vous est possible de rendre ce script un peu plus "modulaire" pour me permettre de le tordre à mes besoins qui sont très similaires.
Grosso modo, je cherche à inverser le rôle de eth0 et wlan0 car le WAN viendrait de mon wifi perso connecté à Internet, et le hot-spot serait diffusé par une autre routeur physique (meilleur signal qu'une clef USB wifi) en mode AP non sécurisé et branché sur le port ethernet du raspberry.

D'avance merci de tout aide.

What to do after install in README

What does one do after a install?
Does one need to configure in the radius GUI ?

Add Hotspot
Go to Management Tab > Hotspots > Click New Hotspot
Enter Hotspot Name and MAC Address of interface connected to clients, Click Apply

Add NAS
Go to Management > Nas > Click New NAS
Enter NAS Info, IP, NAS secret (e.g. testing123), NAS type, Other and NAS shortname. Set NAS Ports to 3997, Click Apply

Or it should all just work out of the box after script is ran ?

Control that counters for download/upload work

Counters are activated within freeradius using SQL configuration (as done in pull #20)
Available load counters are :

  • CS-Total-Octets-Daily
  • CS-Total-Octets-Weekly
  • CS-Total-Octets-Monthly
  • CS-Total-Octets-Quarterly
  • CS-Total-Octets-Yearly
  • CS-Total-Octets
  • CS-Input-Octets-Daily
  • CS-Input-Octets-Weekly
  • CS-Input-Octets-Monthly
  • CS-Input-Octets-Quarterly
  • CS-Input-Octets-Yearly
  • CS-Input-Octets
  • CS-Output-Octets-Daily
  • CS-Output-Octets-Weekly
  • CS-Output-Octets-Monthly
  • CS-Output-Octets-Quarterly
  • CS-Output-Octets-Yearly
  • CS-Output-Octets

These counters have to be tested with the default freeradius install (currently version 2.1.12)

WPA2 Encryption

First of all, thank you for providing this script. I have found it extremely useful.

I am wondering, however, if it is possible to encrypt the wifi traffic using WPA2, but still use the captive portal login?

Enhancement for modifiable login/registratin page

I checked out how things are working in this script, its a nice thing you've made, but mostly people do this so that they can have their own custom pages for login and session management.
The defalt ones that comes with CoovaChilli are not quite good and if you want to modify them, its a PIA.

I think I have a solution to handle this problem, also removing the need of doloradius. Both things can be done in a single site. Since I'm a WordPress developer, thinking of developing a WordPress plugin to deal with FreeRadius database for things like, User Management(just a sync of users in WP with freeradius), Analytics, and Session management, as well as write a custom responsive theme which will allow users to select colors, change fonts, and text, upload/modify logo, and anything that goes on the frontend of the login/registration page.

Still experimenting with stuff and could take a lot of time though but end product would be awesome, might need your help with freeradius and CoovaChilli related things.

Also, we can use some sort of SMS based API to send activation codes or maybe emails. Its quite easy thing to do with WordPress.

Add HTTPS support to front web portal

Could be interesting to add (force ?) HTTPS support for web portal with SSL certificate signed from letsencrypt.
Adding also the renewal of the certificate to not get blocked after 3 months

Seems to be required from Chilli to Radius to not allow PAP authentication occurs in clear over the network (used for issue #39)

Compatibilité rpi 2

Bonsoir,
est-ce que ce script fonctionne avec un raspberry 2 et une clé wifi ?

merci d'avance.

Ethernet connection goes down after line 192 of the script

I attempted to run the Pi-Hotspot script this morning and got stuck after line 192. After the message "Restarting network service to take IP forwarding into account" the ethernet connection no longer has internet connectivity and the rest of the script fails due to lack of connectivity.

eth0 shows it is configured (at 192.168.10.104/24), wlan0 is not associated. Ethernet port lights are blinking and my router shows the Pi is connected and has the same IP address. There's simply no internet access.

Config changes from original settings: Only changed hotspot name and all passwords

Things tried: restarting the Pi had no effect

Warning after Chilli service Start

Hello!

I'm having trouble executing the script between Coova and hostapd installation on my RP3 B Model.

The execution stops and the kernel show me that warning in loop:
chilli: packet size is too short (42 <= 50)

It's the second time that I format my SD and start a new minibian installation before execute the script, and unfortunately got the same issue.

Does anybody know why?

Daloradius has github.

I found this while searching the web for things.
https://github.com/lirantal/daloradius

It looks more updated than that of sourceforge.
I also make a pull on that for the duplicate entry of sqlcounter noresetcounter
related to the script pihotspot.sh lines 466 - 468

maybe we can use github version?
I have not yet tried it though. I might this coming days if I'm not busy.

User Name & Password

Successfully installed updated script, but I am unable to login with user credentials( usertest/passwd)
what is the test user name and password for connecting WiFi(Client)

Error on ./pihotspot.sh

Am having trouble, am using ssh to install but i get this error -> Something went wrong with the last command. Please check the log file

Help please

Self-Registration not working

I'm not sure what I am missing but when I set HS_REG_MODE="self" I get the link to register and can fill out the infos but nothing happens. The form is shown again with the previous inputs (except for the 2nd entry of the password). How can I set this up so a guest has to register with their email before adding a user account? And can the account be added automatically?
Thanks in advance for your help.

Issue on IPv4 network

You need to execute this command before installing via the script on Rasbian Lite
echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
when you are on IPv4 network, otherwise Rasberry will try to pull some packages from IPv6 network and script will fail.

Deleting and disabling user on daloradius

Now it works but am having trouble managing users, if i disable or delete them they keep accessing the internet is it the way it works or there is something i'm missing something?

HotSpot Chambre d'hotes

Salut !

Merci pour les tutos et informations hyper intéressantes !

J'ai besoin d'installer un hotspot Wifi dans une seule chambre d'hôtes, de façon sécurisée et différente de la connexion privée de la propriétaire. Jusque là, ta solution semble parfaite.

J'ai cependant une question, étant complètement novice dans ce genre de projet avec raspberry et linux...
Cette solution propose-t-elle une sauvegarde des fichiers logs ? Etant donné que la loi impose une sauvegarde de 12 mois de ces fameux logs...Une solution ? Est-ce intégrer ?

Comment le débutant que je suis (linux et raspberry) peut faire pour mettre en place ce système de HotSpot.

Merci

How to modify the captive portal splash screen and sign-in process?

Hello! I tried this script two days ago and it works perfectly with just a few minor changes on my side.

I have an idea for a project that involves the clients obtaining internet access not by intentionally signing in (I mean typing username and password), but only when the server gets some info from them through the browser, say location data and a timestamp to do some statistics. The server would renew the session in intervals of 30 min, at the end of which new location and timestamp information is collected from the clients, disconnecting them if it fails, but currently I don't know were to begin to modify the captive portal/splash screen to make this possible and then how to make the clients automatically sign in once the data required is collected (via some HTML/JavaScript I suppose).

I think I need more information on how the splash screen HTML is generated by the software to begin with. Any hints on where should I look into? Thanks in advance!

Log Loppsi

Bonjour,
Après une installation sans soucis particulier sur un RPI2 avec une jessie-lite toute fraîche et la modification des fichiers /etc/network/interfaces (les conf du wifi par défaut de la jessie rentre en conflit avec celles du script) et /etc/hostapd/hostapd.conf (p'tit soucis de driver propre à ma config) pour que cela tourne correctement, je teste un peu ce nouvel hotspot.
Y a encore quelques modifs à faire dans le script concernant le report des fichiers log dans DaloRadius (pb de droits d'accès de certains fichiers ou fichiers manquants) mais ceux ne sont que quelques détails.
Je me demande s'il y a quelque chose concernant les logs type Loppsi dans cette compilation hotspot ou s'il y a un truc que je n'aurai pas vu ou si cela n'est pas tout simplement encore implanté (si ça doit l'être) ?
Pour les générer, la (bonne) piste serait l'activation et triturage des logs d'iptables ou l'installation de squid (qui m'oblige d'utiliser un fichier proxy.pac pour réussir à log les requêtes https) ?

Pour le reste, chapeau bas pour la réalisation du script, je serai bien incapable pour le moment d'en faire autant.
Cordialement,
NuM82

Make installation of Haserl optional

Haserl is needed only in case of using the default coova chilli web portal.
In order to improve installation time, haserl could be disabled by default but activable in the configurable part of the script

Extremely slow access

I've done the install, all looks good. No errors but I have extremely slow access and just getting the captive splash/login takes forever to come up and even then can fail. If I succeed, hitting fast.com will give me something like 2kbs.

Raspberry Pi 3 with the built in wifi using the latest rasbian jessie lite on ethernet
Version:July 2017
Release date:2017-07-05
Kernel version:4.9

I'm at a loss here. Any ideas?

Redirect after login.

When you log into the hotspot it directs you to a successful login page. Then after a set time it directs you to another page. I would like prefer that it directs you to the google search page when it leaves the successful login page. Also, I changed the title in the title file but it stayed the same after reboot. Where else do I change the title?
Thanks in advance for your reply.

No ''done" button on iOS

When using the captive portal via an iOS device the popup landing page of iOS never shows you the 'Done' link on top right after success login. It remains 'Cancel' although you are logged in already.
By enabling the Redirect function (line 75) in the portal.js file that problem is gone.
I know it's only a cosmetic problem cause if you click the home button you are connected to internet. The Done link on top is just nicer in this case and if you happen to click the Cancel link you are disconnected again.
Having a configurable redirect page (line 19) would also be nice in that case

probleme de copier coller ?

Super utile même si ça marche pas direct chez moi ;) j'ai essayé de regarder pourquoi ça plantait après l'installation de mysql il me semble que cela vient des lignes ou il manque un espace après le p : mysql -u root -p$MYSQL_PASSWORD mais vu que j'ai une connexion à mourir j'ai pas eu le temps de re-tester. j'ai aussi vu un problème il manque un point 127.0.0.1 echo "GRANT ALL ON radius.* to 'radius'@'127.0.01';" >> /tmp/grant.sql

par contre je connais pas trop comment fonctionne le portail captif mais je ne vois pas de conf server dhcp ...

;)

Olivier

Utiliser une connexion wifi (wlan1) à la place de eth0 pour l'internet.

Bonjour,

Je viens d'utiliser vos scripts pour transformer ma Pi en HotSpot et cela fonctionne très bien (aussi bien sur une pi3 qu'une pi2 après quelques adaptations). Bravo !

Toutefois j'aurais voulu utiliser également une deuxième connexion wifi (wlan1) comme connexion vers l'internet à la place de eth0, et là je ne suis pas certain des manipulations à effectuer.

Auriez-vous une piste ?

Merci d'avance

prepaid user setup

hello, thank you for the script, it's working.

I have a question though, how to setup/create a user with 1 hour limit?

Script stops on "unable to find chilli interface tun0".

Ran script from FRESH Raspian install.
Everything works well till i run into this error near end of script:

Stops on "unable to find chilli interface tun0".

ifconfig shows no tun0.

pastebin.com/PscgBhiV

A fresh install of latest RASBIAN shows no module TUN if one types "lsmod".
"sudo modprobe tun" gives error

Installation fails

Hi,

during the process of installation, it doesn't seem to go al the way to the end because in the logs, i can find these lines:

`Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-common armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-cli armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Get:33 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-json armhf 1.3.6-1 [16.9 kB]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php-pear all 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Get:34 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapparmor1 armhf 2.9.0-3 [58.1 kB]
Get:35 http://mirrordirector.raspbian.org/raspbian/ jessie/main nginx all 1.6.2-5+deb8u4 [72.6 kB]
Get:36 http://mirrordirector.raspbian.org/raspbian/ jessie/main php-db all 1.7.14-3 [73.0 kB]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-fpm armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-gd armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-mysql armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-readline armhf 5.6.29+dfsg-0+deb8u1
404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]
Get:37 http://mirrordirector.raspbian.org/raspbian/ jessie/main libgd2-xpm-dev armhf 2.1.0-5+deb8u9 [1,236 B]
Fetched 9,015 kB in 6s (1,314 kB/s)
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-common_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-cli_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php-pear_5.6.29+dfsg-0+deb8u1_all.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-fpm_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-gd_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-mysql_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/p/php5/php5-readline_5.6.29+dfsg-0+deb8u1_armhf.deb 404 Not Found [IP: 2a00:1098:0:80:1000:75:0:3 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
**
** Something went wrong with the last command. Please check the log file
**

Does these message can be resolved ?

thanks !

Full distro credentials

I am unable to log in to daloradius or ssh to the raspberry pi having used the full distro, please could you provide the login details

Create a ready-to-use distro

I think that some people could be interested to get a hotspot without calling the script if they agree to use default configuration. Then generating an img file ready to be installed on a 2Gb sd card could be provided.

What is the best place to store the file ?

Syntax Error

i have an error

./pihotspot.sh: line 265: syntax error near unexpected token('
./pihotspot.sh: line 265: display_message " (login : administrator / password : radius)"'

or

./pihotspot.sh: line 265: unexpected EOF while looking for matching"'
./pihotspot.sh: line 266: syntax error: unexpected end of file
`

Ubuntu Mate Xenial support - RPi3

I launched the script on Ubuntu Mate on a RPi3 and it seems some of the packages it would install have been renamed so the procedure fails at various stages.

I tried to pin them down and, if that helps, I'll list my suggestion.

Packages that no longer work and what I supposed may have superseded them

  • libnl1 --> libnl-3-200 or libnl-3-200-udeb (not found in normal repositories)
  • libnl-dev --> libnl-3-dev
  • php5-fpm --> php-fpm
  • php5-gd --> php-gd
  • php5-mysql --> php-mysql
  • php5-xcache --> php-cache
  • libpcrecpp0 --> libpcrecpp0v5
  • nginx --> nginx-core and nginx-common

Apart from that, I found that the script got stuck at line 269. By resuming manually I got to the end of the installation, resulting in a WiFi hotspot that doesn't connect devices to the internet or to Coova Chilli, and these services hadn't been set to start at boot time. Also, pi.ip.add.ress/daloradius in a browser gave me a 502 error so I don't think my solution really worked.
Is there a chance to get this captive portal up and running on xenial-based distros?

Possible syntax error?

Thanks for your script, it's just super useful to me.

I'm using a RaspberryPi 3 with Raspbian Jessie Lite (2016-11-25)

http://pastebin.com/e70hP0ha

not a real expert here, maybe it's me doing something wrong?

Thanks for your work and your time

Block Client

How to block client's from access Router GUI? cannot change router username password.

Connected clients not able to browse the internet

Hello,

Thanks for the script it worked like a charm! Just one problem. Clients connected are not able to browse the internet. I am using the default configuration from the script. Clients can see the portal login and able to login but browsing the internet is not working on the client.

Thanks in advance.

Use counters based on time

@reigelgallarde : can you please tell us how you used the counters for time basis ? On my side i tried with a counter called Max-All-Session set to 180 in the check attributes but it does not work and the user is not disconnected

NAS configuration

Hello,
First thanks for your project, it was exactly what I was looking for !

I have a problem with the NAS configuration. When I try to disconnect a user from Reports > Online Users, I have this error :
radclient: no response from server for ID 33 socket 3

I configured the NAS as follows :
NAS IP/Host : 127.0.0.1
NAS Secret : testing123
NAS Type : other
NAS Shortname : localhost
NAS Ports : 3799

What am I doing wrong ?

suggestions

package nginx missing

all downloads should happen before instalation progress
this way we can download all required softwares by pi-hotspot-script using 3g/4g/bluetooth/wlan internet, instead of ONLY eth0

this script should have some "if/then" to check previously changes
doing this if your install crash u can continue without additional issues, like "mysql table alrealy exist"

thank you for this amazing script
cheers

Unable to find chilli interface tun0

I have tried in Pi-Hotspot-Script in raspbian jessie lite, i got this error can any one please help me

error: Unable to find chilli interface tun0

JSON request time out

there's was an error when redirecting in Portal and also when trying to login with this new Kupiki-Hotspot..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.