%define name smeserver-letsencrypt %define version 0.5 %define release 16 Summary: Plugin to enable letsencrypt certificates Name: %{name} Version: %{version} Release: %{release} License: GNU GPL version 2 URL: https://letsencrypt.org/ Group: SMEserver/addon Source: %{name}-%{version}.tar.gz Patch0: smeserver-letsencrypt-remove-debug-lines.patch Patch1: smeserver-letsencrypt-remove-licence.patch Patch2: smeserver-letsencrypt-log-to-file.patch Patch3: smeserver-letsencrypt-API1-URL-change.patch Patch4: smeserver-letsencrypt-fix-logging.patch Patch5: smeserver-letsencrypt-fix-logging-reverse.patch Patch6: smeserver-letsencrypt-fix-acme-v01-url.patch Patch7: smeserver-letsencrypt-fix-hook-entry.patch Patch8: smeserver-letsencrypt-change-cron-entry.patch BuildRoot: /var/tmp/%{name}-%{version} BuildArchitectures: noarch BuildRequires: e-smith-devtools Requires: e-smith-release >= 9.0 Requires: dehydrated >= 0.6.5 AutoReqProv: no %description Lets Encrypt is a free, automated, and open certificate authority https://letsencrypt.org/ %changelog * Fri Oct 06 2020 Brian Read 0.5-16.sme - Move to SME10 [SME: 11022] * Thu Mar 12 2020 John Crisp 0.5-15.sme - take 3: remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] * Wed Mar 11 2020 Jean-Philipe Pialasse 0.5-14.sme - take 2: remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] * Mon Mar 09 2020 John Crisp 0.5-13.sme - remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] * Sat Jan 18 2020 John Crisp 0.5-12.sme - forgot to remove template-begin and cron.daily dir [SME: 10862] * Fri Jan 17 2020 John Crisp 0.5-11.sme - force required version to 0.6.5 for EPEL version - Add new cron template for EPEL version of dehydrated [SME: 10862] * Fri Jan 17 2020 John Crisp 0.5-10.sme - Fix incorrect HOOK entry in config [SME: 10861] * Fri Jan 04 2019 John Crisp 0.5-9.sme - Fix incorrect CA line in config [SME: 10688] * Mon Dec 31 2018 John Crisp 0.5-8.sme - Reverse my previous error [SME: 10681] * Mon Dec 31 2018 John Crisp 0.5-7.sme - fix spec file numbering * Mon Dec 31 2018 John Crisp 0.5-6.sme - Fix typo error in cron.daily [SME: 10681] * Sun Dec 23 2018 John Crisp 0.5-5.sme - Fix changed V1 staging URL [SME: 10595] - Thanks Terry Fage * Wed Dec 12 2018 John Crisp 0.5-4.sme - log to file rather than /dev/null [SME: 10412] * Tue Oct 13 2018 John Crisp 0.5-3.sme - remove Licence key from config template [SME:10636] * Tue Jun 19 2018 John Crisp 0.5-2.sme - remove debug print lines * Tue Jun 12 2018 John Crisp 0.5-1.sme - Update to v2 API [SME:10595] - Add key letsencrypt hostOverride to ignore 'Self' host check - This requires v0.6 of dehydrated * Wed Jun 06 2018 John Crisp 0.4-6.sme - Fix missing event actions [SME: 10315] * Thu May 31 2018 John Crisp 0.4-5.sme - Fix typo in Accept Terms - add domain-delete to createlinks [SME: 10315] - Update requires release to SME v9 - Update requires dehydrated to v0.5 * Fri Aug 18 2017 Jean-Philipe Pialasse 0.4-4.sme - change ACCEPT_TERMS template position to appear after shebang in config file [SME: 10410] * Wed Jul 12 2017 Jean-Philipe Pialasse 0.4-3.sme - remove workaround for curl dns resolution [SME: 10300] - should be corrected at dnscache level (djbdns-1.05-10) * Fri Apr 28 2017 Jean-Philipe Pialasse 0.4-2.sme - help accept licence [SME: 10253] - workaround for curl issues - spec tidying * Sat Feb 04 2017 John Crisp 0.4-1 - first attempt at using stock letsencrypt script * Wed Sep 14 2016 John Crisp 0.3-1 - Due to madness at letsencrypt the script had to be renamed for copyright reasons - move /etc/letsencrypt.sh to /etc/dehydrated - change references to letsencrypt.sh to dehydrated - Fix typos in readme * Wed Aug 3 2016 John Crisp 0.2-10 - Some tweaks from JPP for the domains.txt file * Wed Aug 3 2016 John Crisp 0.2-9 - Fix version differences with between v8 and v9 * Thu Jul 14 2016 John Crisp 0.2-8 - Remove spaces in POSTIN [[]] * Mon Jun 27 2016 John Crisp 0.2-7 - fix another typo in bash scripts - fix typo in Docs * Fri Jun 10 2016 John Crisp 0.2-6 - Fix typo in domains.txt - Set configure default type none * Tue May 31 2016 John Crisp 0.2-5 - update incorrect bash scripts in spec file * Tue May 31 2016 John Crisp 0.2-4 - update letsencrypt requires * Mon May 30 2016 John Crisp 0.2-3 - add support for letsencrypt.sh v0.2 - config.sh renamed to config - fix trailing / on urls in 40ACME * Mon Apr 04 2016 John Crisp 0.2-2 - letsencrypt.sh now calls deploy-cert with an argument for the chain file - thanks to Dan Brown * Tue Mar 29 2016 John Crisp 0.2-1 - Remove letsencrypt.sh script and put in separate RPM * Tue Mar 29 2016 John Crisp 0.1-21 - modify hook script templates as per Dan Browd contribution * Thu Mar 17 2016 John Crisp 0.1-20 - updated letsencrypt.sh - https://github.com/lukas2511/letsencrypt.sh/commit/429c5250ede7ff4af3b6f37b39925cfa5afee278 - Add "" to wellknown path in config.sh * Fri Feb 05 2016 John Crisp 0.1-19 - updated letsencrypt.sh - https://github.com/lukas2511/letsencrypt.sh/commit/21c18dd3b8c2572b894d9ec2e5c3fc2589f56f32 * Tue Jan 26 2016 John Crisp 0.1-18 - updated letsencrypt.sh - https://github.com/lukas2511/letsencrypt.sh/commit/79ff846e267c30d85988f79f58b81bc7bd91790c * Sat Jan 23 2016 John Crisp 0.1-17 - Fix typos in hook-script - Add latest letsencrypt.sh script * Wed Jan 20 2016 John Crisp 0.1-16 - Minor fixes including typo in cron.daily * Tue Jan 19 2016 John Crisp 0.1-15 - Missed a " - remove ' from Let's encrypt and add URL * Tue Jan 19 2016 John Crisp 0.1-14 - Updated readme and install notes - Allow either domains or hosts * Mon Jan 18 2016 John Crisp 0.1-13 - Add missing templates.metadata file - modify spec file wording * Mon Jan 18 2016 John Crisp 0.1-12 - Set hookscript to always run unless letsencrypt is disabled - Add cron.daily script to console-save action and set perms * Sun Jan 17 2016 John Crisp 0.1-11 - Fix hook-script.sh perms using templates.metadata * Sun Jan 17 2016 John Crisp 0.1-10 - Add latest revision of letsencrypt.sh - add hookscript.sh templates and various fixes * Sat Jan 16 2016 John Crisp 0.1-9 - Add latest revision of letsencrypt.sh * Fri Jan 15 2016 John Crisp 0.1-8 - set +x on hook-script and correct file name in config * Fri Jan 15 2016 John Crisp 0.1-7 - Add missing curly brace - Move Status check line up so we can generate empty file if disabled * Fri Jan 15 2016 John Crisp 0.1-6 - Add hookScript key * Fri Jan 15 2016 John Crisp 0.1-5 - Modify spec file to add paths and set permisssions * Thu Jan 14 2016 John Crisp 0.1-4 - Modify file paths and cron script * Thu Jan 14 2016 John Crisp 0.1-3 - updated bash script in spec file - updated file locations in README.MD * Wed Jan 13 2016 John Crisp 0.1-2 - Moved config.sh file location - added cron.daily template - only works if letsencrypt is enabled - added check to create /etc/letsencrypt.sh directory if it does not exist - added latest letsencrypt.sh script * Thu Jan 07 2016 John Crisp 0.1-1 - initial release %prep %setup %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 # remove old template rm -rf root/etc/e-smith/templates/etc/cron.daily %build perl createlinks %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist echo "%doc COPYING" >> %{name}-%{version}-filelist %clean cd .. rm -rf %{name}-%{version} %files -f %{name}-%{version}-filelist %defattr(-,root,root) %pre %preun %post # if previously installed letsencrypt.sh, but first migration to dehydrated if [[ -e /etc/letsencrypt.sh ]] && [[ ! -e /etc/dehydrated ]]; then # assume in production # CA="https://acme-v01.api.letsencrypt.org/directory" ; # CAHASH="$(echo "${CA}" | urlbase64)" # mkdir /etc/dehydrated; # mkdir -p /etc/dehydrated/accounts # cp -a /etc/letsencrypt.sh/private_key.json /etc/dehydrated/accounts/${CAHASH}/registration_info.json # cp -a /etc/letsencrypt.sh/private_key.pem /etc/dehydrated/accounts/${CAHASH}/account_key.pem # cp -a /etc/letsencrypt.sh/certs /etc/dehydrated/ mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; fi # if letsencrypt still there but already migrated to dehydrated if [[ -e /etc/letsencrypt.sh ]] && [[ -e /etc/dehydrated/certs ]]; then mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; fi # if first installation of dehydrated if [[ ! -e /etc/dehydrated ]]; then mkdir /etc/dehydrated; fi if [[ -f /usr/local/bin/config.sh ]]; then mv -f /usr/local/bin/config.sh /usr/local/bin/config.sh.orig; fi if [[ -f /usr/local/bin/config ]]; then mv -f /usr/local/bin/config /usr/local/bin/config.old; fi if [[ -f /usr/local/bin/domain.txt ]]; then mv -f /usr/local/bin/domains.txt /usr/local/bin/domains.txt.orig; fi if [[ -d /etc/cron.daily/letsencrypt ]]; then rm -rf /etc/cron.daily/letsencrypt; fi if [[ -d /etc/e-smith/templates/etc/cron.daily/letsencrypt ]]; then rm -rf /root/etc/e-smith/templates/etc/cron.daily/letsencrypt fi if [[ ! -e /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge ]]; then mkdir -p /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge; fi chmod -R 0775 /home/e-smith/files/ibays/Primary/html/.well-known chown -R apache:shared /home/e-smith/files/ibays/Primary/html/.well-known # remove old template file if [[ -e /etc/cron.daily/letsencrypt ]]; then rm -rf /etc/cron.daily/letsencrypt fi %postun