diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/ffluci | 5 | ||||
-rw-r--r-- | contrib/ffluci-flash | 88 | ||||
-rwxr-xr-x | contrib/ffluci-upload | 4 | ||||
-rwxr-xr-x | contrib/index.cgi | 3 | ||||
-rw-r--r-- | contrib/index.html | 10 | ||||
-rw-r--r-- | contrib/init.d/luci_fw | 121 | ||||
-rw-r--r-- | contrib/media/cascade.css | 256 | ||||
-rw-r--r-- | contrib/media/cbi.js | 36 | ||||
-rw-r--r-- | contrib/media/css/public_index.css | 3 | ||||
-rw-r--r-- | contrib/media/logo.png | bin | 4002 -> 0 bytes | |||
-rw-r--r-- | contrib/package/ffluci/Makefile | 37 | ||||
-rw-r--r-- | contrib/uci/luci | 35 | ||||
-rw-r--r-- | contrib/uci/luci_fw | 2 |
13 files changed, 23 insertions, 577 deletions
diff --git a/contrib/ffluci b/contrib/ffluci deleted file mode 100755 index e090d560cd..0000000000 --- a/contrib/ffluci +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/haserl --shell=luac -package.path = "/usr/lib/lua/?.lua;/usr/lib/lua/?/init.lua;" .. package.path -package.cpath = "/usr/lib/lua/?.so;" .. package.cpath -require("ffluci").dispatch() - diff --git a/contrib/ffluci-flash b/contrib/ffluci-flash deleted file mode 100644 index 3ff478f0f5..0000000000 --- a/contrib/ffluci-flash +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -. /etc/functions.sh - -# initialize defaults -RAMFS_COPY_BIN="" # extra programs for temporary ramfs root -RAMFS_COPY_DATA="" # extra data files -export KEEP_PATTERN="" -export VERBOSE=1 - -# parse options -while [ -n "$1" ]; do - case "$1" in - -k) - shift - export KEEP_PATTERN="$1" - ;; - -*) - echo "Invalid option: $1" - exit 1 - ;; - *) break;; - esac - shift; -done - -export CONFFILES=/tmp/sysupgrade.conffiles -export CONF_TAR=/tmp/sysupgrade.tgz - -[ -f $CONFFILES ] && rm $CONFFILES -[ -f $CONF_TAR ] && rm $CONF_TAR - -export ARGV="$*" -export ARGC="$#" - -[ -z "$ARGV" ] && { - cat <<EOF -Usage: $0 [options] <image file or URL> - -Options: - -k <"file 1, file 2, ..."> Files to be kept -EOF - exit 1 -} - -add_pattern_conffiles() { - local file="$1" - find $KEEP_PATTERN >> "$file" 2>/dev/null - return 0 -} - -# hooks -sysupgrade_image_check="platform_check_image" -sysupgrade_init_conffiles="" - -[ -n "$KEEP_PATTERN" ] && append sysupgrade_init_conffiles "add_pattern_conffiles" - -include /lib/upgrade - -do_save_conffiles() { - [ -z "$(rootfs_type)" ] && { - echo "Cannot save config while running from ramdisk." - exit 3 - return 0 - } - run_hooks "$CONFFILES" $sysupgrade_init_conffiles - - v "Saving config files..." - [ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V="" - tar c${TAR_V}zf "$CONF_TAR" -T "$CONFFILES" 2>/dev/null -} - -type platform_check_image >/dev/null 2>/dev/null || { - echo "Firmware upgrade is not implemented for this platform." - exit 1 -} - -for check in $sysupgrade_image_check; do - ( eval "$check \"\$ARGV\"" ) || { - echo "Image check '$check' failed." - exit 2 - } -done - -[ -n "$sysupgrade_init_conffiles" ] && do_save_conffiles -run_hooks "" $sysupgrade_pre_upgrade - -v "Switching to ramdisk..." -run_ramfs '. /etc/functions.sh; include /lib/upgrade; do_upgrade'
\ No newline at end of file diff --git a/contrib/ffluci-upload b/contrib/ffluci-upload deleted file mode 100755 index 0128c2dd73..0000000000 --- a/contrib/ffluci-upload +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/haserl --shell=luac --upload-limit=6144 --- This is a bit hacky: remove -upload from SCRIPT_NAME -ENV.SCRIPT_NAME = ENV.SCRIPT_NAME:sub(1, #ENV.SCRIPT_NAME - 7) -dofile("ffluci")
\ No newline at end of file diff --git a/contrib/index.cgi b/contrib/index.cgi deleted file mode 100755 index c9c98b0b29..0000000000 --- a/contrib/index.cgi +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/haserl --shell=luac -print("Status: 302 Found") -print("Location: ffluci/admin\n") diff --git a/contrib/index.html b/contrib/index.html deleted file mode 100644 index 58387a5fec..0000000000 --- a/contrib/index.html +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="refresh" content="0; URL=/cgi-bin/index.cgi" /> -</head> -<body style="background-color: black"> -<a style="color: white; text-decoration: none" href="/cgi-bin/index.cgi">FFLuCI - Freifunk Lua Configuration Interface</a> -</body> -</html>
\ No newline at end of file diff --git a/contrib/init.d/luci_fw b/contrib/init.d/luci_fw deleted file mode 100644 index 880c87dbe3..0000000000 --- a/contrib/init.d/luci_fw +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh /etc/rc.common -START=46 - -apply_portfw() { - local cfg="$1" - config_get proto "$cfg" proto - config_get dport "$cfg" dport - config_get iface "$cfg" iface - config_get to "$cfg" to - - ports=$(echo $to | cut -sd: -f2) - if [ -n "$ports" ]; then - ports="--dport $(echo $ports | sed -e 's/-/:/')" - else - ports="--dport $dport" - fi - - ip=$(echo $to | cut -d: -f1) - - if ([ "$proto" == "tcpudp" ] || [ "$proto" == "tcp" ]); then - iptables -t nat -A luci_prerouting -i "$iface" -p tcp --dport "$dport" -j DNAT --to "$to" - iptables -A luci_forward -i "$iface" -p tcp -d "$ip" $ports -j ACCEPT - fi - - if ([ "$proto" == "tcpudp" ] || [ "$proto" == "udp" ]); then - iptables -t nat -A luci_prerouting -i "$iface" -p udp --dport "$dport" -j DNAT --to "$to" - iptables -A luci_forward -i "$iface" -p udp -d "$ip" $ports -j ACCEPT - fi -} - -apply_rule() { - local cfg="$1" - local cmd="" - - config_get chain "$cfg" chain - [ -n "$chain" ] || return 0 - [ "$chain" == "forward" ] && cmd="$cmd -A luci_forward" - [ "$chain" == "input" ] && cmd="$cmd -A luci_input" - [ "$chain" == "output" ] && cmd="$cmd -A luci_output" - [ "$chain" == "prerouting" ] && cmd="$cmd -t nat -A luci_prerouting" - [ "$chain" == "postrouting" ] && cmd="$cmd -t nat -A luci_postrouting" - - config_get iface "$cfg" iface - [ -n "$iface" ] && cmd="$cmd -i $iface" - - config_get oface "$cfg" oface - [ -n "$oface" ] && cmd="$cmd -o $oface" - - config_get proto "$cfg" proto - [ -n "$proto" ] && cmd="$cmd -p $proto" - - config_get source "$cfg" source - [ -n "$source" ] && cmd="$cmd -s $source" - - config_get destination "$cfg" destination - [ -n "$destination" ] && cmd="$cmd -d $destination" - - config_get sport "$cfg" sport - [ -n "$sport" ] && cmd="$cmd --sport $sport" - - config_get dport "$cfg" dport - [ -n "$dport" ] && cmd="$cmd --dport $dport" - - config_get todest "$cfg" todest - [ -n "$todest" ] && cmd="$cmd --to-destination $todest" - - config_get tosrc "$cfg" tosrc - [ -n "$tosrc" ] && cmd="$cmd --to-source $tosrc" - - config_get jump "$cfg" jump - [ -n "$jump" ] && cmd="$cmd -j $jump" - - config_get command "$cfg" command - [ -n "$command" ] && cmd="$cmd $command" - - iptables $cmd -} - -start() { - ### Create subchains - iptables -N luci_input - iptables -N luci_output - iptables -N luci_forward - iptables -t nat -N luci_prerouting - iptables -t nat -N luci_postrouting - - ### Hook in the chains - iptables -A input_rule -j luci_input - iptables -A output_rule -j luci_output - iptables -A forwarding_rule -j luci_forward - iptables -t nat -A prerouting_rule -j luci_prerouting - iptables -t nat -A postrouting_rule -j luci_postrouting - - ### Read chains from config - config_load luci_fw - config_foreach apply_portfw portfw - config_foreach apply_rule rule -} - -stop() { - ### Hook out the chains - iptables -D input_rule -j luci_input - iptables -D output_rule -j luci_output - iptables -D forwarding_rule -j luci_forward - iptables -t nat -D prerouting_rule -j luci_prerouting - iptables -t nat -D postrouting_rule -j luci_postrouting - - ### Clear subchains - iptables -F luci_input - iptables -F luci_output - iptables -F luci_forward - iptables -t nat -F luci_prerouting - iptables -t nat -F luci_postrouting - - ### Delete subchains - iptables -X luci_input - iptables -X luci_output - iptables -X luci_forward - iptables -t nat -X luci_prerouting - iptables -t nat -X luci_postrouting -} diff --git a/contrib/media/cascade.css b/contrib/media/cascade.css deleted file mode 100644 index d09ab7477c..0000000000 --- a/contrib/media/cascade.css +++ /dev/null @@ -1,256 +0,0 @@ -@charset "utf-8"; - -body { - font-family: Verdana, Arial, sans-serif; - background-color: #aaaaaa; -} - -h1 { - margin: 0%; - font-size: 1.4em; - font-weight: bold; - margin-bottom: 0.5em; -} - -h2 { - margin: 0%; - font-size: 1.2em; - font-weight: bold; -} - -h3 { - margin: 0%; -} - -#header { - padding: 0.2em; - height: 4.5em; - background-color: #262626; -} - -#columns { - border-left: 10.1em solid #262626; - border-right: 10.1em solid #262626; - display: block; - background-color: white; - padding: 0.1em; -} - -#columnswrapper { - display: block; - margin-left: -10em; - margin-right: -10em; -} - -#content { - margin-left: 14em; - margin-right: 14em; - display: block; - position: relative; - padding: 2px; - font-size: 0.8em; -} - -.headerlogo { - height: 4em; - padding: 5px; -} - -.headerlogo img { - height: 100%; -} - -.headertitle { - font-size: 2.4em; - color: gray; - letter-spacing: 0.5em; - text-transform: lowercase; -} - -.separator { - padding-left: 0.25em; - font-weight: bold; - font-size: 0.8em; - line-height: 1.4em; -} - -.whitetext { - color: white; -} - -.yellowtext { - color: #ffcb05; -} - -.magentatext { - color: #dc0065; -} - -.inheritcolor { - color: inherit; -} - -.smalltext { - font-size: 0.8em; -} - -.yellow { - background-color: #ffcb05; -} - -.magenta { - background-color: #dc0065; -} - -.nodeco { - text-decoration: none; -} - -.redhover:hover { - color: red; -} - -.bold { - font-weight: bold; -} - -.sidebar { - position: relative; - padding: 0.25em; - color: gray; - width: 9em; - font-weight: bold; -} - -.separator a, .sidebar a { - color: inherit; - text-decoration: inherit; -} - -.separator a:hover, .sidebar a:hover { - color: red; -} - -.sidebar div { - padding-bottom: 0.5em; -} - -.sidebar ul { - font-size: 0.8em; - color: white; - list-style-type: none; - padding-left: 1em; - margin-top: 0%; -} - -.left { - float: left; - text-align: left; -} - -.right { - float: right; - text-align: right; -} - -.clear { - clear: both; -} - -.hidden { - display: none; -} - -.inline { - display: inline; -} - -.code { - background: #f7f7f7; - border: 1px solid #d7d7d7; - margin: 1em 1.75em; - padding: 1em; -} - -code { - display: block; - background: #f7f7f7; - border: 1px solid #d7d7d7; - margin: 1em 1.75em; - padding: 1em; - overflow: auto; - white-space: pre; -} - -.cbi-section { - margin-top: 1em; -} - -.cbi-section-remove { - text-align: right; -} - -.cbi-value-title { - line-height: 1.75em; - width: 15em; - font-weight: bold; -} - -.cbi-value-field { - text-align: left; - line-height: 1.75em; -} - -.cbi-value-field input, .cbi-value-field select, -.cbi-optionals select, .cbi-optionals input, -.cbi-section-remove input, .cbi-section-create input { - font-size: 0.8em; - margin: 0%; -} - -.cbi-value-description { - font-style: italic; - font-size: 0.8em; - margin-bottom: 0.5em; -} - -.cbi-form-separator { - margin-top: 1em; -} - -.cbi-section-node { - display: block; - background: #f7f7f7; - border: 1px solid #d7d7d7; - overflow: auto; - margn-bottom: 0%; -} - -.cbi-section-node h3 { - margin-bottom: 0.5em; -} - -.cbi-error { - color: red; - font-weight: bold; - font-size: 0.8em; - margin-bottom: 0.75em; -} - -.cbi-optionals { - margin-top: 1em; -} - -.cbi-optionals option { - font-size: 0.8em; -} - -.error { - color: red; - font-weight: bold; -} - -.ok { - color: green; - font-weight: bold; -}
\ No newline at end of file diff --git a/contrib/media/cbi.js b/contrib/media/cbi.js deleted file mode 100644 index f9e463bca1..0000000000 --- a/contrib/media/cbi.js +++ /dev/null @@ -1,36 +0,0 @@ -var cbi_d = {}; - -function cbi_d_add(field, target, value) { - if (!cbi_d[target]) { - cbi_d[target] = {}; - } - if (!cbi_d[target][value]) { - cbi_d[target][value] = []; - } - cbi_d[target][value].push(field); -} - -function cbi_d_update(target) { - if (!cbi_d[target]) { - return; - } - - for (var x in cbi_d[target]) { - for (var i=0; i<cbi_d[target][x].length; i++) { - document.getElementById(cbi_d[target][x][i]).style.display = "none"; - } - } - - var t = document.getElementById(target); - if (t && t.value && cbi_d[target][t.value]) { - for (var i=0; i<cbi_d[target][t.value].length; i++) { - document.getElementById(cbi_d[target][t.value][i]).style.display = "block"; - } - } -} - -function cbi_d_init() { - for (var x in cbi_d) { - cbi_d_update(x); - } -}
\ No newline at end of file diff --git a/contrib/media/css/public_index.css b/contrib/media/css/public_index.css deleted file mode 100644 index a415537a64..0000000000 --- a/contrib/media/css/public_index.css +++ /dev/null @@ -1,3 +0,0 @@ -.contact th { - text-align: left; -}
\ No newline at end of file diff --git a/contrib/media/logo.png b/contrib/media/logo.png Binary files differdeleted file mode 100644 index d4c5dd9a3f..0000000000 --- a/contrib/media/logo.png +++ /dev/null diff --git a/contrib/package/ffluci/Makefile b/contrib/package/ffluci/Makefile index ba11dea3aa..f9e132a40b 100644 --- a/contrib/package/ffluci/Makefile +++ b/contrib/package/ffluci/Makefile @@ -15,7 +15,7 @@ PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install -MAKE_ACTION:=dist-compile LUAC=$(BUILD_DIR_HOST)/lua-luci/luac +MAKE_ACTION:=compile LUAC=$(BUILD_DIR_HOST)/lua-luci/luac include $(INCLUDE_DIR)/package.mk @@ -31,29 +31,38 @@ define Build/Configure endef define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ACTION) + $(MAKE) -C $(PKG_BUILD_DIR)/core $(MAKE_ACTION) + $(MAKE) -C $(PKG_BUILD_DIR)/module/admin-core $(MAKE_ACTION) + $(MAKE) -C $(PKG_BUILD_DIR)/module/public-core $(MAKE_ACTION) endef define Package/ffluci/install - $(INSTALL_DIR) $(1)/usr/lib/lua + $(INSTALL_DIR) $(1)/usr/lib/lua/ffluci $(INSTALL_DIR) $(1)/www/cgi-bin $(INSTALL_DIR) $(1)/www/ffluci $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/init.d/luci_fw $(1)/etc/init.d/luci_fw - $(CP) $(PKG_BUILD_DIR)/dist/* $(1)/usr/lib/lua/ -R - $(CP) $(PKG_BUILD_DIR)/contrib/media $(1)/www/ffluci/ -R - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/ffluci $(1)/www/cgi-bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/ffluci-upload $(1)/www/cgi-bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/index.cgi $(1)/www/cgi-bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/index.html $(1)/www - $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/ffluci-flash $(1)/sbin - $(CP) $(PKG_BUILD_DIR)/contrib/uci/luci $(1)/etc/config/luci - $(CP) $(PKG_BUILD_DIR)/contrib/uci/luci_fw $(1)/etc/config/luci_fw + + $(CP) $(PKG_BUILD_DIR)/core/dist/* $(1)/usr/lib/lua/ -R + $(CP) $(PKG_BUILD_DIR)/core/contrib/media $(1)/www/ffluci/ -R + $(CP) $(PKG_BUILD_DIR)/core/contrib/uci/luci $(1)/etc/config/luci + $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/ffluci $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/ffluci-upload $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/index.cgi $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/core/contrib/index.html $(1)/www + + $(CP) $(PKG_BUILD_DIR)/module/admin-core/dist/* $(1)/usr/lib/lua/ffluci/ -R + $(CP) $(PKG_BUILD_DIR)/module/admin-core/contrib/uci/luci_fw $(1)/etc/config/luci_fw + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/admin-core/contrib/init.d/luci_fw $(1)/etc/init.d/luci_fw + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/admin-core/contrib/ffluci-flash $(1)/sbin + + $(CP) $(PKG_BUILD_DIR)/module/public-core/dist/* $(1)/usr/lib/lua/ffluci/ -R + $(CP) $(PKG_BUILD_DIR)/module/public-core/contrib/media $(1)/www/ffluci/ -R + $(CP) -a ./ipkg/ffluci.postinst $(1)/CONTROL/postinst $(CP) -a ./ipkg/conffiles $(1)/CONTROL/conffiles rm $(DL_DIR)/$(PKG_SOURCE) endef -$(eval $(call BuildPackage,ffluci)) +$(eval $(call BuildPackage,ffluci))
\ No newline at end of file diff --git a/contrib/uci/luci b/contrib/uci/luci deleted file mode 100644 index bae2f48ce2..0000000000 --- a/contrib/uci/luci +++ /dev/null @@ -1,35 +0,0 @@ -config core main - option lang de - option mediaurlbase /ffluci/media - -config core category_privileges - option public nobody:nogroup - -config extern flash_keep - option uci "/etc/config" - option dropbear "/etc/dropbear" - option openvpn "/etc/openvpn" - option passwd "/etc/passwd" - option ipkg "/etc/ipkg.conf" - option httpd "/etc/httpd.conf" - option firewall "/etc/firewall.user" - -config public contact - option nickname - option name - option mail - option phone - option location - option geo - option note - - -config event uci_oncommit - option network "/etc/init.d/network restart" - option wireless "/etc/init.d/network restart" - option olsrd "/etc/init.d/olsrd restart" - option dhcp "/etc/init.d/dnsmasq restart" - option luci_fw "/etc/init.d/luci_fw restart" - option dropbear "/etc/init.d/dropbear restart" - option httpd "/etc/init.d/httpd restart" - option fstab "/etc/init.d/fstab restart"
\ No newline at end of file diff --git a/contrib/uci/luci_fw b/contrib/uci/luci_fw deleted file mode 100644 index c7dec7f2c5..0000000000 --- a/contrib/uci/luci_fw +++ /dev/null @@ -1,2 +0,0 @@ - -
\ No newline at end of file |