Skip to content

Commit d8ef4f8

Browse files
authored
Merge pull request freifunk-gluon#149 from freifunk-gluon/ffac-dsl
ffac-dsl and ffac-web-dsl: use DSL uplink on Gluon WAN
2 parents a2015c4 + 2c09555 commit d8ef4f8

File tree

9 files changed

+201
-0
lines changed

9 files changed

+201
-0
lines changed

ffac-dsl/LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2024, Florian Maurer
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ffac-dsl/Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2024 Florian Maurer
2+
# SPDX-License-Identifier: BSD-2-Clause
3+
include $(TOPDIR)/rules.mk
4+
5+
PKG_NAME:=ffac-dsl
6+
PKG_VERSION:=1.0
7+
PKG_RELEASE:=1
8+
9+
PKG_LICENSE:=BSD-2-Clause
10+
11+
include $(TOPDIR)/../package/gluon.mk
12+
13+
define Package/$(PKG_NAME)
14+
TITLE:=Configure Gluon firmware for DSL usage
15+
DEPENDS:=ppp
16+
endef
17+
18+
define Package/$(PKG_NAME)/description
19+
This package allows to set DSL credentials in gluon to connect WAN directly from DSL.
20+
Besides the username and password, the vlanid can be set.
21+
endef
22+
23+
$(eval $(call BuildPackageGluon,$(PKG_NAME)))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/lua
2+
3+
local uci = require('simple-uci').cursor()
4+
5+
local enabled = uci:get_bool('gluon', 'dsl', 'enabled', false)
6+
local vlanid = uci:get('gluon', 'dsl', 'vlanid')
7+
local username = uci:get('gluon', 'dsl', 'username')
8+
local password = uci:get('gluon', 'dsl', 'password')
9+
10+
if enabled == true then
11+
-- add interface for DSL
12+
uci:section('network','interface','wdsl',{
13+
device = 'dsl0.' .. tostring(vlanid),
14+
proto='pppoe',
15+
username=username,
16+
password=password,
17+
ipv6='auto',
18+
})
19+
20+
uci:section('firewall','rule','wdsl_dhcpv6',{
21+
name = 'DSL DHCPv6',
22+
src = 'wdsl',
23+
family = 'ipv6',
24+
dest_port = '546',
25+
proto = 'udp',
26+
target = 'ACCEPT',
27+
})
28+
else
29+
uci:delete('network', 'wdsl')
30+
uci:delete('network', 'wdsl6')
31+
uci:delete('firewall', 'wdsl_dhcpv6')
32+
end
33+
34+
uci:commit('network')

ffac-web-dsl/Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include $(TOPDIR)/rules.mk
2+
3+
PKG_NAME:=ffac-web-dsl
4+
PKG_VERSION:=1
5+
PKG_RELEASE:=1
6+
7+
include $(TOPDIR)/../package/gluon.mk
8+
9+
define Package/$(PKG_NAME)
10+
TITLE:=gluon-web module to configure ffac-dsl
11+
DEPENDS:=+gluon-web-admin +ffac-dsl
12+
endef
13+
14+
$(eval $(call BuildPackageGluon,$(PKG_NAME)))

ffac-web-dsl/i18n/de.po

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: PACKAGE VERSION\n"
4+
"PO-Revision-Date: 2024-12-26 12:00+0100\n"
5+
"Last-Translator: <[email protected]>\n"
6+
"Language-Team: German\n"
7+
"Language: de\n"
8+
"MIME-Version: 1.0\n"
9+
"Content-Type: text/plain; charset=UTF-8\n"
10+
"Content-Transfer-Encoding: 8bit\n"
11+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
12+
13+
msgid "Enabled"
14+
msgstr "Aktiviert"
15+
16+
msgid "DSL"
17+
msgstr ""
18+
19+
msgid "VLAN-ID"
20+
msgstr ""
21+
22+
msgid "Username"
23+
msgstr "Nutzername"
24+
25+
msgid "Password"
26+
msgstr "Passwort"
27+
28+
msgid "ffac-web-dsl:description"
29+
msgstr ""
30+
"Setzt die DSL Authenfizierung für direkte WAN Anbindung des Uplinks durch DSL"

ffac-web-dsl/i18n/en.po

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: PACKAGE VERSION\n"
4+
"PO-Revision-Date: 2024-12-26 12:00+0100\n"
5+
"Last-Translator: <[email protected]>\n"
6+
"Language-Team: English\n"
7+
"Language: de\n"
8+
"MIME-Version: 1.0\n"
9+
"Content-Type: text/plain; charset=UTF-8\n"
10+
"Content-Transfer-Encoding: 8bit\n"
11+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
12+
13+
msgid "ffac-web-dsl:description"
14+
msgstr ""
15+
"Sets DSL credentials for direct usage of WAN as mesh-vpn uplink"

ffac-web-dsl/i18n/ffac-web-dsl.pot

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
msgid ""
2+
msgstr "Content-Type: text/plain; charset=UTF-8"
3+
4+
msgid "Enabled"
5+
msgstr ""
6+
7+
msgid "Username"
8+
msgstr ""
9+
10+
msgid "Password"
11+
msgstr ""
12+
13+
msgid "VLAN-ID"
14+
msgstr ""
15+
16+
msgid "DSL"
17+
msgstr ""
18+
19+
msgid "ffac-web-dsl:description"
20+
msgstr ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package 'ffac-web-dsl'
2+
3+
entry({"admin", "ffac_dsl"}, model("admin/ffac_dsl"), _("DSL"), 50)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
local uci = require("simple-uci").cursor()
2+
3+
local f = Form(translate("DSL"))
4+
5+
local s = f:section(Section, nil, translate('ffac-web-dsl:description'))
6+
7+
local enabled = s:option(Flag, "enabled", translate("Enabled"))
8+
enabled.default = uci:get_bool('gluon', 'dsl', 'enabled', false)
9+
10+
local username = s:option(Value, "username", translate("Username"))
11+
username:depends(enabled, true)
12+
username.default = uci:get('gluon', 'dsl', 'username')
13+
14+
local password = s:option(Value, "password", translate("Password"))
15+
password:depends(enabled, true)
16+
password.default = uci:get('gluon', 'dsl', 'password')
17+
18+
local vlanid = s:option(Value, "vlanid", translate("VlanID"))
19+
vlanid:depends(enabled, true)
20+
vlanid.default = uci:get('gluon', 'dsl', 'vlanid') or '0'
21+
22+
function f:write()
23+
local dsl_enabled = false
24+
if enabled.data then
25+
dsl_enabled = true
26+
end
27+
28+
uci:section('gluon', 'dsl', 'dsl', {
29+
enabled = dsl_enabled,
30+
vlanid = vlanid.data,
31+
username = username.data,
32+
password = password.data,
33+
})
34+
35+
uci:commit('gluon')
36+
end
37+
38+
return f

0 commit comments

Comments
 (0)