b8fe2ae02d7029d470fa2c425ea0d363e7f0b387
[project/luci.git] /
1 'use strict';
2 'require view';
3 'require form';
4 'require tools.widgets as widgets';
5
6 return view.extend({
7 render: function() {
8 var m, s, o;
9
10 m = new form.Map('crowdsec', _('CrowdSec'),
11 _('Gain <a href="http://www.crowdsec.net">crowd-sourced</a> protection against malicious IPs. ' +
12 'Benefit from the most accurate CTI in the world.'));
13
14
15 s = m.section(form.TypedSection, 'bouncer', _('Bouncer'));
16 s.anonymous = true;
17
18 o = s.option(form.Flag, 'enabled', _('Enable'));
19 o.default = '0';
20 o.rmempty = false;
21
22 o = s.option(form.Value, 'api_url', _('URL of local API'),
23 _('The URL of your local CrowdSec API instance.'));
24 o.default = '';
25 o.rmempty = false;
26
27 o = s.option(form.Value, 'api_key', _('API key'),
28 _('The key of your bouncer as registered on the local CrowdSec API.'));
29 o.default = '';
30 o.password = true;
31 o.rmempty = false;
32
33 o = s.option(widgets.DeviceSelect, 'interface', _('Filtered interfaces'),
34 _('List of interfaces with traffic to be filtered.'));
35 o.noaliases = true;
36 o.multiple = true;
37 o.rmempty = false;
38
39 o = s.option(form.Flag, 'ipv6', _('Enable support for IPv6'),
40 _('If unchecked IPv6 will not be filtered.'));
41 o.default = '1';
42 o.rmempty = false;
43
44 o = s.option(form.Flag, 'filter_input', _('Filter input chain'),
45 _('Block packets from filtered interfaces addressed to the router itself.'));
46 o.default = '1';
47 o.rmempty = false;
48
49 o = s.option(form.Flag, 'filter_forward', _('Filter forward chain'),
50 _('Block packets from filtered interfaces addressed to devices in your network.'));
51 o.default = '1';
52 o.rmempty = false;
53
54 o = s.option(form.Flag, 'deny_log', _('Log filtered ip addresses'),
55 _('If checked, a log statement will be added to the firewall rule and blocked ' +
56 'ip addresses will be logged to System Log.'));
57 o.default = '0';
58 o.rmempty = false;
59
60
61 return m.render();
62 },
63 });
64