Bugzilla – Attachment 50271 Details for
Bug 15303
Letsencrypt option for Debian package installations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15303 Followup for koha-remove
Bug-15303-Followup-for-koha-remove.patch (text/plain), 3.62 KB, created by
Mirko Tietgen
on 2016-04-15 13:27:35 UTC
(
hide
)
Description:
Bug 15303 Followup for koha-remove
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2016-04-15 13:27:35 UTC
Size:
3.62 KB
patch
obsolete
>From 4d79dc5c765466d3a37bf79c1674b012dd4cfbbf Mon Sep 17 00:00:00 2001 >From: Mirko Tietgen <mirko@abunchofthings.net> >Date: Fri, 15 Apr 2016 13:35:16 +0200 >Subject: [PATCH] Bug 15303 Followup for koha-remove > >This patch makes koha-remove take care of > >/etc/letsencrypt/renewal/$opacdomain.conf >/var/lib/koha/$site/letsencrypt.enabled > >It also adds a few helper functions. > >To test >- create a koha instance with LE >- observe you got both files mentioned above >- remove that instance >- verify the files are gone >--- > debian/scripts/koha-create | 2 +- > debian/scripts/koha-functions.sh | 40 ++++++++++++++++++++++++++++++++++++++++ > debian/scripts/koha-remove | 5 +++++ > 3 files changed, 46 insertions(+), 1 deletion(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 4484910..263ee14 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -361,7 +361,7 @@ letsencrypt_instance() > # enable redirect from http to https on port 80 > sed -i "s:^\s*#\(.*\)#nohttps$:\1:" "/etc/apache2/sites-available/$name.conf" > # make koha-list --letsencrypt aware of this instance # could be done by checking apache conf instead >- touch /var/lib/koha/$name/letsencrypt.enabled >+ echo -e "opacdomain=\"$opacdomain\"\nintradomain=\"$intradomain\"" > /var/lib/koha/$name/letsencrypt.enabled > # restart apache with working certs > service apache2 restart > } >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index ef71a3a..1c309fc 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -43,6 +43,46 @@ get_apache_config_for() > fi > } > >+get_opacdomain_for() >+{ >+ local site=$1 >+ >+ if [ -e /etc/koha/koha-sites.conf ]; then >+ . /etc/koha/koha-sites.conf >+ else >+ echo "Error: /etc/koha/koha-sites.conf not present." 1>&2 >+ exit 1 >+ fi >+ local opacdomain="$OPACPREFIX$site$OPACSUFFIX$DOMAIN" >+ echo "$opacdomain" >+} >+ >+get_intradomain_for() >+{ >+ local site=$1 >+ >+ if [ -e /etc/koha/koha-sites.conf ]; then >+ . /etc/koha/koha-sites.conf >+ else >+ echo "Error: /etc/koha/koha-sites.conf not present." 1>&2 >+ exit 1 >+ fi >+ local intradomain="$INTRAPREFIX$site$INTRASUFFIX$DOMAIN" >+ echo "$intradomain" >+} >+ >+letsencrypt_get_opacdomain_for() >+{ >+ local site=$1 >+ >+ if [ -e /var/lib/koha/$site/letsencrypt.enabled ]; then >+ . /var/lib/koha/$site/letsencrypt.enabled >+ else >+ local opacdomain=$(get_opacdomain_for $site) >+ fi >+ echo "$opacdomain" >+} >+ > is_enabled() > { > local site=$1 >diff --git a/debian/scripts/koha-remove b/debian/scripts/koha-remove >index 88392ba..4342c5d 100755 >--- a/debian/scripts/koha-remove >+++ b/debian/scripts/koha-remove >@@ -80,6 +80,7 @@ eof > koha-stop-zebra $name || /bin/true > > instancefile=$(get_apache_config_for $name) >+ le_opacdomain=$(letsencrypt_get_opacdomain_for $name) > > [ -f "$instancefile" ] && \ > rm "$instancefile" >@@ -97,6 +98,10 @@ eof > rm "/etc/koha/sites/$name/zebra-authorities-dom.cfg" > [ -f "/etc/koha/sites/$name/zebra.passwd" ] && \ > rm "/etc/koha/sites/$name/zebra.passwd" >+ [ -f "/var/lib/koha/$name/letsencrypt.enabled" ] && \ >+ rm -r "/var/lib/koha/$name/letsencrypt.enabled" >+ [ -f "/etc/letsencrypt/renewal/$le_opacdomain.conf" ] && \ >+ rm -r "/etc/letsencrypt/renewal/$le_opacdomain.conf" > # Maybe a user has left something in the config directory they want to keep? We won't delete it here, nor throw an error if the have. > [ -d "/etc/koha/sites/$name" ] && \ > rmdir --ignore-fail-on-non-empty "/etc/koha/sites/$name" >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15303
:
45397
|
45399
|
45400
|
45402
|
45404
|
45408
|
45409
|
45414
|
45415
|
46116
|
46117
|
46118
|
46617
|
46742
|
46745
|
46746
|
46747
|
46748
|
46749
|
46750
|
46751
|
46752
|
49470
|
49471
|
50215
|
50216
|
50271
|
50283
|
50287
|
50307
|
50308
|
50309
|
50310
|
50311
|
50312
|
50313
|
50324