From f7deae100d6d36c1e8d6fef17316ca03aaf7214c Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 26 May 2009 17:44:02 +0000 Subject: [PATCH] LuCId --- .../luci-splash/root/etc/cron.minutely/luci_splash | 2 -- .../luci-splash/root/etc/init.d/luci_splash | 23 ++++++++---- applications/luci-splash/root/usr/bin/luci-splashd | 29 --------------- contrib/package/luci/Makefile | 41 ++++++++++------------ libs/lucid/root/etc/config/lucid | 29 +++------------ 5 files changed, 39 insertions(+), 85 deletions(-) delete mode 100755 applications/luci-splash/root/etc/cron.minutely/luci_splash delete mode 100755 applications/luci-splash/root/usr/bin/luci-splashd diff --git a/applications/luci-splash/root/etc/cron.minutely/luci_splash b/applications/luci-splash/root/etc/cron.minutely/luci_splash deleted file mode 100755 index eae429474..000000000 --- a/applications/luci-splash/root/etc/cron.minutely/luci_splash +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -[ "$(date +%M | cut -c2)" == "5" ] && luci-splash sync \ No newline at end of file diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index b6eaf325a..31ffb783a 100755 --- a/applications/luci-splash/root/etc/init.d/luci_splash +++ b/applications/luci-splash/root/etc/init.d/luci_splash @@ -47,6 +47,23 @@ whitelist_add() { boot() { ### We are started by the firewall include + + uci get lucid.splashr || { +uci batch <> /etc/crontabs/root } - - ### Start the splash httpd - start-stop-daemon -S -m -p /var/run/luci-splashd.pid -b -q -x /usr/bin/luci-splashd } stop() { @@ -101,9 +115,6 @@ stop() { iptables -t nat -X luci_splash_leases iptables -t nat -X luci_splash_portal iptables -t nat -X luci_splash_prerouting - - ### Stop the splash httpd - start-stop-daemon -K -p /var/run/luci-splashd.pid -s KILL -q sed -ie '/\/usr\/sbin\/luci-splash sync/d' /var/spool/cron/crontabs/root } diff --git a/applications/luci-splash/root/usr/bin/luci-splashd b/applications/luci-splash/root/usr/bin/luci-splashd deleted file mode 100755 index a4f11c3bf..000000000 --- a/applications/luci-splash/root/usr/bin/luci-splashd +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/lua - -local nixio = require "nixio", require "nixio.util" -local server = nixio.bind(nil, arg[1] or 8082) -local stat = server:listen(32) - -local function remapipv6(adr) - local map = "::ffff:" - if adr:sub(1, #map) == map then - return adr:sub(#map+1) - else - return adr - end -end - -while stat do - local client = server:accept() - - if client then - client:setopt("socket", "rcvtimeo", 1) - client:setopt("socket", "sndtimeo", 1) - local srv = remapipv6(client:getsockname()) - - client:read(1024) - client:writeall("HTTP/1.1 302 Found\r\nLocation: http://" .. srv .. - (arg[2] or "/luci/splash") .. "\r\nContent-Length: 0\r\nConnection: close\r\n\r\n") - client:close() - end -end diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index a1b5955c6..c2f7fa621 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -231,6 +231,18 @@ define Package/luci-luanet/install endef +define Package/luci-lucid + $(call Package/luci/libtemplate) + TITLE:=LuCId Superserver + DEPENDS+=+luci-nixio +luci-http +endef + +define Package/luci-lucid/install + $(call Package/luci/install/template,$(1),libs/lucid) + $(call Package/luci/install/template,$(1),libs/lucid-http) +endef + + NIXIO_TLS:=axtls @@ -277,7 +289,7 @@ endef define Package/luci-web $(call Package/luci/libtemplate) - DEPENDS+=+luci-http +luci-sys +luci-uci +luci-sgi-cgi + DEPENDS+=+luci-http +luci-sys +luci-uci +luci-lucid TITLE:=MVC Webframework $(call Config,luci.main.lang,string,en,Default Language) endef @@ -322,7 +334,7 @@ endef define Package/luci-freifunk-community $(call Package/luci/fftemplate) DEPENDS+= \ - +luci-sgi-cgi +luci-app-splash \ + +luci-lucid +luci-app-splash \ +luci-app-ffwizard-leipzig \ +luci-i18n-german \ +PACKAGE_luci-freifunk-community:olsrd-luci +PACKAGE_luci-freifunk-community:olsrd-luci-mod-dyn-gw-plain \ @@ -664,25 +676,6 @@ define Package/luci-sgi-cgi/install $(call Package/luci/install/template,$(1),libs/sgi-cgi) endef -define Package/luci-sgi-luci - $(call Package/luci/libtemplate) - DEPENDS+=+luci-httpd - TITLE:=SGI for LuCIttpd -endef - -define Package/luci-sgi-luci/install - $(call Package/luci/install/template,$(1),libs/sgi-luci) -endef - -define Package/luci-sgi-webuci - $(call Package/luci/libtemplate) - TITLE:=SGI for Webuci -endef - -define Package/luci-sgi-webuci/install - $(call Package/luci/install/template,$(1),libs/sgi-webuci) -endef - ### Themes ### define Package/luci-theme-base $(call Package/luci/thtemplate) @@ -863,6 +856,9 @@ endif ifneq ($(CONFIG_PACKAGE_luci-luanet),) PKG_SELECTED_MODULES+=libs/luanet endif +ifneq ($(CONFIG_PACKAGE_luci-lucid),) + PKG_SELECTED_MODULES+=libs/lucid libs/lucid-http +endif ifneq ($(CONFIG_PACKAGE_luci-nixio),) PKG_SELECTED_MODULES+=libs/nixio endif @@ -1046,6 +1042,7 @@ $(eval $(call BuildPackage,luci-httpclient)) $(eval $(call BuildPackage,luci-ipkg)) $(eval $(call BuildPackage,luci-json)) $(eval $(call BuildPackage,luci-luanet)) +$(eval $(call BuildPackage,luci-lucid)) $(eval $(call BuildPackage,luci-nixio)) $(eval $(call BuildPackage,luci-uci)) $(eval $(call BuildPackage,luci-sys)) @@ -1086,8 +1083,6 @@ $(eval $(call BuildPackage,luci-app-polipo)) $(eval $(call BuildPackage,luci-app-openvpn)) $(eval $(call BuildPackage,luci-sgi-cgi)) -$(eval $(call BuildPackage,luci-sgi-luci)) -$(eval $(call BuildPackage,luci-sgi-webuci)) $(eval $(call BuildPackage,luci-theme-base)) $(eval $(call BuildPackage,luci-theme-fledermaus)) diff --git a/libs/lucid/root/etc/config/lucid b/libs/lucid/root/etc/config/lucid index dda68d901..bfbb4ca1d 100644 --- a/libs/lucid/root/etc/config/lucid +++ b/libs/lucid/root/etc/config/lucid @@ -2,7 +2,7 @@ config lucid main option pollinterval 15000 option threadlimit 25 option daemon 1 - option debug 1 + option debug 0 list supports tcpserver list supports server @@ -11,51 +11,30 @@ config DirectoryPublisher webroot option physical /www option virtual / option domain '' - list read ':lo' - list read ':br-lan' - list read 'root' config LuciWebPublisher luciweb option name 'LuCI Webapplication' option physical '' list virtual /luci + list virtual /cgi-bin/luci option domain '' - list exec ':lo' - list exec ':br-lan' - list exec 'root' - -config RPCPublisher mainrpc - option namespace 'luci.lucid.rpc' - list export system - list exec ':lo' - list exec 'root' config tcpserver httpd option entrypoint "luci.lucid.http" list supports DirectoryPublisher list supports LuciWebPublisher - -config tcpserver rpcd - option entrypoint "luci.lucid.rpc" - list supports RPCPublisher config daemon http option slave httpd - list address 8080 + list address 80 list publisher webroot list publisher luciweb option enabled 1 config daemon https option slave httpd - list address 4443 + list address 443 list publisher webroot list publisher luciweb option enabled 1 option encryption enable - -config daemon rpc - option slave rpcd - list address 12900 - list publisher mainrpc - option enabled 1 \ No newline at end of file -- 2.11.0