From cd498aa924553422e64c4b56d2fb01e63a170bac Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 11 Apr 2008 18:13:58 +0000 Subject: [PATCH] * Major repository revision --- Makefile | 42 ---- contrib/ffluci-flash | 88 -------- contrib/init.d/luci_fw | 121 ----------- contrib/media/cascade.css | 256 ----------------------- contrib/media/cbi.js | 36 ---- contrib/media/css/public_index.css | 3 - contrib/media/logo.png | Bin 4002 -> 0 bytes contrib/package/ffluci/Makefile | 37 ++-- contrib/uci/luci_fw | 2 - core/Makefile | 37 ++++ {contrib => core/contrib}/uci/luci | 0 {contrib => core}/ffluci | 0 {contrib => core}/ffluci-upload | 0 {contrib => core}/index.cgi | 0 {contrib => core}/index.html | 0 {src => core/src}/ffluci/cbi.lua | 0 {src => core/src}/ffluci/config.lua | 0 {src => core/src}/ffluci/debug.lua | 0 {src => core/src}/ffluci/dispatcher.lua | 0 {src => core/src}/ffluci/fs.lua | 0 {src => core/src}/ffluci/http.lua | 0 {src => core/src}/ffluci/i18n.lua | 0 {src => core/src}/ffluci/i18n/cbi.en | 0 {src => core/src}/ffluci/init.lua | 0 {src => core/src}/ffluci/menu.lua | 0 {src => core/src}/ffluci/model/ipkg.lua | 0 {src => core/src}/ffluci/model/uci.lua | 0 {src => core/src}/ffluci/sys.lua | 0 {src => core/src}/ffluci/template.lua | 0 {src => core/src}/ffluci/util.lua | 0 src/ffluci/controller/admin/index.lua | 1 - src/ffluci/controller/admin/network.lua | 1 - src/ffluci/controller/admin/services.lua | 1 - src/ffluci/controller/admin/status.lua | 1 - src/ffluci/controller/admin/system.lua | 202 ------------------ src/ffluci/controller/admin/uci.lua | 59 ------ src/ffluci/controller/admin/wifi.lua | 1 - src/ffluci/controller/public/index.lua | 1 - src/ffluci/i18n/index.en | 1 - src/ffluci/model/cbi/admin_index/contact.lua | 15 -- src/ffluci/model/cbi/admin_index/luci.lua | 17 -- src/ffluci/model/cbi/admin_network/dhcp.lua | 37 ---- src/ffluci/model/cbi/admin_network/firewall.lua | 61 ------ src/ffluci/model/cbi/admin_network/ifaces.lua | 40 ---- src/ffluci/model/cbi/admin_network/portfw.lua | 24 --- src/ffluci/model/cbi/admin_network/ptp.lua | 31 --- src/ffluci/model/cbi/admin_network/routes.lua | 16 -- src/ffluci/model/cbi/admin_network/vlan.lua | 10 - src/ffluci/model/cbi/admin_services/dnsmasq.lua | 29 --- src/ffluci/model/cbi/admin_services/dropbear.lua | 14 -- src/ffluci/model/cbi/admin_services/httpd.lua | 18 -- src/ffluci/model/cbi/admin_services/olsrd.lua | 82 -------- src/ffluci/model/cbi/admin_system/fstab.lua | 21 -- src/ffluci/model/cbi/admin_wifi/devices.lua | 52 ----- src/ffluci/model/cbi/admin_wifi/networks.lua | 70 ------- src/ffluci/model/menu/00main.lua | 38 ---- src/ffluci/view/admin_index/index.htm | 5 - src/ffluci/view/admin_mesh/index.htm | 2 - src/ffluci/view/admin_network/index.htm | 2 - src/ffluci/view/admin_services/index.htm | 2 - src/ffluci/view/admin_status/index.htm | 2 - src/ffluci/view/admin_status/system.htm | 2 - src/ffluci/view/admin_system/editor.htm | 14 -- src/ffluci/view/admin_system/index.htm | 2 - src/ffluci/view/admin_system/ipkg.htm | 23 -- src/ffluci/view/admin_system/packages.htm | 77 ------- src/ffluci/view/admin_system/passwd.htm | 34 --- src/ffluci/view/admin_system/reboot.htm | 10 - src/ffluci/view/admin_system/sshkeys.htm | 23 -- src/ffluci/view/admin_system/upgrade.htm | 32 --- src/ffluci/view/admin_uci/apply.htm | 6 - src/ffluci/view/admin_uci/changes.htm | 11 - src/ffluci/view/admin_uci/revert.htm | 5 - src/ffluci/view/admin_wifi/index.htm | 2 - src/ffluci/view/cbi/dvalue.htm | 12 -- src/ffluci/view/cbi/footer.htm | 7 - src/ffluci/view/cbi/fvalue.htm | 3 - src/ffluci/view/cbi/header.htm | 7 - src/ffluci/view/cbi/lvalue.htm | 16 -- src/ffluci/view/cbi/map.htm | 7 - src/ffluci/view/cbi/mvalue.htm | 19 -- src/ffluci/view/cbi/nsection.htm | 17 -- src/ffluci/view/cbi/tsection.htm | 22 -- src/ffluci/view/cbi/ucisection.htm | 23 -- src/ffluci/view/cbi/value.htm | 3 - src/ffluci/view/cbi/valuefooter.htm | 8 - src/ffluci/view/cbi/valueheader.htm | 3 - src/ffluci/view/error404.htm | 5 - src/ffluci/view/error500.htm | 5 - src/ffluci/view/footer.htm | 7 - src/ffluci/view/header.htm | 78 ------- src/ffluci/view/public_index/contact.htm | 12 -- src/ffluci/view/public_index/index.htm | 5 - 93 files changed, 60 insertions(+), 1918 deletions(-) delete mode 100644 Makefile delete mode 100644 contrib/ffluci-flash delete mode 100644 contrib/init.d/luci_fw delete mode 100644 contrib/media/cascade.css delete mode 100644 contrib/media/cbi.js delete mode 100644 contrib/media/css/public_index.css delete mode 100644 contrib/media/logo.png delete mode 100644 contrib/uci/luci_fw create mode 100644 core/Makefile rename {contrib => core/contrib}/uci/luci (100%) rename {contrib => core}/ffluci (100%) rename {contrib => core}/ffluci-upload (100%) rename {contrib => core}/index.cgi (100%) rename {contrib => core}/index.html (100%) rename {src => core/src}/ffluci/cbi.lua (100%) rename {src => core/src}/ffluci/config.lua (100%) rename {src => core/src}/ffluci/debug.lua (100%) rename {src => core/src}/ffluci/dispatcher.lua (100%) rename {src => core/src}/ffluci/fs.lua (100%) rename {src => core/src}/ffluci/http.lua (100%) rename {src => core/src}/ffluci/i18n.lua (100%) rename {src => core/src}/ffluci/i18n/cbi.en (100%) rename {src => core/src}/ffluci/init.lua (100%) rename {src => core/src}/ffluci/menu.lua (100%) rename {src => core/src}/ffluci/model/ipkg.lua (100%) rename {src => core/src}/ffluci/model/uci.lua (100%) rename {src => core/src}/ffluci/sys.lua (100%) rename {src => core/src}/ffluci/template.lua (100%) rename {src => core/src}/ffluci/util.lua (100%) delete mode 100644 src/ffluci/controller/admin/index.lua delete mode 100644 src/ffluci/controller/admin/network.lua delete mode 100644 src/ffluci/controller/admin/services.lua delete mode 100644 src/ffluci/controller/admin/status.lua delete mode 100644 src/ffluci/controller/admin/system.lua delete mode 100644 src/ffluci/controller/admin/uci.lua delete mode 100644 src/ffluci/controller/admin/wifi.lua delete mode 100644 src/ffluci/controller/public/index.lua delete mode 100644 src/ffluci/i18n/index.en delete mode 100644 src/ffluci/model/cbi/admin_index/contact.lua delete mode 100644 src/ffluci/model/cbi/admin_index/luci.lua delete mode 100644 src/ffluci/model/cbi/admin_network/dhcp.lua delete mode 100644 src/ffluci/model/cbi/admin_network/firewall.lua delete mode 100644 src/ffluci/model/cbi/admin_network/ifaces.lua delete mode 100644 src/ffluci/model/cbi/admin_network/portfw.lua delete mode 100644 src/ffluci/model/cbi/admin_network/ptp.lua delete mode 100644 src/ffluci/model/cbi/admin_network/routes.lua delete mode 100644 src/ffluci/model/cbi/admin_network/vlan.lua delete mode 100644 src/ffluci/model/cbi/admin_services/dnsmasq.lua delete mode 100644 src/ffluci/model/cbi/admin_services/dropbear.lua delete mode 100644 src/ffluci/model/cbi/admin_services/httpd.lua delete mode 100644 src/ffluci/model/cbi/admin_services/olsrd.lua delete mode 100644 src/ffluci/model/cbi/admin_system/fstab.lua delete mode 100644 src/ffluci/model/cbi/admin_wifi/devices.lua delete mode 100644 src/ffluci/model/cbi/admin_wifi/networks.lua delete mode 100644 src/ffluci/model/menu/00main.lua delete mode 100644 src/ffluci/view/admin_index/index.htm delete mode 100644 src/ffluci/view/admin_mesh/index.htm delete mode 100644 src/ffluci/view/admin_network/index.htm delete mode 100644 src/ffluci/view/admin_services/index.htm delete mode 100644 src/ffluci/view/admin_status/index.htm delete mode 100644 src/ffluci/view/admin_status/system.htm delete mode 100644 src/ffluci/view/admin_system/editor.htm delete mode 100644 src/ffluci/view/admin_system/index.htm delete mode 100644 src/ffluci/view/admin_system/ipkg.htm delete mode 100644 src/ffluci/view/admin_system/packages.htm delete mode 100644 src/ffluci/view/admin_system/passwd.htm delete mode 100644 src/ffluci/view/admin_system/reboot.htm delete mode 100644 src/ffluci/view/admin_system/sshkeys.htm delete mode 100644 src/ffluci/view/admin_system/upgrade.htm delete mode 100644 src/ffluci/view/admin_uci/apply.htm delete mode 100644 src/ffluci/view/admin_uci/changes.htm delete mode 100644 src/ffluci/view/admin_uci/revert.htm delete mode 100644 src/ffluci/view/admin_wifi/index.htm delete mode 100644 src/ffluci/view/cbi/dvalue.htm delete mode 100644 src/ffluci/view/cbi/footer.htm delete mode 100644 src/ffluci/view/cbi/fvalue.htm delete mode 100644 src/ffluci/view/cbi/header.htm delete mode 100644 src/ffluci/view/cbi/lvalue.htm delete mode 100644 src/ffluci/view/cbi/map.htm delete mode 100644 src/ffluci/view/cbi/mvalue.htm delete mode 100644 src/ffluci/view/cbi/nsection.htm delete mode 100644 src/ffluci/view/cbi/tsection.htm delete mode 100644 src/ffluci/view/cbi/ucisection.htm delete mode 100644 src/ffluci/view/cbi/value.htm delete mode 100644 src/ffluci/view/cbi/valuefooter.htm delete mode 100644 src/ffluci/view/cbi/valueheader.htm delete mode 100644 src/ffluci/view/error404.htm delete mode 100644 src/ffluci/view/error500.htm delete mode 100644 src/ffluci/view/footer.htm delete mode 100644 src/ffluci/view/header.htm delete mode 100644 src/ffluci/view/public_index/contact.htm delete mode 100644 src/ffluci/view/public_index/index.htm diff --git a/Makefile b/Makefile deleted file mode 100644 index 57b3efd62..000000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -LUAC = luac -LUAC_OPTIONS = -s - -FILES = ffluci/debug.lua - -CFILES = ffluci/util.lua ffluci/http.lua ffluci/fs.lua \ -ffluci/sys.lua ffluci/model/uci.lua ffluci/model/ipkg.lua \ -ffluci/config.lua ffluci/i18n.lua ffluci/template.lua \ -ffluci/cbi.lua ffluci/dispatcher.lua ffluci/menu.lua ffluci/init.lua - -DIRECTORIES = dist/ffluci/model/cbi dist/ffluci/model/menu dist/ffluci/controller dist/ffluci/i18n dist/ffluci/view - -INFILES = $(CFILES:%=src/%) -OUTFILE = ffluci/init.lua - -.PHONY: all dist-compile dist-source examples-compile examples-source dist examples compile source clean - -all: compile - -dist-compile: compile dist -dist-source: source dist - -dist: - cp src/ffluci/controller/* dist/ffluci/controller/ -R - cp src/ffluci/i18n/* dist/ffluci/i18n/ - cp src/ffluci/view/* dist/ffluci/view/ -R - cp src/ffluci/model/cbi/* dist/ffluci/model/cbi/ -R - cp src/ffluci/model/menu/* dist/ffluci/model/menu/ -R - -compile: - mkdir -p $(DIRECTORIES) - $(LUAC) $(LUAC_OPTIONS) -o dist/$(OUTFILE) $(INFILES) - for i in $(CFILES); do [ -f dist/$$i ] || ln -s `dirname $$i | cut -s -d / -f 2- | sed -e 's/[^/]*\/*/..\//g'``basename $(OUTFILE)` dist/$$i; done - for i in $(FILES); do cp src/$$i dist/$$i; done - -source: - mkdir -p $(DIRECTORIES) - for i in $(CFILES); do cp src/$$i dist/$$i; done - for i in $(FILES); do cp src/$$i dist/$$i; done - -clean: - rm dist -rf diff --git a/contrib/ffluci-flash b/contrib/ffluci-flash deleted file mode 100644 index 3ff478f0f..000000000 --- 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 < - -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/init.d/luci_fw b/contrib/init.d/luci_fw deleted file mode 100644 index 880c87dbe..000000000 --- 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 d09ab7477..000000000 --- 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 f9e463bca..000000000 --- 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; iE40&9Rz zGp-fDtG4fb)1Cau&L-TzaR&mYh1an_P6wxI02Tqy0t;;4tLqvLw_&FcZs53mfyuyl zptKtvp+FTd7pSy-Z&O!HxH@1MdOX*}nIDM<>|fgc~^SVBlfk=uS?x1rQ*&lk@x+@JrkGR<(EF4kg^camNCW z0lT+j*n7Zpz(;Je2G#&;F~Z#sD8yJ0g}@-pW;n1N&-fDfsqK6J-HtIkj&K9Vy#crt zBam!J0)GeQ1M_X)ThYPiIlx%pblUcoGys!q-<#9cXKZ)j29BE#%m&VBg;argz>T)= zt?XhRjs|YW*vzfrUf`;>Y=r|EKX94td&yM8s=*V7Bpa<~5b_mn zS>3PygCiGB-P#rW)Y=pB**$-<3O4|&wNb~FET8#N8o&7%^Ke|u6khi|T zxfr|juo#kOfzxf@YhtRl)ICduhXkG|u)dqT|I$al>ki)P23@*uLtgSRREMj`_>yIn zuch&wk8vi3#ti?9?R%p$8?EkOGz%^wUa-}`xlMuxzBvg6q*VMl4!vKoRcot znlkqs;2IHYY)=aopk$f%xQd*Q=)ELp%G|F~c0-7wHW>BHX}n_Xn3+fX zy;o8tTw1)W@~=I?UldA~RsN?ScS=&8T3LF@A!%K+FSo2EllRo5{t4y5;$@Zp(L=n&qPW_-5#e=9lFu-Hd=5bP+Fu(pZt$th^K8rZmrbys#bUu}Y_ZrPl?02mOwzt4H8X505(#H5I# z(DYk-LUSuHu4g7T15;8rtB#mhh{_eJ`kN!F=QZ>IUv0u+AIw@SBDX0r?UQ4!C`jvy z)865s^U?Lf4IDSqIXEqb^rdveJ88+y2p^QZH*0QJ^VDf<*mR#jW5b4xm!+D*&F!5C zY9aj19gflmj{7}Kz+^OVAlp*f1%cykW?M@8$e1bSr~X)7Hfe7}&X=T~%Jzyp|6=lJWsI@7SBxbD-9CxuKtx>e@1QlprTs zmNh?yc87tg&IirhLt4a|Lk!F++|XZs19%ZQ%=W$Cr@MD;K$MjL@C;A}%ur<^kh5h| z?qAw5?{|AK=pE7ZS+jLpC{mG6!}^19!2N;aww4W!MpeZqpfU@^ zG={#_*ww<}j+@u6!S5b@DDX58Jx=A% zlvhpfB#Z4rlW+saJrfuJ+#F3R7Kx$5czf7TmXw#17$-9b)|tJkLdIA@>2(R z+%>s@3IH zOwkcxf991Ls1Q^hrK-ZoXpbxJ9FzK^FfnVRqAw?t$+77Kw(ot7DIPh!#ptRE2bCx2 z;nDyR84L1kM)R0RVpwSb{{*}oL(m>`Xm?t!eG6k~j}4DG0U*d95gCI>W_i;>;JAqK z>w#{oVTeLa#l*hANVSqp!VRN-nTiHx|9Zv3B-LtT=KK&75nGC>l=%Qyi3urYVh-hr z`_dc2*SR`^HV5PGnj4Ylfqu0|PCPM#ZUs?mT6tnMCfeVjI~nhSmENraK{V zTD!>hz4aDmw~Kb+$`cn-o~WQaaTMi=QpywG2Yv`_%%FUg4SnM5(#+Q=g{EcT;ANFx zqxz6q^4kpU{e-yPxIFPDDxGtcw;_qqwn)_46Y@c(D0){$jar;==Yv_Z;)R=ur^e@? zGMDDX9o1~jJ%f>p;tJ#9g!|8d<2L#ER#I<9IlSh`iD#wJ)B*d&M$0PRo{Q+st#Ex0 zRl<8&hQ5I!bD$Bl@GXmNmf141XirG0z0iRzq)0fCzvA%V(`Y^d1qpb$RLdR77iC z$m3qIvk$47hG;f-eKJX_gyC;|&agMvQJz@O5!K%^a#4L2g=oTuhfnOMs@DrTHKT_2 z_Lw1W+P=4jknyz`7cM)hDt1HVb5yPcZUClWB~J?1zgUEYbx+20pBp%Clg2b|>UAfu zTLJst9X9QU35tB3mA7y9oPY`HM7IlwA=&{vP7n#0K9sF+br zzcm-5RoSYi4ayT6fq!o|g9f)_jQvbk*#d3@P6jySqu+f~J9yIRn$*R$Ws`j1UEuRp zvmYZD)$`_vvE*)j3phA}qL92TPx93G(VRK2&8H%3OWo4tC!}tQmsY-^!Ud}O0LTf%J0i_tVh5*S5~wYqavXMW zTU&XqDVub*qF1Y>XAZ2Mk#4VFh$*^@!cFNJ8w+EG#U&EE5_bb}!IQ@W$89=>TC&W0 z9JmAYMkF$_7LD?RkLb@ayMIfFUd@v7mQG0qObMwzgvw>WfCXU<(OK>ZRwiFVMx{U)aUO-PUGH@SMJtVV#mrf zD{wBpLzG7luF9y*Jpf~3#RY(_&0M~uru5?8m|gjp^rE=#Kzqve1IO);NvT|_aL-Oz zwr~61W{mqASJTyHuzhbUrnn^22}$8J;J$FvI2CxS*!N~yR`Lg`9KSKS`-&RJbr+AC z*4e|-O{lde_r1uwP)#t+jxtYAOqH7p69$?Q2{I(Z-`v z2V+uB_rp$nR4Oc2S^_+7`(E6x-lb^6A-^raVB7c7!+SgDA-~WZnhOjJ!+qV3UFvvh z;JB{>t8Cx9Fx#N6!Y*~NI&j>BfVY6#Y~PD2{p@n=QlA6}9CtWIo5rP|vgvLFj#~-1 zZ6MvbKV}g)?pc@`+@IOL_flIY>nH-p9f7fNU&2(~{9}KHC2-txF+qr_w(s2?Nz?@h zpEC=XX8Yb9yUYiK0>>Q&{0Va`=nC8SzKA7mCqh?u8s-?l*|zV!kk+?reEKT%sb>Q} zz%2Urbmoh3VRg^1Fvp}m#1#GgZw&3O@zJ)xagW24?jMACZJ!0I(vR=AGQJeE)}04z z0&ZxlR_rpL8w?!x6pYz)5+-)~A|^|lGTy($6vP#US23p6p%4?pcoKN3o#p@O&;Q5& zP-gggj|5J@R7a+~pnjONOls#|jXC}DS_e!2v+=M)f8zE30SPdqmS-GahyVZp07*qo IM6N<$g0fW6u>b%7 diff --git a/contrib/package/ffluci/Makefile b/contrib/package/ffluci/Makefile index ba11dea3a..f9e132a40 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_fw b/contrib/uci/luci_fw deleted file mode 100644 index c7dec7f2c..000000000 --- a/contrib/uci/luci_fw +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/core/Makefile b/core/Makefile new file mode 100644 index 000000000..7db8ddb4a --- /dev/null +++ b/core/Makefile @@ -0,0 +1,37 @@ +LUAC = luac +LUAC_OPTIONS = -s + +FILES = ffluci/debug.lua ffluci/view/*.htm ffluci/view/cbi/*.htm + +CFILES = ffluci/util.lua ffluci/http.lua ffluci/fs.lua \ +ffluci/sys.lua ffluci/model/uci.lua ffluci/model/ipkg.lua \ +ffluci/config.lua ffluci/i18n.lua ffluci/template.lua \ +ffluci/cbi.lua ffluci/dispatcher.lua ffluci/menu.lua ffluci/init.lua + +DIRECTORIES = ffluci/model/cbi ffluci/model/menu ffluci/controller ffluci/i18n ffluci/view/cbi + +OUTDIRS = $(DIRECTORIES:%=dist/%) +INFILES = $(CFILES:%=src/%) +OUTFILE = ffluci/init.lua +CPFILES = $(FILES:%=src/%) + +.PHONY: all compile source depends clean + +all: compile + +depends: + mkdir -p $(OUTDIRS) + for i in $(CPFILES); do [ -f "$$i" ] && (i=$$(echo $$i | cut -d/ -f2-); \ + mkdir -p dist/$$(dirname $$i); cp src/$$i dist/$$i); done + +compile: depends + $(LUAC) $(LUAC_OPTIONS) -o dist/$(OUTFILE) $(INFILES) + for i in $(CFILES); do [ -f dist/$$i ] || ln -s `dirname $$i | cut -s -d / -f 2- | sed -e 's/[^/]*\/*/..\//g'``basename $(OUTFILE)` dist/$$i; done + + +source: depends + for i in $(CFILES); do cp src/$$i dist/$$i; done + + +clean: + rm dist -rf diff --git a/contrib/uci/luci b/core/contrib/uci/luci similarity index 100% rename from contrib/uci/luci rename to core/contrib/uci/luci diff --git a/contrib/ffluci b/core/ffluci similarity index 100% rename from contrib/ffluci rename to core/ffluci diff --git a/contrib/ffluci-upload b/core/ffluci-upload similarity index 100% rename from contrib/ffluci-upload rename to core/ffluci-upload diff --git a/contrib/index.cgi b/core/index.cgi similarity index 100% rename from contrib/index.cgi rename to core/index.cgi diff --git a/contrib/index.html b/core/index.html similarity index 100% rename from contrib/index.html rename to core/index.html diff --git a/src/ffluci/cbi.lua b/core/src/ffluci/cbi.lua similarity index 100% rename from src/ffluci/cbi.lua rename to core/src/ffluci/cbi.lua diff --git a/src/ffluci/config.lua b/core/src/ffluci/config.lua similarity index 100% rename from src/ffluci/config.lua rename to core/src/ffluci/config.lua diff --git a/src/ffluci/debug.lua b/core/src/ffluci/debug.lua similarity index 100% rename from src/ffluci/debug.lua rename to core/src/ffluci/debug.lua diff --git a/src/ffluci/dispatcher.lua b/core/src/ffluci/dispatcher.lua similarity index 100% rename from src/ffluci/dispatcher.lua rename to core/src/ffluci/dispatcher.lua diff --git a/src/ffluci/fs.lua b/core/src/ffluci/fs.lua similarity index 100% rename from src/ffluci/fs.lua rename to core/src/ffluci/fs.lua diff --git a/src/ffluci/http.lua b/core/src/ffluci/http.lua similarity index 100% rename from src/ffluci/http.lua rename to core/src/ffluci/http.lua diff --git a/src/ffluci/i18n.lua b/core/src/ffluci/i18n.lua similarity index 100% rename from src/ffluci/i18n.lua rename to core/src/ffluci/i18n.lua diff --git a/src/ffluci/i18n/cbi.en b/core/src/ffluci/i18n/cbi.en similarity index 100% rename from src/ffluci/i18n/cbi.en rename to core/src/ffluci/i18n/cbi.en diff --git a/src/ffluci/init.lua b/core/src/ffluci/init.lua similarity index 100% rename from src/ffluci/init.lua rename to core/src/ffluci/init.lua diff --git a/src/ffluci/menu.lua b/core/src/ffluci/menu.lua similarity index 100% rename from src/ffluci/menu.lua rename to core/src/ffluci/menu.lua diff --git a/src/ffluci/model/ipkg.lua b/core/src/ffluci/model/ipkg.lua similarity index 100% rename from src/ffluci/model/ipkg.lua rename to core/src/ffluci/model/ipkg.lua diff --git a/src/ffluci/model/uci.lua b/core/src/ffluci/model/uci.lua similarity index 100% rename from src/ffluci/model/uci.lua rename to core/src/ffluci/model/uci.lua diff --git a/src/ffluci/sys.lua b/core/src/ffluci/sys.lua similarity index 100% rename from src/ffluci/sys.lua rename to core/src/ffluci/sys.lua diff --git a/src/ffluci/template.lua b/core/src/ffluci/template.lua similarity index 100% rename from src/ffluci/template.lua rename to core/src/ffluci/template.lua diff --git a/src/ffluci/util.lua b/core/src/ffluci/util.lua similarity index 100% rename from src/ffluci/util.lua rename to core/src/ffluci/util.lua diff --git a/src/ffluci/controller/admin/index.lua b/src/ffluci/controller/admin/index.lua deleted file mode 100644 index b4a7720f8..000000000 --- a/src/ffluci/controller/admin/index.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.index", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/network.lua b/src/ffluci/controller/admin/network.lua deleted file mode 100644 index 4f8160a4c..000000000 --- a/src/ffluci/controller/admin/network.lua +++ /dev/null @@ -1 +0,0 @@ -module(..., package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/services.lua b/src/ffluci/controller/admin/services.lua deleted file mode 100644 index 42181212b..000000000 --- a/src/ffluci/controller/admin/services.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.services", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/status.lua b/src/ffluci/controller/admin/status.lua deleted file mode 100644 index bdd51d462..000000000 --- a/src/ffluci/controller/admin/status.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.status", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/system.lua b/src/ffluci/controller/admin/system.lua deleted file mode 100644 index b0763d8af..000000000 --- a/src/ffluci/controller/admin/system.lua +++ /dev/null @@ -1,202 +0,0 @@ -module("ffluci.controller.admin.system", package.seeall) - -require("ffluci.sys") -require("ffluci.http") -require("ffluci.util") -require("ffluci.fs") -require("ffluci.model.ipkg") -require("ffluci.model.uci") - -function action_editor() - local file = ffluci.http.formvalue("file", "") - local data = ffluci.http.formvalue("data") - local err = nil - local msg = nil - local stat = true - - if file and data then - stat, err = ffluci.fs.writefile(file, data) - end - - if not stat then - err = ffluci.util.split(err, " ") - table.remove(err, 1) - msg = table.concat(err, " ") - end - - local cnt, err = ffluci.fs.readfile(file) - if cnt then - cnt = ffluci.util.pcdata(cnt) - end - ffluci.template.render("admin_system/editor", {fn=file, cnt=cnt, msg=msg}) -end - -function action_ipkg() - local file = "/etc/ipkg.conf" - local data = ffluci.http.formvalue("data") - local stat = nil - local err = nil - - if data then - stat, err = ffluci.fs.writefile(file, data) - end - - local cnt = ffluci.fs.readfile(file) - if cnt then - cnt = ffluci.util.pcdata(cnt) - end - - ffluci.template.render("admin_system/ipkg", {cnt=cnt, msg=err}) -end - -function action_packages() - local ipkg = ffluci.model.ipkg - local void = nil - local submit = ffluci.http.formvalue("submit") - - - -- Search query - local query = ffluci.http.formvalue("query") - query = (query ~= '') and query or nil - - - -- Packets to be installed - local install = ffluci.http.formvalue("install") - install = (type(install) == "table" and submit) and install or nil - - -- Install from URL - local url = ffluci.http.formvalue("url") - if url and url ~= '' and submit then - if not install then - install = {} - end - install[url] = 1 - end - - -- Do install - if install then - for k, v in pairs(install) do - void, install[k] = ipkg.install(k) - end - end - - - -- Remove packets - local remove = ffluci.http.formvalue("remove") - remove = (type(remove) == "table" and submit) and remove or nil - if remove then - for k, v in pairs(remove) do - void, remove[k] = ipkg.remove(k) - end - end - - - -- Update all packets - local update = ffluci.http.formvalue("update") - if update then - void, update = ipkg.update() - end - - - -- Upgrade all packets - local upgrade = ffluci.http.formvalue("upgrade") - if upgrade then - void, upgrade = ipkg.upgrade() - end - - - -- Package info - local info = ffluci.model.ipkg.info(query) - info = info or {} - local pkgs = {} - - -- Sort after status and name - for k, v in pairs(info) do - local x = 0 - for i, j in pairs(pkgs) do - local vins = (v.Status and v.Status.installed) - local jins = (j.Status and j.Status.installed) - if vins ~= jins then - if vins then - break - end - else - if j.Package > v.Package then - break - end - end - x = i - end - table.insert(pkgs, x+1, v) - end - - ffluci.template.render("admin_system/packages", {pkgs=pkgs, query=query, - install=install, remove=remove, update=update, upgrade=upgrade}) -end - -function action_passwd() - local p1 = ffluci.http.formvalue("pwd1") - local p2 = ffluci.http.formvalue("pwd2") - local stat = nil - - if p1 or p2 then - if p1 == p2 then - stat = ffluci.sys.user.setpasswd("root", p1) - else - stat = 10 - end - end - - ffluci.template.render("admin_system/passwd", {stat=stat}) -end - -function action_reboot() - local reboot = ffluci.http.formvalue("reboot") - ffluci.template.render("admin_system/reboot", {reboot=reboot}) - if reboot then - ffluci.sys.reboot() - end -end - -function action_sshkeys() - local file = "/etc/dropbear/authorized_keys" - local data = ffluci.http.formvalue("data") - local stat = nil - local err = nil - - if data then - stat, err = ffluci.fs.writefile(file, data) - end - - local cnt = ffluci.fs.readfile(file) - if cnt then - cnt = ffluci.util.pcdata(cnt) - end - - ffluci.template.render("admin_system/sshkeys", {cnt=cnt, msg=err}) -end - -function action_upgrade() - local ret = nil - local plat = ffluci.fs.mtime("/lib/upgrade/platform.sh") - - local image = ffluci.http.formvalue("image") - local imgname = ffluci.http.formvalue("image_name") - local keepcfg = ffluci.http.formvalue("keepcfg") - - if plat and imgname then - local kpattern = nil - if keepcfg then - local files = ffluci.model.uci.show("luci", "flash_keep") - if files.luci and files.luci.flash_keep then - kpattern = "" - for k,v in pairs(files.luci.flash_keep) do - kpattern = kpattern .. " " .. v - end - end - end - ret = ffluci.sys.flash(image, kpattern) - end - - ffluci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret}) -end \ No newline at end of file diff --git a/src/ffluci/controller/admin/uci.lua b/src/ffluci/controller/admin/uci.lua deleted file mode 100644 index 3c9fc8739..000000000 --- a/src/ffluci/controller/admin/uci.lua +++ /dev/null @@ -1,59 +0,0 @@ -module("ffluci.controller.admin.uci", package.seeall) -require("ffluci.util") -require("ffluci.sys") - --- This function has a higher priority than the admin_uci/apply template -function action_apply() - local changes = ffluci.model.uci.changes() - local output = "" - - if changes then - local apply = {} - - -- Collect files to be applied - for i, line in ipairs(ffluci.util.split(changes)) do - local r = line:match("^-?([^.]+)") - if r then - apply[r] = true - end - end - - -- Commit changes - ffluci.model.uci.commit() - - -- Search for post-commit commands - if ffluci.config.uci_oncommit then - for k, v in pairs(apply) do - local cmd = ffluci.config.uci_oncommit[k] - if cmd then - output = output .. cmd .. ":" .. ffluci.sys.exec(cmd) - end - end - end - end - - ffluci.template.render("admin_uci/apply", {changes=changes, output=output}) -end - - -function action_revert() - local changes = ffluci.model.uci.changes() - if changes then - local revert = {} - - -- Collect files to be reverted - for i, line in ipairs(ffluci.util.split(changes)) do - local r = line:match("^-?([^.]+)") - if r then - revert[r] = true - end - end - - -- Revert them - for k, v in pairs(revert) do - ffluci.model.uci.revert(k) - end - end - - ffluci.template.render("admin_uci/revert", {changes=changes}) -end \ No newline at end of file diff --git a/src/ffluci/controller/admin/wifi.lua b/src/ffluci/controller/admin/wifi.lua deleted file mode 100644 index bc1040c71..000000000 --- a/src/ffluci/controller/admin/wifi.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.wifi", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/public/index.lua b/src/ffluci/controller/public/index.lua deleted file mode 100644 index 4f8160a4c..000000000 --- a/src/ffluci/controller/public/index.lua +++ /dev/null @@ -1 +0,0 @@ -module(..., package.seeall) \ No newline at end of file diff --git a/src/ffluci/i18n/index.en b/src/ffluci/i18n/index.en deleted file mode 100644 index 71255873a..000000000 --- a/src/ffluci/i18n/index.en +++ /dev/null @@ -1 +0,0 @@ -hello = "Hello" \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_index/contact.lua b/src/ffluci/model/cbi/admin_index/contact.lua deleted file mode 100644 index 55f5098a5..000000000 --- a/src/ffluci/model/cbi/admin_index/contact.lua +++ /dev/null @@ -1,15 +0,0 @@ -m = Map("luci", "Kontakt", [[Diese Daten sind auf der öffentlichen Kontaktseite -sichtbar. Alle Felder sind natürlich freiwillig. Du kannst soviel oder so wenig -über dich angeben, wie du möchtest.]]) - -c = m:section(NamedSection, "contact") - -c:option(Value, "nickname", "Pseudonym") -c:option(Value, "name", "Name") -c:option(Value, "mail", "E-Mail") -c:option(Value, "phone", "Telefon") -c:option(Value, "location", "Standort") -c:option(Value, "geo", "Koordinaten", "Bitte als Breite;Länge angeben") -c:option(Value, "note", "Notiz") - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_index/luci.lua b/src/ffluci/model/cbi/admin_index/luci.lua deleted file mode 100644 index eed626c5b..000000000 --- a/src/ffluci/model/cbi/admin_index/luci.lua +++ /dev/null @@ -1,17 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("luci", "FFLuCI") - -c = m:section(NamedSection, "main", "core", "Allgemein") -c:option(Value, "lang", "Sprache") -c:option(Value, "mediaurlbase", "Mediaverzeichnis") - -f = m:section(NamedSection, "flash", "extern", "Firmwareupgrade") -f:option(Value, "keep", "Übernehme Dateien").size = 64 - -p = m:section(NamedSection, "category_privileges", "core", "Kategorieprivilegien") -p.dynamic = true - -u = m:section(NamedSection, "uci_oncommit", "event", "UCI-Befehle beim Anwenden") -u.dynamic = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/dhcp.lua b/src/ffluci/model/cbi/admin_network/dhcp.lua deleted file mode 100644 index 83ba19641..000000000 --- a/src/ffluci/model/cbi/admin_network/dhcp.lua +++ /dev/null @@ -1,37 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -require("ffluci.model.uci") -require("ffluci.sys") - -m = Map("dhcp", "DHCP") - -s = m:section(TypedSection, "dhcp") -s.addremove = true -s.anonymous = true - -iface = s:option(ListValue, "interface", "Schnittstelle") -for k, v in pairs(ffluci.model.uci.show("network").network) do - if v[".type"] == "interface" and k ~= "loopback" then - iface:value(k) - end -end - -s:option(Value, "start", "Start").rmempty = true - -s:option(Value, "limit", "Limit").rmempty = true - -s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true - -s:option(Value, "name", "Name").optional = true - -s:option(Flag, "ignore", "Schnittstelle ignorieren").optional = true - -s:option(Value, "netmask", "Netzmaske").optional = true - -s:option(Flag, "force", "Start erzwingen").optional = true - -for i, line in pairs(ffluci.sys.execl("dnsmasq --help dhcp")) do - k, v = line:match("([^ ]+) +([^ ]+)") - s:option(Value, "dhcp"..k, v).optional = true -end - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/firewall.lua b/src/ffluci/model/cbi/admin_network/firewall.lua deleted file mode 100644 index cf7018e99..000000000 --- a/src/ffluci/model/cbi/admin_network/firewall.lua +++ /dev/null @@ -1,61 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("luci_fw", "Firewall") - -s = m:section(TypedSection, "rule") -s.addremove = true -s.anonymous = true - -chain = s:option(ListValue, "chain", "Kette") -chain:value("forward", "Forward") -chain:value("input", "Input") -chain:value("output", "Output") -chain:value("prerouting", "Prerouting") -chain:value("postrouting", "Postrouting") - -s:option(Value, "iface", "Eingangsschnittstelle").optional = true -s:option(Value, "oface", "Ausgangsschnittstelle").optional = true - -proto = s:option(ListValue, "proto", "Protokoll") -proto.optional = true -proto:value("") -proto:value("tcp", "TCP") -proto:value("udp", "UDP") - -s:option(Value, "source", "Quelladresse").optional = true -s:option(Value, "destination", "Zieladresse").optional = true - -sport = s:option(Value, "sport", "Quellport") -sport.optional = true -sport:depends("proto", "tcp") -sport:depends("proto", "udp") - -dport = s:option(Value, "dport", "Zielport") -dport.optional = true -dport:depends("proto", "tcp") -dport:depends("proto", "udp") - -tosrc = s:option(Value, "tosrc", "Neue Quelladresse [SNAT]") -tosrc.optional = true -tosrc:depends("jump", "SNAT") - -tosrc = s:option(Value, "todest", "Neue Zieladresse [DNAT]") -tosrc.optional = true -tosrc:depends("jump", "DNAT") - -jump = s:option(ListValue, "jump", "Aktion") -jump.rmempty = true -jump:value("", "") -jump:value("ACCEPT", "annehmen (ACCEPT)") -jump:value("REJECT", "zurückweisen (REJECT)") -jump:value("DROP", "verwerfen (DROP)") -jump:value("LOG", "protokollieren (LOG)") -jump:value("DNAT", "Ziel umschreiben (DNAT) [nur Prerouting]") -jump:value("MASQUERADE", "maskieren (MASQUERADE) [nur Postrouting]") -jump:value("SNAT", "Quelle umschreiben (SNAT) [nur Postrouting]") - - -add = s:option(Value, "command", "Eigener Befehl") -add.size = 50 -add.rmempty = true - -return m diff --git a/src/ffluci/model/cbi/admin_network/ifaces.lua b/src/ffluci/model/cbi/admin_network/ifaces.lua deleted file mode 100644 index 193f83f51..000000000 --- a/src/ffluci/model/cbi/admin_network/ifaces.lua +++ /dev/null @@ -1,40 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("network", "Schnittstellen") - -s = m:section(TypedSection, "interface") -s.addremove = true -s:exclude("loopback") -s:depends("proto", "static") -s:depends("proto", "dhcp") - -p = s:option(ListValue, "proto", "Protokoll") -p:value("static", "statisch") -p:value("dhcp", "DHCP") -p.default = "static" - -br = s:option(Flag, "type", "Netzwerkbrücke", "überbrückt angegebene Schnittstelle(n)") -br.enabled = "bridge" -br.rmempty = true - -s:option(Value, "ifname", "Schnittstelle") - -s:option(Value, "ipaddr", "IP-Adresse") - -s:option(Value, "netmask", "Netzmaske"):depends("proto", "static") - -gw = s:option(Value, "gateway", "Gateway") -gw:depends("proto", "static") -gw.rmempty = true - -dns = s:option(Value, "dns", "DNS-Server") -dns:depends("proto", "static") -dns.optional = true - -mtu = s:option(Value, "mtu", "MTU") -mtu.optional = true -mtu.isinteger = true - -mac = s:option(Value, "macaddr", "MAC-Adresse") -mac.optional = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/portfw.lua b/src/ffluci/model/cbi/admin_network/portfw.lua deleted file mode 100644 index 70a174907..000000000 --- a/src/ffluci/model/cbi/admin_network/portfw.lua +++ /dev/null @@ -1,24 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -require("ffluci.sys") -m = Map("luci_fw", "Portweiterleitung") - -s = m:section(TypedSection, "portfw") -s.addremove = true -s.anonymous = true - -iface = s:option(ListValue, "iface", "Externes Interface") -iface:value("") -for k,v in pairs(ffluci.sys.net.devices()) do - iface:value(v) -end - -proto = s:option(ListValue, "proto", "Protokoll") -proto:value("tcp", "TCP") -proto:value("udp", "UDP") -proto:value("tcpudp", "TCP+UDP") - -dport = s:option(Value, "dport", "Externer Port", "Port[:Endport]") - -to = s:option(Value, "to", "Interne Adresse", "IP-Adresse[:Zielport[-Zielendport]]") - -return m diff --git a/src/ffluci/model/cbi/admin_network/ptp.lua b/src/ffluci/model/cbi/admin_network/ptp.lua deleted file mode 100644 index 78fcf94b9..000000000 --- a/src/ffluci/model/cbi/admin_network/ptp.lua +++ /dev/null @@ -1,31 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("network", "Punkt-zu-Punkt Verbindungen") - -s = m:section(TypedSection, "interface") -s.addremove = true -s:depends("proto", "pppoe") -s:depends("proto", "pptp") - -p = s:option(ListValue, "proto", "Protokoll") -p:value("pppoe", "PPPoE") -p:value("pptp", "PPTP") -p.default = "pppoe" - -s:option(Value, "ifname", "Schnittstelle") - -s:option(Value, "username", "Benutzername") -s:option(Value, "password", "Passwort") - -s:option(Value, "keepalive", "Keep-Alive").optional = true - -s:option(Value, "demand", "Dial on Demand (idle time)").optional = true - -srv = s:option(Value, "server", "PPTP-Server") -srv:depends("proto", "pptp") -srv.optional = true - -mtu = s:option(Value, "mtu", "MTU") -mtu.optional = true -mtu.isinteger = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/routes.lua b/src/ffluci/model/cbi/admin_network/routes.lua deleted file mode 100644 index 5a5f78007..000000000 --- a/src/ffluci/model/cbi/admin_network/routes.lua +++ /dev/null @@ -1,16 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("network", "Statische Routen") - -s = m:section(TypedSection, "route") -s.addremove = true -s.anonymous = true - -s:option(Value, "interface", "Schnittstelle") - -s:option(Value, "target", "Ziel", "Host-IP oder Netzwerk") - -s:option(Value, "netmask", "Netzmaske", "falls Ziel ein Netzwerk ist").rmemepty = true - -s:option(Value, "gateway", "Gateway") - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_network/vlan.lua b/src/ffluci/model/cbi/admin_network/vlan.lua deleted file mode 100644 index 3186f2d9b..000000000 --- a/src/ffluci/model/cbi/admin_network/vlan.lua +++ /dev/null @@ -1,10 +0,0 @@ --- ToDo: Autodetect things, maybe use MultiValue instead, Translate, Add descriptions -m = Map("network", "VLAN", "Konfguriert den Switch des Routers.") - -s = m:section(TypedSection, "switch") - -for i = 0, 15 do - s:option(Value, "vlan"..i, "vlan"..i).optional = true -end - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/dnsmasq.lua b/src/ffluci/model/cbi/admin_services/dnsmasq.lua deleted file mode 100644 index d6934c891..000000000 --- a/src/ffluci/model/cbi/admin_services/dnsmasq.lua +++ /dev/null @@ -1,29 +0,0 @@ -m = Map("dhcp", "Dnsmasq") - -s = m:section(TypedSection, "dnsmasq", "Einstellungen") -s.anonymous = true - -s:option(Flag, "domainneeded", "Anfragen nur mit Domain", "Anfragen ohne Domainnamen nicht weiterleiten") -s:option(Flag, "authoritative", "Authoritativ", "Dies ist der einzige DHCP im lokalen Netz") -s:option(Flag, "boguspriv", "Private Anfragen filtern", "Reverse DNS-Anfragen für lokalen Netze nicht weiterleiten") -s:option(Flag, "filterwin2k", "Windowsanfragen filtern", "nutzlose DNS-Anfragen aktueller Windowssysteme filtern") -s:option(Flag, "localise_queries", "Lokalisiere Anfragen", "Gibt die Adresse eines Hostnamen entsprechend seines Subnetzes zurück") -s:option(Value, "local", "Lokale Server") -s:option(Value, "domain", "Lokale Domain") -s:option(Flag, "expandhosts", "Erweitere Hosts", "Fügt Domainnamen zu einfachen Hosteinträgen in der Resolvdatei hinzu") -s:option(Flag, "nonegcache", "Unbekannte nicht cachen", "Negative DNS-Antworten nicht zwischenspeichern") -s:option(Flag, "readethers", "Verwende /etc/ethers", "Lese Informationen aus /etc/ethers um den DHCP-Server zu konfigurieren") -s:option(Value, "leasefile", "Leasedatei", "Speicherort für vergebenen DHCP-Adressen") -s:option(Value, "resolvfile", "Resolvdatei", "Lokale DNS-Datei") -s:option(Flag, "nohosts", "Ignoriere /etc/hosts").optional = true -s:option(Flag, "strictorder", "Strikte Reihenfolge", "DNS-Server werden strikt der Reihenfolge in der Resolvdatei nach abgefragt").optional = true -s:option(Flag, "logqueries", "Schreibe Abfragelog").optional = true -s:option(Flag, "noresolv", "Ignoriere Resolvdatei").optional = true -s:option(Value, "dnsforwardmax", "gleichzeitige Abfragen").optional = true -s:option(Value, "port", "DNS-Port").optional = true -s:option(Value, "ednspacket_max", "max. EDNS.0 Paketgröße").optional = true -s:option(Value, "dhcpleasemax", "max. DHCP-Leases").optional = true -s:option(Value, "addnhosts", "Zusätzliche Hostdatei").optional = true -s:option(Value, "queryport", "Abfrageport").optional = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/dropbear.lua b/src/ffluci/model/cbi/admin_services/dropbear.lua deleted file mode 100644 index b8fcb9e6b..000000000 --- a/src/ffluci/model/cbi/admin_services/dropbear.lua +++ /dev/null @@ -1,14 +0,0 @@ --- ToDo: Translate, Add descriptions -m = Map("dropbear", "SSH-Server") - -s = m:section(TypedSection, "dropbear") -s.anonymous = true - -port = s:option(Value, "Port", "Port") -port.isinteger = true - -pwauth = s:option(Flag, "PasswordAuth", "Passwortanmeldung") -pwauth.enabled = 'on' -pwauth.disabled = 'off' - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/httpd.lua b/src/ffluci/model/cbi/admin_services/httpd.lua deleted file mode 100644 index f89dbb7ae..000000000 --- a/src/ffluci/model/cbi/admin_services/httpd.lua +++ /dev/null @@ -1,18 +0,0 @@ --- ToDo: Translate, Add descriptions -m = Map("httpd", "HTTP-Server") - -s = m:section(TypedSection, "httpd") -s.anonymous = true - -port = s:option(Value, "port", "Port") -port.isinteger = true - -s:option(Value, "home", "Wurzelverzeichnis") - -config = s:option(Value, "c_file", "Konfigurationsdatei", "/etc/httpd.conf wenn leer") -config.rmempty = true - -realm = s:option(Value, "realm", "Anmeldeaufforderung") -realm.rmempty = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/olsrd.lua b/src/ffluci/model/cbi/admin_services/olsrd.lua deleted file mode 100644 index 430b78687..000000000 --- a/src/ffluci/model/cbi/admin_services/olsrd.lua +++ /dev/null @@ -1,82 +0,0 @@ --- ToDo: Autodetect things, Translate, Add descriptions -require("ffluci.fs") - -m = Map("olsr", "OLSR") - -s = m:section(NamedSection, "general", "olsr", "Allgemeine Einstellungen") - -debug = s:option(ListValue, "DebugLevel", "Debugmodus") -for i=0, 9 do - debug:value(i) -end - -ipv = s:option(ListValue, "IpVersion", "Internet Protokoll") -ipv:value("4", "IPv4") -ipv:value("6", "IPv6") - -noint = s:option(Flag, "AllowNoInt", "Start ohne Netzwerk") -noint.enabled = "yes" -noint.disabled = "no" - -s:option(Value, "Pollrate", "Abfragerate (Pollrate)", "s").isnumber = true - -tcr = s:option(ListValue, "TcRedundancy", "TC-Redundanz") -tcr:value("0", "MPR-Selektoren") -tcr:value("1", "MPR-Selektoren und MPR") -tcr:value("2", "Alle Nachbarn") - -s:option(Value, "MprCoverage", "MPR-Erfassung").isinteger = true - -lql = s:option(ListValue, "LinkQualityLevel", "VQ-Level") -lql:value("0", "deaktiviert") -lql:value("1", "MPR-Auswahl") -lql:value("2", "MPR-Auswahl und Routing") - -lqfish = s:option(Flag, "LinkQualityFishEye", "VQ-Fisheye") - -s:option(Value, "LinkQualityWinSize", "VQ-Fenstergröße").isinteger = true - -s:option(Value, "LinkQualityDijkstraLimit", "VQ-Dijkstralimit") - -hyst = s:option(Flag, "UseHysteresis", "Hysterese aktivieren") -hyst.enabled = "yes" -hyst.disabled = "no" - - -i = m:section(TypedSection, "Interface", "Schnittstellen") -i.anonymous = true -i.addremove = true -i.dynamic = true - -i:option(Value, "Interface", "Netzwerkschnittstellen") - -i:option(Value, "HelloInterval", "Hello-Intervall").isnumber = true - -i:option(Value, "HelloValidityTime", "Hello-Gültigkeit").isnumber = true - -i:option(Value, "TcInterval", "TC-Intervall").isnumber = true - -i:option(Value, "TcValidityTime", "TC-Gültigkeit").isnumber = true - -i:option(Value, "MidInterval", "MID-Intervall").isnumber = true - -i:option(Value, "MidValidityTime", "MID-Gültigkeit").isnumber = true - -i:option(Value, "HnaInterval", "HNA-Intervall").isnumber = true - -i:option(Value, "HnaValidityTime", "HNA-Gültigkeit").isnumber = true - - -p = m:section(TypedSection, "LoadPlugin", "Plugins") -p.addremove = true -p.dynamic = true - -lib = p:option(ListValue, "Library", "Bibliothek") -lib:value("") -for k, v in pairs(ffluci.fs.dir("/usr/lib")) do - if v:sub(1, 6) == "olsrd_" then - lib:value(v) - end -end - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_system/fstab.lua b/src/ffluci/model/cbi/admin_system/fstab.lua deleted file mode 100644 index cf9a483d7..000000000 --- a/src/ffluci/model/cbi/admin_system/fstab.lua +++ /dev/null @@ -1,21 +0,0 @@ -m = Map("fstab", "Einhängepunkte") - -mount = m:section(TypedSection, "mount", "Einhängepunkte") -mount.anonymous = true -mount.addremove = true - -mount:option(Flag, "enabled", "aktivieren") -mount:option(Value, "device", "Gerät") -mount:option(Value, "target", "Einhängepunkt") -mount:option(Value, "fstype", "Dateisystem") -mount:option(Value, "options", "Optionen") - - -swap = m:section(TypedSection, "swap", "SWAP") -swap.anonymous = true -swap.addremove = true - -swap:option(Flag, "enabled", "aktivieren") -swap:option(Value, "device", "Gerät") - -return m diff --git a/src/ffluci/model/cbi/admin_wifi/devices.lua b/src/ffluci/model/cbi/admin_wifi/devices.lua deleted file mode 100644 index 0b1b9a2ff..000000000 --- a/src/ffluci/model/cbi/admin_wifi/devices.lua +++ /dev/null @@ -1,52 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts - -m = Map("wireless", "Geräte") - -s = m:section(TypedSection, "wifi-device") ---s.addremove = true - -en = s:option(Flag, "disabled", "Aktivieren") -en.enabled = "0" -en.disabled = "1" - -t = s:option(ListValue, "type", "Typ") -t:value("broadcom") -t:value("atheros") -t:value("mac80211") -t:value("prism2") ---[[ -require("ffluci.sys") -local c = ". /etc/functions.sh;for i in /lib/wifi/*;do . $i;done;echo $DRIVERS" -for driver in ffluci.sys.execl(c)[1]:gmatch("[^ ]+") do - t:value(driver) -end -]]-- - -mode = s:option(ListValue, "mode", "Modus") -mode:value("", "standard") -mode:value("11b", "802.11b") -mode:value("11g", "802.11g") -mode:value("11a", "802.11a") -mode:value("11bg", "802.11b+g") -mode.rmempty = true - -s:option(Value, "channel", "Funkkanal") - -s:option(Value, "txantenna", "Sendeantenne").rmempty = true - -s:option(Value, "rxantenna", "Empfangsantenne").rmempty = true - -s:option(Value, "distance", "Distanz", - "Distanz zum am weitesten entfernten Funkpartner (m)").rmempty = true - -s:option(Value, "diversity", "Diversität"):depends("type", "atheros") - -country = s:option(Value, "country", "Ländercode") -country.optional = true -country:depends("type", "broadcom") - -maxassoc = s:option(Value, "maxassoc", "Verbindungslimit") -maxassoc:depends("type", "broadcom") -maxassoc.optional = true - -return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_wifi/networks.lua b/src/ffluci/model/cbi/admin_wifi/networks.lua deleted file mode 100644 index 20342ffb0..000000000 --- a/src/ffluci/model/cbi/admin_wifi/networks.lua +++ /dev/null @@ -1,70 +0,0 @@ --- ToDo: Translate, Add descriptions and help texts -m = Map("wireless", "Netze") - -s = m:section(TypedSection, "wifi-iface") -s.addremove = true -s.anonymous = true - -s:option(Value, "ssid", "Netzkennung (ESSID)").maxlength = 32 - -device = s:option(ListValue, "device", "Gerät") -local d = ffluci.model.uci.show("wireless").wireless -if d then - for k, v in pairs(d) do - if v[".type"] == "wifi-device" then - device:value(k) - end - end -end - -network = s:option(ListValue, "network", "Netzwerk") -network:value("") -for k, v in pairs(ffluci.model.uci.show("network").network) do - if v[".type"] == "interface" and k ~= "loopback" then - network:value(k) - end -end - -mode = s:option(ListValue, "mode", "Modus") -mode:value("ap", "Access Point") -mode:value("adhoc", "Ad-Hoc") -mode:value("sta", "Client") -mode:value("wds", "WDS") - -s:option(Value, "bssid", "BSSID").optional = true - -s:option(Value, "txpower", "Sendeleistung", "dbm").rmempty = true - -encr = s:option(ListValue, "encryption", "Verschlüsselung") -encr:value("none", "keine") -encr:value("wep", "WEP") -encr:value("psk", "WPA-PSK") -encr:value("wpa", "WPA-Radius") -encr:value("psk2", "WPA2-PSK") -encr:value("wpa2", "WPA2-Radius") - -key = s:option(Value, "key", "Schlüssel") -key:depends("encryption", "wep") -key:depends("encryption", "psk") -key:depends("encryption", "wpa") -key:depends("encryption", "psk2") -key:depends("encryption", "wpa2") -key.rmempty = true - -server = s:option(Value, "server", "Radius-Server") -server:depends("encryption", "wpa") -server:depends("encryption", "wpa2") -server.rmempty = true - -port = s:option(Value, "port", "Radius-Port") -port:depends("encryption", "wpa") -port:depends("encryption", "wpa2") -port.rmempty = true - -s:option(Flag, "isolate", "AP-Isolation", "Unterbindet Client-Client-Verkehr").optional = true - -s:option(Flag, "hidden", "ESSID verstecken").optional = true - - - -return m \ No newline at end of file diff --git a/src/ffluci/model/menu/00main.lua b/src/ffluci/model/menu/00main.lua deleted file mode 100644 index 09c5dbf0d..000000000 --- a/src/ffluci/model/menu/00main.lua +++ /dev/null @@ -1,38 +0,0 @@ --- General menu definition -add("public", "index", "Übersicht", 10) -act("contact", "Kontakt") - - -add("admin", "index", "Übersicht", 10) -act("contact", "Kontakt") -act("luci", "FFLuCI") - -add("admin", "status", "Status", 20) -act("system", "System") - -add("admin", "system", "System", 30) -act("packages", "Paketverwaltung") -act("passwd", "Passwort ändern") -act("sshkeys", "SSH-Schlüssel") -act("fstab", "Einhängepunkte") -act("upgrade", "Firmwareupgrade") -act("reboot", "Neu starten") - -add("admin", "services", "Dienste", 40) -act("olsrd", "OLSR") -act("httpd", "HTTP-Server") -act("dropbear", "SSH-Server") -act("dnsmasq", "Dnsmasq") - -add("admin", "network", "Netzwerk", 50) -act("vlan", "Switch") -act("ifaces", "Schnittstellen") -act("dhcp", "DHCP-Server") -act("ptp", "PPPoE / PPTP") -act("routes", "Statische Routen") -act("portfw", "Portweiterleitung") -act("firewall", "Firewall") - -add("admin", "wifi", "Drahtlos", 60) -act("devices", "Geräte") -act("networks", "Netze") \ No newline at end of file diff --git a/src/ffluci/view/admin_index/index.htm b/src/ffluci/view/admin_index/index.htm deleted file mode 100644 index 1f06e344c..000000000 --- a/src/ffluci/view/admin_index/index.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+header%> -

