Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanteleimon Sarantos <pantelis.fedora@gmail.com>2017-09-23 20:20:01 +0300
committernachoparker <nacho@ownyourbits.com>2017-09-24 23:53:42 +0300
commitd42cbb74b85787b28b96d6301b17f1a9e7f22524 (patch)
treece7bf7f2d16dce16d2ecac0328d3e6ec635397bb
parentacbe26cc141cea7d6f9b139ddd1211b44403a2ac (diff)
ncp-web authentication prompt
-rw-r--r--lamp.sh4
-rw-r--r--nextcloudpi.sh29
2 files changed, 28 insertions, 5 deletions
diff --git a/lamp.sh b/lamp.sh
index dc59d917..18eed1af 100644
--- a/lamp.sh
+++ b/lamp.sh
@@ -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
diff --git a/nextcloudpi.sh b/nextcloudpi.sh
index ceed393b..fad2d2de 100644
--- a/nextcloudpi.sh
+++ b/nextcloudpi.sh
@@ -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