lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

commit c1d26bacdff1dc104f59ecd06d777286fabf9c6f
parent a23c4e85c5f6c9f9dcf67743b93c492ba833e365
Author: Daniel Dickinson <lede@cshore.thecshore.com>
Date:   Wed, 11 Jan 2017 18:54:16 -0500

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>

Diffstat:
Mnet/nut/Makefile | 1+
Anet/nut/files/add_nut_httpd_conf | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/nut/Makefile b/net/nut/Makefile @@ -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 diff --git a/net/nut/files/add_nut_httpd_conf b/net/nut/files/add_nut_httpd_conf @@ -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 +}