[httpd] Implement "trusted_networks" option

Some clients aren't really capable of authenticating + some users probably
don't want to enter a password for the web interface. This option allows
clients on for instance the local network to connect without authentication.
This commit is contained in:
ejurgensen
2017-11-11 21:17:42 +01:00
parent 6d937469f5
commit 3d5aeda7aa
8 changed files with 80 additions and 42 deletions

View File

@@ -284,7 +284,7 @@ rsp_request_authorize(struct httpd_request *hreq)
char *passwd;
int ret;
if (cfg_getbool(cfg_getsec(cfg, "general"), "promiscuous_mode"))
if (httpd_peer_is_trusted(hreq->req))
return 0;
passwd = cfg_getstr(cfg_getsec(cfg, "library"), "password");