b1afb3f7ea2130075fa1befc5813506bae045cff
[project/luci.git] / applications / luci-tinyproxy / luasrc / model / cbi / tinyproxy.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15 m = Map("tinyproxy", translate("tinyproxy"), translate("tinyproxy_desc"))
16
17 s = m:section(TypedSection, "tinyproxy", translate("general"))
18 s.anonymous = true
19
20 s:option(Flag, "enable", translate("enable"))
21
22 s:option(Value, "Port", translate("port"))
23 s:option(Value, "Listen").optional = true
24 s:option(Value, "Bind").optional = true
25 s:option(Value, "Timeout").optional = true
26
27 s:option(Value, "DefaultErrorFile").optional = true
28 s:option(Value, "StatFile").optional = true
29
30 s:option(Flag, "Syslog").optional = true
31 f = s:option(Value, "Logfile")
32 f.optional = true
33 f:depends({Syslog = ""})
34
35 l = s:option(ListValue, "LogLevel")
36 l.optional = true
37 l:value("Critical")
38 l:value("Error")
39 l:value("Warning")
40 l:value("Notice")
41 l:value("Connect")
42 l:value("Info")
43
44 s:option(DynamicList, "XTinyproxy").optional = true
45
46 s:option(DynamicList, "Allow")
47 s:option(Value, "ViaProxyName")
48
49 s:option(FileUpload, "Filter")
50 s:option(Flag, "FilterURLs")
51 s:option(Flag, "FilterExtended")
52 s:option(Flag, "FilterCaseSensitive")
53 s:option(Flag, "FilterDefaultDeny")
54
55 s:option(DynamicList, "Anonymous")
56 s:option(DynamicList, "ConnectPort")
57
58 s:option(Value, "User").optional = true
59 s:option(Value, "Group").optional = true
60 s:option(Value, "MaxClients").optional = true
61 s:option(Value, "MinSpareServers").optional = true
62 s:option(Value, "MaxSpareServers").optional = true
63 s:option(Value, "StartServers").optional = true
64 s:option(Value, "MaxRequestsPerChild").optional = true
65
66
67 s = m:section(TypedSection, "upstream")
68 s.anonymous = true
69 s.addremove = true
70
71 t = s:option(ListValue, "type")
72 t:value("proxy", translate("tinyproxy_type_proxy"))
73 t:value("reject", translate("tinyproxy_type_reject"))
74
75 ta = s:option(Value, "target")
76 ta.rmempty = true
77
78 v = s:option(Value, "via")
79 v:depends({type="proxy"})
80
81 return m