From acd6e0ccbcc716106cd65cce73e440aa0c4ec5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Sun, 12 Jun 2022 20:04:24 +0200 Subject: [PATCH] cleanup cm --- package/gluon-private-ap/Makefile | 12 --- .../lib/gluon/upgrade/325-gluon-private-ap | 52 ---------- package/gluon-web-private-ap/Makefile | 12 --- package/gluon-web-private-ap/i18n/de.po | 59 ----------- package/gluon-web-private-ap/i18n/fr.po | 50 ---------- .../i18n/gluon-web-private-ap.pot | 47 --------- .../controller/admin/privateap.lua | 8 -- .../config-mode/model/admin/privateap.lua | 99 ------------------- 8 files changed, 339 deletions(-) delete mode 100644 package/gluon-private-ap/Makefile delete mode 100755 package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap delete mode 100644 package/gluon-web-private-ap/Makefile delete mode 100644 package/gluon-web-private-ap/i18n/de.po delete mode 100644 package/gluon-web-private-ap/i18n/fr.po delete mode 100644 package/gluon-web-private-ap/i18n/gluon-web-private-ap.pot delete mode 100644 package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/controller/admin/privateap.lua delete mode 100644 package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/model/admin/privateap.lua diff --git a/package/gluon-private-ap/Makefile b/package/gluon-private-ap/Makefile deleted file mode 100644 index 2df31c98..00000000 --- a/package/gluon-private-ap/Makefile +++ /dev/null @@ -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)) diff --git a/package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap b/package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap deleted file mode 100755 index 64698789..00000000 --- a/package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap +++ /dev/null @@ -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') diff --git a/package/gluon-web-private-ap/Makefile b/package/gluon-web-private-ap/Makefile deleted file mode 100644 index 2c40e740..00000000 --- a/package/gluon-web-private-ap/Makefile +++ /dev/null @@ -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)) diff --git a/package/gluon-web-private-ap/i18n/de.po b/package/gluon-web-private-ap/i18n/de.po deleted file mode 100644 index 45fc9ad1..00000000 --- a/package/gluon-web-private-ap/i18n/de.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2015-05-04 02:25+0200\n" -"Last-Translator: \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." diff --git a/package/gluon-web-private-ap/i18n/fr.po b/package/gluon-web-private-ap/i18n/fr.po deleted file mode 100644 index 3b51c36b..00000000 --- a/package/gluon-web-private-ap/i18n/fr.po +++ /dev/null @@ -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 \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 "" diff --git a/package/gluon-web-private-ap/i18n/gluon-web-private-ap.pot b/package/gluon-web-private-ap/i18n/gluon-web-private-ap.pot deleted file mode 100644 index ed0a147f..00000000 --- a/package/gluon-web-private-ap/i18n/gluon-web-private-ap.pot +++ /dev/null @@ -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 "" diff --git a/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/controller/admin/privateap.lua b/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/controller/admin/privateap.lua deleted file mode 100644 index 39f2b7c9..00000000 --- a/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/controller/admin/privateap.lua +++ /dev/null @@ -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 diff --git a/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/model/admin/privateap.lua b/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/model/admin/privateap.lua deleted file mode 100644 index 8d7eff5e..00000000 --- a/package/gluon-web-private-ap/luasrc/lib/gluon/config-mode/model/admin/privateap.lua +++ /dev/null @@ -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