Interest Check: No login required from local network


 

Bryan Mayland

TVWBB Hall of Fame
Tired of always having to login to get to the configuration page, I tested a bit of code in luci to make it so you are automatically logged in if you're hitting the website from the local network. It works but I was going to flesh it out to make it part of the luci main distribution as an option. It is a bit of work so I want to know if this is something that others want too.

What are your thoughts on this? The downside would be that anyone on your wireless would be able to administer the system and change HeaterMeter settings/setpoint/etc. The upside would be no interstitial login page, you'd just be "admin" whenever you hit the site.
 
I think auth all the time would get a bit old, especially since the idea is to be able to connect from whatever device you happen to be holding, etc.

I've still not played with the interface (SD Card clearing off now).... but if you can read the system but not change values without auth, that is a good thing, but to be honest, no auth at all would probably be okay with me.

I'm glad it is there so I can keep public ports forwarded without some random internet person messing with setpoints, etc...

Is it feasible to make it a mode? So in the off chance someone wants to lock it down on LAN can... (for instance a tailgate or bbq comp with public wifi). So, basically, a checkbox somewhere that says "Allow all LAN users to be admin without login".

Anyway, that would be a perk. I think no auth on local LAN would be great.

I've been meaning to ask... if there is not a wifi network defined to connect up to, does it (or will it) go into ad-hoc mode? If not, I think that would be cool so in the absence of wifi you can get connected up with it in AP mode, define new wifi keys, or use it as is, etc.

Feel free to create a 'feature request' thread when you are ready :)

One idea (so I dont forget to put it out there) is to have some options:

When food = setpoint:
[X] Send Email (TXT Message or email really)
[X] Run Program: (let user insert path to bash script or program)

.... Same options for high/low alarms, fuel needed alarm, etc. Adding script access would make it easy to do a quick customization w/o the end user messing with luci/lua, etc, maybe utilize the GPIO pins on the rPi for stuff, snap photos, upload junk to an FTP, etc,etc.

An additional "Run Script Now" button would be great, I even saw someone who was able to switch OS distributions over to OpenELEC via a bash script (and back via XMBC). Those who want to dual use the device might like that option.

(Sorry, hijacked the thread :( )
 
Last edited:
Is it feasible to make it a mode? So in the off chance someone wants to lock it down on LAN can... (for instance a tailgate or bbq comp with public wifi). So, basically, a checkbox somewhere that says "Allow all LAN users to be admin without login".
Yeah what I was thinking was to make it an option on the Network configuration page, like each network (WAN, LAN, WWAN, bridges) will have a checkbox to indicate it is a "trusted network". On a trusted network you'll be logged in automatically. That's where the fun comes in-- getting it accepted into LuCI trunk.
I've been meaning to ask... if there is not a wifi network defined to connect up to, does it (or will it) go into ad-hoc mode? If not, I think that would be cool so in the absence of wifi you can get connected up with it in AP mode, define new wifi keys, or use it as is, etc.
Nope! I'm sure you can write a script or something that does it though that runs on startup? That's more of an OpenWrt question than a LinkMeter question. It definitely isn't something built in though because Wrt is designed to be one thing and stay that way. Example script:
Code:
#!/bin/sh
# give time for the wifi to connect
sleep 30
AP=`iwinfo wlan0 info | sed -n 's/Access Point: \(.*\)$/\1/p'`

if [ "$AP" == "00:00:00:00:00:00" ] ; then
  # not connected
  # set wireless mode to AP, will revert on reboot if you don't commit
  uci set wireless.@wifi-iface[0].mode=ap
  # restart the network
  /etc/init.d/network restart
  # and start the DHCP server
  /etc/init.d/dnsmasq start
fi
 
One idea (so I dont forget to put it out there) is to have some options:

When food = setpoint:
[X] Send Email (TXT Message or email really)
[X] Run Program: (let user insert path to bash script or program)
Yeah this is how the alarm system is going to work. It is all going to be "execute a script" but there will be some built-in scripts for sending email or SMS or whatnot.
 
Yeah this is how the alarm system is going to work. It is all going to be "execute a script" but there will be some built-in scripts for sending email or SMS or whatnot.

Sounds good to me.

Thanks for the AP select script. My motivation is that I'd like to be able to take my setup out to my parents place and use it on his smoker, but being in the country, it is a good distance from the wireless AP... plus I guess you have to select the AP initially by ethernetting in? Anyway, no need for "internet" connectivity out there, I just need access with my phone, so Ad-hoc would work great.

What is the purpose of getting it accepted upstream in Luci? Just to have one less patch? I imagine for the intended purpose of Luci, they will want to avoid insecurities. I need to read more about Luci, but I am not able to compile from the svn.

I get:

evanmj@ubuntu:~/openwrt/lucisvn$ make runhttpd

<lots of stuff> ...
make[2]: Leaving directory `/home/evanmj/openwrt/lucisvn/contrib/uci/uci.git/lua'
make[1]: Leaving directory `/home/evanmj/openwrt/lucisvn/contrib/uci'
make[1]: Entering directory `/home/evanmj/openwrt/lucisvn/contrib/uhttpd'
(cd uhttpd-src; make LUA_SUPPORT=0 TLS_SUPPORT=0 CGI_SUPPORT=1)
make[2]: Entering directory `/home/evanmj/openwrt/lucisvn/contrib/uhttpd/uhttpd-src'
cc -o uhttpd -L./lua-5.1.4/src -Wl,--export-dynamic -lcrypt -ldl uhttpd.o uhttpd-file.o uhttpd-utils.o uhttpd-cgi.o
uhttpd.o: In function `main':
/home/evanmj/openwrt/lucisvn/contrib/uhttpd/uhttpd-src/uhttpd.c:968: undefined reference to `crypt'
uhttpd-utils.o: In function `uh_auth_check':
/home/evanmj/openwrt/lucisvn/contrib/uhttpd/uhttpd-src/uhttpd-utils.c:780: undefined reference to `crypt'
collect2: ld returned 1 exit status
make[2]: *** [compile] Error 1
make[2]: Leaving directory `/home/evanmj/openwrt/lucisvn/contrib/uhttpd/uhttpd-src'
make[1]: *** [compile] Error 2
make[1]: Leaving directory `/home/evanmj/openwrt/lucisvn/contrib/uhttpd'
*** Compilation of contrib/uhttpd failed!
make: *** [gccbuild] Error 1
evanmj@ubuntu:~/openwrt/lucisvn$

I have /usr/include/crypt.h...

I've installed the pre-reqs listed here: http://luci.subsignal.org/trac/wiki/Documentation/DevelopmentEnvironmentHowTo
( GCC, Make (build-essential), Lua 5.1.x + development headers (lua5.1, liblua5.1-0-dev) )
 
Last edited:
Tired of always having to login to get to the configuration page, I tested a bit of code in luci to make it so you are automatically logged in if you're hitting the website from the local network. It works but I was going to flesh it out to make it part of the luci main distribution as an option. It is a bit of work so I want to know if this is something that others want too.

What are your thoughts on this? The downside would be that anyone on your wireless would be able to administer the system and change HeaterMeter settings/setpoint/etc. The upside would be no interstitial login page, you'd just be "admin" whenever you hit the site.

I'd rather have to log into the config each time. Once I start cooking I generally don't need to go into the config page and I'd be afraid that someone on the network will screw around with it. Just my feeling on the matter and I can see the benefits from both sides on having it. It's not too much of an inconvenience to me to type my password in. We all do it enough each day already.
 

 

Back
Top