Skip to content

Commit

Permalink
Revert "mesh-vpn: recognise parker as vpn type"
Browse files Browse the repository at this point in the history
This reverts commit a8a703d.
  • Loading branch information
maurerle committed Nov 1, 2024
1 parent ec3141b commit c7735e9
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/lua

local uci = require('simple-uci').cursor()
local vpn_name, vpn = require('gluon.mesh-vpn').get_active_provider()

local vpn_config = {
enabled = uci:get_bool('gluon', 'mesh_vpn', 'enabled'),
Expand All @@ -9,12 +10,20 @@ local vpn_config = {
limit_ingress = uci:get('gluon', 'mesh_vpn', 'limit_ingress'),
}

uci:delete('simple-tc', 'client')
uci:section('simple-tc', 'interface', 'client', {
ifname = 'br-client',
enabled = vpn_config.limit_enabled,
-- limits are flipped here
limit_ingress = vpn_config.limit_egress,
limit_egress = vpn_config.limit_ingress,
})
uci:commit('simple-tc')
if vpn_name ~= 'fastd' then
uci:set('fastd', 'mesh_vpn', 'enabled', false)
uci:save('fastd')
end

if vpn_name ~= 'tunneldigger' then
uci:set('tunneldigger', 'mesh_vpn', 'enabled', false)
uci:save('tunneldigger')
end

vpn.enable(vpn_config.enabled)
if vpn_config.limit_enabled then
vpn.set_limit(vpn_config.limit_ingress, vpn_config.limit_egress)
else
vpn.set_limit(nil, nil)
end

0 comments on commit c7735e9

Please sign in to comment.