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

Target

Select target project
  • ffbs/ffbs-gluon
  • parabol1337/ffbs-gluon
  • darkbit/ffbs-gluon
3 results
Show changes
Showing
with 216 additions and 154 deletions
if PACKAGE_gluon-autoupdater
config GLUON_AUTOUPDATER_BRANCH
string "Autoupdater branch"
default ""
config GLUON_AUTOUPDATER_ENABLED
bool "Enable autoupdater by default"
endif
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater
PKG_VERSION:=4
PKG_CONFIG_DEPENDS := CONFIG_GLUON_BRANCH
PKG_CONFIG_DEPENDS := CONFIG_GLUON_AUTOUPDATER_BRANCH CONFIG_GLUON_AUTOUPDATER_ENABLED
include ../gluon.mk
......@@ -13,19 +12,19 @@ define Package/gluon-autoupdater
endef
define Package/gluon-autoupdater/config
config GLUON_BRANCH
string "Gluon autoupdater branch"
depends on PACKAGE_gluon-autoupdater
default ""
source "$(SOURCE)/Config.in"
endef
define Package/gluon-autoupdater/install
$(Gluon/Build/Install)
ifneq ($(CONFIG_GLUON_BRANCH),"")
$(INSTALL_DIR) $(1)/lib/gluon/autoupdater
echo '$(call qstrip,$(CONFIG_GLUON_BRANCH))' > $(1)/lib/gluon/autoupdater/default_branch
endif
ifneq ($(CONFIG_GLUON_AUTOUPDATER_BRANCH),"")
echo '$(call qstrip,$(CONFIG_GLUON_AUTOUPDATER_BRANCH))' > $(1)/lib/gluon/autoupdater/default_branch
endif
ifneq ($(CONFIG_GLUON_AUTOUPDATER_ENABLED),)
touch $(1)/lib/gluon/autoupdater/default_enabled
endif
endef
$(eval $(call BuildPackageGluon,gluon-autoupdater))
need_string(in_site({'autoupdater', 'branch'}))
need_table({'autoupdater', 'branches'}, function(branch)
local branches = table_keys(need_table({'autoupdater', 'branches'}, function(branch)
need_alphanumeric_key(branch)
need_string(in_site(extend(branch, {'name'})))
need_string_array_match(extend(branch, {'mirrors'}), '^http://')
local pubkeys = need_string_array_match(in_site(extend(branch, {'pubkeys'})), '^%x+$')
need_number(in_site(extend(branch, {'good_signatures'})))
need_string_array_match(in_site(extend(branch, {'pubkeys'})), '^%x+$')
need(in_site(extend(branch, {'good_signatures'})), function(good_signatures)
return good_signatures <= #pubkeys
end, nil, string.format('be less than or equal to the number of public keys (%d)', #pubkeys))
obsolete(in_site(extend(branch, {'probability'})), 'Use GLUON_PRIORITY in site.mk instead.')
end)
end))
need_one_of(in_site({'autoupdater', 'branch'}), branches, false)
-- Check GLUON_AUTOUPDATER_BRANCH
local default_branch
local f = io.open((os.getenv('IPKG_INSTROOT') or '') .. '/lib/gluon/autoupdater/default_branch')
if f then
default_branch = f:read('*line')
f:close()
end
need_one_of(value('GLUON_AUTOUPDATER_BRANCH', default_branch), branches, false)
......@@ -2,15 +2,15 @@
stop() {
if [ -x /etc/init.d/"$1" ]; then
echo "Stopping $1..."
/etc/init.d/"$1" stop
fi
if [ -x /etc/init.d/"$1" ]; then
echo "Stopping $1..."
/etc/init.d/"$1" stop
fi
}
start_enabled() {
if [ -x /etc/init.d/"$1" ] && /etc/init.d/"$1" enabled; then
echo "Starting $1..."
/etc/init.d/"$1" start
fi
if [ -x /etc/init.d/"$1" ] && /etc/init.d/"$1" enabled; then
echo "Starting $1..."
/etc/init.d/"$1" start
fi
}
......@@ -4,6 +4,6 @@
start_enabled cron
start_enabled haveged
start_enabled urngd
start_enabled micrond
start_enabled sysntpd
......@@ -4,6 +4,6 @@
stop cron
stop haveged
stop urngd
stop micrond
stop sysntpd
......@@ -2,8 +2,11 @@
local site = require 'gluon.site'
local uci = require('simple-uci').cursor()
local unistd = require 'posix.unistd'
local min_branch
for name, config in pairs(site.autoupdater.branches()) do
uci:delete('autoupdater', name)
uci:section('autoupdater', 'branch', name, {
......@@ -12,25 +15,41 @@ for name, config in pairs(site.autoupdater.branches()) do
good_signatures = config.good_signatures,
pubkey = config.pubkeys,
})
end
if not uci:get('autoupdater', 'settings') then
local enabled = false
local branch = site.autoupdater.branch()
if not min_branch or (name < min_branch) then
min_branch = name
end
end
local function default_branch()
local f = io.open('/lib/gluon/autoupdater/default_branch')
if f then
enabled = true
branch = f:read('*line')
local ret = f:read('*line')
f:close()
return ret
end
uci:section('autoupdater', 'autoupdater', 'settings', {
enabled = enabled,
branch = branch,
})
return site.autoupdater.branch(min_branch)
end
local enabled, branch
if not uci:get('autoupdater', 'settings') then
enabled = unistd.access('/lib/gluon/autoupdater/default_enabled') ~= nil
end
local old_branch = uci:get('autoupdater', 'settings', 'branch')
if not old_branch or not uci:get('autoupdater', old_branch) then
branch = default_branch()
if not branch then
enabled = false
end
end
uci:section('autoupdater', 'autoupdater', 'settings', {
enabled = enabled,
branch = branch,
})
uci:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release')
uci:save('autoupdater')
......
/*
Copyright (c) 2016, Matthias Schiffer <mschiffer@universe-factory.net>
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.
*/
/* SPDX-FileCopyrightText: 2016, Matthias Schiffer <mschiffer@universe-factory.net> */
/* SPDX-License-Identifier: BSD-2-Clause */
#include <respondd.h>
......@@ -59,7 +37,7 @@ static struct json_object * get_autoupdater(void) {
return ret;
error:
error:
uci_free_context(ctx);
return NULL;
}
......
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-client-bridge
PKG_VERSION:=1
include ../gluon.mk
define Package/gluon-client-bridge
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
$(eval $(call BuildPackageGluon,gluon-client-bridge))
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)
for _, config in ipairs({'wifi24', 'wifi5'}) do
if need_table({config, 'ap'}, nil, false) then
need_string_match(in_domain({config, 'ap', 'ssid'}), '^' .. ('.?'):rep(32) .. '$')
need_boolean({config, 'ap', 'disabled'}, false)
if need_boolean({config, 'ap', 'owe_transition_mode'}, false) then
need_string_match(in_domain({config, 'ap', 'ssid'}), '^' .. ('.?'):rep(32) .. '$')
need_string_match(in_domain({config, 'ap', 'owe_ssid'}), '^' .. ('.?'):rep(32) .. '$')
else
need_string_match(in_domain({config, 'ap', 'ssid'}), '^' .. ('.?'):rep(32) .. '$', false)
need_string_match(in_domain({config, 'ap', 'owe_ssid'}), '^' .. ('.?'):rep(32) .. '$', false)
end
end
end
......@@ -6,26 +6,9 @@ local util = require 'gluon.util'
local uci = require('simple-uci').cursor()
local interfaces = uci:get('network', 'client', 'ifname') or {}
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
local interfaces = util.get_role_interfaces(uci, 'client', true)
util.add_to_set(interfaces, 'local-port')
uci:delete('network', 'client')
uci:section('network', 'interface', 'client', {
type = 'bridge',
ifname = interfaces,
......@@ -40,9 +23,6 @@ uci:section('network', 'interface', 'client', {
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', {
name = 'drop',
network = {'client'},
......@@ -51,9 +31,9 @@ uci:section('firewall', 'zone', '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')
uci:set_list('firewall', 'local_client', 'network', networks)
uci:set_list('firewall', 'loc_client', 'network', networks)
local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
......@@ -61,14 +41,12 @@ uci:set('dhcp', dnsmasq, 'boguspriv', false)
uci:set('dhcp', dnsmasq, 'localise_queries', 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', {
interface = 'client',
ignore = true,
})
uci:delete('dhcp', 'local_client')
uci:save('dhcp')
uci:save('firewall')
......@@ -10,7 +10,6 @@ local uci = require('simple-uci').cursor()
local next_node = site.next_node({})
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', {
type = 'veth',
name = 'local-node',
......@@ -23,15 +22,13 @@ 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
ip6 = next_node.ip6 .. '/128'
end
uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', {
ifname = 'local-node',
proto = 'static',
......
#!/usr/bin/lua
local util = require 'gluon.util'
local wireless = require 'gluon.wireless'
local uci = require('simple-uci').cursor()
......@@ -13,9 +13,7 @@ local function is_disabled(config, name)
return config.disabled(false)
end
util.foreach_radio(uci, function(radio, index, config)
local radio_name = radio['.name']
local function configure_ap(radio, index, config, radio_name)
local name = 'client_' .. radio_name
local suffix = radio_name:match('^radio(%d+)$')
......@@ -24,12 +22,9 @@ util.foreach_radio(uci, function(radio, index, config)
uci:delete('wireless', name)
if not ap() then
return
end
local macaddr = wireless.get_wlan_mac(uci, radio, index, 1)
local macaddr = util.get_wlan_mac(uci, radio, index, 1)
if not macaddr then
if not ap.ssid() or not macaddr then
return
end
......@@ -42,6 +37,79 @@ util.foreach_radio(uci, function(radio, index, config)
ifname = suffix and 'client' .. suffix,
disabled = disabled or false,
})
end
local function configure_owe(radio, index, config, radio_name)
local name = 'owe_' .. radio_name
local suffix = radio_name:match('^radio(%d+)$')
local ap = config.ap
local disabled = is_disabled(ap, 'client_' .. radio_name)
uci:delete('wireless', name)
-- Don't configure OWE in case our device
-- can't do MFP, as it's mandatory for OWE.
if not wireless.device_supports_mfp(uci) then
return
end
local macaddr = wireless.get_wlan_mac(uci, radio, index, 3)
if not ap.owe_ssid() or not macaddr then
return
end
uci:section('wireless', 'wifi-iface', name, {
device = radio_name,
network = 'client',
mode = 'ap',
ssid = ap.owe_ssid(),
macaddr = macaddr,
ifname = suffix and 'owe' .. suffix,
disabled = disabled or false,
encryption = 'owe',
ieee80211w = 2,
})
end
local function configure_owe_transition_mode(config, radio_name)
local ap = config.ap
-- Don't configure OWE in case our device
-- can't do MFP, as it's mandatory for OWE.
if not wireless.device_supports_mfp(uci) then
return
end
if not ap.owe_transition_mode(false) then
return
end
local name_client = 'client_' .. radio_name
local name_owe = 'owe_' .. radio_name
local ifname_client = uci:get('wireless', name_client, 'ifname')
local ifname_owe = uci:get('wireless', name_owe, 'ifname')
if not (ifname_client and ifname_owe) then
return
end
uci:set('wireless', name_client, 'owe_transition_ifname', ifname_owe)
uci:set('wireless', name_owe, 'owe_transition_ifname', ifname_client)
uci:set('wireless', name_owe, 'hidden', '1')
end
wireless.foreach_radio(uci, function(radio, index, config)
local radio_name = radio['.name']
configure_ap(radio, index, config, radio_name)
configure_owe(radio, index, config, radio_name)
configure_owe_transition_mode(config, radio_name)
end)
uci:save('wireless')
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-autoupdater
PKG_VERSION:=1
include ../gluon.mk
......
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-03-18 16:03+0100\n"
"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr ""
"Dieser Knoten aktualisiert seine Firmware automatisch, sobald "
"eine neue Version vorliegt."
msgid ""
"Automatic updates are disabled. They can be enabled in <em>Advanced "
"settings</em>."
msgstr ""
"Automatische Updates sind deaktiviert. Sie können in den <em>Erweiterten "
"Einstellungen</em> aktiviert werden."
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr ""
"Dieser Knoten aktualisiert seine Firmware automatisch, sobald eine neue "
"Version vorliegt."
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-04 20:20+0100\n"
"Last-Translator: Bernot Tobias <tqbs@airmail.cc>\n"
"Language-Team: French\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr "Ce nœud s'actualisera automatiquement quand une nouvelle "
"version sera disponible."
msgid ""
"Automatic updates are disabled. They can be enabled in <em>Advanced "
"settings</em>."
msgstr ""
"Mises à jour automatiques sont désactivées. Ils peuvent être activés dans "
"<em>Paramètres avancés</em>."
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
msgstr ""
"Ce nœud s'actualisera automatiquement quand une nouvelle version sera "
"disponible."
......@@ -2,11 +2,11 @@ msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"This node will automatically update its firmware when a new version is "
"available."
"Automatic updates are disabled. They can be enabled in <em>Advanced "
"settings</em>."
msgstr ""
msgid ""
"Automatic updates are disabled. They can be enabled in <em>Advanced "
"settings</em>."
"This node will automatically update its firmware when a new version is "
"available."
msgstr ""
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-contact-info
PKG_VERSION:=1
include ../gluon.mk
......
......@@ -14,20 +14,20 @@ msgid "Contact info"
msgstr "Kontakt"
msgid ""
"Please provide your contact information here to allow others to contact "
"you. Note that this information will be visible <em>publicly</em> on "
"the internet together with your node's coordinates. This means it can "
"be downloaded and processed by anyone. This information is "
"not required to operate a node. If you chose to enter data, it will be "
"stored on this node and can be deleted by yourself at any time."
"Please provide your contact information here to allow others to contact you. "
"Note that this information will be visible <em>publicly</em> on the internet "
"together with your node's coordinates. This means it can be downloaded and "
"processed by anyone. This information is not required to operate a node. If "
"you chose to enter data, it will be stored on this node and can be deleted "
"by yourself at any time."
msgstr ""
"Bitte hinterlege hier einen Hinweis, um anderen zu ermöglichen, "
"Kontakt mit dir aufzunehmen. Beachte, dass dieser Hinweis auch "
"<em>öffentlich</em> im Internet, zusammen mit den Koordinaten "
"deines Knotens, einsehbar sein wird. Das bedeutet, dass diese Informationen "
"von jedem heruntergeladen und verarbeitet werden können. Für den Betrieb sind diese "
"Informationen nicht erforderlich. Eine Speicherung erfolgt auf diesem Knoten. "
"Die Daten können durch dich in diesem Menü eigenständig gelöscht werden."
"Bitte hinterlege hier einen Hinweis, um anderen zu ermöglichen, Kontakt mit "
"dir aufzunehmen. Beachte, dass dieser Hinweis auch <em>öffentlich</em> im "
"Internet, zusammen mit den Koordinaten deines Knotens, einsehbar sein wird. "
"Das bedeutet, dass diese Informationen von jedem heruntergeladen und "
"verarbeitet werden können. Für den Betrieb sind diese Informationen nicht "
"erforderlich. Eine Speicherung erfolgt auf diesem Knoten. Die Daten können "
"durch dich in diesem Menü eigenständig gelöscht werden."
msgid "e.g. E-mail or phone number"
msgstr "z.B. E-Mail oder Telefonnummer"
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-12 23:30+0100\n"
"Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
"Language-Team: French\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
......@@ -14,20 +14,19 @@ msgid "Contact info"
msgstr "Informations de Contact"
msgid ""
"Please provide your contact information here to allow others to contact "
"you. Note that this information will be visible <em>publicly</em> on "
"the internet together with your node's coordinates. This means it can "
"be downloaded and processed by anyone. This information is "
"not required to operate a node. If you chose to enter data, it will be "
"stored on this node and can be deleted by yourself at any time."
"Please provide your contact information here to allow others to contact you. "
"Note that this information will be visible <em>publicly</em> on the internet "
"together with your node's coordinates. This means it can be downloaded and "
"processed by anyone. This information is not required to operate a node. If "
"you chose to enter data, it will be stored on this node and can be deleted "
"by yourself at any time."
msgstr ""
"Entrez vos coordonnées ici si vous souhaitez permettre à d'autres "
"personnes de communiquer avec vous. Ces informations seront affichées "
"<em>en ligne</em> avec les coordonnées du nœud. Il peut être téléchargé "
"et traité par tous. Il n'est pas obligatoire "
"de fournir ces informations pour pouvoir opérer un nœud. Si vous avez "
"choisi d'entrer des données, elles seront stockées sur ce nœud et vous "
"pourrez les effacer par vous-même à tout moment."
"Entrez vos coordonnées ici si vous souhaitez permettre à d'autres personnes "
"de communiquer avec vous. Ces informations seront affichées <em>en ligne</"
"em> avec les coordonnées du nœud. Il peut être téléchargé et traité par "
"tous. Il n'est pas obligatoire de fournir ces informations pour pouvoir "
"opérer un nœud. Si vous avez choisi d'entrer des données, elles seront "
"stockées sur ce nœud et vous pourrez les effacer par vous-même à tout moment."
msgid "e.g. E-mail or phone number"
msgstr "Ex : E-mail ou numéro de téléphone"