a18eb50da99d31c66c0be9aaef21a7ccc7435cc7
[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
34 l = s:option(ListValue, "LogLevel")
35 l.optional = true
36 l:value("Critical")
37 l:value("Error")
38 l:value("Warning")
39 l:value("Notice")
40 l:value("Connect")
41 l:value("Info")
42
43 s:option(DynamicList, "XTinyproxy").optional = true
44
45 s:option(DynamicList, "Allow")
46 s:option(Value, "ViaProxyName")
47
48 s:option(FileUpload, "Filter")
49 s:option(Flag, "FilterURLs")
50 s:option(Flag, "FilterExtended")
51 s:option(Flag, "FilterCaseSensitive")
52 s:option(Flag, "FilterDefaultDeny")
53
54 s:option(DynamicList, "Anonymous")
55 s:option(DynamicList, "ConnectPort")
56
57 s:option(Value, "User").optional = true
58 s:option(Value, "Group").optional = true
59 s:option(Value, "MaxClients").optional = true
60 s:option(Value, "MinSpareServers").optional = true
61 s:option(Value, "MaxSpareServers").optional = true
62 s:option(Value, "StartServers").optional = true
63 s:option(Value, "MaxRequestsPerChild").optional = true
64
65
66 s = m:section(TypedSection, "upstream")
67 s.anonymous = true
68 s.addremove = true
69
70 t = s:option(ListValue, "type")
71 t:value("proxy", translate("tinyproxy_type_proxy"))
72 t:value("reject", translate("tinyproxy_type_reject"))
73
74 ta = s:option(Value, "target")
75 ta.rmempty = true
76
77 v = s:option(Value, "via")
78 v:depends({type="proxy"})
79
80 return m