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