<%:hello Hallo!%>

-

<%:admin1 Dies ist der Administrationsbereich. %> -

ToDo: Intelligenter Einleitungstext

-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_mesh/index.htm b/src/ffluci/view/admin_mesh/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_mesh/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_network/index.htm b/src/ffluci/view/admin_network/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_network/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_services/index.htm b/src/ffluci/view/admin_services/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_services/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_status/index.htm b/src/ffluci/view/admin_status/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_status/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_status/system.htm b/src/ffluci/view/admin_status/system.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_status/system.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/editor.htm b/src/ffluci/view/admin_system/editor.htm deleted file mode 100644 index 0215c91df..000000000 --- a/src/ffluci/view/admin_system/editor.htm +++ /dev/null @@ -1,14 +0,0 @@ -<%+header%> -

<%:texteditor Texteditor%>

-
-
<%:file Datei%>: -<% if msg then %><%:error Fehler%>: <%=msg%><% end %>
-
-
-
-
- - -
-
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/index.htm b/src/ffluci/view/admin_system/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_system/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/ipkg.htm b/src/ffluci/view/admin_system/ipkg.htm deleted file mode 100644 index bbe7f3bc6..000000000 --- a/src/ffluci/view/admin_system/ipkg.htm +++ /dev/null @@ -1,23 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:ipkg IPKG-Konfiguration%>

