mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 19:14:30 +04:00
net/nut: Protect CGI via HTTP Basic Auth
When using uhttpd (the default), protect NUT CGI via HTTP Basic Auth. Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
This commit is contained in:
@@ -275,6 +275,7 @@ define Package/nut-web-cgi/conffiles
|
||||
/etc/nut/upsstats.html
|
||||
/etc/nut/upsstats-single.html
|
||||
/etc/config/nut_cgi
|
||||
/etc/httpd.conf
|
||||
endef
|
||||
|
||||
define Package/nut-web-cgi/install
|
||||
|
||||
6
net/nut/files/add_nut_httpd_conf
Normal file
6
net/nut/files/add_nut_httpd_conf
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
grep -q '/cgi-bin/nut' /etc/httpd.conf 2>/dev/null || {
|
||||
echo '/cgi-bin/nut:root:$p$root' >>/etc/httpd.conf
|
||||
/etc/init.d/uhttpd restart
|
||||
}
|
||||
Reference in New Issue
Block a user