summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-clamav/htdocs/luci-static/resources/view/clamav/freshclam.js
blob: 583b9ccf8209133f8f5c5113dbeda5a4a0719cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
'use strict';
'require form';
'require fs';
'require uci';
'require view';

return view.extend({
	load: function() {

	},

	render: function() {
		var m, s, o;

		m = new form.Map('freshclam', _('Freshclam'), _('Configuration'));

		// Section
		s = m.section(form.TypedSection, 'freshclam', _('Settings'));
		s.anonymous = true;
		s.addremove = false;

		// Advanced Tab
		s.tab('tab_advanced', _('Settings'));

		// freshclam_config_file
		o = s.taboption('tab_advanced', form.Value, 'freshclam_config_file', _('clamd config file'));
		o.datatype = 'string';
		o.value('/etc/clamav/freshclam.conf');
		o.placeholder = '/etc/clamav/freshclam.conf';

		/*
		// UpdateLogFile
		o = s.taboption('tab_advanced', form.Value, 'UpdateLogFile', _('Logfile'));
		o.value('/tmp/clamav-milter.log');
		o.placeholder = '/tmp/clamav-milter.log';

		// LogFileMaxSize
		o = s.taboption('tab_advanced', form.Value, 'LogFileMaxSize', _('Max size of log file'));
		o.value('512K', _('512K'));
		o.value('1M', _('1M'));
		o.value('2M', _('2M'));

		// LogRotate
		o = s.taboption('tab_advanced', form.ListValue, 'LogRotate', _('Add header'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));
		*/

		// LogTime
		o = s.taboption('tab_advanced', form.ListValue, 'LogTime', _('Log time with each message'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// LogVerbose
		o = s.taboption('tab_advanced', form.ListValue, 'LogVerbose', _('Enable verbose logging'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// Debug
		o = s.taboption('tab_advanced', form.ListValue, 'Debug', _('Debug logging'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));
		o.placeholder = 'true';

		// LogSyslog
		o = s.taboption('tab_advanced', form.ListValue, 'LogSyslog', _('Log to syslog'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));
		o.placeholder = 'true';

		// LogFacility
		o = s.taboption('tab_advanced', form.ListValue, 'LogFacility', _('Syslog facility'));
		o.value('LOG_KERN');
		o.value('LOG_USER');
		o.value('LOG_MAIL');
		o.value('LOG_DAEMON');
		o.value('LOG_AUTH');
		o.value('LOG_LPR');
		o.value('LOG_NEWS');
		o.value('LOG_UUCP');
		o.value('LOG_CRON');
		o.value('LOG_LOCAL0');
		o.value('LOG_LOCAL1');
		o.value('LOG_LOCAL2');
		o.value('LOG_LOCAL3');
		o.value('LOG_LOCAL4');
		o.value('LOG_LOCAL5');
		o.value('LOG_LOCAL6');
		o.value('LOG_LOCAL7');
		// cannot do o.depends - it removes the option if dep condition is not met, thereby causing a startup error
		// o.depends('LogSyslog', 'true');

		// Foreground
		o = s.taboption('tab_advanced', form.ListValue, 'Foreground', _('Run in foreground'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));
		o.placeholder = 'false';

		// PidFile
		o = s.taboption('tab_advanced', form.Value, 'PidFile', _('PID file'));
		o.datatype = 'string';
		o.value('/var/run/clamav/freshclam.pid');
		o.placeholder = '/var/run/clamav/freshclam.pid';

		// NotifyClamd
		o = s.taboption('tab_advanced', form.Value, 'NotifyClamd', _('Notify clamd'));
		o.datatype = 'string';
		o.value('/etc/clamav/clamd.conf');
		o.placeholder = '/etc/clamav/clamd.conf';

		// DatabaseOwner
		o = s.taboption('tab_advanced', form.Value, 'DatabaseOwner', _('Database owner'));
		o.datatype = 'string';
		o.value('clamav');
		o.value('root');
		o.placeholder = 'root';

		// DatabaseDirectory
		o = s.taboption('tab_advanced', form.Value, 'DatabaseDirectory', _('Database directory'));
		o.datatype = 'string';
		o.value('/usr/share/clamav');
		o.placeholder = '/usr/share/clamav';

		// DNSDatabaseInfo
		o = s.taboption('tab_advanced', form.Value, 'DNSDatabaseInfo', _('DNS database info'));
		o.datatype = 'string';
		o.value('current.cvd.clamav.net');
		o.placeholder = 'current.cvd.clamav.net';

		// DatabaseMirror
		o = s.taboption('tab_advanced', form.Value, 'DatabaseMirror', _('Database mirror'));
		o.datatype = 'string';
		o.value('database.clamav.net');
		o.placeholder = 'database.clamav.net';

		// DatabaseCustomURL
		o = s.taboption('tab_advanced', form.Value, 'DatabaseCustomURL', _('Custom database URL'));
		o.value('http://myserver.example.com/mysigs.ndb');
		o.value('https://myserver.example.com:4567/allow_list.wdb');
		o.value('ftp://myserver.example.com/example.ldb');
		o.value('file:///mnt/nfs/local.hdb');
		o.value('file:///mnt/nfs/local.hdb');

		// PrivateMirror
		o = s.taboption('tab_advanced', form.Value, 'PrivateMirror', _('Private mirror URL'));
		o.value('mirror1.example.com');
		o.value('mirror2.example.com');

		// ScriptedUpdates
		o = s.taboption('tab_advanced', form.ListValue, 'ScriptedUpdates', _('Scripted updates'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// CompressLocalDatabase
		o = s.taboption('tab_advanced', form.ListValue, 'CompressLocalDatabase', _('Compress local database'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// ConnectTimeout
		o = s.taboption('tab_advanced', form.Value, 'ConnectTimeout', _('Connect timeout'));
		o.value('30');
		o.value('60');
		o.placeholder = '60';

		// ReceiveTimeout
		o = s.taboption('tab_advanced', form.Value, 'ReceiveTimeout', _('Receive timeout'));
		o.value('60');
		o.value('300');
		o.placeholder = '60';

		// Checks
		o = s.taboption('tab_advanced', form.Value, 'Checks', _('Database checks per day'));
		o.value('12');
		o.value('24');

		// TestDatabases
		o = s.taboption('tab_advanced', form.ListValue, 'TestDatabases', _('Test databases'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// Bytecode
		o = s.taboption('tab_advanced', form.MultiValue, 'Bytecode', _('Download bytecode.cvd'));
		o.value('false', _('No'));
		o.value('true', _('Yes'));

		// ExtraDatabase
		o = s.taboption('tab_advanced', form.Value, 'ExtraDatabase', _('Extra databases'));
		o.datatype = 'string';
		o.placeholder = 'dbname1';

		// ExcludeDatabase
		o = s.taboption('tab_advanced', form.Value, 'ExcludeDatabase', _('Exclude databases'));
		o.datatype = 'string';
		o.placeholder = 'dbname1';

		return m.render();
	},

});