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 |
jcrisp |
1.3 |
%define release 3 |
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.1 |
|
20 |
|
|
BuildArch: noarch |
21 |
|
|
BuildRoot: /var/tmp/%{name}-%{version} |
22 |
|
|
|
23 |
|
|
BuildRequires: e-smith-devtools |
24 |
|
|
|
25 |
jcrisp |
1.2 |
Requires: e-smith-release >= 10.0 |
26 |
|
|
Requires: php74-php-fpm |
27 |
jcrisp |
1.1 |
Requires: openssl |
28 |
|
|
Requires: openvpn |
29 |
|
|
Conflicts: phpki |
30 |
|
|
AutoReqProv: no |
31 |
|
|
|
32 |
|
|
%description |
33 |
|
|
http://sourceforge.net/projects/phpki/ |
34 |
|
|
https://github.com/radicand/phpki |
35 |
jcrisp |
1.2 |
https://github.com/reetp/phpki |
36 |
jcrisp |
1.1 |
PHPki is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance. |
37 |
|
|
With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled |
38 |
|
|
e-mail clients, SSL servers, and VPN applications. |
39 |
|
|
|
40 |
|
|
%changelog |
41 |
jcrisp |
1.3 |
* Mon Mar 08 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-3.sme |
42 |
|
|
- Fix Typo in certificate password [SME: 11435] |
43 |
|
|
- Fix typos and preg_match issues [SME: 11436] |
44 |
|
|
- Add Certificate ctreation notification [SME: 11437] |
45 |
|
|
- Bit of file fomatting |
46 |
|
|
|
47 |
jcrisp |
1.2 |
* Wed Mar 07 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-2.sme |
48 |
|
|
- Change version to 0.84 |
49 |
|
|
- Fix undefined constant errors [SME: 11397] |
50 |
|
|
- fix tempdir [SME: 11398] |
51 |
|
|
- update code to be PHP 7.4+ compliant |
52 |
|
|
- format with CodeSniff to PSR2 |
53 |
|
|
|
54 |
jcrisp |
1.1 |
* Wed Apr 01 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-1.sme |
55 |
jcrisp |
1.2 |
- Rename to php-ng 0.84 [SME: 11192] |
56 |
jcrisp |
1.1 |
- Fix date sorting in certificates |
57 |
|
|
|
58 |
|
|
* Thu Mar 19 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-9.sme |
59 |
|
|
- Update DH to 2048 |
60 |
|
|
|
61 |
|
|
* Mon Mar 09 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-8.sme |
62 |
|
|
- move warning and exit to %pre |
63 |
|
|
|
64 |
|
|
* Sat Mar 07 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-7.sme |
65 |
|
|
- Lots of formatting - adding quotes to items and tidying up |
66 |
|
|
- set default md to 512 |
67 |
|
|
|
68 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-6.sme |
69 |
|
|
- Fix renew-cert |
70 |
|
|
- revert DH setup so you can see progress |
71 |
|
|
|
72 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-5.sme |
73 |
|
|
- Fix create cert without password |
74 |
|
|
|
75 |
|
|
* Wed Mar 04 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-4.sme |
76 |
|
|
- Fix openvpn error |
77 |
|
|
|
78 |
|
|
* Tue Mar 03 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-3.sme |
79 |
|
|
- more fixes |
80 |
|
|
|
81 |
|
|
* Sat Feb 29 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-2.sme |
82 |
|
|
- small fixes |
83 |
|
|
|
84 |
|
|
* Fri Feb 28 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.83-1.sme |
85 |
|
|
- Update to 0.83 |
86 |
|
|
|
87 |
jcrisp |
1.2 |
* Sat Nov 17 2018 Terry Fage <tfage@yahoo.com.au> 0.82-19.sme |
88 |
jcrisp |
1.1 |
- Fix preg_match warnings [SME:10622] |
89 |
|
|
|
90 |
|
|
* Mon Oct 8 2018 Daniel B. <daniel@firewall-services.com> 0.82-18.sme |
91 |
|
|
- Fix potential XSS with unsafe use of PHP_SELF [SME: 10626] |
92 |
|
|
|
93 |
|
|
* Thu Sep 6 2018 brian r. <brianr@bjsystems.co.uk> 0.82-17.sme |
94 |
|
|
- Replace use of ereg by preg_replace as per deprecated in php 5.3 and removed in 7.0 |
95 |
|
|
- [SME: 10622] |
96 |
|
|
|
97 |
|
|
* Mon Dec 12 2011 Daniel B. <daniel@firewall-services.com> 0.82-16.sme |
98 |
|
|
- Remove php-posix dependency (not available, nor needed on SME 7.x) [SME: 6805] |
99 |
|
|
|
100 |
|
|
* Wed Oct 26 2011 Daniel B. <daniel@firewall-services.com> 0.82-15.sme |
101 |
|
|
- Requires php-posix |
102 |
|
|
|
103 |
|
|
* Wed Jun 29 2011 Daniel B. <daniel@firewall-services.com> 0.82-14.sme |
104 |
|
|
- Don't check issuer (everyone allowed to access /ca can manage |
105 |
|
|
all the certificates, access to /ca is controlled by apache) |
106 |
|
|
|
107 |
|
|
* Tue Mar 15 2011 Daniel B. <daniel@firewall-services.com> 0.82-13.sme |
108 |
|
|
- Replace md5 with sha1 for signing |
109 |
|
|
|
110 |
|
|
* Fri May 28 2010 Daniel B. <daniel@firewall-services.com> [0.82-12] |
111 |
|
|
- Weekly update the CRL via cron so MS Crypto API will be happy |
112 |
|
|
|
113 |
|
|
* Thu Mar 18 2010 Daniel B. <daniel@firewall-services.com> [0.82-11] |
114 |
|
|
- Fixe empty password with PHP 5.2 (SME 8b5) |
115 |
|
|
|
116 |
|
|
* Wed Aug 26 2009 Daniel B. <daniel@firewall-services.com> [0.82-10] |
117 |
|
|
- Fixe links for CA help page |
118 |
|
|
|
119 |
|
|
* Mon Mar 23 2009 Daniel B. <daniel@firewall-services.com> [0.82-9] |
120 |
|
|
- Remove links after uninstall so you can easily re-install the contrib |
121 |
|
|
later [SME: 5091] |
122 |
|
|
|
123 |
|
|
* Tue Mar 03 2009 Daniel B. <daniel@firewall-services.com> [0.82-8] |
124 |
|
|
- Add e-smith-devtools as a dependencie |
125 |
|
|
|
126 |
|
|
* Tue Jan 20 2009 Daniel B. <daniel@firewall-services.com> [0.82-7] |
127 |
|
|
- Don't replace config file on upgrades |
128 |
|
|
|
129 |
|
|
* Wed Jan 07 2009 Daniel B. <daniel@firewall-services.com> [0.82-6] |
130 |
|
|
- Remove the email address from the file name during upload (in search page) |
131 |
|
|
- Remove secure.sh script |
132 |
|
|
|
133 |
|
|
* Tue Dec 16 2008 Daniel B. <daniel@firewall-services.com> [0.82-5] |
134 |
|
|
- Link index.php to setup-presetup.php |
135 |
|
|
|
136 |
|
|
* Mon Dec 08 2008 Daniel B. <daniel@firewall-services.com> [0.82-4] |
137 |
|
|
- Changes so certificates imported from openvpn-bridge are recognized |
138 |
|
|
- Configure default admin user to 'admin' |
139 |
|
|
- Create a static key for OpenVPN TLS auth (requires openvpn) |
140 |
|
|
- Add expirey values (3 Months, 6 Months) |
141 |
|
|
- Display or download takey.pem and dhparam1024.pem from |
142 |
|
|
the certificate management menue |
143 |
|
|
- Display the Root certificate in PEM format |
144 |
|
|
- Possibility to download the CRL in PEM format |
145 |
|
|
- Remove the email address from the file name during upload |
146 |
|
|
- Disable download of certificate after creating a new one |
147 |
|
|
- Remove security warning after setup |
148 |
|
|
|
149 |
|
|
* Fri Dec 05 2008 Daniel B. <daniel@firewall-services.com> [0.82-3] |
150 |
|
|
- Correct extension name for email_signing certificates |
151 |
|
|
- Remove links, and recreate them in the %post section so upgrade can be done smoothly |
152 |
|
|
|
153 |
|
|
* Wed Nov 26 2008 Daniel B. <daniel@firewall-services.com> [0.82-0] |
154 |
|
|
- initial release |
155 |
|
|
- builds from unchanged .tar.gz |
156 |
|
|
|
157 |
|
|
%prep |
158 |
|
|
%setup -c -n %{name} |
159 |
jcrisp |
1.2 |
%patch1 -p1 |
160 |
jcrisp |
1.3 |
%patch2 -p1 |
161 |
jcrisp |
1.1 |
|
162 |
|
|
%build |
163 |
|
|
%{__mkdir_p} root/opt/phpki/html |
164 |
|
|
%{__mkdir_p} root/opt/phpki/phpki-store |
165 |
|
|
%{__mkdir_p} root/opt/phpki/bin |
166 |
|
|
%{__mkdir_p} root/%{_sysconfdir}/cron.weekly/ |
167 |
|
|
%{__mv} %{name}-%{version}/gen_crl.php root/opt/phpki/bin/ |
168 |
|
|
%{__mv} %{name}-%{version}/* root/opt/phpki/html/ |
169 |
|
|
|
170 |
|
|
|
171 |
|
|
cat <<"HERE" > root/%{_sysconfdir}/cron.weekly/phpki_update_crl |
172 |
|
|
#!/bin/bash |
173 |
|
|
|
174 |
|
|
cd /opt/phpki/bin |
175 |
jcrisp |
1.2 |
/usr/bin/php74 ./gen_crl.php 2>&1 > /dev/null |
176 |
jcrisp |
1.1 |
|
177 |
|
|
HERE |
178 |
|
|
|
179 |
|
|
|
180 |
|
|
# Remove links to setup page so upgrades can be done smoothly |
181 |
|
|
%{__rm} -f root/opt/phpki/html/index.php |
182 |
|
|
%{__rm} -f root/opt/phpki/html/ca/index.php |
183 |
|
|
%{__rm} -f root/opt/phpki/html/setup.php |
184 |
|
|
|
185 |
|
|
# This script shouldn't be here |
186 |
|
|
%{__rm} -f root/opt/phpki/html/secure.sh |
187 |
|
|
|
188 |
|
|
|
189 |
|
|
%install |
190 |
|
|
rm -rf $RPM_BUILD_ROOT |
191 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
192 |
|
|
rm -f %{name}-%{version}-filelist |
193 |
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
194 |
|
|
--file '/opt/phpki/html/config.php' 'attr(660,root,phpki) %config(noreplace)' \ |
195 |
|
|
--file '/opt/phpki/html/openssl.cnf' 'attr(660,root,phpki) %config(noreplace)' \ |
196 |
|
|
--file '%{_sysconfdir}/cron.weekly/phpki_update_crl' 'attr(744,root,root)' \ |
197 |
|
|
--dir '/opt/phpki/html' 'attr(770,root,phpki)' \ |
198 |
|
|
--dir '/opt/phpki/html/ca' 'attr(770,root,phpki)' \ |
199 |
|
|
--dir '/opt/phpki/phpki-store' 'attr(750,phpki,phpki)' \ |
200 |
|
|
> %{name}-%{version}-filelist |
201 |
|
|
|
202 |
|
|
%files -f %{name}-%{version}-filelist |
203 |
|
|
%defattr(-,root,root) |
204 |
|
|
|
205 |
|
|
%clean |
206 |
|
|
cd .. |
207 |
|
|
rm -rf $RPM_BUILD_ROOT |
208 |
|
|
|
209 |
|
|
%pre |
210 |
|
|
echo "******************************************************" |
211 |
|
|
echo "* " |
212 |
|
|
echo "* !!! IMPORTANT - READ THIS NOW !!! " |
213 |
|
|
echo "* " |
214 |
|
|
echo "******************************************************" |
215 |
|
|
echo "* This contrib now has higher levels of encryption" |
216 |
|
|
echo "* " |
217 |
|
|
echo "* We cannot upgrade your existing certificates" |
218 |
|
|
echo "* " |
219 |
|
|
echo "* If we detect an existing certificate store" |
220 |
|
|
echo "* we are going to move it" |
221 |
|
|
echo "* " |
222 |
|
|
echo "* You can then start with a new CA and certificates" |
223 |
|
|
echo "******************************************************" |
224 |
|
|
echo "" |
225 |
|
|
|
226 |
|
|
if [ -d /opt/phpki/phpki-store ] ; then |
227 |
|
|
echo "Backing up your /opt/phpki/phpki-store" |
228 |
|
|
RANDOM=$$ |
229 |
|
|
PHPKIDIR=$(( 1 + $RANDOM%99999 )) |
230 |
|
|
echo "Number is $PHPKIDIR" |
231 |
|
|
echo "moving from /opt/phpki/phpki-store to /opt/phpki/phpki-store.$PHPKIDIR" |
232 |
|
|
mv /opt/phpki/phpki-store "/opt/phpki/phpki-store.$PHPKIDIR" |
233 |
|
|
echo "Directory moved...continuing installaton" |
234 |
|
|
else |
235 |
|
|
echo "No directory detected...continuing installaton" |
236 |
|
|
fi |
237 |
|
|
|
238 |
|
|
echo "Creating phpki user" |
239 |
|
|
|
240 |
|
|
if ! /usr/bin/id phpki &>/dev/null; then |
241 |
|
|
/usr/sbin/useradd -c 'Phpki User' -s /sbin/nologin -r -d /opt/phpki/phpki-store phpki &>/dev/null || \ |
242 |
|
|
%logmsg "Unexpected error adding user \"phpki\". Abort installation." |
243 |
|
|
fi |
244 |
|
|
|
245 |
|
|
%preun |
246 |
|
|
|
247 |
|
|
|
248 |
|
|
%post |
249 |
|
|
# First install, point index.php to setup.php |
250 |
|
|
if [ $1 == 1 ]; then |
251 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/index.php |
252 |
|
|
%{__ln_s} /opt/phpki/html/setup.php-presetup /opt/phpki/html/setup.php |
253 |
|
|
echo "<?php |
254 |
|
|
header(\"Location: ./../index.php\"); |
255 |
|
|
?> |
256 |
|
|
" > /opt/phpki/html/ca/index.php |
257 |
|
|
fi |
258 |
|
|
|
259 |
|
|
|
260 |
|
|
%postun |
261 |
|
|
# Remove the links to index.php after uninstall |
262 |
|
|
if [ $1 == 0 ]; then |
263 |
|
|
%{__rm} -f /opt/phpki/html/index.php |
264 |
|
|
%{__rm} -f /opt/phpki/html/setup.php |
265 |
|
|
%{__rm} -f /opt/phpki/html/ca/index.php |
266 |
|
|
fi |
267 |
|
|
|
268 |
|
|
true |