1 |
michel |
1.1 |
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip |
2 |
|
|
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-10-10 19:05:43.000000000 +0400 |
3 |
|
|
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/xt_geoip 2019-10-16 17:59:19.000000000 +0400 |
4 |
|
|
@@ -254,17 +254,37 @@ |
5 |
|
|
<trans>Choose if you want to have the general filter to apply to all incoming connections or if you do not want to filter ports already defined with a specific service rule. This would allow you to have a service less restricted than the general rule if you enable this.</trans> |
6 |
|
|
</entry> |
7 |
|
|
|
8 |
|
|
- <field type="literal" id="countries_list_label" value=""> |
9 |
|
|
- <description>COUNTRIES_LIST_DESCRIPTION</description> |
10 |
|
|
- </field> |
11 |
|
|
- <subroutine src="print_custom_button('COUNTRIES_LIST', 'Codes')"/> |
12 |
|
|
+ <entry> |
13 |
|
|
+ <base>SERVICE_LIST_DESCRIPTION</base> |
14 |
|
|
+ <trans><![CDATA[<ul> |
15 |
|
|
+ <li>Click here to select <b>new </b>services among an <b>available services list</b></li> |
16 |
|
|
+ </ul> ]]> |
17 |
|
|
+ </trans> |
18 |
|
|
+ </entry> |
19 |
|
|
+ |
20 |
|
|
+ <entry> |
21 |
|
|
+ <base>LABEL_SERVICE_LIST</base> |
22 |
|
|
+ <trans>Service codes : </trans> |
23 |
|
|
+ </entry> |
24 |
|
|
+ |
25 |
|
|
+ <entry> |
26 |
|
|
+ <base>SERV_LIST</base> |
27 |
|
|
+ <trans>List</trans> |
28 |
|
|
+ </entry> |
29 |
|
|
+ |
30 |
|
|
+ <entry> |
31 |
|
|
+ <base>DESC_AVAILABLE_SERVICES</base> |
32 |
|
|
+ <trans><![CDATA[ <h2> New Services selection</h2> |
33 |
|
|
+ <ul><li>Select here among the other services not yet managed individually. |
34 |
|
|
+ </li><li>You may select one or more elements. Generally <b>enabled and public</b> ones. |
35 |
|
|
+ </li></ul> ]]> |
36 |
|
|
+ </trans> |
37 |
|
|
+ </entry> |
38 |
|
|
|
39 |
|
|
+ <entry> |
40 |
|
|
+ <base>LABEL_AVAILABLE_SERVICES</base> |
41 |
|
|
+ <trans>Available Services</trans> |
42 |
|
|
+ </entry> |
43 |
|
|
|
44 |
|
|
- <subroutine src="print_button('NEXT')" /> |
45 |
|
|
- |
46 |
|
|
- <field type="literal" id="service_label" value=""> |
47 |
|
|
- <description>SERVICE_DESCRIPTION</description> |
48 |
|
|
- </field> |
49 |
|
|
- <subroutine src="print_custom_button('PER_SERVICE_GEOIP', 'Service', '')"/> |
50 |
|
|
|
51 |
|
|
</lexicon> |
52 |
|
|
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip |
53 |
|
|
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip 2019-10-10 19:05:43.000000000 +0400 |
54 |
|
|
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/xt_geoip 2019-10-16 18:00:05.000000000 +0400 |
55 |
|
|
@@ -93,12 +93,12 @@ |
56 |
|
|
|
57 |
|
|
<entry> |
58 |
|
|
<base>IPT_LIST</base> |
59 |
|
|
- <trans>Stats des connexions évitées à l'aide de XT-geoip</trans> |
60 |
|
|
+ <trans>Filtrés</trans> |
61 |
|
|
</entry> |
62 |
|
|
|
63 |
|
|
<entry> |
64 |
|
|
<base>SSH_LIST</base> |
65 |
|
|
- <trans>Stats des erreurs SSH non bloquées par XT-geoip</trans> |
66 |
|
|
+ <trans>Erreurs SSH</trans> |
67 |
|
|
</entry> |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
@@ -119,7 +119,7 @@ |
71 |
|
|
|
72 |
|
|
<entry> |
73 |
|
|
<base>STATS_DESCRIPTION</base> |
74 |
|
|
- <trans><![CDATA[ <h2>Statistiques pour Xtables GeoIP </h2><ul> |
75 |
|
|
+ <trans><![CDATA[<HR class="sme-copyrightbar"> <h3>Statistiques pour Xtables GeoIP </h3><ul> |
76 |
|
|
<li>Pour 3 périodes : Jour, Semaine et Mois</li> |
77 |
|
|
<li>Ips bloqués par pays triés par score</li> |
78 |
|
|
<li>Erreurs Ssh par pays triées par score </li> |
79 |
|
|
@@ -142,7 +142,7 @@ |
80 |
|
|
|
81 |
|
|
<entry> |
82 |
|
|
<base>PER_SERVICE_GEOIP</base> |
83 |
|
|
- <trans>-> Services</trans> |
84 |
|
|
+ <trans>Services</trans> |
85 |
|
|
</entry> |
86 |
|
|
|
87 |
|
|
<entry> |
88 |
|
|
@@ -191,8 +191,102 @@ |
89 |
|
|
</entry> |
90 |
|
|
|
91 |
|
|
<entry> |
92 |
|
|
- <base>ERR_COUNTRY_MAX: {$ctr}</base> |
93 |
|
|
- <trans>Code(s) pays inexistant(s) sur le serveur: {$listerr}</trans> |
94 |
|
|
+ <base>ERROR_COUNTRY_MAX: {$ctr}</base> |
95 |
|
|
+ <trans>Trop de codes pays saisis : {$ctr}</trans> |
96 |
|
|
</entry> |
97 |
|
|
- |
98 |
|
|
+ |
99 |
|
|
+ <entry> |
100 |
|
|
+ <base>SSH_LIST_DESCRIPTION</base> |
101 |
|
|
+ <trans><![CDATA[<ul><li>Cliquer ici pour avoir les statistiques des <b>erreurs SSH </b>pour des accés non bloqués</li></ul> ]]> |
102 |
|
|
+ </trans> |
103 |
|
|
+ </entry> |
104 |
|
|
+ |
105 |
|
|
+ <entry> |
106 |
|
|
+ <base>IPT_LIST_DESCRIPTION</base> |
107 |
|
|
+ <trans><![CDATA[<ul><li>Cliquer ici pour avoir les statistiques des <b>connexions refusées</b></li></ul> ]]> |
108 |
|
|
+ </trans> |
109 |
|
|
+ </entry> |
110 |
|
|
+ |
111 |
|
|
+ <entry> |
112 |
|
|
+ <base>COUNTRY_LIST_DESCRIPTION</base> |
113 |
|
|
+ <trans><![CDATA[<ul><li>Cliquer pour avoir une <b>liste des codes pays disponibles</b></li></ul> ]]> |
114 |
|
|
+ </trans> |
115 |
|
|
+ </entry> |
116 |
|
|
+ |
117 |
|
|
+ <entry> |
118 |
|
|
+ <base>LABEL_COUNTRY_LIST</base> |
119 |
|
|
+ <trans>Codes pays : </trans> |
120 |
|
|
+ </entry> |
121 |
|
|
+ <entry> |
122 |
|
|
+ <base>COUNTRY_LIST</base> |
123 |
|
|
+ <trans>Codes Pays</trans> |
124 |
|
|
+ </entry> |
125 |
|
|
+ |
126 |
|
|
+ <entry> |
127 |
|
|
+ <base>CNTRY_LIST</base> |
128 |
|
|
+ <trans>Liste</trans> |
129 |
|
|
+ </entry> |
130 |
|
|
+ |
131 |
|
|
+ <entry> |
132 |
|
|
+ <base>END_OF_CODES</base> |
133 |
|
|
+ <trans>Fin de la liste de codes</trans> |
134 |
|
|
+ </entry> |
135 |
|
|
+ |
136 |
|
|
+ <entry> |
137 |
|
|
+ <base>LABEL_REVERSE_MATCH</base> |
138 |
|
|
+ <trans>Rejeté si </trans> |
139 |
|
|
+ </entry> |
140 |
|
|
+ |
141 |
|
|
+ <entry> |
142 |
|
|
+ <base>DESC_REVERSE_MATCH</base> |
143 |
|
|
+ <trans>L'option qui suit permet de choisir de rejeter les visiteurs à partir de la liste de pays (==) |
144 |
|
|
+ ce qui est le comportement par défaut, ou d'autoriser leurs accès (!=).</trans> |
145 |
|
|
+ </entry> |
146 |
|
|
+ |
147 |
|
|
+ <entry> |
148 |
|
|
+ <base>LABEL_OTHERS</base> |
149 |
|
|
+ <trans>Filtre général uniquement pour les services sans règles d'accès</trans> |
150 |
|
|
+ </entry> |
151 |
|
|
+ |
152 |
|
|
+ <entry> |
153 |
|
|
+ <base>DESC_OTHERS</base> |
154 |
|
|
+ <trans> Choisir d'appliquer le filtre général à tous les accés entrant |
155 |
|
|
+ ou de ne pas le faire pour les ports faisant déjà l'objet d'un filtrage par service. |
156 |
|
|
+ Ceci permet, si vous validez ici, d'avoir un service moins restreint qu'avec la règle générale. |
157 |
|
|
+ </trans> |
158 |
|
|
+ </entry> |
159 |
|
|
+ |
160 |
|
|
+ <entry> |
161 |
|
|
+ <base>SERVICE_LIST_DESCRIPTION</base> |
162 |
|
|
+ <trans><![CDATA[<ul> |
163 |
|
|
+ <li>Cliquer ici pour pouvoir sélectionner de <b>nouveaux</b> services parmi les <b>services disponibles restant</b></li> |
164 |
|
|
+ </ul> ]]> |
165 |
|
|
+ </trans> |
166 |
|
|
+ </entry> |
167 |
|
|
+ |
168 |
|
|
+ <entry> |
169 |
|
|
+ <base>LABEL_SERVICE_LIST</base> |
170 |
|
|
+ <trans>Codes des Services : </trans> |
171 |
|
|
+ </entry> |
172 |
|
|
+ |
173 |
|
|
+ <entry> |
174 |
|
|
+ <base>SERV_LIST</base> |
175 |
|
|
+ <trans>Liste</trans> |
176 |
|
|
+ </entry> |
177 |
|
|
+ |
178 |
|
|
+ <entry> |
179 |
|
|
+ <base>DESC_AVAILABLE_SERVICES</base> |
180 |
|
|
+ <trans><![CDATA[ <h2>Sélection de nouveaux services</h2> |
181 |
|
|
+ <ul><li>Choisir ici parmi les autres services non encore gérés individuellement. |
182 |
|
|
+ </li><li>Vous pouvez choisir un ou plusieurs éléments. Généralement des services marqués <b>enabled et public</b>. |
183 |
|
|
+ </li></ul> ]]> |
184 |
|
|
+ </trans> |
185 |
|
|
+ </entry> |
186 |
|
|
+ |
187 |
|
|
+ <entry> |
188 |
|
|
+ <base>LABEL_AVAILABLE_SERVICES</base> |
189 |
|
|
+ <trans>Services disponibles</trans> |
190 |
|
|
+ </entry> |
191 |
|
|
+ |
192 |
|
|
</lexicon> |
193 |
|
|
+ |
194 |
|
|
diff -urN smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip |
195 |
|
|
--- smeserver-xt_geoip-1.0.1.old/root/etc/e-smith/web/functions/xt_geoip 2019-10-10 19:05:43.000000000 +0400 |
196 |
|
|
+++ smeserver-xt_geoip-1.0.1/root/etc/e-smith/web/functions/xt_geoip 2019-10-16 23:49:18.000000000 +0400 |
197 |
|
|
@@ -103,7 +103,7 @@ |
198 |
|
|
<field type="literal" id="country_list_label" value=""> |
199 |
|
|
<description>COUNTRY_LIST_DESCRIPTION</description> |
200 |
|
|
</field> |
201 |
|
|
- <subroutine src="print_custom_button('CNTRY_LIST', 'Codes')"/> |
202 |
|
|
+ <subroutine src="print_custom_button('CNTRY_LIST', 'Codes', '')"/> |
203 |
|
|
|
204 |
|
|
|
205 |
|
|
<subroutine src="print_button('NEXT')" /> |
206 |
|
|
@@ -115,6 +115,13 @@ |
207 |
|
|
<subroutine src="print_service_table()" /> |
208 |
|
|
|
209 |
|
|
|
210 |
|
|
+ <field type="literal" id="service_list_label" value=""> |
211 |
|
|
+ <description>SERVICE_LIST_DESCRIPTION</description> |
212 |
|
|
+ </field> |
213 |
|
|
+ <subroutine src="print_custom_button('SERV_LIST', 'Services', '')"/> |
214 |
|
|
+ |
215 |
|
|
+ |
216 |
|
|
+ |
217 |
|
|
<field type="literal" id="stats_label" value=""> |
218 |
|
|
<description>STATS_DESCRIPTION</description> |
219 |
|
|
</field> |
220 |
|
|
@@ -268,6 +275,7 @@ |
221 |
|
|
|
222 |
|
|
|
223 |
|
|
<page name="Stats" pre-event="generateStats" post-event="wherenext('First')"> |
224 |
|
|
+ <subroutine src="print_button('NEXT')"/> |
225 |
|
|
</page> |
226 |
|
|
|
227 |
|
|
|
228 |
|
|
@@ -275,6 +283,19 @@ |
229 |
|
|
<subroutine src="print_button('NEXT')"/> |
230 |
|
|
</page> |
231 |
|
|
|
232 |
|
|
+ <page name="Services" pre-event="turn_off_buttons()" post-event="do_otherServices()"> |
233 |
|
|
+ <field |
234 |
|
|
+ type="select" multiple="1" |
235 |
|
|
+ id="SelectedServices" |
236 |
|
|
+ value="otherServices('sel')" |
237 |
|
|
+ options="otherServices('all')"> |
238 |
|
|
+ <label>LABEL_AVAILABLE_SERVICES</label> |
239 |
|
|
+ <description>DESC_AVAILABLE_SERVICES</description> |
240 |
|
|
+ </field> |
241 |
|
|
+ |
242 |
|
|
+ <subroutine src="print_button('NEXT')"/> |
243 |
|
|
+ </page> |
244 |
|
|
+ |
245 |
|
|
|
246 |
|
|
|
247 |
|
|
</form> |
248 |
|
|
diff -urN smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm |
249 |
|
|
--- smeserver-xt_geoip-1.0.1.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-10-10 19:05:43.000000000 +0400 |
250 |
|
|
+++ smeserver-xt_geoip-1.0.1/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/xt_geoip.pm 2019-10-16 23:12:46.000000000 +0400 |
251 |
|
|
@@ -19,6 +19,8 @@ |
252 |
|
|
our @ISA = qw(esmith::FormMagick Exporter); |
253 |
|
|
|
254 |
|
|
our @EXPORT = qw( |
255 |
|
|
+ otherServices |
256 |
|
|
+ do_otherServices |
257 |
|
|
get_prop |
258 |
|
|
get_value |
259 |
|
|
get_badcountries |
260 |
|
|
@@ -281,6 +283,8 @@ |
261 |
|
|
my $self = shift; |
262 |
|
|
my $q = $self->{cgi}; |
263 |
|
|
|
264 |
|
|
+ $self->turn_off_buttons(); |
265 |
|
|
+ |
266 |
|
|
# Untaint $name before use in system() |
267 |
|
|
my $stats_type = $q->param ('type'); |
268 |
|
|
$stats_type =~ /(.+)/; $stats_type = $1; |
269 |
|
|
@@ -308,7 +312,7 @@ |
270 |
|
|
print "</pre>\n"; |
271 |
|
|
|
272 |
|
|
print $q->h3($self->localise('END_OF_STATS')); |
273 |
|
|
- $self->wherenext('First'); |
274 |
|
|
+ #$self->wherenext('First'); |
275 |
|
|
return ''; |
276 |
|
|
} |
277 |
|
|
} |
278 |
|
|
@@ -496,6 +500,8 @@ |
279 |
|
|
my $self = shift; |
280 |
|
|
my $q = $self->{cgi}; |
281 |
|
|
|
282 |
|
|
+ $self->turn_off_buttons(); |
283 |
|
|
+ |
284 |
|
|
my $file = "/usr/share/xt_geoip/geoip_countries_list.txt"; |
285 |
|
|
unless ( -e $file ) { |
286 |
|
|
print $q->p($q->b($self->localise('INVALID_CODES_LIST'))); |
287 |
|
|
@@ -516,10 +522,56 @@ |
288 |
|
|
print "</pre>\n"; |
289 |
|
|
|
290 |
|
|
print $q->h3($self->localise('END_OF_CODES')); |
291 |
|
|
- $self->wherenext('First'); |
292 |
|
|
return ''; |
293 |
|
|
|
294 |
|
|
} |
295 |
|
|
|
296 |
|
|
|
297 |
|
|
+#Subroutine to list other services codes |
298 |
|
|
+sub otherServices |
299 |
|
|
+{ |
300 |
|
|
+ my ($self, $choice) = @_; |
301 |
|
|
+ |
302 |
|
|
+ my %serv_ok = map { $_ => 1} split(/,/, $db->get_prop("masq", "XtServices")); |
303 |
|
|
+ # unless $choice eq 'all'; |
304 |
|
|
+ |
305 |
|
|
+ my @serv_others = (); |
306 |
|
|
+ |
307 |
|
|
+ for ($db->get_all_by_prop(type => 'service')) |
308 |
|
|
+ { |
309 |
|
|
+ next unless $_->prop('TCPPort'); |
310 |
|
|
+ # if ( $_->prop('TCPPort')) { |
311 |
|
|
+ |
312 |
|
|
+ # push @serv_others, $_->key unless exists( $serv_ok{$_->key}); |
313 |
|
|
+ push @serv_others, $_->key unless $choice eq 'sel' and not exists( $serv_ok{$_->key}); |
314 |
|
|
+ # } |
315 |
|
|
+ } |
316 |
|
|
+ |
317 |
|
|
+ return \@serv_others; |
318 |
|
|
+ |
319 |
|
|
+} |
320 |
|
|
+ |
321 |
|
|
+ |
322 |
|
|
+#Subroutine to update list services codes |
323 |
|
|
+sub do_otherServices |
324 |
|
|
+{ |
325 |
|
|
+ my $self = shift; |
326 |
|
|
+ |
327 |
|
|
+ my $q = $self->{'cgi'}; |
328 |
|
|
+ |
329 |
|
|
+ my @selected = $q->param('SelectedServices'); |
330 |
|
|
+ |
331 |
|
|
+ my $serv1 = ($db->get_prop("masq", "XtServices")) || ''; |
332 |
|
|
+ my $serv2 = join( ',', @selected); |
333 |
|
|
+ |
334 |
|
|
+ $self->wherenext('First'); |
335 |
|
|
+ |
336 |
|
|
+ return $self->success("NO_CHANGE") if ( $serv1 eq $serv2); |
337 |
|
|
+ |
338 |
|
|
+ $db->set_prop("masq", "XtServices", $serv2); |
339 |
|
|
+ |
340 |
|
|
+ return $self->success("SUCCESS"); |
341 |
|
|
+} |
342 |
|
|
+ |
343 |
|
|
+ |
344 |
|
|
1; |