/[smecontribs]/rpms/smeserver-openvpn-bridge/contribs7/smeserver-openvpn-bridge-2.0-configure_crl_url.patch
ViewVC logotype

Contents of /rpms/smeserver-openvpn-bridge/contribs7/smeserver-openvpn-bridge-2.0-configure_crl_url.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Mar 2 23:27:16 2009 UTC (15 years, 8 months ago) by slords
Branch: MAIN
CVS Tags: smeserver-openvpn-bridge-2_0-43_el4_sme, smeserver-openvpn-bridge-2_0-29_el4_sme, smeserver-openvpn-bridge-2_0-39_el4_sme, smeserver-openvpn-bridge-2_0-48_el4_sme, smeserver-openvpn-bridge-2_0-19_el4_sme, smeserver-openvpn-bridge-2_0-21_el4_sme, smeserver-openvpn-bridge-2_0-33_el4_sme, smeserver-openvpn-bridge-2_0-35_el4_sme, smeserver-openvpn-bridge-2_0-47_el4_sme, smeserver-openvpn-bridge-2_0-18_el4_sme, smeserver-openvpn-bridge-2_0-12_el4_sme, smeserver-openvpn-bridge-2_0-11_el4_sme, smeserver-openvpn-bridge-2_0-27_el4_sme, smeserver-openvpn-bridge-2_0-10_el4_sme, smeserver-openvpn-bridge-2_0-20_el4_sme, smeserver-openvpn-bridge-2_0-23_el4_sme, smeserver-openvpn-bridge-2_0-30_el4_sme, smeserver-openvpn-bridge-2_0-42_el4_sme, smeserver-openvpn-bridge-2_0-41_el4_sme, smeserver-openvpn-bridge-2_0-36_el4_sme, smeserver-openvpn-bridge-2_0-8_el4_sme, smeserver-openvpn-bridge-2_0-9_el4_sme, smeserver-openvpn-bridge-2_0-26_el4_sme, smeserver-openvpn-bridge-2_0-13_el4_sme, smeserver-openvpn-bridge-2_0-17_el4_sme, smeserver-openvpn-bridge-2_0-14_el4_sme, smeserver-openvpn-bridge-2_0-46_el4_sme, smeserver-openvpn-bridge-2_0-40_el4_sme, smeserver-openvpn-bridge-2_0-32_el4_sme, smeserver-openvpn-bridge-2_0-24_el4_sme, smeserver-openvpn-bridge-2_0-38_el4_sme, smeserver-openvpn-bridge-2_0-25_el4_sme, smeserver-openvpn-bridge-2_0-15_el4_sme, smeserver-openvpn-bridge-2_0-16_el4_sme, smeserver-openvpn-bridge-2_0-45_el4_sme, smeserver-openvpn-bridge-2_0-37_el4_sme, smeserver-openvpn-bridge-2_0-34_el4_sme, HEAD
Initial import of smeserver-openvpn-bridge