- -
- -
<%:ipkg_pkglists Paketlisten%>:src Name URL
-
<%:ipkg_targets Installationsziele%>:dest Name Pfad
- -
- -
-
-
-
-
- - -
- <% if msg then %>
<%:error Fehler%>: <%=msg%>
<% end %> -
-
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/packages.htm b/src/ffluci/view/admin_system/packages.htm deleted file mode 100644 index d9cdb4dd0..000000000 --- a/src/ffluci/view/admin_system/packages.htm +++ /dev/null @@ -1,77 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:packages Paketverwaltung%>

- -
- -<% if install or remove or update or upgrade then %> -
<%:status Status%>:
-<% if update then %> - <%:packages_update Paketlisten aktualisieren%>: <% if update == 0 then %><%:ok OK%><% else %><%:error Fehler%> (<%:code Code%> <%=update%>)<% end %>
-<% end %> -<% if upgrade then%> - <%:packages_upgrade Installierte Pakete aktualisieren%>: <% if upgrade == 0 then %><%:ok OK%><% else %><%:error Fehler%> (<%:code Code%> <%=upgrade%>)<% end %>
-<% end %> -<% if install then for k,v in pairs(install) do %> - <%:packages_install Installation von%> '<%=k%>': <% if v == 0 then %><%:ok OK%><% else %><%:error Fehler%> (<%:code Code%> <%=v%>)<% end %>
-<% end end %> -<% if remove then for k,v in pairs(remove) do %> - <%:packages_remove Deinstallation von%> '<%=k%>': <% if v == 0 then %><%:ok OK%><% else %><%:error Fehler%> (<%:code Code%> <%=v%>)<% end %>
-<% end end %> -
-
-<% end %> - - - -
-
- -
-
- <%:packages_installurl Paket herunterladen und installieren%>:
- - -
- -
-
- -
- <%:filter Filter%>: - - - -
- -
-
- -
- - - - - - - - - <% for k, pkg in pairs(pkgs) do %> - - - - - - - - <% end %> -
<%:packages_name Paketname%><%:version Version%><%:install Installieren%><%:delete Löschen%><%:descr Beschreibung%>
<%=pkg.Package%><%=(pkg.Version or '')%><% if not pkg.Status or not pkg.Status.installed then %><% else %><%:installed installiert%><% end %><% if pkg.Status and pkg.Status.installed then %><% else %><%:notinstalled nicht installiert%><% end %><%=(pkg.Description or '')%>
-
-
- -
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/passwd.htm b/src/ffluci/view/admin_system/passwd.htm deleted file mode 100644 index 441753d83..000000000 --- a/src/ffluci/view/admin_system/passwd.htm +++ /dev/null @@ -1,34 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:passwd Passwort ändern%>

