ncp-web authentication prompt

This commit is contained in:
Panteleimon Sarantos 2017-09-23 20:20:01 +03:00 committed by nachoparker
parent acbe26cc14
commit d42cbb74b8
2 changed files with 28 additions and 5 deletions

View File

@ -33,6 +33,7 @@ install()
$APTINSTALL cron
$APTINSTALL util-linux # TODO only need getopt (busybox?)
$APTINSTALL apache2
$APTINSTALL libapache2-mod-authnz-external
$APTINSTALL php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip php7.0-APC php7.0-fileinfo php7.0-mcrypt
mkdir -p /run/php
@ -108,7 +109,8 @@ EOF
a2enmod dir
a2enmod mime
a2enmod ssl
a2enmod authnz_external
a2dismod -f status reqtimeout env autoindex access_compat auth_basic authn_file authn_core alias access_compat
echo "ServerName localhost" >> /etc/apache2/apache2.conf

View File

@ -41,13 +41,34 @@ Listen 4443
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<IfModule mod_authnz_external.c>
DefineExternalAuth pwauth pipe /usr/sbin/pwauth
</IfModule>
</VirtualHost>
<Directory /var/www/ncp-web/>
Require host localhost
Require local
Require ip 192.168
Require ip 10
AuthType Basic
AuthName "Login"
AuthBasicProvider external
AuthExternal pwauth
<RequireAll>
<RequireAny>
Require host localhost
Require local
Require ip 192.168
Require ip 10
</RequireAny>
Require user pi
</RequireAll>
</Directory>
EOF
a2ensite ncp