cleanup cm

This commit is contained in:
Maciej Krüger 2022-06-12 20:04:24 +02:00 committed by Alexander List
parent 15fd874588
commit acd6e0ccbc
8 changed files with 0 additions and 339 deletions

View File

@ -1,12 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-private-ap
include ../gluon.mk
define Package/gluon-private-ap
TITLE:=Provides a virtual access point for the nodes client network
DEPENDS:=+gluon-core
endef
$(eval $(call BuildPackageGluon,gluon-private-ap))

View File

@ -1,52 +0,0 @@
#!/usr/bin/lua
local uci = require("simple-uci").cursor()
local wireless = require 'gluon.wireless'
wireless.foreach_radio(uci, function(radio)
local radio_name = radio['.name']
local suffix = radio_name:match('^radio(%d+)$')
local name = "ap_" .. radio_name
if not uci:get('wireless', name, 'device') then
return
end
uci:set('wireless', name, 'ifname', suffix and 'ap' .. suffix)
end)
uci:set('network', 'globals', 'ula_prefix', uci:get('network_gluon-old', 'globals', 'ula_prefix'))
uci:section('network', 'interface', 'ap', {
type = 'bridge',
ifname = {},
proto = 'static',
ipaddr = uci:get('network_gluon-old', 'ap', 'ipaddr') or '192.168.178.1/24',
ip6assign = '64',
zone = 'ap',
})
uci:section('dhcp', 'dhcp', 'ap', {
interface = 'ap',
start = '100',
limit = '150',
leasetime = '12h',
})
uci:section('firewall', 'zone', 'ap', {
name = 'ap',
network = { 'ap' },
input = 'ACCEPT',
output = 'ACCEPT',
forward = 'ACCEPT'
})
uci:section('firewall', 'forwarding', 'afm', {
src = 'ap',
dest = 'mesh'
})
uci:save('firewall')
uci:save('network')
uci:save('dhcp')
uci:save('wireless')

View File

@ -1,12 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-web-private-ap
include ../gluon.mk
define Package/gluon-web-private-ap
DEPENDS:=+gluon-web-admin +gluon-private-ap
TITLE:=UI for activating a private AP
endef
$(eval $(call BuildPackageGluon,gluon-web-private-ap))

View File

@ -1,59 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 02:25+0200\n"
"Last-Translator: <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 "8-63 characters"
msgstr "8-63 Zeichen"
msgid "Disabled"
msgstr "Deaktiviert"
msgid "Enabled"
msgstr "Aktiviert"
msgid "Encryption"
msgstr "Verschlüsselung"
msgid "Key"
msgstr "Schlüssel"
msgid "Management Frame Protection"
msgstr ""
msgid "Name (SSID)"
msgstr "Name (SSID)"
msgid "Optional"
msgstr ""
msgid "Private AP"
msgstr "Privates AP"
msgid "Required"
msgstr "Aktiviert"
msgid "WPA2"
msgstr ""
msgid "WPA2 / WPA3"
msgstr ""
msgid "WPA3"
msgstr ""
msgid ""
"Your node can additionally offer a private client access point "
"which allows you to use the mesh like regular private wifi "
"with your own network, LAN addresses, password, etc."
msgstr ""
"Dein Knoten kann zusätzlich einen privaten Klient Zugangspunkt anbieten. "
"Das erlaubt dir das mesh wie ein normales Privat-WLAN zu verwenden, "
"das ein eigenes Netz, eigene LAN-Addressesn, ein eigens Passwort, etc hat."

View File

@ -1,50 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-19 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"
msgid "8-63 characters"
msgstr "8-63 charactères"
msgid "Disabled"
msgstr ""
msgid "Enabled"
msgstr "Activé"
msgid "Encryption"
msgstr ""
msgid "Key"
msgstr "Clé"
msgid "Management Frame Protection"
msgstr ""
msgid "Name (SSID)"
msgstr "Nom (SSID)"
msgid "Optional"
msgstr ""
msgid "Private AP"
msgstr "AP privé"
msgid "Required"
msgstr ""
msgid "WPA2"
msgstr ""
msgid "WPA2 / WPA3"
msgstr ""
msgid "WPA3"
msgstr ""

View File