-

-<% if stat then %> - <% if stat == 0 then %> - <%:password_changed Passwort erfolgreich geändert!%> - <% elseif stat == 10 then %> - <%:password_nomatch Passwörter stimmen nicht überein! %> - <% else %> - <%:unknown_error Unbekannter Fehler!%> - <% end %> -<% end %> -<% if not stat or stat == 10 then %> -
-
-
-
<%:password Passwort%>
-
-
-
-
<%:confirmation Bestätigung%>
-
-
-
-
- - -
-
-
-<% end %> -
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/reboot.htm b/src/ffluci/view/admin_system/reboot.htm deleted file mode 100644 index 365c33078..000000000 --- a/src/ffluci/view/admin_system/reboot.htm +++ /dev/null @@ -1,10 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:reboot Neu starten%>

-<% if not reboot then %> -

<%:reboot_do Neustart durchführen%>

-<% else %> -

<%:reboot_running Bitte warten: Neustart wird durchgeführt...%>

- -<% end %> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/sshkeys.htm b/src/ffluci/view/admin_system/sshkeys.htm deleted file mode 100644 index 1e1cc24ce..000000000 --- a/src/ffluci/view/admin_system/sshkeys.htm +++ /dev/null @@ -1,23 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:sshkeys SSH-Schlüssel%>

