This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
forked from ffrl/ffrl-packages
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch all packages to gluon pull request version: freifunk-gluon/glu…
- Loading branch information
Joerg Deckert
committed
Mar 7, 2017
1 parent
ab8ace5
commit 0ce3667
Showing
17 changed files
with
180 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 0 additions & 64 deletions
64
gluon-config-mode-tunneldigger/files/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
gluon-config-mode-tunneldigger/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
gluon-mesh-vpn-tunneldigger/files/lib/gluon/upgrade/400-mesh-vpn-tunneldigger
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
gluon-mesh-vpn-tunneldigger/files/lib/gluon/upgrade/420-mesh-vpn-tunneldigger-simple-tc
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
gluon-mesh-vpn-tunneldigger/luasrc/lib/gluon/upgrade/400-mesh-vpn-tunneldigger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |
Oops, something went wrong.