davesteele / comitup

Bootstrap Wifi support over Wifi
https://davesteele.github.io/comitup/
GNU General Public License v2.0
322 stars 54 forks source link

Flexible options for flask server #61

Closed Blimpyway closed 3 years ago

Blimpyway commented 5 years ago

Hi, I noticed in https://github.com/davesteele/comitup/blob/master/web/comitupweb.py the Flask app is started on a fixed port 80 and with debug mode enabled.

It would be nice to have these configurable in /etc/comitup.conf for following reasons:

I know it would be easier with a second, usb wifi dongle but that adds significant, unnecessary drain to battery.

Thanks, the debug off option is probably simpler. The dynamics of bringing interfaces up and down while services are running might be tricky.

Regards, Cezar

davesteele commented 5 years ago

Flask debug should be off. As for changing the web port, there is more to it than just the port number, though it is not because of issues from the state changes. I'd consider patches.

Blimpyway commented 5 years ago

Hi if this is of any help,

With flask in debug mode cpu consumed only about 10% on a pi zero, which is less than I initially noticed. When I had higher numbers was because I started manually lighttpd and the comitup service was continuously attempting to restart while port 80 was busy.

Both debug mode and port number for flask are in comitupweb.py and changing them to debug=False and port 82 seems to work fine, at least from what I was able to notice.

davesteele commented 5 years ago

Yes, that should be all you need to reconfigure the web server. But, note that Comitup will still shut down the web service while CONNECTED. You could probably work around this by setting web_service to "comitup-web".

davesteele commented 4 years ago

Note that there is a link to the configuration web location in dns-hotspot.conf, which implements the DHCP captive portal behavior. You may want to change that as well.