sebpiq / freedomportal Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
https://github.com/sebpiq/FreedomPortal/blob/master/freedomportal/lighttpd.conf#L34
Apparently when the captive portal loads the page, the url /
is not matched, which means that the visitor won't be logged. Find the right regex to log also in this case, without logging too much
Hello,
First of all, thanks for sharing and putting this together. I ran into this project while researching on ways to improve the captive portal experience -- specifically in linking out to Safari from iOS' CNA.
I was looking forward to trying this out but couldn't get it to run. I'm using a GL-inet mini router and ran through your entire read me without error. Connecting on both desktop and mobile produces no captive portal. Navigating to URLs in the browser behaves normally both with and without an internet connection.
I've pasted the contents of my log folder below. Did something change, or am I missing something?
Thanks again!
lua: /root/FreedomPortal/freedomportal/openwrt.lua:24: attempt to index field '?' (a nil value)
stack traceback:
/root/FreedomPortal/freedomportal/openwrt.lua:24: in function </root/FreedomPortal/freedomportal/openwrt.lua:21>
/root/FreedomPortal/scripts/refresh_clients.lua:21: in main chunk
[C]: ?
lua: /root/FreedomPortal/freedomportal/openwrt.lua:24: attempt to index field '?' (a nil value)
stack traceback:
/root/FreedomPortal/freedomportal/openwrt.lua:24: in function </root/FreedomPortal/freedomportal/openwrt.lua:21>
/root/FreedomPortal/freedomportal/clients/init.lua:24: in function 'get_clients'
...FreedomPortal/freedomportal/clients/file_storage.lua:97: in function 'replace_all'
/root/FreedomPortal/freedomportal/clients/init.lua:22: in function 'refresh'
/root/FreedomPortal/scripts/refresh_clients.lua:23: in main chunk
[C]: ?
lua: /root/FreedomPortal/freedomportal/openwrt.lua:24: attempt to index field '?' (a nil value)
stack traceback:
/root/FreedomPortal/freedomportal/openwrt.lua:24: in function </root/FreedomPortal/freedomportal/openwrt.lua:21>
/root/FreedomPortal/scripts/refresh_clients.lua:21: in main chunk
[C]: ?
lua: /root/FreedomPortal/freedomportal/openwrt.lua:24: attempt to index field '?' (a nil value)
stack traceback:
/root/FreedomPortal/freedomportal/openwrt.lua:24: in function </root/FreedomPortal/freedomportal/openwrt.lua:21>
/root/FreedomPortal/freedomportal/clients/init.lua:24: in function 'get_clients'
...FreedomPortal/freedomportal/clients/file_storage.lua:97: in function 'replace_all'
/root/FreedomPortal/freedomportal/clients/init.lua:22: in function 'refresh'
/root/FreedomPortal/scripts/refresh_clients.lua:23: in main chunk
[C]: ?
warning : couldnt find an IP mapping for MAC address 8C:8E:F2:62:DB:48
This is a really cool project!
I'm trying to run it on a GL-MT300N
. I used the web interface to connect to the internet, upgrade the firmware to 2.25, and am able to ssh
in.
However, my distribution seems to differ from what you're running. uhttpd
for instance isn't present. Following the rest of the README.md appears to work, but when the router restarts, I'm not able to connect to it, and have to connect over ethernet and reload the firmware in failsafe mode.
It'd be helpful to know what devices you're using to develop this and what else it works on. Links to the binaries used would be awesome too.
Thanks!
Config is by now spread around in several files (lighttpd, sh scripts, lua scripts, etc ...) it should be centralized in one file.
https://github.com/sebpiq/FreedomPortal/blob/master/freedomportal/lighttpd.conf#L17
With the current implementation, when a page is not found the configured handler is looked relatively to the current host. So we cannot configure a per-host 404. It's easy to work around though ...
Under "Install FreedomPortal on the router," note that an Internet connection is required (as we are downloading packages).
Under "Connect Through SSH," note that if you are configuring more than one router you may get the message "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" In which case, enter
ssh-keygen -R 192.168.8.1
and then connect via
for example the install script will configure dnsmasq even if install of packages failed, ... so after reboot install is not possible anymore cause there won't be any connectivity.
Hi Sebastian,
I was reading your README.md and it doesn't say anything about which router firmware you used. I assume it's OpenWRT as you're using opkg
, but could you provide some information about which version worked for you?
Regards,
Sam
Hello,
Very cool project !
I installed it on a OpenWRT router and tried it both on Android and iPhone, looks like everything is working fine but when I connect to the router WiFi, I'm always getting straight to my index page in the CNA. It does not go through Android or iOS connecting / connected pages, nor opens generic browser.
I am wondering if it could be a URL configuration problem; because I don't see the link between the URLs in lighttpd.conf and config.lua ?
In lighttpd.conf:
alias.url = (
"/_freedomportal" => "/root/FreedomPortal/pages/",
In config.lua:
redirect_success = '/freedomportal_content',
captive_static_root_url = '/freedomportal_static',
captive_dynamic_root_url = '/freedomportal',
Best regards,
henll
Hi, I just managed to get this working on a gl-mt300n-v2
(incidentally: the only change I needed to make in your code was to change paths from "PORTALKEY" to "sda1" as it didn't seem to read the name/label of the volume on the USB key)
I am trying to figure out how to access the visitor log and can't work it out from the code. I'm completely new to both OpenWRT and lihgttpd so please excuse me if this is actually obvious - but I wonder if it might be an important thing to add to the setup guide?
thanks so much for making this inspiring project available
CNA both in iOS and Android is missing some features, which will cause problems if you use them (for example file upload field, it will even cause iOS to simply drop you from the network without any warning).
There are several workarounds possible :
find a reliable way to detect that the browser is in fact a CNA from JavaScript and degrade gracefully.
Problem: on iOS, you can't just tell the user to open a browser, because you need to finish the connection process (or tap "cancel -> use without Internet"), otherwise you will be dropped from the network
implement a connection process to redirect user to browser from CNA. This can be automatic (just click, and CNA automagically closes and browser opens) or simply make sure that the phone won't drop you off the network (on iOS this involves returning the "SUCCESS" page), and instruct the user to open a web browser manually. These processes were implemented in older version :
Wont really call this an issue but more of a query from a complete noob...
(am fairly experienced in nodejs webpage routing building and stuff you can say but havent really done this so bear with please)
Im planning on/trying to use FreedomPortal on a private network server i have installed in my apartment complex and i wanted to know if i could
Thanks in advance!
I think the version for OpenWrt routers may no longer work. I set up Freedom Portal on a GL-inet MT300A router as per the instructions (and with latest firmware for the router - v2.265). The WiFi hotspot can then be connected to from my iPhone (iOS17.1.2) and MacBook (MacOS 13.5.2) but the captive portal page is not automatically opened.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.