- -
- -
<%:sshkeys_descr Hier können öffentliche SSH-Schlüssel (einer pro Zeile) - zur Authentifizierung abgelegt werden.%>
- -
- -
-
-
-
-
- - -
- <% if msg then %>
<%:error Fehler%>: <%=msg%>
<% end %> -
-
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/upgrade.htm b/src/ffluci/view/admin_system/upgrade.htm deleted file mode 100644 index d91d169a4..000000000 --- a/src/ffluci/view/admin_system/upgrade.htm +++ /dev/null @@ -1,32 +0,0 @@ -<%+header%> -

<%:system System%>

-

<%:upgrade Upgrade%>

-
-<% if sysupgrade and not ret then %> -
-
-
-
<%:fwimage Firmwareimage%>
-
-
-
-
- - <%:keepcfg Konfigurationsdateien übernehmen%> -
-
-
- -
-
-
-<% elseif ret then %> - <% if ret == 0 then %> -
<%:flashed Flashvorgang erfolgreich. Router startet neu...%>
- <% else %> -
<%:flasherr Flashvorgang fehlgeschlagen!%> (<%:code Code%> <%=ret%>)
- <% end %> -<% else %> -
<%:notimplemented Diese Funktion steht leider (noch) nicht zur Verfügung.%>
-<% end %> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_uci/apply.htm b/src/ffluci/view/admin_uci/apply.htm deleted file mode 100644 index 43777c6c6..000000000 --- a/src/ffluci/view/admin_uci/apply.htm +++ /dev/null @@ -1,6 +0,0 @@ -<%+header%> -

