1 |
%define name smeserver-letsencrypt |
%define name smeserver-letsencrypt |
2 |
%define version 0.4 |
%define version 0.4 |
3 |
%define release 1 |
%define release 2 |
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 |
|
|
14 |
BuildRoot: /var/tmp/%{name}-%{version} |
BuildRoot: /var/tmp/%{name}-%{version} |
15 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
16 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
23 |
https://letsencrypt.org/ |
https://letsencrypt.org/ |
24 |
|
|
25 |
%changelog |
%changelog |
26 |
|
* Fri Apr 28 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-2.sme |
27 |
|
- help accept licence [SME: 10253] |
28 |
|
- workaround for curl issues |
29 |
|
- spec tidying |
30 |
|
|
31 |
* 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 |
32 |
- first attempt at using stock letsencrypt script |
- first attempt at using stock letsencrypt script |
33 |
|
|
152 |
|
|
153 |
%prep |
%prep |
154 |
%setup |
%setup |
155 |
|
%patch0 -p1 |
156 |
|
|
157 |
%build |
%build |
158 |
perl createlinks |
perl createlinks |
177 |
%preun |
%preun |
178 |
|
|
179 |
%post |
%post |
180 |
if [[ ! -e /etc/letsencrypt.sh ]]; |
# if previously installed letsencrypt.sh, but first migration to dehydrated |
181 |
then mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
if [[ -e /etc/letsencrypt.sh ]] && [[ ! -e /etc/dehydrated ]]; |
182 |
|
then |
183 |
|
# assume in production |
184 |
|
# CA="https://acme-v01.api.letsencrypt.org/directory" ; |
185 |
|
# CAHASH="$(echo "${CA}" | urlbase64)" |
186 |
|
# mkdir /etc/dehydrated; |
187 |
|
# mkdir -p /etc/dehydrated/accounts |
188 |
|
# cp -a /etc/letsencrypt.sh/private_key.json /etc/dehydrated/accounts/${CAHASH}/registration_info.json |
189 |
|
# cp -a /etc/letsencrypt.sh/private_key.pem /etc/dehydrated/accounts/${CAHASH}/account_key.pem |
190 |
|
# cp -a /etc/letsencrypt.sh/certs /etc/dehydrated/ |
191 |
|
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
192 |
|
fi |
193 |
|
|
194 |
|
# if letsencrypt still there but already migrated to dehydrated |
195 |
|
if [[ -e /etc/letsencrypt.sh ]] && [[ -e /etc/dehydrated/certs ]]; |
196 |
|
then |
197 |
|
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
198 |
fi |
fi |
199 |
|
|
200 |
|
# if first installation of dehydrated |
201 |
if [[ ! -e /etc/dehydrated ]]; |
if [[ ! -e /etc/dehydrated ]]; |
202 |
then mkdir /etc/dehydrated; |
then mkdir /etc/dehydrated; |
203 |
fi |
fi |
222 |
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 |
223 |
|
|
224 |
|
|
|
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 "###################################################################" |
|
225 |
|
|
226 |
%postun |
%postun |