diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-12-03 15:17:05 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-08 16:26:20 +0100 |
commit | 1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch) | |
tree | 35e16f100466e4e00657199b38bb3d87d52bf73f /applications/luci-polipo | |
parent | 9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff) |
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names
* Make each LuCI module its own standalone package
* Deploy a shared luci.mk which is used by each module Makefile
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'applications/luci-polipo')
-rw-r--r-- | applications/luci-polipo/Makefile | 4 | ||||
-rwxr-xr-x | applications/luci-polipo/ipkg/postinst | 6 | ||||
-rw-r--r-- | applications/luci-polipo/luasrc/controller/polipo.lua | 26 | ||||
-rw-r--r-- | applications/luci-polipo/luasrc/model/cbi/polipo.lua | 188 | ||||
-rw-r--r-- | applications/luci-polipo/luasrc/view/polipo_status.htm | 18 | ||||
-rwxr-xr-x | applications/luci-polipo/root/etc/uci-defaults/luci-polipo | 11 | ||||
-rwxr-xr-x | applications/luci-polipo/root/usr/sbin/polipo_purge | 18 |
7 files changed, 0 insertions, 271 deletions
diff --git a/applications/luci-polipo/Makefile b/applications/luci-polipo/Makefile deleted file mode 100644 index 4f5743f443..0000000000 --- a/applications/luci-polipo/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -PO = polipo - -include ../../build/config.mk -include ../../build/module.mk diff --git a/applications/luci-polipo/ipkg/postinst b/applications/luci-polipo/ipkg/postinst deleted file mode 100755 index 0e23e2a4ae..0000000000 --- a/applications/luci-polipo/ipkg/postinst +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -[ -n "${IPKG_INSTROOT}" ] || { - ( . /etc/uci-defaults/luci-polipo ) && rm -f /etc/uci-defaults/luci-polipo - /etc/init.d/polipo enabled || /etc/init.d/polipo enable - exit 0 -} diff --git a/applications/luci-polipo/luasrc/controller/polipo.lua b/applications/luci-polipo/luasrc/controller/polipo.lua deleted file mode 100644 index 1113f8f267..0000000000 --- a/applications/luci-polipo/luasrc/controller/polipo.lua +++ /dev/null @@ -1,26 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Aleksandar Krsteski <alekrsteski@gmail.com> - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - -module("luci.controller.polipo", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/polipo") then - return - end - - entry({"admin", "services", "polipo"}, alias("admin", "services", "polipo", "config"), _("Polipo")) - entry({"admin", "services", "polipo", "status"}, template("polipo_status"), _("Status")) - entry({"admin", "services", "polipo", "config"}, cbi("polipo"), _("Configuration")) -end - diff --git a/applications/luci-polipo/luasrc/model/cbi/polipo.lua b/applications/luci-polipo/luasrc/model/cbi/polipo.lua deleted file mode 100644 index 6dc35d581a..0000000000 --- a/applications/luci-polipo/luasrc/model/cbi/polipo.lua +++ /dev/null @@ -1,188 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Aleksandar Krsteski <alekrsteski@gmail.com> - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - -m = Map("polipo", translate("Polipo"), - translate("Polipo is a small and fast caching web proxy.")) - --- General section -s = m:section(NamedSection, "general", "polipo", translate("Proxy")) - -s:tab("general", translate("General Settings")) -s:tab("dns", translate("DNS and Query Settings")) -s:tab("proxy", translate("Parent Proxy")) -s:tab("logging", translate("Logging and RAM")) - --- General settings -s:taboption("general", Flag, "enabled", translate("enable")) - -o = s:taboption("general", Value, "proxyAddress", translate("Listen address"), - translate("The interface on which Polipo will listen. To listen on all " .. - "interfaces use 0.0.0.0 or :: (IPv6).")) - -o.placeholder = "0.0.0.0" -o.datatype = "ipaddr" - - -o = s:taboption("general", Value, "proxyPort", translate("Listen port"), - translate("Port on which Polipo will listen")) - -o.optional = true -o.placeholder = "8123" -o.datatype = "port" - - -o = s:taboption("general", DynamicList, "allowedClients", - translate("Allowed clients"), - translate("When listen address is set to 0.0.0.0 or :: (IPv6), you must " .. - "list clients that are allowed to connect. The format is IP address " .. - "or network address (192.168.1.123, 192.168.1.0/24, " .. - "2001:660:116::/48 (IPv6))")) - -o.datatype = "ipaddr" -o.placeholder = "0.0.0.0/0" - - --- DNS settings -dns = s:taboption("dns", Value, "dnsNameServer", translate("DNS server address"), - translate("Set the DNS server address to use, if you want Polipo to use " .. - "different DNS server than the host system.")) - -dns.optional = true -dns.datatype = "ipaddr" - -l = s:taboption("dns", ListValue, "dnsQueryIPv6", - translate("Query DNS for IPv6")) - -l.default = "happily" -l:value("true", translate("Query only IPv6")) -l:value("happily", translate("Query IPv4 and IPv6, prefer IPv6")) -l:value("reluctantly", translate("Query IPv4 and IPv6, prefer IPv4")) -l:value("false", translate("Do not query IPv6")) - - -l = s:taboption("dns", ListValue, "dnsUseGethostbyname", - translate("Query DNS by hostname")) - -l.default = "reluctantly" -l:value("true", translate("Always use system DNS resolver")) -l:value("happily", - translate("Query DNS directly, for unknown hosts fall back " .. - "to system resolver")) -l:value("reluctantly", - translate("Query DNS directly, fallback to system resolver")) -l:value("false", translate("Never use system DNS resolver")) - - --- Proxy settings -o = s:taboption("proxy", Value, "parentProxy", - translate("Parent proxy address"), - translate("Parent proxy address (in host:port format), to which Polipo " .. - "will forward the requests.")) - -o.optional = true -o.datatype = "ipaddr" - - -o = s:taboption("proxy", Value, "parentAuthCredentials", - translate("Parent proxy authentication"), - translate("Basic HTTP authentication supported. Provide username and " .. - "password in username:password format.")) - -o.optional = true -o.placeholder = "username:password" - - --- Logging -s:taboption("logging", Flag, "logSyslog", translate("Log to syslog")) - -s:taboption("logging", Value, "logFacility", - translate("Syslog facility")):depends("logSyslog", "1") - - -v = s:taboption("logging", Value, "logFile", - translate("Log file location"), - translate("Use of external storage device is recommended, because the " .. - "log file is written frequently and can grow considerably.")) - -v:depends("logSyslog", "") -v.rmempty = true - - -o = s:taboption("logging", Value, "chunkHighMark", - translate("In RAM cache size (in bytes)"), - translate("How much RAM should Polipo use for its cache.")) - -o.datatype = "uinteger" - - --- Disk cache section -s = m:section(NamedSection, "cache", "polipo", translate("On-Disk Cache")) -s:tab("general", translate("General Settings")) -s:tab("advanced", translate("Advanced Settings")) - - --- Disk cache settings -s:taboption("general", Value, "diskCacheRoot", translate("Disk cache location"), - translate("Location where polipo will cache files permanently. Use of " .. - "external storage devices is recommended, because the cache can " .. - "grow considerably. Leave it empty to disable on-disk " .. - "cache.")).rmempty = true - - -s:taboption("general", Flag, "cacheIsShared", translate("Shared cache"), - translate("Enable if cache (proxy) is shared by multiple users.")) - - -o = s:taboption("advanced", Value, "diskCacheTruncateSize", - translate("Truncate cache files size (in bytes)"), - translate("Size to which cached files should be truncated")) - -o.optional = true -o.placeholder = "1048576" -o.datatype = "uinteger" - - -o = s:taboption("advanced", Value, "diskCacheTruncateTime", - translate("Truncate cache files time"), - translate("Time after which cached files will be truncated")) - -o.optional = true -o.placeholder = "4d12h" - - -o = s:taboption("advanced", Value, "diskCacheUnlinkTime", - translate("Delete cache files time"), - translate("Time after which cached files will be deleted")) - -o.optional = true -o.placeholder = "32d" - - --- Poor man's multiplexing section -s = m:section(NamedSection, "pmm", "polipo", - translate("Poor Man's Multiplexing"), - translate("Poor Man's Multiplexing (PMM) is a technique that simulates " .. - "multiplexing by requesting an instance in multiple segments. It " .. - "tries to lower the latency caused by the weakness of HTTP " .. - "protocol. NOTE: some sites may not work with PMM enabled.")) - -s:option(Value, "pmmSize", translate("PMM segments size (in bytes)"), - translate("To enable PMM, PMM segment size must be set to some " .. - "positive value.")).rmempty = true - -s:option(Value, "pmmFirstSize", translate("First PMM segment size (in bytes)"), - translate("Size of the first PMM segment. If not defined, it defaults " .. - "to twice the PMM segment size.")).rmempty = true - -return m diff --git a/applications/luci-polipo/luasrc/view/polipo_status.htm b/applications/luci-polipo/luasrc/view/polipo_status.htm deleted file mode 100644 index c2695ca82b..0000000000 --- a/applications/luci-polipo/luasrc/view/polipo_status.htm +++ /dev/null @@ -1,18 +0,0 @@ -<% - -local uci = require "luci.model.uci".cursor() -local addr = "127.0.0.1" -local port = uci:get("polipo", "general", "proxyPort") or "8123" - --%> - -<%+header%> - -<div class="cbi-map"> - <h2><a id="content" name="content"><%:Polipo Status%></a></h2> - <div class="cbi-section"> - <iframe id="sf" src="http://<%=luci.http.getenv('SERVER_NAME')%>:<%=port%>/polipo/" style="width:100%; height:350px; border:none"></iframe> - </div> -</div> - -<%+footer%> diff --git a/applications/luci-polipo/root/etc/uci-defaults/luci-polipo b/applications/luci-polipo/root/etc/uci-defaults/luci-polipo deleted file mode 100755 index 0c570630da..0000000000 --- a/applications/luci-polipo/root/etc/uci-defaults/luci-polipo +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@polipo[-1] - add ucitrack polipo - set ucitrack.@polipo[-1].init=polipo - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/applications/luci-polipo/root/usr/sbin/polipo_purge b/applications/luci-polipo/root/usr/sbin/polipo_purge deleted file mode 100755 index 23ba571927..0000000000 --- a/applications/luci-polipo/root/usr/sbin/polipo_purge +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -DAEMON=/usr/sbin/polipo -PIDFILE=`uci get polipo.daemon.pidFile` -CFGFILE=/var/etc/polipo.conf - -[ -e "$PIDFILE" ] && { - PID=`cat $PIDFILE` - - # send Polipo USR1 signal to write its in-memory cache to disk - kill -USR1 $PID - sleep 2 - # start polipo with -x flag to purge the on-disk cache - polipo -c $CFGFILE -x - # send Polipo USR2 signal to discard its in-memory cache - kill -USR2 $PID -} - |