<%:config Konfiguration%>

-

<%:uci_applied Die folgenden Änderungen wurden übernommen:%>

-<%=(changes or "-")%> -<%=output%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_uci/changes.htm b/src/ffluci/view/admin_uci/changes.htm deleted file mode 100644 index 3bbcd0e5f..000000000 --- a/src/ffluci/view/admin_uci/changes.htm +++ /dev/null @@ -1,11 +0,0 @@ -<%+header%> -

<%:config Konfiguration%>

-

<%:changes Änderungen%>

-<%=(ffluci.model.uci.changes() or "-")%> -
- -
-
- -
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_uci/revert.htm b/src/ffluci/view/admin_uci/revert.htm deleted file mode 100644 index f5eabc71b..000000000 --- a/src/ffluci/view/admin_uci/revert.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+header%> -

<%:config Konfiguration%>

-

<%:uci_reverted Die folgenden Änderungen wurden verworfen:%>

-<%=(changes or "-")%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_wifi/index.htm b/src/ffluci/view/admin_wifi/index.htm deleted file mode 100644 index 75aa02658..000000000 --- a/src/ffluci/view/admin_wifi/index.htm +++ /dev/null @@ -1,2 +0,0 @@ -<%+header%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/cbi/dvalue.htm b/src/ffluci/view/cbi/dvalue.htm deleted file mode 100644 index 178f2e16a..000000000 --- a/src/ffluci/view/cbi/dvalue.htm +++ /dev/null @@ -1,12 +0,0 @@ -<%+cbi/valueheader%> -<% if self.value then - if type(self.value) == "function" then %> - <%=self:value(section)%> -<% else %> - <%=self.value%> -<% end -else %> - <%=(self:cfgvalue(section) or "")%> -<% end %> -  -<%+cbi/valuefooter%> diff --git a/src/ffluci/view/cbi/footer.htm b/src/ffluci/view/cbi/footer.htm deleted file mode 100644 index 2acf710cd..000000000 --- a/src/ffluci/view/cbi/footer.htm +++ /dev/null @@ -1,7 +0,0 @@ -
- - - -
- -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/cbi/fvalue.htm b/src/ffluci/view/cbi/fvalue.htm deleted file mode 100644 index b609f1d4f..000000000 --- a/src/ffluci/view/cbi/fvalue.htm +++ /dev/null @@ -1,3 +0,0 @@ -<%+cbi/valueheader%> - " name="cbid.<%=self.config.."."..section.."."..self.option%>"<% if self:cfgvalue(section) == self.enabled then %> checked="checked"<% end %> value="1" /> -<%+cbi/valuefooter%> \ No newline at end of file diff --git a/src/ffluci/view/cbi/header.htm b/src/ffluci/view/cbi/header.htm deleted file mode 100644 index 20b4aac7f..000000000 --- a/src/ffluci/view/cbi/header.htm +++ /dev/null @@ -1,7 +0,0 @@ -<%+header%> -
"> -
- - - -
diff --git a/src/ffluci/view/cbi/lvalue.htm b/src/ffluci/view/cbi/lvalue.htm deleted file mode 100644 index f1ae5a093..000000000 --- a/src/ffluci/view/cbi/lvalue.htm +++ /dev/null @@ -1,16 +0,0 @@ -<%+cbi/valueheader%> -<% if self.widget == "select" then %> - -<% elseif self.widget == "radio" then - local c = 0; - for i, key in pairs(self.keylist) do - c = c + 1%> - <%=self.vallist[i]%>"<% if self:cfgvalue(section) == key then %> checked="checked"<% end %> value="<%=key%>" /> -<% if c == self.size then c = 0 %>
-<% end end %> -<% end %> -<%+cbi/valuefooter%> \ No newline at end of file diff --git a/src/ffluci/view/cbi/map.htm b/src/ffluci/view/cbi/map.htm deleted file mode 100644 index 83c377fb8..000000000 --- a/src/ffluci/view/cbi/map.htm +++ /dev/null @@ -1,7 +0,0 @@ -
-