1 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/createlinks mezzanine_patched_smeserver-openvpn-bridge-2.0/createlinks
2 --- smeserver-openvpn-bridge-2.0/createlinks 2008-12-10 02:53:47.000000000 +0100
3 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/createlinks 2009-01-16 15:32:58.000000000 +0100
4 @@ -25,4 +25,5 @@
5 templates2events("/etc/crontab", qw(openvpn-bridge-update));
6
7 event_link("openvpn-bridge-reload-ccd", qw(openvpn-bridge-update openvpn-bridge-reload-ccd), "20");
8 +event_link("openvpn-bridge-update-crl", qw(openvpn-bridge-update openvpn-bridge-reload-ccd), "30");
9
10 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/db/configuration/defaults/openvpn-bridge/CrlUrl mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/db/configuration/defaults/openvpn-bridge/CrlUrl
11 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/db/configuration/defaults/openvpn-bridge/CrlUrl 1970-01-01 01:00:00.000000000 +0100
12 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/db/configuration/defaults/openvpn-bridge/CrlUrl 2009-01-16 15:32:58.000000000 +0100
13 @@ -0,0 +1 @@
14 +http://localhost:940/phpki/index.php?stage=dl_crl_pem
15 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/events/actions/openvpn-bridge-update-crl mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/events/actions/openvpn-bridge-update-crl
16 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/events/actions/openvpn-bridge-update-crl 1970-01-01 01:00:00.000000000 +0100
17 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/events/actions/openvpn-bridge-update-crl 2009-01-16 15:32:58.000000000 +0100
18 @@ -0,0 +1,29 @@
19 +#!/bin/bash
20 +
21 +URL=$(/sbin/e-smith/db configuration getprop openvpn-bridge CrlUrl)
22 +DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
23 +
24 +/usr/bin/wget $URL -O /tmp/cacrl.pem > /dev/null 2>&1
25 +
26 +/usr/bin/openssl crl -inform PEM -in /tmp/cacrl.pem -text > /dev/null 2>&1
27 +
28 +if [ "$?" -eq "0" ]; then
29 + /bin/mv -f /tmp/cacrl.pem /etc/openvpn/bridge/pub/cacrl.pem > /dev/null 2>&1
30 +else
31 + cat > /tmp/crlmail <<END
32 +
33 +An error occured while updating the CRL for OpenVPN-Bridge
34 +because openssl didn't recognize the file as a valid CRL.
35 +Below is the copy of the latest CRL downloaded from
36 +$URL
37 +
38 +
39 +END
40 +
41 + cat /tmp/cacrl.pem >> /tmp/crlmail
42 + mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail
43 +fi
44 +
45 +rm -f /tmp/cacrl.pem
46 +rm -f /tmp/crlmail
47 +
48 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/en/etc/e-smith/web/functions/openvpnbridge mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/en/etc/e-smith/web/functions/openvpnbridge
49 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/en/etc/e-smith/web/functions/openvpnbridge 2009-01-16 15:33:54.000000000 +0100
50 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/en/etc/e-smith/web/functions/openvpnbridge 2009-01-16 15:32:58.000000000 +0100
51 @@ -397,5 +397,43 @@
52 <trans><![CDATA[<span style="color:red">The bridge service must be enabled.<br>The following commands will enable it:<br>db configuration setprop bridge status enabled<br>/etc/init.d/bridge start</span><br><br>]]></trans>
53 </entry>
54
55 + <entry>
56 + <base>NOT_A_VALID_URL</base>
57 + <trans>"{$string}" isn't a valid URL</trans>
58 + </entry>
59 +
60 + <entry>
61 + <base>DESC_CRL_URL</base>
62 + <trans>Enter here the URL to update the CRL. (if phpki runs on the same server, you can let the default value)</trans>
63 + </entry>
64 +
65 + <entry>
66 + <base>LABEL_CRL_URL</base>
67 + <trans>URL to update the CRL</trans>
68 + </entry>
69 +
70 + <entry>
71 + <base>LABEL_CA_PEM</base>
72 + <trans>CA certificate</trans>
73 + </entry>
74
75 + <entry>
76 + <base>LABEL_CRT_PEM</base>
77 + <trans>Server certificate</trans>
78 + </entry>
79 +
80 + <entry>
81 + <base>LABEL_KEY_PEM</base>
82 + <trans>Server private key</trans>
83 + </entry>
84 +
85 + <entry>
86 + <base>LABEL_DH_PEM</base>
87 + <trans>DH parameters</trans>
88 + </entry>
89 +
90 + <entry>
91 + <base>LABEL_TA_PEM</base>
92 + <trans>Static key</trans>
93 + </entry>
94 </lexicon>
95 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/openvpnbridge mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/openvpnbridge
96 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/openvpnbridge 2009-01-16 15:33:54.000000000 +0100
97 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/openvpnbridge 2009-01-16 15:32:58.000000000 +0100
98 @@ -395,4 +395,45 @@
99 <trans><![CDATA[<span style="color:red">Le service bridge doit être activé.<br>Les commandes suivantes permettrons de l'activer:<br>db configuration setprop bridge status enabled<br>/etc/init.d/bridge start</span><br><br>]]></trans>
100 </entry>
101
102 + <entry>
103 + <base>NOT_A_VALID_URL</base>
104 + <trans>"{$string}" n'est pas une URL valide</trans>
105 + </entry>
106 +
107 + <entry>
108 + <base>DESC_CRL_URL</base>
109 + <trans>Entrez ici l'URL de mise à jour de la CRL. (si phpki est installé sur la même machine, vous pouvez laisser la valeur par défaut)</trans>
110 + </entry>
111 +
112 + <entry>
113 + <base>LABEL_CRL_URL</base>
114 + <trans>URL de mise à jour de la CRL</trans>
115 + </entry>
116 +
117 + <entry>
118 + <base>LABEL_CA_PEM</base>
119 + <trans>Certificat autoritaire</trans>
120 + </entry>
121 +
122 + <entry>
123 + <base>LABEL_CRT_PEM</base>
124 + <trans>Certificat serveur</trans>
125 + </entry>
126 +
127 + <entry>
128 + <base>LABEL_KEY_PEM</base>
129 + <trans>Clé privée du serveur</trans>
130 + </entry>
131 +
132 + <entry>
133 + <base>LABEL_DH_PEM</base>
134 + <trans>Paramètres DH</trans>
135 + </entry>
136 +
137 + <entry>
138 + <base>LABEL_TA_PEM</base>
139 + <trans>Clé statique</trans>
140 + </entry>
141 +
142 +
143 </lexicon>
144 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/crontab/openvpn-bridge-crl mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/crontab/openvpn-bridge-crl
145 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/crontab/openvpn-bridge-crl 2008-12-10 02:54:47.000000000 +0100
146 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/templates/etc/crontab/openvpn-bridge-crl 2009-01-16 15:33:17.000000000 +0100
147 @@ -2,7 +2,6 @@
148 my $url = ${'openvpn-bridge'}{'CrlUrl'} || '';
149 if ($url =~ /^http(s)?:\/\/.*$/){
150 $OUT .= "# Update OpenVPN bridge's CRL\n";
151 - $OUT .= "5 * * * * root /usr/bin/ovpn-bridge-update-crl 2>&1 /dev/null\n";
152 -
153 + $OUT .= "5 * * * * root /etc/e-smith/events/actions/openvpn-bridge-update-crl 2>&1 /dev/null\n";
154 }
155 }
156 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/etc/e-smith/web/functions/openvpnbridge mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/web/functions/openvpnbridge
157 --- smeserver-openvpn-bridge-2.0/root/etc/e-smith/web/functions/openvpnbridge 2008-12-10 03:56:57.000000000 +0100
158 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/etc/e-smith/web/functions/openvpnbridge 2009-01-16 15:32:58.000000000 +0100
159 @@ -255,34 +255,50 @@
160 pre-event="turn_off_buttons()"
161 post-event="write_pem()">
162
163 - <field
164 + <field
165 type="literal"
166 id="desc_initial_config"
167 value="">
168 <description>DESC_CRT_CONFIG_PAGE</description>
169 + </field>
170 +
171 + <field
172 + type="text"
173 + id="crl_url"
174 + size="60"
175 + value="get_prop('CrlUrl')"
176 + validation="is_url">
177 + <label>LABEL_CRL_URL</label>
178 + <description>DESC_CRL_URL</description>
179 </field>
180
181 - <field type="textarea" id="ca_pem" rows="15" cols="70" value="read_pem('cacert.pem')">
182 +
183 + <field type="textarea" id="ca_pem" rows="15" cols="70" value="read_pem('cacert.pem')">
184 + <label>LABEL_CA_PEM</label>
185 <description>DESC_CA_PEM</description>
186 </field>
187
188 <field type="textarea" id="crt_pem" rows="15" cols="70" value="read_pem('cert.pem')">
189 + <label>LABEL_CRT_PEM</label>
190 <description>DESC_CRT_PEM</description>
191 </field>
192
193 <field type="textarea" id="key_pem" rows="15" cols="70" value="read_pem('key.pem')">
194 + <label>LABEL_KEY_PEM</label>
195 <description>DESC_KEY_PEM</description>
196 </field>
197
198 - <field type="textarea" id="dhpar_pem" rows="15" cols="70" value="read_pem('dh.pem')">
199 + <field type="textarea" id="dhpar_pem" rows="15" cols="70" value="read_pem('dh.pem')">
200 + <label>LABEL_DH_PEM</label>
201 <description>DESC_DH_PEM</description>
202 </field>
203
204 - <field type="textarea" id="ta_pem" rows="15" cols="70" value="read_pem('takey.pem')">
205 + <field type="textarea" id="ta_pem" rows="15" cols="70" value="read_pem('takey.pem')">
206 + <label>LABEL_TA_PEM</label>
207 <description>DESC_TA_PEM</description>
208 </field>
209
210 - <subroutine src="print_button('SAVE')" />
211 + <subroutine src="print_button('SAVE')" />
212
213 </page>
214
215 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/usr/bin/ovpn-bridge-update-crl mezzanine_patched_smeserver-openvpn-bridge-2.0/root/usr/bin/ovpn-bridge-update-crl
216 --- smeserver-openvpn-bridge-2.0/root/usr/bin/ovpn-bridge-update-crl 2008-12-10 03:08:19.000000000 +0100
217 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/usr/bin/ovpn-bridge-update-crl 1970-01-01 01:00:00.000000000 +0100
218 @@ -1,29 +0,0 @@
219 -#!/bin/bash
220 -
221 -URL=$(/sbin/e-smith/db configuration getprop openvpn-bridge CrlUrl)
222 -DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
223 -
224 -/usr/bin/wget $URL -O /tmp/cacrl.pem > /dev/null 2>&1
225 -
226 -/usr/bin/openssl crl -inform PEM -in /tmp/cacrl.pem -text > /dev/null 2>&1
227 -
228 -if [ "$?" -eq "0" ]; then
229 - /bin/mv -f /tmp/cacrl.pem /etc/openvpn/bridge/pub/cacrl.pem
230 -else
231 - cat > /tmp/crlmail <<END
232 -
233 -An error occured while updating the CRL for OpenVPN-Bridge
234 -because openssl didn't recognize the file as a valid CRL.
235 -Below is the copy of the latest CRL downloaded from
236 -$URL
237 -
238 -
239 -END
240 -
241 - cat /tmp/cacrl.pem >> /tmp/crlmail
242 - mail -s 'CRL update failed' admin@$DOMAIN < /tmp/crlmail
243 -fi
244 -
245 -rm -f /tmp/cacrl.pem
246 -rm -f /tmp/crlmail
247 -
248 diff -Nur -x '*.orig' -x '*.rej' smeserver-openvpn-bridge-2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpnbridge.pm mezzanine_patched_smeserver-openvpn-bridge-2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpnbridge.pm
249 --- smeserver-openvpn-bridge-2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpnbridge.pm 2009-01-16 15:33:54.000000000 +0100
250 +++ mezzanine_patched_smeserver-openvpn-bridge-2.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/openvpnbridge.pm 2009-01-16 15:32:58.000000000 +0100
251 @@ -634,6 +634,8 @@
252 my $dh = $q->param('dhpar_pem');
253 my $ta = $q->param('ta_pem');
254
255 + $config_db->set_prop('openvpn-bridge', 'CrlUrl', $q->param('crl_url'));
256 +
257 if (! open (CA, ">$pubdir/cacert.pem")){
258 $fm->error('ERROR_OPEN_CA','FIRST');
259 # Tell the user something bad has happened
260 @@ -769,5 +771,16 @@
261 return "OK";
262 }
263
264 +sub is_url
265 +{
266 + my ($fm, $url) = @_;
267 +
268 + unless ($url =~ /^(http:\/\/)|(https:\/\/)/){
269 + return $fm->localise('NOT_A_VALID_URL',{string => $url});
270 + }
271 + return "OK";
272 +
273 +}
274 +
275
276 1;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed