1 |
%define name smeserver-letsencrypt |
2 |
%define version 0.5 |
3 |
%define release 17 |
4 |
Summary: Plugin to enable letsencrypt certificates |
5 |
Name: %{name} |
6 |
Version: %{version} |
7 |
Release: %{release} |
8 |
License: GNU GPL version 2 |
9 |
URL: https://letsencrypt.org/ |
10 |
Group: SMEserver/addon |
11 |
Source: %{name}-%{version}.tar.gz |
12 |
Patch0: smeserver-letsencrypt-remove-debug-lines.patch |
13 |
Patch1: smeserver-letsencrypt-remove-licence.patch |
14 |
Patch2: smeserver-letsencrypt-log-to-file.patch |
15 |
Patch3: smeserver-letsencrypt-API1-URL-change.patch |
16 |
Patch4: smeserver-letsencrypt-fix-logging.patch |
17 |
Patch5: smeserver-letsencrypt-fix-logging-reverse.patch |
18 |
Patch6: smeserver-letsencrypt-fix-acme-v01-url.patch |
19 |
Patch7: smeserver-letsencrypt-fix-hook-entry.patch |
20 |
Patch8: smeserver-letsencrypt-change-cron-entry.patch |
21 |
Patch9: smeserver-letsencrypt-0.5-change-API-default-to-v2.patch |
22 |
|
23 |
BuildRoot: /var/tmp/%{name}-%{version} |
24 |
BuildArchitectures: noarch |
25 |
BuildRequires: e-smith-devtools |
26 |
Requires: e-smith-release >= 9.0 |
27 |
Requires: dehydrated >= 0.6.5 |
28 |
AutoReqProv: no |
29 |
|
30 |
%description |
31 |
Lets Encrypt is a free, automated, and open certificate authority |
32 |
https://letsencrypt.org/ |
33 |
|
34 |
%changelog |
35 |
* Thu Apr 01 2021 Brian Read <brianr@bjsystems.co.uk> 0.5-17.sme |
36 |
- Add in mkdir in spec file for smeserver-letsencrypt-update event [SME: 11514] |
37 |
|
38 |
* Tue Oct 06 2020 Brian Read <brianr@bjsystems.co.uk> 0.5-16.sme |
39 |
- Move to SME10 and set default to API v2 [SME: 11022] |
40 |
|
41 |
* Thu Mar 12 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-15.sme |
42 |
- take 3: remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] |
43 |
|
44 |
* Wed Mar 11 2020 Jean-Philipe Pialasse <tests@pialasse.com> 0.5-14.sme |
45 |
- take 2: remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] |
46 |
|
47 |
* Mon Mar 09 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-13.sme |
48 |
- remove dangling cron.daily dir missed in 0.5-12 [SME: 10862] |
49 |
|
50 |
* Sat Jan 18 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-12.sme |
51 |
- forgot to remove template-begin and cron.daily dir [SME: 10862] |
52 |
|
53 |
* Fri Jan 17 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-11.sme |
54 |
- force required version to 0.6.5 for EPEL version |
55 |
- Add new cron template for EPEL version of dehydrated [SME: 10862] |
56 |
|
57 |
* Fri Jan 17 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-10.sme |
58 |
- Fix incorrect HOOK entry in config [SME: 10861] |
59 |
|
60 |
* Fri Jan 04 2019 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-9.sme |
61 |
- Fix incorrect CA line in config [SME: 10688] |
62 |
|
63 |
* Mon Dec 31 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-8.sme |
64 |
- Reverse my previous error [SME: 10681] |
65 |
|
66 |
* Mon Dec 31 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-7.sme |
67 |
- fix spec file numbering |
68 |
|
69 |
* Mon Dec 31 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-6.sme |
70 |
- Fix typo error in cron.daily [SME: 10681] |
71 |
|
72 |
* Sun Dec 23 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-5.sme |
73 |
- Fix changed V1 staging URL [SME: 10595] |
74 |
- Thanks Terry Fage |
75 |
|
76 |
* Wed Dec 12 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-4.sme |
77 |
- log to file rather than /dev/null [SME: 10412] |
78 |
|
79 |
* Sat Oct 13 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-3.sme |
80 |
- remove Licence key from config template [SME:10636] |
81 |
|
82 |
* Tue Jun 19 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-2.sme |
83 |
- remove debug print lines |
84 |
|
85 |
* Tue Jun 12 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.5-1.sme |
86 |
- Update to v2 API [SME:10595] |
87 |
- Add key letsencrypt hostOverride to ignore 'Self' host check |
88 |
- This requires v0.6 of dehydrated |
89 |
|
90 |
* Wed Jun 06 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-6.sme |
91 |
- Fix missing event actions [SME: 10315] |
92 |
|
93 |
* Thu May 31 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-5.sme |
94 |
- Fix typo in Accept Terms |
95 |
- add domain-delete to createlinks [SME: 10315] |
96 |
- Update requires release to SME v9 |
97 |
- Update requires dehydrated to v0.5 |
98 |
|
99 |
* Fri Aug 18 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-4.sme |
100 |
- change ACCEPT_TERMS template position to appear after shebang in config file [SME: 10410] |
101 |
|
102 |
* Wed Jul 12 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-3.sme |
103 |
- remove workaround for curl dns resolution [SME: 10300] |
104 |
- should be corrected at dnscache level (djbdns-1.05-10) |
105 |
|
106 |
* Fri Apr 28 2017 Jean-Philipe Pialasse <tests@pialasse.com> 0.4-2.sme |
107 |
- help accept licence [SME: 10253] |
108 |
- workaround for curl issues |
109 |
- spec tidying |
110 |
|
111 |
* Sat Feb 04 2017 John Crisp <jcrisp@safeandsoundit.co.uk> 0.4-1 |
112 |
- first attempt at using stock letsencrypt script |
113 |
|
114 |
* Wed Sep 14 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.3-1 |
115 |
- Due to madness at letsencrypt the script had to be renamed for copyright reasons |
116 |
- move /etc/letsencrypt.sh to /etc/dehydrated |
117 |
- change references to letsencrypt.sh to dehydrated |
118 |
- Fix typos in readme |
119 |
|
120 |
* Wed Aug 3 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-10 |
121 |
- Some tweaks from JPP for the domains.txt file |
122 |
|
123 |
* Wed Aug 3 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-9 |
124 |
- Fix version differences with between v8 and v9 |
125 |
|
126 |
* Thu Jul 14 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-8 |
127 |
- Remove spaces in POSTIN [[]] |
128 |
|
129 |
* Mon Jun 27 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-7 |
130 |
- fix another typo in bash scripts |
131 |
- fix typo in Docs |
132 |
|
133 |
* Fri Jun 10 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-6 |
134 |
- Fix typo in domains.txt |
135 |
- Set configure default type none |
136 |
|
137 |
* Tue May 31 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-5 |
138 |
- update incorrect bash scripts in spec file |
139 |
|
140 |
* Tue May 31 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-4 |
141 |
- update letsencrypt requires |
142 |
|
143 |
* Mon May 30 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-3 |
144 |
- add support for letsencrypt.sh v0.2 |
145 |
- config.sh renamed to config |
146 |
- fix trailing / on urls in 40ACME |
147 |
|
148 |
* Mon Apr 04 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-2 |
149 |
- letsencrypt.sh now calls deploy-cert with an argument for the chain file |
150 |
- thanks to Dan Brown |
151 |
|
152 |
* Tue Mar 29 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.2-1 |
153 |
- Remove letsencrypt.sh script and put in separate RPM |
154 |
|
155 |
* Tue Mar 29 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-21 |
156 |
- modify hook script templates as per Dan Browd contribution |
157 |
|
158 |
* Thu Mar 17 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-20 |
159 |
- updated letsencrypt.sh |
160 |
- https://github.com/lukas2511/letsencrypt.sh/commit/429c5250ede7ff4af3b6f37b39925cfa5afee278 |
161 |
- Add "" to wellknown path in config.sh |
162 |
|
163 |
* Fri Feb 05 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-19 |
164 |
- updated letsencrypt.sh |
165 |
- https://github.com/lukas2511/letsencrypt.sh/commit/21c18dd3b8c2572b894d9ec2e5c3fc2589f56f32 |
166 |
|
167 |
* Tue Jan 26 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-18 |
168 |
- updated letsencrypt.sh |
169 |
- https://github.com/lukas2511/letsencrypt.sh/commit/79ff846e267c30d85988f79f58b81bc7bd91790c |
170 |
|
171 |
* Sat Jan 23 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-17 |
172 |
- Fix typos in hook-script |
173 |
- Add latest letsencrypt.sh script |
174 |
|
175 |
* Wed Jan 20 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-16 |
176 |
- Minor fixes including typo in cron.daily |
177 |
|
178 |
* Tue Jan 19 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-15 |
179 |
- Missed a " |
180 |
- remove ' from Let's encrypt and add URL |
181 |
|
182 |
* Tue Jan 19 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-14 |
183 |
- Updated readme and install notes |
184 |
- Allow either domains or hosts |
185 |
|
186 |
* Mon Jan 18 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-13 |
187 |
- Add missing templates.metadata file |
188 |
- modify spec file wording |
189 |
|
190 |
* Mon Jan 18 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-12 |
191 |
- Set hookscript to always run unless letsencrypt is disabled |
192 |
- Add cron.daily script to console-save action and set perms |
193 |
|
194 |
* Sun Jan 17 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-11 |
195 |
- Fix hook-script.sh perms using templates.metadata |
196 |
|
197 |
* Sun Jan 17 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-10 |
198 |
- Add latest revision of letsencrypt.sh |
199 |
- add hookscript.sh templates and various fixes |
200 |
|
201 |
* Sat Jan 16 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-9 |
202 |
- Add latest revision of letsencrypt.sh |
203 |
|
204 |
* Fri Jan 15 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-8 |
205 |
- set +x on hook-script and correct file name in config |
206 |
|
207 |
* Fri Jan 15 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-7 |
208 |
- Add missing curly brace |
209 |
- Move Status check line up so we can generate empty file if disabled |
210 |
|
211 |
* Fri Jan 15 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-6 |
212 |
- Add hookScript key |
213 |
|
214 |
* Fri Jan 15 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-5 |
215 |
- Modify spec file to add paths and set permisssions |
216 |
|
217 |
* Thu Jan 14 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-4 |
218 |
- Modify file paths and cron script |
219 |
|
220 |
* Thu Jan 14 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-3 |
221 |
- updated bash script in spec file |
222 |
- updated file locations in README.MD |
223 |
|
224 |
* Wed Jan 13 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-2 |
225 |
- Moved config.sh file location |
226 |
- added cron.daily template - only works if letsencrypt is enabled |
227 |
- added check to create /etc/letsencrypt.sh directory if it does not exist |
228 |
- added latest letsencrypt.sh script |
229 |
|
230 |
* Thu Jan 07 2016 John Crisp <jcrisp@safeandsoundit.co.uk> 0.1-1 |
231 |
- initial release |
232 |
|
233 |
%prep |
234 |
%setup |
235 |
%patch0 -p1 |
236 |
%patch1 -p1 |
237 |
%patch2 -p1 |
238 |
%patch3 -p1 |
239 |
%patch4 -p1 |
240 |
%patch5 -p1 |
241 |
%patch6 -p1 |
242 |
%patch7 -p1 |
243 |
%patch8 -p1 |
244 |
%patch9 -p1 |
245 |
mkdir -p root/etc/e-smith/events/smeserver-letsencrypt-update |
246 |
|
247 |
# remove old template |
248 |
rm -rf root/etc/e-smith/templates/etc/cron.daily |
249 |
|
250 |
%build |
251 |
perl createlinks |
252 |
|
253 |
%install |
254 |
rm -rf $RPM_BUILD_ROOT |
255 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
256 |
rm -f %{name}-%{version}-filelist |
257 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist |
258 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
259 |
|
260 |
|
261 |
%clean |
262 |
cd .. |
263 |
rm -rf %{name}-%{version} |
264 |
|
265 |
%files -f %{name}-%{version}-filelist |
266 |
%defattr(-,root,root) |
267 |
|
268 |
%pre |
269 |
|
270 |
%preun |
271 |
|
272 |
%post |
273 |
# if previously installed letsencrypt.sh, but first migration to dehydrated |
274 |
if [[ -e /etc/letsencrypt.sh ]] && [[ ! -e /etc/dehydrated ]]; |
275 |
then |
276 |
# assume in production |
277 |
# CA="https://acme-v01.api.letsencrypt.org/directory" ; |
278 |
# CAHASH="$(echo "${CA}" | urlbase64)" |
279 |
# mkdir /etc/dehydrated; |
280 |
# mkdir -p /etc/dehydrated/accounts |
281 |
# cp -a /etc/letsencrypt.sh/private_key.json /etc/dehydrated/accounts/${CAHASH}/registration_info.json |
282 |
# cp -a /etc/letsencrypt.sh/private_key.pem /etc/dehydrated/accounts/${CAHASH}/account_key.pem |
283 |
# cp -a /etc/letsencrypt.sh/certs /etc/dehydrated/ |
284 |
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
285 |
fi |
286 |
|
287 |
# if letsencrypt still there but already migrated to dehydrated |
288 |
if [[ -e /etc/letsencrypt.sh ]] && [[ -e /etc/dehydrated/certs ]]; |
289 |
then |
290 |
mv -f /etc/letsencrypt.sh /etc/letsencrypt.sh.old; |
291 |
fi |
292 |
|
293 |
# if first installation of dehydrated |
294 |
if [[ ! -e /etc/dehydrated ]]; |
295 |
then mkdir /etc/dehydrated; |
296 |
fi |
297 |
|
298 |
if [[ -f /usr/local/bin/config.sh ]]; |
299 |
then mv -f /usr/local/bin/config.sh /usr/local/bin/config.sh.orig; |
300 |
fi |
301 |
|
302 |
if [[ -f /usr/local/bin/config ]]; |
303 |
then mv -f /usr/local/bin/config /usr/local/bin/config.old; |
304 |
fi |
305 |
|
306 |
if [[ -f /usr/local/bin/domain.txt ]]; |
307 |
then mv -f /usr/local/bin/domains.txt /usr/local/bin/domains.txt.orig; |
308 |
fi |
309 |
|
310 |
if [[ -d /etc/cron.daily/letsencrypt ]]; |
311 |
then rm -rf /etc/cron.daily/letsencrypt; |
312 |
fi |
313 |
|
314 |
if [[ -d /etc/e-smith/templates/etc/cron.daily/letsencrypt ]]; |
315 |
then rm -rf /root/etc/e-smith/templates/etc/cron.daily/letsencrypt |
316 |
fi |
317 |
|
318 |
if [[ ! -e /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge ]]; |
319 |
then mkdir -p /home/e-smith/files/ibays/Primary/html/.well-known/acme-challenge; |
320 |
fi |
321 |
|
322 |
chmod -R 0775 /home/e-smith/files/ibays/Primary/html/.well-known |
323 |
chown -R apache:shared /home/e-smith/files/ibays/Primary/html/.well-known |
324 |
|
325 |
# remove old template file |
326 |
if [[ -e /etc/cron.daily/letsencrypt ]]; |
327 |
then rm -rf /etc/cron.daily/letsencrypt |
328 |
fi |
329 |
%postun |