<%=self.title%>

-
<%=self.description%>
-
-<% self:render_children() %> -
-
diff --git a/src/ffluci/view/cbi/mvalue.htm b/src/ffluci/view/cbi/mvalue.htm deleted file mode 100644 index 97a1c4295..000000000 --- a/src/ffluci/view/cbi/mvalue.htm +++ /dev/null @@ -1,19 +0,0 @@ -<% -local v = self:valuelist(section) -%> -<%+cbi/valueheader%> -<% if self.widget == "select" then %> - -<% elseif self.widget == "checkbox" then - local c = 0; - for i, key in pairs(self.keylist) do - c = c + 1%> - <%=self.vallist[i]%>[]"<% if ffluci.util.contains(v, key) then %> checked="checked"<% end %> value="<%=key%>" /> -<% if c == self.size then c = 0 %>
-<% end end %> -<% end %> -<%+cbi/valuefooter%> \ No newline at end of file diff --git a/src/ffluci/view/cbi/nsection.htm b/src/ffluci/view/cbi/nsection.htm deleted file mode 100644 index 9c54a9942..000000000 --- a/src/ffluci/view/cbi/nsection.htm +++ /dev/null @@ -1,17 +0,0 @@ -<% if self:cfgvalue(self.section) then -section = self.section %> -
-