@ -1,47 +0,0 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "8-63 characters"
msgstr ""
msgid "Disabled"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "Encryption"
msgstr ""
msgid "Key"
msgstr ""
msgid "Management Frame Protection"
msgstr ""
msgid "Name (SSID)"
msgstr ""
msgid "Optional"
msgstr ""
msgid "Private WLAN"
msgstr ""
msgid "Required"
msgstr ""
msgid "WPA2"
msgstr ""
msgid "WPA2 / WPA3"
msgstr ""
msgid "WPA3"
msgstr ""
msgid ""
"Your node can additionally offer a private client access point "
"which allows you to use the mesh like regular private wifi "
"with your own network, LAN addresses, password, etc."
msgstr ""

View File

@ -1,8 +0,0 @@
local uci = require("simple-uci").cursor()
local wireless = require 'gluon.wireless'
package 'gluon-web-private-ap'
if wireless.device_uses_wlan(uci) then
entry({"admin", "privateap"}, model("admin/privateap"), _("Private AP"), 31)
end

View File

@ -1,99 +0,0 @@
local uci = require("simple-uci").cursor()
local wireless = require 'gluon.wireless'
-- where to read the configuration from
local primary_iface = 'ap_radio0'
local f = Form(translate("Private AP"))
local s = f:section(Section, nil, translate(
'Your node can additionally offer a private client access point '
.. 'which allows you to use the mesh like regular private wifi '
.. 'with your own network, LAN addresses, password, etc.'
))
local enabled = s:option(Flag, "enabled", translate("Enabled"))
enabled.default = uci:get('wireless', primary_iface) and not uci:get_bool('wireless', primary_iface, "disabled")
local ssid = s:option(Value, "ssid", translate("Name (SSID)"))
ssid:depends(enabled, true)
ssid.datatype = "maxlength(32)"
ssid.default = uci:get('wireless', primary_iface, "ssid")
local key = s:option(Value, "key", translate("Key"), translate("8-63 characters"))
key:depends(enabled, true)
key.datatype = "wpakey"
key.default = uci:get('wireless', primary_iface, "key")
local encryption = s:option(ListValue, "encryption", translate("Encryption"))
encryption:depends(enabled, true)
encryption:value("psk2", translate("WPA2"))
if wireless.device_supports_wpa3() then
encryption:value("psk3-mixed", translate("WPA2 / WPA3"))
encryption:value("psk3", translate("WPA3"))
end
encryption.default = uci:get('wireless', primary_iface, 'encryption') or "psk2"
local mfp = s:option(ListValue, "mfp", translate("Management Frame Protection"))
mfp:depends(enabled, true)
mfp:value("0", translate("Disabled"))
if wireless.device_supports_mfp(uci) then
mfp:value("1", translate("Optional"))
mfp:value("2", translate("Required"))
end
mfp.default = uci:get('wireless', primary_iface, 'ieee80211w') or "0"
local subnet4 = s:option(Value, "subnet4", translate("Subnet IPv4 (NAT)"), translate("IPv4 CIDR"))
subnet4:depends(enabled, true)
subnet4.datatype = "maxlength(32)"
subnet4.default = uci:get('network', 'ap', 'ipaddr')
local subnet6 = s:option(Value, "subnet6", translate("ULA IPv6"), translate("IPv6 CIDR or 'auto'"))
subnet6:depends(enabled, true)
subnet6.datatype = "maxlength(128)"
subnet6.default = uci:get('network', 'globals', 'ula_prefix')
-- TODO: ipv4 when prefix4() set? or always? allow custom cidr
-- TODO: allow mesh (regular meshing) on private net?
function f:write()
uci:set('network', 'globals', 'ula_prefix', subnet6.data)
uci:set('network', 'ap', 'ipaddr', subnet4.data)
wireless.foreach_radio(uci, function(radio, index)
local radio_name = radio['.name']
local suffix = radio_name:match('^radio(%d+)$')
local name = "ap_" .. radio_name
if enabled.data then
local macaddr = wireless.get_wlan_mac(uci, radio, index, 5)
uci:section('wireless', 'wifi-iface', name, {
device = radio_name,
network = 'ap',
mode = 'ap',
encryption = encryption.data,
ssid = ssid.data,
key = key.data,
macaddr = macaddr,
ifname = suffix and 'ap' .. suffix,
disabled = false,
})
-- hostapd-mini won't start in case 802.11w is configured
if wireless.device_supports_mfp(uci) then
uci:set('wireless', name, 'ieee80211w', mfp.data)
else
uci:delete('wireless', name, 'ieee80211w')
end
else
uci:set('wireless', name, "disabled", true)
end
end)
uci:commit('network')
uci:commit('wireless')
end
return f