1 |
jcrisp |
1.1 |
# $Id: phpki-ng.spec,v 1.4 2018/11/17 13:20:42 jcrisp Exp $ |
2 |
|
|
# Authority: vip-ire |
3 |
|
|
# Name: Daniel Berteaud |
4 |
|
|
|
5 |
|
|
%define name phpki-ng |
6 |
|
|
%define version 0.84 |
7 |
jpp |
1.14 |
%define release 13 |
8 |
jcrisp |
1.1 |
Summary: Phpki is a simple certificate management suite |
9 |
|
|
Name: %{name} |
10 |
|
|
Version: %{version} |
11 |
|
|
Release: %{release}%{?dist} |
12 |
|
|
License: GNU GPL version 2 |
13 |
|
|
URL: http://sourceforge.net/projects/phpki/ |
14 |
|
|
Group: SMEserver/addon |
15 |
|
|
#wget http://www.fooweb.com/downloads/foo-3.6.431.tar.gz |
16 |
|
|
Source: %{name}-%{version}.tar.gz |
17 |
jcrisp |
1.2 |
Patch1: phpki-ng-0.84-fix-for-php74-code-tidy.patch |
18 |
jcrisp |
1.3 |
Patch2: phpki-ng-0.84-fix-pregmatch-revoke-certs.patch |
19 |
jcrisp |
1.4 |
Patch3: phpki-ng-0.84-fix-crl.patch |
20 |
jcrisp |
1.5 |
Patch4: phpki-ng-0.84-fix-missing-slash-certtype-detection.patch |
21 |
jcrisp |
1.7 |
Patch5: phpki-ng-0.84-fix-html-directory-check.patch |
22 |
jcrisp |
1.8 |
Patch6: phpki-ng-0.84-fix-download-cert.patch |
23 |
jcrisp |
1.12 |
Patch7: phpki-ng-0.84-fix-html-syntax-in-help.patch |
24 |
jcrisp |
1.13 |
Patch8: phpki-ng-0.84-fix-final-redirect.patch |
25 |
|
|
|
26 |
jcrisp |
1.1 |
|
27 |
|
|
BuildArch: noarch |
28 |
|
|
BuildRoot: /var/tmp/%{name}-%{version} |
29 |
|
|
|
30 |
|
|
BuildRequires: e-smith-devtools |
31 |
|
|
|
32 |
jcrisp |
1.2 |
Requires: e-smith-release >= 10.0 |
33 |
|
|
Requires: php74-php-fpm |
34 |
jcrisp |
1.1 |
Requires: openssl |
35 |
|
|
Requires: openvpn |
36 |
|
|
Conflicts: phpki |
37 |
|
|
AutoReqProv: no |
38 |
|
|
|
39 |
|
|
%description |
40 |
|
|
http://sourceforge.net/projects/phpki/ |
41 |
|
|
https://github.com/radicand/phpki |
42 |
jcrisp |
1.2 |
https://github.com/reetp/phpki |
43 |
jcrisp |
1.1 |
PHPki is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance. |
44 |
|
|
With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled |
45 |
|
|
e-mail clients, SSL servers, and VPN applications. |
46 |
|
|
|
47 |
|
|
%changelog |
48 |
jpp |
1.14 |
* Fri Nov 18 2022 Jean-Philippe Pialasse <tests@pialasse.com> %{version}-13.sme |
49 |
|
|
- remove extra space in URL in search.php [SME: 12232] |
50 |
|
|
|
51 |
jcrisp |
1.13 |
* Thu Sep 30 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-12.sme |
52 |
|
|
- Attempt to fix the final reload after CA creation [SME: 11192] |
53 |
|
|
|
54 |
jcrisp |
1.12 |
* Thu Aug 05 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-11.sme |
55 |
|
|
- Fix html syntax error in help - Thanks Mauro De Carolis [SME: 11688] |
56 |
|
|
|
57 |
|
|
* Tue Apr 06 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-10.sme |
58 |
jcrisp |
1.11 |
- And tidy up the copying wording. [SME: 11192] |
59 |
|
|
- Credit to Terry Fage for persisting with testing |
60 |
|
|
|
61 |
jcrisp |
1.10 |
* Mon Apr 05 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-9.sme |
62 |
|
|
- Really fix the copy this time [SME: 11192] |
63 |
|
|
|
64 |
|
|
* Sat Apr 03 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-8.sme |
65 |
|
|
- copy phpki-store as a backup instead of move [SME: 11192] |
66 |
jcrisp |
1.9 |
|
67 |
jcrisp |
1.8 |
* Thu Apr 01 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-7.sme |
68 |
|
|
- Fix broken Download Certificate in Cert generation [SME: 11513] |
69 |
|
|
|
70 |
jcrisp |
1.7 |
* Thu Mar 18 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-6.sme |
71 |
jcrisp |
1.10 |
- Update html header info [SME: 11192] |
72 |
jcrisp |
1.7 |
- Remove obsolete align |
73 |
|
|
- Remove accidentally duplicated html |
74 |
|
|
- Fix typo |
75 |
|
|
- Fix directory check |
76 |
|
|
- move function flush_exec to functions file |
77 |
|
|
|
78 |
jcrisp |
1.5 |
* Tue Mar 09 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-5.sme |
79 |
|
|
- Fix missing / [SME:11435] |
80 |
|
|
- Update cert type detection for renew [SME: 11436] |
81 |
|
|
- Code formatting |
82 |
|
|
|
83 |
jcrisp |
1.4 |
* Mon Mar 08 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-4.sme |
84 |
|
|
- Fix crl creation [SME: 11141] |
85 |
|
|
- Extra notes in setup page |
86 |
|
|
|
87 |
jcrisp |
1.3 |
* Mon Mar 08 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-3.sme |
88 |
|
|
- Fix Typo in certificate password [SME: 11435] |
89 |
|
|
- Fix typos and preg_match issues [SME: 11436] |
90 |
jcrisp |
1.4 |
- Add Certificate creation notification [SME: 11437] |
91 |
|
|
- Bit of file formatting |
92 |
jcrisp |
1.3 |
|
93 |
jcrisp |
1.4 |
* Wed Mar 03 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-2.sme |
94 |
jcrisp |
1.2 |
- Change version to 0.84 |
95 |
|
|
- Fix undefined constant errors [SME: 11397] |
96 |
|
|
- fix tempdir [SME: 11398] |
97 |
|
|
- update code to be PHP 7.4+ compliant |
98 |
|
|
- format with CodeSniff to PSR2 |
99 |
|
|
|
100 |
jcrisp |
1.1 |
* Wed Apr 01 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-1.sme |
101 |
jcrisp |
1.2 |
- Rename to php-ng 0.84 [SME: 11192] |
102 |
jcrisp |
1.1 |
- Fix date sorting in certificates |
103 |
|
|
|
104 |
|
|
* Thu Mar 19 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-9.sme |
105 |
|
|
- Update DH to 2048 |
106 |
|
|
|
107 |
|
|
* Mon Mar 09 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-8.sme |
108 |
|
|
- move warning and exit to %pre |
109 |
|
|
|
110 |
|
|
* Sat Mar 07 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-7.sme |
111 |
|
|
- Lots of formatting - adding quotes to items and tidying up |
112 |
|
|
- set default md to 512 |
113 |
|
|
|
114 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-6.sme |
115 |
|
|
- Fix renew-cert |
116 |
|
|
- revert DH setup so you can see progress |
117 |
|
|
|
118 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-5.sme |
119 |
|
|
- Fix create cert without password |
120 |
|
|
|
121 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-4.sme |
122 |
|
|
- Fix openvpn error |
123 |
|
|
|
124 |
|
|
* Tue Mar 03 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-3.sme |
125 |
|
|
- more fixes |
126 |
|
|
|
127 |
|
|
* Sat Feb 29 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-2.sme |
128 |
|
|
- small fixes |
129 |
|
|
|
130 |
|
|
* Fri Feb 28 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-1.sme |
131 |
|
|
- Update to 0.83 |
132 |
|
|
|
133 |
jcrisp |
1.2 |
* Sat Nov 17 2018 Terry Fage <tfage@yahoo.com.au> 0.82-19.sme |
134 |
jcrisp |
1.1 |
- Fix preg_match warnings [SME:10622] |
135 |
|
|
|
136 |
|
|
* Mon Oct 8 2018 Daniel B. <daniel@firewall-services.com> 0.82-18.sme |
137 |
|
|
- Fix potential XSS with unsafe use of PHP_SELF [SME: 10626] |
138 |
|
|
|
139 |
|
|
* Thu Sep 6 2018 brian r. <brianr@bjsystems.co.uk> 0.82-17.sme |
140 |
|
|
- Replace use of ereg by preg_replace as per deprecated in php 5.3 and removed in 7.0 |
141 |
|
|
- [SME: 10622] |
142 |
|
|
|
143 |
|
|
* Mon Dec 12 2011 Daniel B. <daniel@firewall-services.com> 0.82-16.sme |
144 |
|
|
- Remove php-posix dependency (not available, nor needed on SME 7.x) [SME: 6805] |
145 |
|
|
|
146 |
|
|
* Wed Oct 26 2011 Daniel B. <daniel@firewall-services.com> 0.82-15.sme |
147 |
|
|
- Requires php-posix |
148 |
|
|
|
149 |
|
|
* Wed Jun 29 2011 Daniel B. <daniel@firewall-services.com> 0.82-14.sme |
150 |
|
|
- Don't check issuer (everyone allowed to access /ca can manage |
151 |
|
|
all the certificates, access to /ca is controlled by apache) |
152 |
|
|
|
153 |
|
|
* Tue Mar 15 2011 Daniel B. <daniel@firewall-services.com> 0.82-13.sme |
154 |
|
|
- Replace md5 with sha1 for signing |
155 |
|
|
|
156 |
|
|
* Fri May 28 2010 Daniel B. <daniel@firewall-services.com> [0.82-12] |
157 |
|
|
- Weekly update the CRL via cron so MS Crypto API will be happy |
158 |
|
|
|
159 |
|
|
* Thu Mar 18 2010 Daniel B. <daniel@firewall-services.com> [0.82-11] |
160 |
|
|
- Fixe empty password with PHP 5.2 (SME 8b5) |
161 |
|
|
|
162 |
|
|
* Wed Aug 26 2009 Daniel B. <daniel@firewall-services.com> [0.82-10] |
163 |
|
|
- Fixe links for CA help page |
164 |
|
|
|
165 |
|
|
* Mon Mar 23 2009 Daniel B. <daniel@firewall-services.com> [0.82-9] |
166 |
|
|
- Remove links after uninstall so you can easily re-install the contrib |
167 |
|
|
later [SME: 5091] |
168 |
|
|
|
169 |
|
|
* Tue Mar 03 2009 Daniel B. <daniel@firewall-services.com> [0.82-8] |
170 |
|
|
- Add e-smith-devtools as a dependencie |
171 |
|
|
|
172 |
|
|
* Tue Jan 20 2009 Daniel B. <daniel@firewall-services.com> [0.82-7] |
173 |
|
|
- Don't replace config file on upgrades |
174 |
|
|
|
175 |
|
|
* Wed Jan 07 2009 Daniel B. <daniel@firewall-services.com> [0.82-6] |
176 |
|
|
- Remove the email address from the file name during upload (in search page) |
177 |
|
|
- Remove secure.sh script |
178 |
|
|
|
179 |
|
|
* Tue Dec 16 2008 Daniel B. <daniel@firewall-services.com> [0.82-5] |
180 |
|
|
- Link index.php to setup-presetup.php |
181 |
|
|
|
182 |
|
|
* Mon Dec 08 2008 Daniel B. <daniel@firewall-services.com> [0.82-4] |
183 |
|
|
- Changes so certificates imported from openvpn-bridge are recognized |
184 |
|
|
- Configure default admin user to 'admin' |
185 |
|
|
- Create a static key for OpenVPN TLS auth (requires openvpn) |
186 |
|
|
- Add expirey values (3 Months, 6 Months) |
187 |
|
|
- Display or download takey.pem and dhparam1024.pem from |
188 |
|
|
the certificate management menue |
189 |
|
|
- Display the Root certificate in PEM format |
190 |
|
|
- Possibility to download the CRL in PEM format |
191 |
|
|
- Remove the email address from the file name during upload |
192 |
|
|
- Disable download of certificate after creating a new one |
193 |
|
|
- Remove security warning after setup |
194 |
|
|
|
195 |
|
|
* Fri Dec 05 2008 Daniel B. <daniel@firewall-services.com> [0.82-3] |
196 |
|
|
- Correct extension name for email_signing certificates |
197 |
|
|
- Remove links, and recreate them in the %post section so upgrade can be done smoothly |
198 |
|
|
|
199 |
|
|
* Wed Nov 26 2008 Daniel B. <daniel@firewall-services.com> [0.82-0] |
200 |
|
|
- initial release |
201 |
|
|
- builds from unchanged .tar.gz |
202 |
|
|
|
203 |
|
|
%prep |
204 |
|
|
%setup -c -n %{name} |
205 |
jcrisp |
1.2 |
%patch1 -p1 |
206 |
jcrisp |
1.3 |
%patch2 -p1 |
207 |
jcrisp |
1.4 |
%patch3 -p1 |
208 |
jcrisp |
1.5 |
%patch4 -p1 |
209 |
jcrisp |
1.7 |
%patch5 -p1 |
210 |
jcrisp |
1.8 |
%patch6 -p1 |
211 |
jcrisp |
1.12 |
%patch7 -p1 |
212 |
jcrisp |
1.13 |
%patch8 -p1 |
213 |
jcrisp |
1.1 |
|
214 |
|
|
%build |
215 |
|
|
%{__mkdir_p} root/opt/phpki/html |
216 |
|
|
%{__mkdir_p} root/opt/phpki/phpki-store |
217 |
|
|
%{__mkdir_p} root/opt/phpki/bin |
218 |
|
|
%{__mkdir_p} root/%{_sysconfdir}/cron.weekly/ |
219 |
|
|
%{__mv} %{name}-%{version}/gen_crl.php root/opt/phpki/bin/ |
220 |
|
|
%{__mv} %{name}-%{version}/* root/opt/phpki/html/ |
221 |
|
|
|
222 |
|
|
|
223 |
|
|
cat <<"HERE" > root/%{_sysconfdir}/cron.weekly/phpki_update_crl |
224 |
|
|
#!/bin/bash |
225 |
|
|
|
226 |
|
|
cd /opt/phpki/bin |
227 |
jcrisp |
1.2 |
/usr/bin/php74 ./gen_crl.php 2>&1 > /dev/null |
228 |
jcrisp |
1.1 |
|
229 |
|
|
HERE |
230 |
|
|
|
231 |
|
|
|
232 |
|
|
# Remove links to setup page so upgrades can be done smoothly |
233 |
|
|
%{__rm} -f root/opt/phpki/html/index.php |
234 |
|
|
%{__rm} -f root/opt/phpki/html/ca/index.php |
235 |
|
|
%{__rm} -f root/opt/phpki/html/setup.php |
236 |
|
|
|
237 |
|
|
# This script shouldn't be here |
238 |
|
|
%{__rm} -f root/opt/phpki/html/secure.sh |
239 |
|
|
|
240 |
|
|
|
241 |
|
|
%install |
242 |
|
|
rm -rf $RPM_BUILD_ROOT |
243 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
244 |
|
|
rm -f %{name}-%{version}-filelist |
245 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
246 |
|
|
--file '/opt/phpki/html/config.php' 'attr(660,root,phpki) %config(noreplace)' \ |
247 |
|
|
--file '/opt/phpki/html/openssl.cnf' 'attr(660,root,phpki) %config(noreplace)' \ |
248 |
|
|
--file '%{_sysconfdir}/cron.weekly/phpki_update_crl' 'attr(744,root,root)' \ |
249 |
|
|
--dir '/opt/phpki/html' 'attr(770,root,phpki)' \ |
250 |
|
|
--dir '/opt/phpki/html/ca' 'attr(770,root,phpki)' \ |
251 |
|
|
--dir '/opt/phpki/phpki-store' 'attr(750,phpki,phpki)' \ |
252 |
|
|
> %{name}-%{version}-filelist |
253 |
|
|
|
254 |
|
|
%files -f %{name}-%{version}-filelist |
255 |
|
|
%defattr(-,root,root) |
256 |
|
|
|
257 |
|
|
%clean |
258 |
|
|
cd .. |
259 |
|
|
rm -rf $RPM_BUILD_ROOT |
260 |
|
|
|
261 |
|
|
%pre |
262 |
|
|
echo "******************************************************" |
263 |
|
|
echo "* " |
264 |
|
|
echo "* !!! IMPORTANT - READ THIS NOW !!! " |
265 |
|
|
echo "* " |
266 |
|
|
echo "******************************************************" |
267 |
|
|
echo "* This contrib now has higher levels of encryption" |
268 |
|
|
echo "* " |
269 |
|
|
echo "* We cannot upgrade your existing certificates" |
270 |
|
|
echo "* " |
271 |
jcrisp |
1.9 |
echo "* If you have existing certificates you want to use" |
272 |
|
|
echo "* then start with a new CA, backup up, and then restore" |
273 |
|
|
echo "* your phpki-store directory in /opt/phpki" |
274 |
jcrisp |
1.1 |
echo "* " |
275 |
|
|
echo "******************************************************" |
276 |
|
|
echo "" |
277 |
|
|
|
278 |
|
|
if [ -d /opt/phpki/phpki-store ] ; then |
279 |
|
|
echo "Backing up your /opt/phpki/phpki-store" |
280 |
|
|
RANDOM=$$ |
281 |
|
|
PHPKIDIR=$(( 1 + $RANDOM%99999 )) |
282 |
|
|
echo "Number is $PHPKIDIR" |
283 |
jcrisp |
1.11 |
echo "Copying from /opt/phpki/phpki-store to /opt/phpki/phpki-store.$PHPKIDIR" |
284 |
jcrisp |
1.10 |
/bin/cp -pr /opt/phpki/phpki-store "/opt/phpki/phpki-store.$PHPKIDIR" |
285 |
jcrisp |
1.11 |
echo "Directory copied...continuing installaton" |
286 |
jcrisp |
1.1 |
else |
287 |
|
|
echo "No directory detected...continuing installaton" |
288 |
|
|
fi |
289 |
|
|
|
290 |
jcrisp |
1.11 |
|
291 |
jcrisp |
1.1 |
|
292 |
|
|
if ! /usr/bin/id phpki &>/dev/null; then |
293 |
jcrisp |
1.11 |
echo "Creating phpki user" |
294 |
jcrisp |
1.1 |
/usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d /opt/phpki/phpki-store phpki &>/dev/null || \ |
295 |
|
|
%logmsg "Unexpected error adding user \"phpki\". Abort installation." |
296 |
|
|
fi |
297 |
|
|
|
298 |
|
|
%preun |
299 |
|
|
|
300 |
|
|
|
301 |
|
|
%post |
302 |
|
|
# First install, point index.php to setup.php |
303 |
|
|
if [ $1 == 1 ]; then |
304 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/index.php |
305 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/setup.php |
306 |
|
|
echo "<?php |
307 |
|
|
header(\"Location: ./../index.php\"); |
308 |
|
|
?> |
309 |
|
|
" > /opt/phpki/html/ca/index.php |
310 |
|
|
fi |
311 |
|
|
|
312 |
|
|
|
313 |
|
|
%postun |
314 |
|
|
# Remove the links to index.php after uninstall |
315 |
|
|
if [ $1 == 0 ]; then |
316 |
|
|
%{__rm} -f /opt/phpki/html/index.php |
317 |
|
|
%{__rm} -f /opt/phpki/html/setup.php |
318 |
|
|
%{__rm} -f /opt/phpki/html/ca/index.php |
319 |
|
|
fi |
320 |
|
|
|
321 |
|
|
true |