Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream vpn package again #38

Merged
merged 23 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7e5784e
Updated: checkout action
GoliathLabs Aug 16, 2021
f814ac2
Merge pull request #28 from GoliathLabs/workflow
awlx Aug 16, 2021
6bb8961
Merge branch 'freifunk-gluon:master' into main
awlx Sep 20, 2021
c34e108
Update Makefile
awlx Oct 18, 2021
97b3ab3
Updated: checkout action
GoliathLabs Aug 16, 2021
58c7e8d
Merge branch 'main' of github.com:freifunkMUC/community-packages
awlx Oct 18, 2021
d748ad2
Wonder how that worked
awlx Oct 21, 2021
1c2980b
Merge branch 'freifunk-gluon:master' into main
awlx Oct 21, 2021
92f356e
Remove reverse synchronization of gluon.mesh_vpn.enabled
goligo Oct 21, 2021
d0bdc81
Renamed ffmuc-gluon-mesh-vpn-wireguard-vxlan to ffmuc-mesh-vpn-wiregu…
goligo Oct 16, 2021
0273c43
Merge pull request #30 from goligo/main
goligo Oct 31, 2021
876a8d8
Only add ip6tables rule, if not set already
goligo Feb 4, 2022
29d058c
Adapted checkuplink for changes nslookup output in OpenWrt 22.03
goligo Sep 12, 2022
fd5f1c7
Add mesh-vpn to BATMAN, as Gluon does not do it anymore
goligo Sep 12, 2022
7fe757a
Revert "Add mesh-vpn to BATMAN, as Gluon does not do it anymore"
grische Sep 16, 2022
3291ff6
Merge pull request #31 from grische/revert_forced_meshvpn
grische Sep 17, 2022
77f94dc
Add mtu() to wireguard provider API
grische Sep 17, 2022
18ccfa8
Add compatibility variable for enabling mesh vpn
grische Sep 17, 2022
ca884df
Add wireguard_pubkey.sh to be more compatible
grische Sep 17, 2022
c6d3e69
Merge pull request #32 from grische/fix/wireguard_mesh_vpn
grische Sep 17, 2022
36b8614
Fix broken grep
awlx Oct 9, 2022
6470f63
Merge pull request #33 from freifunkMUC/awlx-patch-1
awlx Oct 9, 2022
ecb432e
Merge branch 'master' into fix-stuff
awlx Sep 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Lua
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt-get install lua-check
- name: Lint Lua
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ check_address_family() {
# Check if we have a default route for v6 if not fallback to v4
defgw=$(ip -6 route show table 1 | grep 'default via')
if [ "$?" -eq "0" ]; then
local ipv6="$(gluon-wan nslookup $gateway | grep 'Address [0-9]' | egrep -o '([a-f0-9:]+:+)+[a-f0-9]+')"
local ipv6="$(gluon-wan nslookup $gateway | grep 'Address:\? [0-9]' | egrep -o '([a-f0-9:]+:+)+[a-f0-9]+')"
echo [$ipv6]$(echo $peer_endpoint | egrep -oe :[0-9]+$)
else
local ipv4="$(gluon-wan nslookup $gateway | grep 'Address [0-9]' | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")"
local ipv4="$(gluon-wan nslookup $gateway | grep 'Address:\? [0-9]' | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")"
echo $ipv4$(echo $peer_endpoint | egrep -oe :[0-9]+$)
fi

Expand All @@ -52,7 +52,7 @@ if [ "$(uci get wireguard.mesh_vpn.enabled)" == "true" ] || [ "$(uci get wiregua
# Check connectivity to supernode
wget http://[$(wg | grep fe80 | awk '{split($3,A,"/")};{print A[1]}')%$MESH_VPN_IFACE]/ --timeout=5 -O/dev/null -q
if [ "$?" -eq "0" ]; then
GWMAC=$(batctl gwl | grep \* | awk '{print $2}')
GWMAC=$(batctl gwl | awk '/[*]/{print $2}')
batctl ping -c 5 $GWMAC &> /dev/null
if [ "$?" -eq "0" ]; then
CONNECTED=1
Expand Down Expand Up @@ -107,7 +107,11 @@ if [ "$(uci get wireguard.mesh_vpn.enabled)" == "true" ] || [ "$(uci get wiregua

# We need to allow incoming vxlan traffic on mesh iface
sleep 10
ip6tables -I INPUT 1 -i $MESH_VPN_IFACE -m udp -p udp --dport 8472 -j ACCEPT
RULE="-i $MESH_VPN_IFACE -m udp -p udp --dport 8472 -j ACCEPT"
ip6tables -C INPUT $RULE
if [ $? -ne 0 ]; then
ip6tables -I INPUT 1 $RULE
fi

# Bring up VXLAN
ip link add mesh-vpn type vxlan id "$(lua -e 'print(tonumber(require("gluon.util").domain_seed_bytes("gluon-mesh-vpn-vxlan", 3), 16))')" local $(interface_linklocal "$MESH_VPN_IFACE") remote $(uci get wireguard.peer_$PEER.link_address) dstport 8472 dev $MESH_VPN_IFACE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/bin/wg show wg_mesh_vpn public-key
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end)

local mesh_enabled = uci:get_bool('gluon', 'mesh_vpn', 'enabled') -- default
or uci:get_bool('fastd', 'mesh_vpn', 'enabled') --migration
or not uci:get_bool('network', 'wg_mesh', 'disabled') --compatiblity with upstream
or wg_enabled -- specific config

uci:section("wireguard", "wireguard", "mesh_vpn", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ local vpn_core = require 'gluon.mesh-vpn'
local M = {}

function M.public_key()
return util.trim(util.exec('/usr/bin/wg show wg_mesh_vpn public-key'))
local key = util.trim(util.exec("/lib/gluon/mesh-vpn/wireguard_pubkey.sh"))

if key == '' then
key = nil
end

return key
end

function M.enable(val)
Expand All @@ -33,4 +39,8 @@ function M.set_limit(ingress_limit, egress_limit)
uci:save('simple-tc')
end

function M.mtu()
return site.mesh_vpn.wireguard.mtu()
end

return M
Loading