1 |
%define name smeserver-letsencrypt |
%define name smeserver-letsencrypt |
2 |
%define version 0.4 |
%define version 0.4 |
3 |
%define release 1 |
%define release 5 |
4 |
Summary: Plugin to enable letsencrypt certificates |
Summary: Plugin to enable letsencrypt certificates |
5 |
Name: %{name} |
Name: %{name} |
6 |
Version: %{version} |
Version: %{version} |
9 |
URL: https://letsencrypt.org/ |
URL: https://letsencrypt.org/ |
10 |
Group: SMEserver/addon |
Group: SMEserver/addon |
11 |
Source: %{name}-%{version}.tar.gz |
Source: %{name}-%{version}.tar.gz |
12 |
|
Patch0: smeserver-letsencrypt-0.4-bz10253.patch |
13 |
|
Patch1: smeserver-letsencrypt-events.patch |
14 |
|
|
15 |
BuildRoot: /var/tmp/%{name}-%{version} |
BuildRoot: /var/tmp/%{name}-%{version} |
16 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
17 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
18 |
Requires: e-smith-release >= 8.0 |
Requires: e-smith-release >= 9.0 |
19 |
Requires: dehydrated >= 0.3.1 |
Requires: dehydrated >= 0.5 |
20 |
AutoReqProv: no |
AutoReqProv: no |
21 |
|
|
22 |
%description |
%description |
24 |
https://letsencrypt.org/ |
https://letsencrypt.org/ |
25 |
|
|
26 |
%changelog |
%changelog |
27 |
|
* Thu May 31 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-5.sme |
28 |
|
- Fix typo in Accept Terms |
29 |
|
- add domain-delete to createlinks [SME: 10315] |
30 |
|
- Update requires release to SME v9 |
31 |
|
- Update requires dehydrated to v0.5 |
32 |
|
|
33 |
|
* Fri Aug 18 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-4.sme |
34 |
|
- change ACCEPT_TERMS template position to appear after shebang in config file [SME: 10410] |
35 |
|
|
36 |
|
* Wed Jul 12 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-3.sme |
37 |
|
- remove workaround for curl dns resolution [SME: 10300] |
38 |
|
- should be corrected at dnscache level (djbdns-1.05-10) |
39 |
|
|
40 |
|
* Fri Apr 28 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-2.sme |
41 |
|
- help accept licence [SME: 10253] |
42 |
|
- workaround for curl issues |
43 |
|
- spec tidying |
44 |
|
|
45 |
* Sat Feb 04 2017 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-1 |
* Sat Feb 04 2017 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-1 |
46 |
- first attempt at using stock letsencrypt script |
- first attempt at using stock letsencrypt script |
47 |
|
|
166 |
|
|
167 |
%prep |
%prep |
168 |
%setup |
%setup |
169 |
|
%patch0 -p1 |
170 |
|
%patch1 -p1 |
171 |
|
|
172 |
%build |
%build |
173 |
perl createlinks |
perl createlinks |
192 |
%preun |
%preun |
193 |
|
|
194 |
%post |
%post |
195 |
if [[ ! -e /etc/letsencrypt.sh ]]; |
# if previously installed letsencrypt.sh, but first migration to dehydrated |
196 |
then mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
if [[ -e /etc/letsencrypt.sh ]] && [[ ! -e /etc/dehydrated ]]; |
197 |
|
then |
198 |
|
# assume in production |
199 |
|
# CA="https://acme-v01.api.letsencrypt.org/directory" ; |
200 |
|
# CAHASH="$(echo "${CA}" | urlbase64)" |
201 |
|
# mkdir /etc/dehydrated; |
202 |
|
# mkdir -p /etc/dehydrated/accounts |
203 |
|
# cp -a /etc/letsencrypt.sh/private_key.json /etc/dehydrated/accounts/${CAHASH}/registration_info.json |
204 |
|
# cp -a /etc/letsencrypt.sh/private_key.pem /etc/dehydrated/accounts/${CAHASH}/account_key.pem |
205 |
|
# cp -a /etc/letsencrypt.sh/certs /etc/dehydrated/ |
206 |
|
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
207 |
|
fi |
208 |
|
|
209 |
|
# if letsencrypt still there but already migrated to dehydrated |
210 |
|
if [[ -e /etc/letsencrypt.sh ]] && [[ -e /etc/dehydrated/certs ]]; |
211 |
|
then |
212 |
|
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
213 |
fi |
fi |
214 |
|
|
215 |
|
# if first installation of dehydrated |
216 |
if [[ ! -e /etc/dehydrated ]]; |
if [[ ! -e /etc/dehydrated ]]; |
217 |
then mkdir /etc/dehydrated; |
then mkdir /etc/dehydrated; |
218 |
fi |
fi |
237 |
chown -R apache:shared /home/e-smith/files/ibays/Primary/html/.well-known |
chown -R apache:shared /home/e-smith/files/ibays/Primary/html/.well-known |
238 |
|
|
239 |
|
|
|
echo "###################################################################" |
|
|
echo "" |
|
|
echo "************************************************************" |
|
|
echo " NOTE ! letsencrypt.sh has had to be renamed to 'dehydrated'" |
|
|
echo "************************************************************" |
|
|
echo "" |
|
|
echo "# After install please set your db keys" |
|
|
echo "# Make sure you set the letsencrypt status key to test" |
|
|
echo "# Enable some domains or hosts" |
|
|
echo "# Then run the following" |
|
|
echo "# signal-event console-save" |
|
|
echo "# dehydrated -c" |
|
|
echo "# Once you are satisfied set the letsencrypt status key to enabled" |
|
|
echo "# mv /etc/dehydrated/private_key.pem /etc/dehydrated/private_key.test" |
|
|
echo "# Run the dehydrated file again to generate your keys" |
|
|
echo "# signal-event console-save" |
|
|
echo "# dehydrated -c -x" |
|
|
echo "# Thereafter only use" |
|
|
echo "# dehydrated -c" |
|
|
echo "# If you make any key changes run console-save first" |
|
|
echo "###################################################################" |
|
240 |
|
|
241 |
%postun |
%postun |