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