<%=self.title%>

-
<%=self.description%>
- <% if self.addremove then %>
- -
<% end %> -<%+cbi/ucisection%> -
-<% elseif self.addremove then %> -
-

<%=self.title%>

-
<%=self.description%>
- -
-<% end %> diff --git a/src/ffluci/view/cbi/tsection.htm b/src/ffluci/view/cbi/tsection.htm deleted file mode 100644 index 8da0b4a1d..000000000 --- a/src/ffluci/view/cbi/tsection.htm +++ /dev/null @@ -1,22 +0,0 @@ -
-

<%=self.title%>

-
<%=self.description%>
-<% for k, v in pairs(self:cfgsections()) do%> - <% if self.addremove then %>
- -
<% end %> - <% if not self.anonymous then %>

<%=k%>

<% end %> -<% section = k %> -<%+cbi/ucisection%> -<% end %> -<% if self.addremove then %> -
- <% if self.anonymous then %> - - <% else %> - - - <% end %><% if self.err_invalid then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> -
-<% end %> -
diff --git a/src/ffluci/view/cbi/ucisection.htm b/src/ffluci/view/cbi/ucisection.htm deleted file mode 100644 index ef1b6cb0e..000000000 --- a/src/ffluci/view/cbi/ucisection.htm +++ /dev/null @@ -1,23 +0,0 @@ -
-<% self:render_children(section) %> - <% if #self.optionals[section] > 0 or self.dynamic then %> -
- <% if self.dynamic then %> - - <% else %> - - - <% end %> - -
- <% end %> -
-
\ No newline at end of file diff --git a/src/ffluci/view/cbi/value.htm b/src/ffluci/view/cbi/value.htm deleted file mode 100644 index 61033a0f5..000000000 --- a/src/ffluci/view/cbi/value.htm +++ /dev/null @@ -1,3 +0,0 @@ -<%+cbi/valueheader%> - size="<%=self.size%>" <% end %><% if self.maxlength then %>maxlength="<%=self.maxlength%>" <% end %>name="cbid.<%=self.config.."."..section.."."..self.option%>" id="cbid.<%=self.config.."."..section.."."..self.option%>" value="<%=(self:cfgvalue(section) or "")%>" /> -<%+cbi/valuefooter%> diff --git a/src/ffluci/view/cbi/valuefooter.htm b/src/ffluci/view/cbi/valuefooter.htm deleted file mode 100644 index 3f92f09e2..000000000 --- a/src/ffluci/view/cbi/valuefooter.htm +++ /dev/null @@ -1,8 +0,0 @@ -
<%=self.description%>
- - <% if self.tag_invalid[section] then %>
<%:cbi_invalid Fehler: Ungültige Eingabe%>
<% end %> - - <% if #self.deps > 0 then %><% end %> \ No newline at end of file diff --git a/src/ffluci/view/cbi/valueheader.htm b/src/ffluci/view/cbi/valueheader.htm deleted file mode 100644 index 86c782d71..000000000 --- a/src/ffluci/view/cbi/valueheader.htm +++ /dev/null @@ -1,3 +0,0 @@ -
"> -
<%=self.title%>
-
\ No newline at end of file diff --git a/src/ffluci/view/error404.htm b/src/ffluci/view/error404.htm deleted file mode 100644 index adc671de0..000000000 --- a/src/ffluci/view/error404.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+header%> -

404 Not Found

-

Sorry, the object you requested was not found.

-Unable to dispatch: <%=os.getenv("PATH_INFO")%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/error500.htm b/src/ffluci/view/error500.htm deleted file mode 100644 index 8af22e8f2..000000000 --- a/src/ffluci/view/error500.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+header%> -

500 Internal Server Error

-

Sorry, the server encountered an unexpected error.

-<%=message%> -<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/footer.htm b/src/ffluci/view/footer.htm deleted file mode 100644 index 8d48c5fac..000000000 --- a/src/ffluci/view/footer.htm +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
- -
FFLuCI 0.2 - Freifunk Lua Configuration Interface
- - \ No newline at end of file diff --git a/src/ffluci/view/header.htm b/src/ffluci/view/header.htm deleted file mode 100644 index 40d54f516..000000000 --- a/src/ffluci/view/header.htm +++ /dev/null @@ -1,78 +0,0 @@ -<% -require("ffluci.sys") -local load1, load5, load15 = ffluci.sys.loadavg() -local req = require("ffluci.dispatcher").request -local menu = require("ffluci.menu").get()[req.category] -require("ffluci.i18n").loadc("default") -require("ffluci.http").htmlheader() -%> - - - - - - - - FFLuCI - - - - - - -
- - <% end %> -
- -
\ No newline at end of file diff --git a/src/ffluci/view/public_index/contact.htm b/src/ffluci/view/public_index/contact.htm deleted file mode 100644 index ded0a94af..000000000 --- a/src/ffluci/view/public_index/contact.htm +++ /dev/null @@ -1,12 +0,0 @@ -<%+header%> -

<%:contact Kontakt%>

- - - - - - - - -
<%:nickname Pseudonym%>:<%~luci.contact.nickname%>
<%:name Name%>:<%~luci.contact.name%>
<%:mail E-Mail%>:<%~luci.contact.mail%>
<%:phone Telefon%>:<%~luci.contact.phone%>
<%:location Standort%>:<%~luci.contact.location%>
<%:geocoord Geokoordinaten%>:<%~luci.contact.geo%>
<%:note Notiz%>:<%~luci.contact.note%>
-<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/public_index/index.htm b/src/ffluci/view/public_index/index.htm deleted file mode 100644 index 1f06e344c..000000000 --- a/src/ffluci/view/public_index/index.htm +++ /dev/null @@ -1,5 +0,0 @@ -<%+header%> -

<%:hello Hallo!%>

-

<%:admin1 Dies ist der Administrationsbereich. %> -

ToDo: Intelligenter Einleitungstext

-<%+footer%> \ No newline at end of file -- 2.11.0