From c0220106f9e4b8cfe3a5c803b621fb4db74cac6f Mon Sep 17 00:00:00 2001 From: Mirko Tietgen Date: Sat, 16 Jan 2016 10:27:15 +0100 Subject: [PATCH] Bug 15587 Unstable letsencrypt_x.x.x-x_all.deb testing Apply on top of bug 15303! * only one commandline parameter left: ** --letsencrypt replaces --force-https: use LE ** old --letsencrypt (folder path) obsolete * dependency: letsencrypt debian package Test plan: - apply bug 15303 - apply this patch - build a package - test in disposable vm, we're mixing releases - install koha-common unstable and dependencies - enable debian unstable repository - install package letsencrypt and dependencies - remove debian unstable repository - create koha instance koha-create --create-db --letsencrypt - follow test plan on bug 15303 where applicable --- C4/Auth_cas_servers.yaml.orig | 12 ------------ debian/control.in | 3 ++- debian/docs/koha-create.xml | 13 ++----------- debian/scripts/koha-create | 37 ++++++++++++++++++++++--------------- install_misc/debian.packages | 1 + 5 files changed, 27 insertions(+), 39 deletions(-) delete mode 100644 C4/Auth_cas_servers.yaml.orig diff --git a/C4/Auth_cas_servers.yaml.orig b/C4/Auth_cas_servers.yaml.orig deleted file mode 100644 index 8ad171e..0000000 --- a/C4/Auth_cas_servers.yaml.orig +++ /dev/null @@ -1,12 +0,0 @@ -# This file is used for authenticating against multiple CAS servers -# If the file Auth_cas_servers.yaml exists, then the casServerUrl syspref will be ignored - -# If you have to authenticate against only one CAS server, which is usually the case, -# don't use this file, but the casServerUrl syspref instead - -default: ServerName ---- - ServerName: "https://example.com/cas" - OtherServerName: "https://example.org/cas" - ThirdServerName: "https://example.edu/cas" - diff --git a/debian/control.in b/debian/control.in index ad9b891..ab61736 100644 --- a/debian/control.in +++ b/debian/control.in @@ -35,7 +35,8 @@ Depends: ${misc:Depends}, ${koha:Depends}, xmlstarlet, yaz Suggests: mysql-server | virtual-mysql-server, - memcached + memcached, +letsencrypt Homepage: http://koha-community.org/ Description: integrated (physical) library management system Koha is an Integrated Library Management system for real-world libraries diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml index 3f3b4d8..ad78f87 100644 --- a/debian/docs/koha-create.xml +++ b/debian/docs/koha-create.xml @@ -40,8 +40,7 @@ port directory - - directory + | instancename @@ -179,17 +178,9 @@ - - - Set up a https-only website - - - - - Specify the where letsencrypt-auto lives - It defaults to /usr/bin. + Set up a https-only website with letsencrypt cerificates diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index a5f0c04..5604792 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -71,8 +71,7 @@ Options: conjunction with --defaultsql and --populate-db. --upload-path dir Set a user defined upload_path. It defaults to /var/lib/koha//uploads - --force-https Set up a https-only site with letsencrypt certificates - --letsencrypt Path to the letsencrypt folder + --letsencrypt Set up a https-only site with letsencrypt certificates --help,-h Show this help. Note: the instance name cannot be longer that 11 chars. @@ -195,11 +194,11 @@ EOM fi # Check that mod_ssl is installed and enabled. - if [ "$USE_HTTPS" = "yes" ]; then + if [ "$CLO_LETSENCRYPT" = "yes" ]; then if ! /usr/sbin/apachectl -M 2> /dev/null | grep -q 'ssl_module'; then cat 1>&2 </dev/null | grep -c "ok installed") -eq 0 ]; then + apt-cache show letsencrypt &>/dev/null + if [ $? -eq 0 ]; then + read -r -p "The letsencrypt package is not installed. Do it now? [y/N] " response + if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then + apt-get install -y letsencrypt + else + die "You have to install letsencrypt to use the --letsencrypt parameter." + fi + else + die "No installation candidate available for package letsencrypt." + fi fi if [ -f $PASSWDFILE ] && [ `cat $PASSWDFILE | grep "^$name:"` ] @@ -641,7 +648,7 @@ FLUSH PRIVILEGES; eof fi #` - if [ "$USE_HTTPS" = "yes" ]; then + if [ "$CLO_LETSENCRYPT" = "yes" ]; then APACHE_CONFIGFILE="apache-site-https.conf.in" else APACHE_CONFIGFILE="apache-site.conf.in" @@ -757,7 +764,7 @@ then koha-indexer --start "$name" fi - if [ "$USE_HTTPS" = "yes" ]; then + if [ "$CLO_LETSENCRYPT" = "yes" ]; then # Get letsencrypt certificates letsencrypt_instance fi diff --git a/install_misc/debian.packages b/install_misc/debian.packages index c4bcb93..23d3b27 100644 --- a/install_misc/debian.packages +++ b/install_misc/debian.packages @@ -8,6 +8,7 @@ idzebra-2.0 install idzebra-2.0-common install idzebra-2.0-doc install idzebra-2.0-utils install +letsencrypt install libalgorithm-checkdigits-perl install libanyevent-http-perl install libanyevent-perl install -- 2.1.4