Skip to content
Snippets Groups Projects
Commit e640fa39 authored by chrissi^'s avatar chrissi^
Browse files

parker: remove prefix6 and prefix4

This change removes the prefix4 and prefix6 attributes from the
site.conf. These do not make sense in the context of parker.

Packages that are usually used in parker do not use these anymore. Some
other packages do - you should not enable those :-)

With this change a ipv6 route to prefix_6 will no longer be set on
br-client. Systems that already have this route will keep it.

With this change the (not working) redirect in the http status page has
been removed. We should consider to add this later on.

Hint: Some changes were moved from this commit to:
community-packages:ffbs-mesh-vpn-parker/files/lib/gluon/upgrade/401-respondd-firewall-parker
This reverts changes done in package/gluon-respondd/luasrc/lib/gluon/upgrade/400-respondd-firewall.
parent 4f34d780
No related branches found
No related tags found
No related merge requests found
need_string_match(in_domain({'next_node', 'mac'}), '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$', false)
if need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false) then
need_string_match(in_domain({'prefix4'}), '^%d+.%d+.%d+.%d+/%d+$')
end
need_string_match(in_domain({'next_node', 'ip6'}), '^[%x:]+$', false)
......
......@@ -22,8 +22,7 @@ uci:section('network', 'device', 'local_node_dev', {
local ip4, ip6
if next_node.ip4 then
local plen = site.prefix4():match('/%d+$')
ip4 = next_node.ip4 .. plen
ip4 = next_node.ip4 .. '/32'
end
if next_node.ip6 then
......
......@@ -26,10 +26,6 @@ need_string(in_site({'timezone'}))
need_string_array({'ntp_servers'}, false)
need_string_match(in_domain({'prefix4'}), '^%d+.%d+.%d+.%d+/%d+$', false)
need_string_match(in_domain({'prefix6'}), '^[%x:]+/64$')
need_string_array_match(in_domain({'extra_prefixes6'}), '^[%x:]+/%d+$', false)
local supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000}
for _, config in ipairs({'wifi24', 'wifi5'}) do
if need_table({config}, nil, false) then
......
......@@ -63,24 +63,7 @@ end
entry({}, call(function(http, renderer)
local nodeinfo = json.parse(util.exec('exec gluon-neighbour-info -d ::1 -p 1001 -t 3 -c 1 -r nodeinfo'))
local node_ip = parse_ip(http:getenv('SERVER_ADDR'))
if node_ip and (
match(node_ip, parse_ip(site.next_node.ip4()), 8) or
match(node_ip, parse_ip(site.next_node.ip6()), 8)
) then
-- The user has visited the status page via a next-node address
-- Redirect the user to a unique address to avoid switching nodes
local prefix = parse_ip(site.prefix6():match('^[^/]+'))
for _, addr in ipairs(nodeinfo.network.addresses) do
if match(prefix, parse_ip(addr), 4) then
http:header('Cache-Control', 'no-cache, no-store, must-revalidate')
http:redirect('http://[' .. addr .. ']' .. http:getenv('REQUEST_URI'))
http:close()
return
end
end
end
-- TODO: Add a redirect to a local v6 addr for parker
renderer.render('status-page', { nodeinfo = nodeinfo, site = site }, 'gluon-status-page')
end))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment