Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
Loading items
Show changes
Showing
with 38 additions and 133 deletions
/* /* SPDX-FileCopyrightText: 2016, Matthias Schiffer <mschiffer@universe-factory.net> */
Copyright (c) 2016, Matthias Schiffer <mschiffer@universe-factory.net> /* SPDX-License-Identifier: BSD-2-Clause */
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.
*/
#include <respondd.h> #include <respondd.h>
......
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-client-bridge PKG_NAME:=gluon-client-bridge
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
define Package/gluon-client-bridge define Package/gluon-client-bridge
TITLE:=Provides a bridge and a wireless interface for clients to connect to TITLE:=Provides a bridge and a wireless interface for clients to connect to
DEPENDS:=+gluon-core +kmod-veth +@GLUON_SPECIALIZE_KERNEL:KERNEL_VETH DEPENDS:=+gluon-core +kmod-veth
endef endef
$(eval $(call BuildPackageGluon,gluon-client-bridge)) $(eval $(call BuildPackageGluon,gluon-client-bridge))
...@@ -6,26 +6,9 @@ local util = require 'gluon.util' ...@@ -6,26 +6,9 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
local interfaces = uci:get('network', 'client', 'ifname') or {} local interfaces = util.get_role_interfaces(uci, 'client', true)
if type(interfaces) == 'string' then
local ifname = interfaces
interfaces = {}
for iface in ifname:gmatch('%S+') do
util.add_to_set(interfaces, iface)
end
end
if sysconfig.lan_ifname and uci:get_bool('network', 'mesh_lan', 'disabled') then
for lanif in sysconfig.lan_ifname:gmatch('%S+') do
util.add_to_set(interfaces, lanif)
end
end
util.add_to_set(interfaces, 'local-port') util.add_to_set(interfaces, 'local-port')
uci:delete('network', 'client')
uci:section('network', 'interface', 'client', { uci:section('network', 'interface', 'client', {
type = 'bridge', type = 'bridge',
ifname = interfaces, ifname = interfaces,
...@@ -40,9 +23,6 @@ uci:section('network', 'interface', 'client', { ...@@ -40,9 +23,6 @@ uci:section('network', 'interface', 'client', {
uci:save('network') uci:save('network')
-- TODO: remove this line and the next in 2019. Firewall zones have been renamed in 2017.
uci:delete('firewall', 'client')
uci:section('firewall', 'zone', 'drop', { uci:section('firewall', 'zone', 'drop', {
name = 'drop', name = 'drop',
network = {'client'}, network = {'client'},
...@@ -51,9 +31,9 @@ uci:section('firewall', 'zone', 'drop', { ...@@ -51,9 +31,9 @@ uci:section('firewall', 'zone', 'drop', {
forward = 'DROP', forward = 'DROP',
}) })
local networks = uci:get_list('firewall', 'local_client', 'network') local networks = uci:get_list('firewall', 'loc_client', 'network')
util.add_to_set(networks, 'local_node') util.add_to_set(networks, 'local_node')
uci:set_list('firewall', 'local_client', 'network', networks) uci:set_list('firewall', 'loc_client', 'network', networks)
local dnsmasq = uci:get_first('dhcp', 'dnsmasq') local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
...@@ -61,10 +41,6 @@ uci:set('dhcp', dnsmasq, 'boguspriv', false) ...@@ -61,10 +41,6 @@ uci:set('dhcp', dnsmasq, 'boguspriv', false)
uci:set('dhcp', dnsmasq, 'localise_queries', false) uci:set('dhcp', dnsmasq, 'localise_queries', false)
uci:set('dhcp', dnsmasq, 'rebind_protection', false) uci:set('dhcp', dnsmasq, 'rebind_protection', false)
-- TODO: remove this line and the next two in 2019 the zones were removed in 2017
uci:delete('dhcp', 'client')
uci:delete('firewall', 'local_node')
uci:section('dhcp', 'dhcp', 'local_client', { uci:section('dhcp', 'dhcp', 'local_client', {
interface = 'client', interface = 'client',
ignore = true, ignore = true,
......
...@@ -10,7 +10,6 @@ local uci = require('simple-uci').cursor() ...@@ -10,7 +10,6 @@ local uci = require('simple-uci').cursor()
local next_node = site.next_node({}) local next_node = site.next_node({})
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', { uci:section('network', 'device', 'local_node_dev', {
type = 'veth', type = 'veth',
name = 'local-node', name = 'local-node',
...@@ -31,7 +30,6 @@ if next_node.ip6 then ...@@ -31,7 +30,6 @@ if next_node.ip6 then
ip6 = next_node.ip6 .. '/128' ip6 = next_node.ip6 .. '/128'
end end
uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', { uci:section('network', 'interface', 'local_node', {
ifname = 'local-node', ifname = 'local-node',
proto = 'static', proto = 'static',
......
#!/usr/bin/lua #!/usr/bin/lua
local platform = require 'gluon.platform'
local wireless = require 'gluon.wireless' local wireless = require 'gluon.wireless'
local uci = require('simple-uci').cursor() local uci = require('simple-uci').cursor()
...@@ -52,7 +51,7 @@ local function configure_owe(radio, index, config, radio_name) ...@@ -52,7 +51,7 @@ local function configure_owe(radio, index, config, radio_name)
-- Don't configure OWE in case our device -- Don't configure OWE in case our device
-- can't do MFP, as it's mandatory for OWE. -- can't do MFP, as it's mandatory for OWE.
if not platform.device_supports_mfp(uci) then if not wireless.device_supports_mfp(uci) then
return return
end end
...@@ -80,7 +79,7 @@ local function configure_owe_transition_mode(config, radio_name) ...@@ -80,7 +79,7 @@ local function configure_owe_transition_mode(config, radio_name)
-- Don't configure OWE in case our device -- Don't configure OWE in case our device
-- can't do MFP, as it's mandatory for OWE. -- can't do MFP, as it's mandatory for OWE.
if not platform.device_supports_mfp(uci) then if not wireless.device_supports_mfp(uci) then
return return
end end
...@@ -91,21 +90,16 @@ local function configure_owe_transition_mode(config, radio_name) ...@@ -91,21 +90,16 @@ local function configure_owe_transition_mode(config, radio_name)
local name_client = 'client_' .. radio_name local name_client = 'client_' .. radio_name
local name_owe = 'owe_' .. radio_name local name_owe = 'owe_' .. radio_name
local ssid_client = uci:get('wireless', name_client, 'ssid') local ifname_client = uci:get('wireless', name_client, 'ifname')
local ssid_owe = uci:get('wireless', name_owe, 'ssid') local ifname_owe = uci:get('wireless', name_owe, 'ifname')
local macaddr_client = uci:get('wireless', name_client, 'macaddr') if not (ifname_client and ifname_owe) then
local macaddr_owe = uci:get('wireless', name_owe, 'macaddr')
if not (ssid_client and ssid_owe and macaddr_client and macaddr_owe) then
return return
end end
uci:set('wireless', name_client, 'owe_transition_ssid', ssid_owe) uci:set('wireless', name_client, 'owe_transition_ifname', ifname_owe)
uci:set('wireless', name_client, 'owe_transition_bssid', macaddr_owe) uci:set('wireless', name_owe, 'owe_transition_ifname', ifname_client)
uci:set('wireless', name_owe, 'owe_transition_ssid', ssid_client)
uci:set('wireless', name_owe, 'owe_transition_bssid', macaddr_client)
uci:set('wireless', name_owe, 'hidden', '1') uci:set('wireless', name_owe, 'hidden', '1')
end end
......
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-autoupdater PKG_NAME:=gluon-config-mode-autoupdater
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
......
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-contact-info PKG_NAME:=gluon-config-mode-contact-info
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
......
...@@ -21,7 +21,6 @@ return function(form, uci) ...@@ -21,7 +21,6 @@ return function(form, uci)
o.optional = true o.optional = true
function o:write(data) function o:write(data)
uci:set("gluon-node-info", owner, "contact", data) uci:set("gluon-node-info", owner, "contact", data)
uci:save("gluon-node-info")
end end
return {'gluon-node-info'}
end end
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-core PKG_NAME:=gluon-config-mode-core
PKG_VERSION:=2
include ../gluon.mk include ../gluon.mk
......
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html lang="">
<head> <head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0">
<meta http-equiv="refresh" content="0; URL=/cgi-bin/config" /> <meta http-equiv="refresh" content="0; URL=/cgi-bin/config">
</head> </head>
<body> <body>
</body> </body>
......
local util = require "gluon.util" local util = require "gluon.util"
local uci = require("simple-uci").cursor() local uci = require("simple-uci").cursor()
local wizard = {}
for _, entry in ipairs(util.glob('/lib/gluon/config-mode/wizard/*')) do
local f = assert(loadfile(entry))
setfenv(f, getfenv())
local w = f()
table.insert(wizard, w)
end
local f = Form(translate("Welcome!")) local f = Form(translate("Welcome!"))
f.submit = translate('Save & restart') f.submit = translate('Save & restart')
f.reset = false f.reset = false
...@@ -18,21 +9,10 @@ local s = f:section(Section) ...@@ -18,21 +9,10 @@ local s = f:section(Section)
s.template = "wizard/welcome" s.template = "wizard/welcome"
s.package = "gluon-config-mode-core" s.package = "gluon-config-mode-core"
local commit = {'gluon-setup-mode'} for _, entry in ipairs(util.glob('/lib/gluon/config-mode/wizard/*')) do
local run = {} local section = assert(loadfile(entry))
setfenv(section, getfenv())
for _, w in ipairs(wizard) do section()(f, uci)
for _, c in ipairs(w(f, uci) or {}) do
if type(c) == 'string' then
if not util.contains(commit, c) then
table.insert(commit, c)
end
elseif type(c) == 'function' then
table.insert(run, c)
else
error('invalid wizard module return')
end
end
end end
function f:write() function f:write()
...@@ -40,13 +20,9 @@ function f:write() ...@@ -40,13 +20,9 @@ function f:write()
local unistd = require 'posix.unistd' local unistd = require 'posix.unistd'
uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", true) uci:set("gluon-setup-mode", uci:get_first("gluon-setup-mode", "setup_mode"), "configured", true)
uci:save("gluon-setup-mode")
for _, c in ipairs(commit) do os.execute('exec gluon-reconfigure >/dev/null')
uci:commit(c)
end
for _, r in ipairs(run) do
r()
end
f.template = "wizard/reboot" f.template = "wizard/reboot"
f.package = "gluon-config-mode-core" f.package = "gluon-config-mode-core"
......
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-domain-select PKG_NAME:=gluon-config-mode-domain-select
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
......
...@@ -49,20 +49,8 @@ return function(form, uci) ...@@ -49,20 +49,8 @@ return function(form, uci)
o:value(domain.domain_code, domain.domain_name) o:value(domain.domain_code, domain.domain_name)
end end
local domain_changed = false
function o:write(data) function o:write(data)
if data ~= selected_domain then
domain_changed = true
uci:set('gluon', 'core', 'domain', data) uci:set('gluon', 'core', 'domain', data)
uci:save('gluon')
end end
end end
local function reconfigure()
if domain_changed then
os.execute('gluon-reconfigure')
end
end
return {'gluon', reconfigure}
end
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-geo-location-osm PKG_NAME:=gluon-config-mode-geo-location-osm
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
......
...@@ -2,3 +2,9 @@ need_number(in_site({'config_mode', 'geo_location', 'osm', 'center', 'lon'})) ...@@ -2,3 +2,9 @@ need_number(in_site({'config_mode', 'geo_location', 'osm', 'center', 'lon'}))
need_number(in_site({'config_mode', 'geo_location', 'osm', 'center', 'lat'})) need_number(in_site({'config_mode', 'geo_location', 'osm', 'center', 'lat'}))
need_number(in_site({'config_mode', 'geo_location', 'osm', 'zoom'}), false) need_number(in_site({'config_mode', 'geo_location', 'osm', 'zoom'}), false)
need_string(in_site({'config_mode', 'geo_location', 'osm', 'openlayers_url'}), false) need_string(in_site({'config_mode', 'geo_location', 'osm', 'openlayers_url'}), false)
if need_table(in_site({'config_mode', 'geo_location', 'osm', 'tile_layer'}), nil, false) then
need_one_of(in_site({'config_mode', 'geo_location', 'osm', 'tile_layer', 'type'}), {'XYZ'})
need_string(in_site({'config_mode', 'geo_location', 'osm', 'tile_layer', 'url'}))
need_string(in_site({'config_mode', 'geo_location', 'osm', 'tile_layer', 'attributions'}))
end
...@@ -19,6 +19,7 @@ function M.options() ...@@ -19,6 +19,7 @@ function M.options()
return { return {
openlayers_url = config.openlayers_url(), openlayers_url = config.openlayers_url(),
tile_layer = config.tile_layer(),
zoom = config.zoom(12), zoom = config.zoom(12),
pos = config.center(), pos = config.center(),
} }
......
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-geo-location PKG_NAME:=gluon-config-mode-geo-location
PKG_VERSION:=1
include ../gluon.mk include ../gluon.mk
......
...@@ -32,9 +32,6 @@ msgstr "Längengrad" ...@@ -32,9 +32,6 @@ msgstr "Längengrad"
msgid "Set node position" msgid "Set node position"
msgstr "Knotenposition setzen" msgstr "Knotenposition setzen"
msgid "Advertise node position"
msgstr "Knotenposition veröffentlichen"
msgid "" msgid ""
"Specifying the altitude is optional; it should only be filled in if an " "Specifying the altitude is optional; it should only be filled in if an "
"accurate value is known." "accurate value is known."
......
...@@ -30,9 +30,6 @@ msgstr "Longitude" ...@@ -30,9 +30,6 @@ msgstr "Longitude"
msgid "Set node position" msgid "Set node position"
msgstr "" msgstr ""
msgid "Advertise node position"
msgstr ""
msgid "" msgid ""
"Specifying the altitude is optional; it should only be filled in if an " "Specifying the altitude is optional; it should only be filled in if an "
"accurate value is known." "accurate value is known."
......
...@@ -100,5 +100,7 @@ return function(form, uci) ...@@ -100,5 +100,7 @@ return function(form, uci)
end end
end end
return {'gluon-node-info'} function s:write()
uci:save("gluon-node-info")
end
end end