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