[SCM] Debian packaging of Pinto CPAN distribution branch, master, updated. fb6a90f5a8cc15f1a21a950c53b7d74305d0fc17

Oleg Gashev oleg at gashev.net
Sun Jun 9 20:23:59 UTC 2013


The following commit has been merged in the master branch:
commit fb6a90f5a8cc15f1a21a950c53b7d74305d0fc17
Author: Oleg Gashev <oleg at gashev.net>
Date:   Sun Jun 9 20:22:53 2013 +0000

    Added basic HTTP authentication for pintod.

diff --git a/debian/control b/debian/control
index bf1d0af..7a2dc21 100644
--- a/debian/control
+++ b/debian/control
@@ -73,6 +73,7 @@ Package: pinto
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends},
  libapp-cmd-perl,
+ libauthen-simple-passwd-perl,
  libclass-load-perl,
  libcpan-checksums-perl,
  libcpan-distnameinfo-perl,
diff --git a/debian/pinto.config b/debian/pinto.config
new file mode 100644
index 0000000..36b087e
--- /dev/null
+++ b/debian/pinto.config
@@ -0,0 +1,29 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+# the passwords are reset at the end of every postinst run,
+# however, they are left in the "seen" state so that the
+# admin is not prompted for them at every upgrade.
+while [ ! "$passwordsmatch" ]; do
+	#only ask for a password if no htpasswd exists
+	test -f /etc/pinto/htpasswd.users && break 
+	db_input high pinto/adminpassword || true
+	db_input high pinto/adminpassword-repeat || true
+	db_go || true
+	db_get pinto/adminpassword
+	p1="$RET"
+	db_get pinto/adminpassword-repeat
+	p2="$RET"
+	if [ "$p1" = "$p2" ]; then
+		passwordsmatch="yes"
+	else
+		db_fset pinto/adminpassword seen false
+		db_fset pinto/adminpassword-repeat seen false
+		db_fset pinto/adminpassword-mismatch seen false
+		db_input critical pinto/adminpassword-mismatch || true
+	fi
+done
+
+db_go || true
+
diff --git a/debian/pinto.default b/debian/pinto.default
index 6f68104..de063dc 100644
--- a/debian/pinto.default
+++ b/debian/pinto.default
@@ -10,4 +10,4 @@
 START_PINTOD=0
 
 # command line options
-PINTOD_OPTS="--root=/var/lib/pinto/repository/default/ --access-log=/var/log/pinto/access.log --error-log=/var/log/pinto/error.log --daemonize"
+PINTOD_OPTS="--root=/var/lib/pinto/repository/default/ --auth backend=Passwd --auth path=/etc/pinto/htpasswd.users  --access-log=/var/log/pinto/access.log --error-log=/var/log/pinto/error.log --daemonize"
diff --git a/debian/pinto.postinst b/debian/pinto.postinst
index 890fd48..11a9d23 100644
--- a/debian/pinto.postinst
+++ b/debian/pinto.postinst
@@ -34,6 +34,20 @@ if [ "$1" = configure ]; then
 		chmod 0640 /var/log/pinto/error.log
 	fi
 
+	if [ ! -e /etc/pinto ] ; then
+		mkdir -p /etc/pinto
+		chmod 0750 /etc/pinto
+	fi
+
+	db_get pinto/adminpassword
+	admpass="$RET"
+	htpw='/etc/pinto/htpasswd.users'
+
+	if [ -n "$admpass" ]; then
+		touch "$htpw"
+		htpasswd -b "$htpw" pintoadmin "$admpass"
+	fi
+
 	if /bin/pidof /usr/bin/pintod >/dev/null 2>&1; then
 		invoke-rc.d pinto restart
 	else
diff --git a/debian/pinto.postrm b/debian/pinto.postrm
index 4cb3e67..2370bef 100644
--- a/debian/pinto.postrm
+++ b/debian/pinto.postrm
@@ -4,7 +4,8 @@ set -e
 
 case "$1" in
 	purge)
-		for d in /var/log/pinto \
+		for d in /etc/pinto \
+			/var/log/pinto \
 			/var/lib/pinto ; do
 			rm -rf $d 2> /dev/null || true;
 		done;
diff --git a/debian/pinto.templates b/debian/pinto.templates
new file mode 100644
index 0000000..7d111de
--- /dev/null
+++ b/debian/pinto.templates
@@ -0,0 +1,17 @@
+Template: pinto/adminpassword
+Type: password
+Description: Pinto web administration password:
+ Please provide the password to be created with the "pintoadmin" user.
+ .
+ This is the username and password you will use to log in to your pinto
+ installation after configuration is complete.  If you do not provide
+ a password, you will have to configure access to pinto yourself.
+
+Template: pinto/adminpassword-repeat
+Type: password
+Description: Password confirmation:
+
+Template: pinto/adminpassword-mismatch
+Type: note
+Description: The passwords do not match
+

-- 
Debian packaging of Pinto CPAN distribution



More information about the Pkg-perl-cvs-commits mailing list