Browse Source

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>
lilik-openwrt-22.03
Daniel Dickinson 8 years ago
parent
commit
c1d26bacdf
2 changed files with 7 additions and 0 deletions
  1. +1
    -0
      net/nut/Makefile
  2. +6
    -0
      net/nut/files/add_nut_httpd_conf

+ 1
- 0
net/nut/Makefile View File

@ -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
- 0
net/nut/files/add_nut_httpd_conf View 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
}

Loading…
Cancel
Save