* luci/applications: add polipo proxy support
[project/luci.git] / applications / luci-polipo / luasrc / model / cbi / polipo.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Aleksandar Krsteski <alekrsteski@gmail.com>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 m = Map("polipo")
15
16 -- General section
17 s = m:section(NamedSection, "general", "polipo")
18
19 -- General settings
20 s:option(Flag, "enabled", translate("enable"))
21 s:option(Value, "proxyAddress")
22 s:option(Value, "proxyPort").optional = true
23 s:option(DynamicList, "allowedClients")
24 s:option(Flag, "logSyslog")
25 s:option(Value, "logFacility"):depends("logSyslog", "1")
26 v = s:option(Value, "logFile")
27 v:depends("logSyslog", "")
28 v.rmempty = true
29 s:option(Value, "chunkHighMark")
30
31 -- DNS and proxy settings
32 s:option(Value, "dnsNameServer").optional = true
33 s:option(Value, "parentProxy").optional = true
34 s:option(Value, "parentAuthCredentials").optional = true
35 l = s:option(ListValue, "dnsQueryIPv6")
36 l.optional = true
37 l.default = "happily"
38 l:value("")
39 l:value("true")
40 l:value("reluctantly")
41 l:value("happily")
42 l:value("false")
43 l = s:option(ListValue, "dnsUseGethostbyname")
44 l.optional = true
45 l.default = "reluctantly"
46 l:value("")
47 l:value("true")
48 l:value("reluctantly")
49 l:value("happily")
50 l:value("false")
51
52 -- Dsik cache section
53 s = m:section(NamedSection, "cache", "polipo")
54
55 -- Dsik cache settings
56 s:option(Value, "diskCacheRoot").rmempty = true
57 s:option(Flag, "cacheIsShared")
58 s:option(Value, "diskCacheTruncateSize").optional = true
59 s:option(Value, "diskCacheTruncateTime").optional = true
60 s:option(Value, "diskCacheUnlinkTime").optional = true
61
62 -- Poor man's multiplexing section
63 s = m:section(NamedSection, "pmm", "polipo")
64 s:option(Value, "pmmSize").rmempty = true
65 s:option(Value, "pmmFirstSize").optional = true
66
67 return m