Browse Source

update for current gluon-master

our changes in 'ffho-config-mode-geo-location' and 'ffho-config-mode-mesh-vpn' are upstream since Apr 27, 2016.
Karsten Böddeker 8 years ago
parent
commit
a894345516

+ 0 - 26
ffho/ffho-config-mode-geo-location/LICENSE

@@ -1,26 +0,0 @@
-The code of Project Gluon may be distributed under the following terms, unless
-noted otherwise in individual files or subtrees.
-
-Copyright (c) 2013, Project Gluon
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-  1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-

+ 0 - 44
ffho/ffho-config-mode-geo-location/Makefile

@@ -1,44 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ffho-config-mode-geo-location
-PKG_VERSION:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-
-define Package/ffho-config-mode-geo-location
-  SECTION:=ffho
-  CATEGORY:=Gluon
-  TITLE:=Set geographic location of a node
-  DEPENDS:=gluon-config-mode-core-virtual +gluon-node-info
-  PROVIDES:=gluon-config-mode-geo-location
-  MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
-  URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-	$(call GluonBuildI18N,ffho-config-mode-geo-location,i18n)
-endef
-
-define Package/ffho-config-mode-geo-location/install
-	$(CP) ./files/* $(1)/
-	$(call GluonInstallI18N,ffho-config-mode-geo-location,$(1))
-endef
-
-define Package/ffho-config-mode-geo-location/postinst
-#!/bin/sh
-$(call GluonCheckSite,check_site.lua)
-endef
-
-$(eval $(call BuildPackage,ffho-config-mode-geo-location))

+ 0 - 25
ffho/ffho-config-mode-geo-location/ReadMe.md

@@ -1,25 +0,0 @@
-ffho-config-mode-geo-location
-=============================
-
-This package enables the user to set latitude, longitude and altitude of their
-node within config mode. As the usage of the altitude is not well defined the
-corresponding field can be disabled.
-
-site.conf
----------
-
-**config_mode.geo_location.show_altitude: optional**
-- `true` enables the altitude field (default)
-- `false` disables the altitude field if altitude has not yet been set
-
-### example
-```lua
-{
-  config_mode = {
-    geo_location = {
-      show_altitude = false,
-    },
-  },
-  ...
-},
-```

+ 0 - 3
ffho/ffho-config-mode-geo-location/check_site.lua

@@ -1,3 +0,0 @@
-if need_table('config_mode', nil, false) and need_table('config_mode.geo_location', nil, false) then
-  need_boolean('config_mode.geo_location.show_altitude', false)
-end

+ 0 - 76
ffho/ffho-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua

@@ -1,76 +0,0 @@
-local cbi = require "luci.cbi"
-local i18n = require "luci.i18n"
-local uci = luci.model.uci.cursor()
-local site = require 'gluon.site_config'
-
-local M = {}
-
-local function show_altitude()
-  if ((site.config_mode or {}).geo_location or {}).show_altitude ~= false then
-    return true
-  end
-  if uci:get_first("gluon-node-info", "location", "altitude") then
-    return true
-  end
-  return false
-end
-
-function M.section(form)
-  local text = i18n.translate('If you want the location of your node to '
-    .. 'be displayed on the map, you can enter its coordinates here.')
-  if show_altitude() then
-    text = text .. ' ' .. i18n.translate('Specifying the altitude is '
-      .. 'optional and should only be done if a proper value is known.')
-  end
-  local s = form:section(cbi.SimpleSection, nil, text)
-
-
-  local o
-
-  o = s:option(cbi.Flag, "_location", i18n.translate("Show node on the map"))
-  o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled)
-  o.rmempty = false
-
-  o = s:option(cbi.Value, "_latitude", i18n.translate("Latitude"))
-  o.default = uci:get_first("gluon-node-info", "location", "latitude")
-  o:depends("_location", "1")
-  o.rmempty = false
-  o.datatype = "float"
-  o.description = i18n.translatef("e.g. %s", "53.873621")
-
-  o = s:option(cbi.Value, "_longitude", i18n.translate("Longitude"))
-  o.default = uci:get_first("gluon-node-info", "location", "longitude")
-  o:depends("_location", "1")
-  o.rmempty = false
-  o.datatype = "float"
-  o.description = i18n.translatef("e.g. %s", "10.689901")
-
-  if show_altitude() then
-    o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude"))
-    o.default = uci:get_first("gluon-node-info", "location", "altitude")
-    o:depends("_location", "1")
-    o.rmempty = true
-    o.datatype = "float"
-    o.description = i18n.translatef("e.g. %s", "11.51")
-  end
-
-end
-
-function M.handle(data)
-  local sname = uci:get_first("gluon-node-info", "location")
-
-  uci:set("gluon-node-info", sname, "share_location", data._location)
-  if data._location and data._latitude ~= nil and data._longitude ~= nil then
-    uci:set("gluon-node-info", sname, "latitude", data._latitude:trim())
-    uci:set("gluon-node-info", sname, "longitude", data._longitude:trim())
-    if data._altitude ~= nil then
-      uci:set("gluon-node-info", sname, "altitude", data._altitude:trim())
-    else
-      uci:delete("gluon-node-info", sname, "altitude")
-    end
-  end
-  uci:save("gluon-node-info")
-  uci:commit("gluon-node-info")
-end
-
-return M

+ 0 - 40
ffho/ffho-config-mode-geo-location/i18n/de.po

@@ -1,40 +0,0 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: gluon-config-mode-geo-location\n"
-"PO-Revision-Date: 2015-03-23 02:18+0100\n"
-"Last-Translator: Martin Weinelt <martin@darmstadt.freifunk.net>\n"
-"Language-Team: German\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-msgid ""
-"If you want the location of your node to be displayed on the map, you can "
-"enter its coordinates here."
-msgstr ""
-"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
-"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen."
-
-msgid ""
-"Specifying the altitude is optional and should only be done if a proper "
-"value is known."
-msgstr ""
-"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein "
-"exakter Wert bekannt ist."
-
-msgid "Latitude"
-msgstr "Breitengrad"
-
-msgid "Longitude"
-msgstr "Längengrad"
-
-msgid "Altitude"
-msgstr "Höhe"
-
-msgid "Show node on the map"
-msgstr "Knoten auf der Karte anzeigen"
-
-msgid "e.g. %s"
-msgstr "z.B. %s"

+ 0 - 27
ffho/ffho-config-mode-geo-location/i18n/ffho-config-mode-geo-location.pot

@@ -1,27 +0,0 @@
-msgid ""
-msgstr "Content-Type: text/plain; charset=UTF-8"
-
-msgid ""
-"If you want the location of your node to be displayed on the map, you can "
-"enter its coordinates here."
-msgstr ""
-
-msgid ""
-"Specifying the altitude is optional and should only be done if a proper "
-"value is known."
-msgstr ""
-
-msgid "Latitude"
-msgstr ""
-
-msgid "Longitude"
-msgstr ""
-
-msgid "Altitude"
-msgstr ""
-
-msgid "Show node on the map"
-msgstr ""
-
-msgid "e.g. %s"
-msgstr ""

+ 0 - 40
ffho/ffho-config-mode-geo-location/i18n/fr.po

@@ -1,40 +0,0 @@
-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2015-08-12 23:30+0100\n"
-"Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
-"Language-Team: French\n"
-"Language: fr\n"
-"MIME-Version: 1.0\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-msgid ""
-"If you want the location of your node to be displayed on the map, you can "
-"enter its coordinates here."
-msgstr ""
-"Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. "
-"Ici vous pouvez entrer sa position."
-
-msgid ""
-"Specifying the altitude is optional and should only be done if a proper "
-"value is known."
-msgstr ""
-"La altitude est optionelle et ne devrait que être ajoutée si la valeur "
-"exacte est connue."
-
-msgid "Latitude"
-msgstr "Latitude"
-
-msgid "Longitude"
-msgstr "Longitude"
-
-msgid "Altitude"
-msgstr "Hauteur"
-
-msgid "Show node on the map"
-msgstr "Afficher le nœud sur la carte"
-
-msgid "e.g. %s"
-msgstr "Ex: %s"

+ 0 - 26
ffho/ffho-config-mode-mesh-vpn/LICENSE

@@ -1,26 +0,0 @@
-The code of Project Gluon may be distributed under the following terms, unless
-noted otherwise in individual files or subtrees.
-
-Copyright (c) 2013, Project Gluon
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-  1. Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-

+ 0 - 39
ffho/ffho-config-mode-mesh-vpn/Makefile

@@ -1,39 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=ffho-config-mode-mesh-vpn
-PKG_VERSION:=2
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-
-define Package/ffho-config-mode-mesh-vpn
-  SECTION:=ffho
-  CATEGORY:=Gluon
-  TITLE:=Toggle mesh-vpn and bandwidth limit
-  DEPENDS:=gluon-config-mode-core-virtual +gluon-mesh-vpn-fastd
-  PROVIDES:=gluon-config-mode-mesh-vpn
-  MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
-  URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-	$(call GluonBuildI18N,ffho-config-mode-mesh-vpn,i18n)
-endef
-
-define Package/ffho-config-mode-mesh-vpn/install
-	$(CP) ./files/* $(1)/
-	$(call GluonInstallI18N,ffho-config-mode-mesh-vpn,$(1))
-endef
-
-$(eval $(call BuildPackage,ffho-config-mode-mesh-vpn))

+ 0 - 26
ffho/ffho-config-mode-mesh-vpn/ReadMe.md

@@ -1,26 +0,0 @@
-ffho-config-mode-mesh-vpn
-=========================
-
-Costomization of `gluon-config-mode-mesh-vpn` to use the contactinformation
-within the reboot page.
-
-site/i18n/*.po
---------------
-
-Within `msgid "gluon-config-mode:pubkey"` you can use:
-- `<%=contact%>`
-- `<%=hostname%>`
-- `<%=pubkey%>`
-- `<%=sysconfig.*%>`
-
-### example
-```
-msgid "gluon-config-mode:pubkey"
-msgstr ""
-"<div class=\"the-key\">"
-"<%=hostname%><br/><br/>"
-"# Owner: <%=contact%><br/>"
-"# MAC: <%=sysconfig.primary_mac%><br/>"
-"key \"<%= pubkey %>\";"
-"</div>"
-```

+ 0 - 26
ffho/ffho-config-mode-mesh-vpn/files/lib/gluon/config-mode/reboot/0100-mesh-vpn.lua

@@ -1,26 +0,0 @@
-local uci = luci.model.uci.cursor()
-local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0")
-
-if meshvpn_enabled ~= "1" then
-  return nil
-else
-  local i18n = require "luci.i18n"
-  local util = require "luci.util"
-  local site = require 'gluon.site_config'
-  local sysconfig = require 'gluon.sysconfig'
-
-  local pubkey = util.trim(util.exec("/etc/init.d/fastd show_key " .. "mesh_vpn"))
-  local hostname = uci:get_first("system", "system", "hostname")
-  local contact = uci:get_first("gluon-node-info", "owner", "contact")
-
-  local msg = i18n.translate('gluon-config-mode:pubkey')
-
-  return function ()
-           luci.template.render_string(msg, { pubkey=pubkey
-                                            , hostname=hostname
-                                            , site=site
-                                            , sysconfig=sysconfig
-                                            , contact=contact
-                                            })
-         end
-end

+ 0 - 64
ffho/ffho-config-mode-mesh-vpn/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua

@@ -1,64 +0,0 @@
-local cbi = require "luci.cbi"
-local i18n = require "luci.i18n"
-local uci = luci.model.uci.cursor()
-
-local M = {}
-
-function M.section(form)
-  local msg = i18n.translate('Your internet connection can be used to establish an ' ..
-                             'encrypted connection with other nodes. ' ..
-                             'Enable this option if there are no other nodes reachable ' ..
-                             'over WLAN in your vicinity or you want to make a part of ' ..
-                             'your connection\'s bandwidth available for the network. You can limit how ' ..
-                             'much bandwidth the node will use at most.')
-  local s = form:section(cbi.SimpleSection, nil, msg)
-
-  local o
-
-  o = s:option(cbi.Flag, "_meshvpn", i18n.translate("Use internet connection (mesh VPN)"))
-  o.default = uci:get_bool("fastd", "mesh_vpn", "enabled") and o.enabled or o.disabled
-  o.rmempty = false
-
-  o = s:option(cbi.Flag, "_limit_enabled", i18n.translate("Limit bandwidth"))
-  o:depends("_meshvpn", "1")
-  o.default = uci:get_bool("simple-tc", "mesh_vpn", "enabled") and o.enabled or o.disabled
-  o.rmempty = false
-
-  o = s:option(cbi.Value, "_limit_ingress", i18n.translate("Downstream (kbit/s)"))
-  o:depends("_limit_enabled", "1")
-  o.value = uci:get("simple-tc", "mesh_vpn", "limit_ingress")
-  o.rmempty = false
-  o.datatype = "uinteger"
-
-  o = s:option(cbi.Value, "_limit_egress", i18n.translate("Upstream (kbit/s)"))
-  o:depends("_limit_enabled", "1")
-  o.value = uci:get("simple-tc", "mesh_vpn", "limit_egress")
-  o.rmempty = false
-  o.datatype = "uinteger"
-end
-
-function M.handle(data)
-  uci:set("fastd", "mesh_vpn", "enabled", data._meshvpn)
-  uci:save("fastd")
-  uci:commit("fastd")
-
-  -- checks for nil needed due to o:depends(...)
-  if data._limit_enabled ~= nil then
-    uci:set("simple-tc", "mesh_vpn", "interface")
-    uci:set("simple-tc", "mesh_vpn", "enabled", data._limit_enabled)
-    uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn")
-
-    if data._limit_ingress ~= nil then
-      uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress:trim())
-    end
-
-    if data._limit_egress ~= nil then
-      uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress:trim())
-    end
-
-    uci:commit("simple-tc")
-    uci:commit("simple-tc")
-  end
-end
-
-return M

+ 0 - 36
ffho/ffho-config-mode-mesh-vpn/i18n/de.po

@@ -1,36 +0,0 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2015-03-19 22:05+0100\n"
-"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
-"Language-Team: German\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-msgid "Downstream (kbit/s)"
-msgstr "Downstream (kbit/s)"
-
-msgid "Limit bandwidth"
-msgstr "Bandbreite begrenzen"
-
-msgid "Upstream (kbit/s)"
-msgstr "Upstream (kbit/s)"
-
-msgid "Use internet connection (mesh VPN)"
-msgstr "Internetverbindung nutzen (Mesh-VPN)"
-
-msgid ""
-"Your internet connection can be used to establish an encrypted connection "
-"with other nodes. Enable this option if there are no other nodes reachable "
-"over WLAN in your vicinity or you want to make a part of your connection's "
-"bandwidth available for the network. You can limit how much bandwidth the "
-"node will use at most."
-msgstr ""
-"Dein Knoten kann deine Internetverbindung nutzen um darüber eine "
-"verschlüsselte Verbindung zu anderen Knoten aufzubauen. Die dafür "
-"genutzte Bandbreite kannst du beschränken. Aktiviere die Option, falls keine "
-"per WLAN erreichbaren Nachbarknoten in deiner Nähe sind oder du deine "
-"Internetverbindung für das Mesh-Netzwerk zur Verfügung stellen möchtest."

+ 0 - 22
ffho/ffho-config-mode-mesh-vpn/i18n/ffho-config-mode-mesh-vpn.pot

@@ -1,22 +0,0 @@
-msgid ""
-msgstr "Content-Type: text/plain; charset=UTF-8"
-
-msgid "Downstream (kbit/s)"
-msgstr ""
-
-msgid "Limit bandwidth"
-msgstr ""
-
-msgid "Upstream (kbit/s)"
-msgstr ""
-
-msgid "Use internet connection (mesh VPN)"
-msgstr ""
-
-msgid ""
-"Your internet connection can be used to establish an encrypted connection "
-"with other nodes. Enable this option if there are no other nodes reachable "
-"over WLAN in your vicinity or you want to make a part of your connection's "
-"bandwidth available for the network. You can limit how much bandwidth the "
-"node will use at most."
-msgstr ""

+ 0 - 36
ffho/ffho-config-mode-mesh-vpn/i18n/fr.po

@@ -1,36 +0,0 @@
-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2015-08-12 23:30+0100\n"
-"Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
-"Language-Team: French\n"
-"Language: fr\n"
-"MIME-Version: 1.0\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-msgid "Downstream (kbit/s)"
-msgstr "Débit déscendant (kbit/s)"
-
-msgid "Limit bandwidth"
-msgstr "Limiter la bande passante"
-
-msgid "Upstream (kbit/s)"
-msgstr "Débit ascendant (kbit/s)"
-
-msgid "Use internet connection (mesh VPN)"
-msgstr "Utiliser la connection internet (Mesh-VPN)"
-
-msgid ""
-"Your internet connection can be used to establish an encrypted connection "
-"with other nodes. Enable this option if there are no other nodes reachable "
-"over WLAN in your vicinity or you want to make a part of your connection's "
-"bandwidth available for the network. You can limit how much bandwidth the "
-"node will use at most."
-msgstr ""
-"Votre nœud peut partager votre accès internet grâce une communication encryptée "
-"avec d'autres nœuds. Vous pouvez limiter la bande passante utilisée par ceci. "
-"Active cette option, si vous n'avez pas d'autres nœuds atteignables par WLAN " 
-"ou si vous voulez partager votre bande passante pour le réseau MESH."
-