polipo.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. -- Copyright 2008 Aleksandar Krsteski <alekrsteski@gmail.com>
  2. -- Licensed to the public under the Apache License 2.0.
  3. m = Map("polipo", translate("Polipo"),
  4. translate("Polipo is a small and fast caching web proxy."))
  5. -- General section
  6. s = m:section(NamedSection, "general", "polipo", translate("Proxy"))
  7. s:tab("general", translate("General Settings"))
  8. s:tab("dns", translate("DNS and Query Settings"))
  9. s:tab("proxy", translate("Parent Proxy"))
  10. s:tab("logging", translate("Logging and RAM"))
  11. -- General settings
  12. s:taboption("general", Flag, "enabled", translate("enable"))
  13. o = s:taboption("general", Value, "proxyAddress", translate("Listen address"),
  14. translate("The interface on which Polipo will listen. To listen on all " ..
  15. "interfaces use 0.0.0.0 or :: (IPv6)."))
  16. o.placeholder = "0.0.0.0"
  17. o.datatype = "ipaddr"
  18. o = s:taboption("general", Value, "proxyPort", translate("Listen port"),
  19. translate("Port on which Polipo will listen"))
  20. o.optional = true
  21. o.placeholder = "8123"
  22. o.datatype = "port"
  23. o = s:taboption("general", DynamicList, "allowedClients",
  24. translate("Allowed clients"),
  25. translate("When listen address is set to 0.0.0.0 or :: (IPv6), you must " ..
  26. "list clients that are allowed to connect. The format is IP address " ..
  27. "or network address (192.168.1.123, 192.168.1.0/24, " ..
  28. "2001:660:116::/48 (IPv6))"))
  29. o.datatype = "ipaddr"
  30. o.placeholder = "0.0.0.0/0"
  31. -- DNS settings
  32. dns = s:taboption("dns", Value, "dnsNameServer", translate("DNS server address"),
  33. translate("Set the DNS server address to use, if you want Polipo to use " ..
  34. "different DNS server than the host system."))
  35. dns.optional = true
  36. dns.datatype = "ipaddr"
  37. l = s:taboption("dns", ListValue, "dnsQueryIPv6",
  38. translate("Query DNS for IPv6"))
  39. l.default = "happily"
  40. l:value("true", translate("Query only IPv6"))
  41. l:value("happily", translate("Query IPv4 and IPv6, prefer IPv6"))
  42. l:value("reluctantly", translate("Query IPv4 and IPv6, prefer IPv4"))
  43. l:value("false", translate("Do not query IPv6"))
  44. l = s:taboption("dns", ListValue, "dnsUseGethostbyname",
  45. translate("Query DNS by hostname"))
  46. l.default = "reluctantly"
  47. l:value("true", translate("Always use system DNS resolver"))
  48. l:value("happily",
  49. translate("Query DNS directly, for unknown hosts fall back " ..
  50. "to system resolver"))
  51. l:value("reluctantly",
  52. translate("Query DNS directly, fallback to system resolver"))
  53. l:value("false", translate("Never use system DNS resolver"))
  54. -- Proxy settings
  55. o = s:taboption("proxy", Value, "parentProxy",
  56. translate("Parent proxy address"),
  57. translate("Parent proxy address (in host:port format), to which Polipo " ..
  58. "will forward the requests."))
  59. o.optional = true
  60. o.datatype = "ipaddr"
  61. o = s:taboption("proxy", Value, "parentAuthCredentials",
  62. translate("Parent proxy authentication"),
  63. translate("Basic HTTP authentication supported. Provide username and " ..
  64. "password in username:password format."))
  65. o.optional = true
  66. o.placeholder = "username:password"
  67. -- Logging
  68. s:taboption("logging", Flag, "logSyslog", translate("Log to syslog"))
  69. s:taboption("logging", Value, "logFacility",
  70. translate("Syslog facility")):depends("logSyslog", "1")
  71. v = s:taboption("logging", Value, "logFile",
  72. translate("Log file location"),
  73. translate("Use of external storage device is recommended, because the " ..
  74. "log file is written frequently and can grow considerably."))
  75. v:depends("logSyslog", "")
  76. v.rmempty = true
  77. o = s:taboption("logging", Value, "chunkHighMark",
  78. translate("In RAM cache size (in bytes)"),
  79. translate("How much RAM should Polipo use for its cache."))
  80. o.datatype = "uinteger"
  81. -- Disk cache section
  82. s = m:section(NamedSection, "cache", "polipo", translate("On-Disk Cache"))
  83. s:tab("general", translate("General Settings"))
  84. s:tab("advanced", translate("Advanced Settings"))
  85. -- Disk cache settings
  86. s:taboption("general", Value, "diskCacheRoot", translate("Disk cache location"),
  87. translate("Location where polipo will cache files permanently. Use of " ..
  88. "external storage devices is recommended, because the cache can " ..
  89. "grow considerably. Leave it empty to disable on-disk " ..
  90. "cache.")).rmempty = true
  91. s:taboption("general", Flag, "cacheIsShared", translate("Shared cache"),
  92. translate("Enable if cache (proxy) is shared by multiple users."))
  93. o = s:taboption("advanced", Value, "diskCacheTruncateSize",
  94. translate("Truncate cache files size (in bytes)"),
  95. translate("Size to which cached files should be truncated"))
  96. o.optional = true
  97. o.placeholder = "1048576"
  98. o.datatype = "uinteger"
  99. o = s:taboption("advanced", Value, "diskCacheTruncateTime",
  100. translate("Truncate cache files time"),
  101. translate("Time after which cached files will be truncated"))
  102. o.optional = true
  103. o.placeholder = "4d12h"
  104. o = s:taboption("advanced", Value, "diskCacheUnlinkTime",
  105. translate("Delete cache files time"),
  106. translate("Time after which cached files will be deleted"))
  107. o.optional = true
  108. o.placeholder = "32d"
  109. -- Poor man's multiplexing section
  110. s = m:section(NamedSection, "pmm", "polipo",
  111. translate("Poor Man's Multiplexing"),
  112. translate("Poor Man's Multiplexing (PMM) is a technique that simulates " ..
  113. "multiplexing by requesting an instance in multiple segments. It " ..
  114. "tries to lower the latency caused by the weakness of HTTP " ..
  115. "protocol. NOTE: some sites may not work with PMM enabled."))
  116. s:option(Value, "pmmSize", translate("PMM segments size (in bytes)"),
  117. translate("To enable PMM, PMM segment size must be set to some " ..
  118. "positive value.")).rmempty = true
  119. s:option(Value, "pmmFirstSize", translate("First PMM segment size (in bytes)"),
  120. translate("Size of the first PMM segment. If not defined, it defaults " ..
  121. "to twice the PMM segment size.")).rmempty = true
  122. return m