Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
switch all packages to gluon pull request version: freifunk-gluon/glu…
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerg Deckert committed Mar 7, 2017
1 parent ab8ace5 commit 0ce3667
Show file tree
Hide file tree
Showing 17 changed files with 180 additions and 255 deletions.
5 changes: 3 additions & 2 deletions gluon-config-mode-tunneldigger/Makefile
Expand Up @@ -5,7 +5,7 @@ PKG_VERSION:=1

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../gluon.mk

PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)

Expand All @@ -26,10 +26,11 @@ endef

define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-tunneldigger,i18n)
$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef

define Package/gluon-config-mode-tunneldigger/install
$(CP) ./files/* $(1)/
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-tunneldigger,$(1))
endef

Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions gluon-config-mode-tunneldigger/i18n/de.po
Expand Up @@ -19,18 +19,18 @@ msgstr "Bandbreite begrenzen"
msgid "Upstream (kbit/s)"
msgstr "Upstream (kbit/s)"

msgid "Use internet connection (mesh VPN via L2TP)"
msgstr "Internetverbindung nutzen (Mesh-VPN via L2TP)"
msgid "Use internet connection (mesh VPN)"
msgstr "Internetverbindung nutzen (Mesh-VPN)"

msgid ""
"Your internet connection can be used to establish a L2TP VPN connection "
"Your internet connection can be used to establish a VPN 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 "
"L2TP-VPN Verbindung zu anderen Knoten aufzubauen. Die dafür "
"VPN 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."
Expand Up @@ -10,11 +10,11 @@ msgstr ""
msgid "Upstream (kbit/s)"
msgstr ""

msgid "Use internet connection (mesh VPN via L2TP)"
msgid "Use internet connection (mesh VPN)"
msgstr ""

msgid ""
"Your internet connection can be used to establish a L2TP VPN connection "
"Your internet connection can be used to establish a VPN 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 "
Expand Down
@@ -0,0 +1,47 @@
return function(form, uci)
local msg = translate(
'Your internet connection can be used to establish a ' ..
'VPN 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(Section, nil, msg)

local o

local meshvpn = s:option(Flag, "meshvpn", translate("Use internet connection (mesh VPN)"))
meshvpn.default = uci:get_bool("tunneldigger", "mesh_vpn", "enabled")
function meshvpn:write(data)
uci:set("tunneldigger", "mesh_vpn", "enabled", data)
end

local limit = s:option(Flag, "limit_enabled", translate("Limit bandwidth"))
limit:depends(meshvpn, true)
limit.default = uci:get_bool("simple-tc", "mesh_vpn", "enabled")
function limit:write(data)
uci:set("simple-tc", "mesh_vpn", "interface")
uci:set("simple-tc", "mesh_vpn", "enabled", data)
uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn")
end

o = s:option(Value, "limit_ingress", translate("Downstream (kbit/s)"))
o:depends(limit, true)
o.default = uci:get("simple-tc", "mesh_vpn", "limit_ingress")
o.datatype = "uinteger"
function o:write(data)
uci:set("simple-tc", "mesh_vpn", "limit_ingress", data)
end

o = s:option(Value, "limit_egress", translate("Upstream (kbit/s)"))
o:depends(limit, true)
o.default = uci:get("simple-tc", "mesh_vpn", "limit_egress")
o.datatype = "uinteger"
function o:write(data)
uci:set("simple-tc", "mesh_vpn", "limit_egress", data)
end

return {'tunneldigger', 'simple-tc'}
end
8 changes: 5 additions & 3 deletions gluon-mesh-vpn-tunneldigger/Makefile
Expand Up @@ -5,13 +5,13 @@ PKG_VERSION:=3

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../gluon.mk

define Package/gluon-mesh-vpn-tunneldigger
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Support for connecting batman-adv meshes via tunneltigger/l2tpv3 pseudowire
DEPENDS:=+gluon-core gluon-mesh-batman-adv +gluon-wan-dnsmasq +tunneldigger +iptables-mod-extra +simple-tc
TITLE:=Support for connecting meshes via tunneltigger/l2tpv3 pseudowire
DEPENDS:=+gluon-core +gluon-wan-dnsmasq +tunneldigger +iptables +iptables-mod-extra +simple-tc
endef

define Package/gluon-mesh-vpn-tunneldigger/description
Expand All @@ -26,10 +26,12 @@ define Build/Configure
endef

define Build/Compile
$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef

define Package/gluon-mesh-vpn-tunneldigger/install
$(CP) ./files/* $(1)/
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
endef

define Package/gluon-mesh-vpn-tunneldigger/postinst
Expand Down
6 changes: 3 additions & 3 deletions gluon-mesh-vpn-tunneldigger/check_site.lua
Expand Up @@ -3,7 +3,7 @@ need_boolean('tunneldigger_mesh_vpn.enabled', false)
need_string_array('tunneldigger_mesh_vpn.brokers')

if need_table('tunneldigger_mesh_vpn.bandwidth_limit', nil, false) then
need_boolean('tunneldigger_mesh_vpn.bandwidth_limit.enabled', false)
need_number('tunneldigger_mesh_vpn.bandwidth_limit.ingress', false)
need_number('tunneldigger_mesh_vpn.bandwidth_limit.egress', false)
need_boolean('tunneldigger_mesh_vpn.bandwidth_limit.enabled', false)
need_number('tunneldigger_mesh_vpn.bandwidth_limit.ingress', false)
need_number('tunneldigger_mesh_vpn.bandwidth_limit.egress', false)
end

This file was deleted.

This file was deleted.

@@ -0,0 +1,61 @@
#!/usr/bin/lua

local site = require 'gluon.site_config'
local users = require 'gluon.users'
local util = require 'gluon.util'

local uci = require('simple-uci').cursor()


-- Group for iptables rule
users.add_group('gluon-tunneldigger', 900)

local enabled = uci:get('tunneldigger', 'mesh_vpn', 'enabled')
if enabled == nil then
enabled = uci:get_first('tunneldigger', 'broker', 'enabled')
end
if enabled == nil then
enabled = site.tunneldigger_mesh_vpn.enabled or false
end

-- Delete old broker config section
if not uci:get('tunneldigger', 'mesh_vpn') then
uci:delete_all('tunneldigger', 'broker')
end

uci:section('tunneldigger', 'broker', 'mesh_vpn',
{
enabled = enabled,
uuid = util.node_id(),
interface = 'mesh-vpn',
bind_interface = 'br-wan',
group = 'gluon-tunneldigger',
broker_selection = 'usage',
address = site.tunneldigger_mesh_vpn.brokers,
}
)

uci:save('tunneldigger')

uci:section('network', 'interface', 'mesh_vpn',
{
ifname = 'mesh-vpn',
proto = 'gluon_mesh',
fixed_mtu = '1',
transitive = '1',
mtu = site.tunneldigger_mesh_vpn.mtu,
}
)

uci:save('network')


uci:section('firewall', 'include', 'mesh_vpn_dns',
{
type = 'restore',
path = '/lib/gluon/mesh-vpn-tunneldigger/iptables.rules',
family = 'ipv4',
}
)

uci:save('firewall')

0 comments on commit 0ce3667

Please sign in to comment.