Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wadey committed May 1, 2024
2 parents f6e5381 + f39bfbb commit 46a8095
Show file tree
Hide file tree
Showing 81 changed files with 2,273 additions and 1,417 deletions.
22 changes: 17 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ body:
attributes:
value: |
### Thank you for taking the time to file a bug report!
Please fill out this form as completely as possible.
- type: input
id: version
attributes:
label: What version of `nebula` are you using?
label: What version of `nebula` are you using? (`nebula -version`)
placeholder: 0.0.0
validations:
required: true
Expand All @@ -41,17 +41,29 @@ body:
attributes:
label: Logs from affected hosts
description: |
Provide logs from all affected hosts during the time of the issue.
Please provide logs from ALL affected hosts during the time of the issue. If you do not provide logs we will be unable to assist you!
[Learn how to find Nebula logs here.](https://nebula.defined.net/docs/guides/viewing-nebula-logs/)
Improve formatting by using <code>```</code> at the beginning and end of each log block.
value: |
```
```
validations:
required: false
required: true

- type: textarea
id: configs
attributes:
label: Config files from affected hosts
description: |
Provide config files for all affected hosts.
Improve formatting by using <code>```</code> at the beginning and end of each config file.
value: |
```
```
validations:
required: false
required: true
4 changes: 2 additions & 2 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Install goimports
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand All @@ -35,9 +35,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand Down Expand Up @@ -68,9 +68,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Import certificates
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/smoke-extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: smoke-extra
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, labeled, reopened]
paths:
- '.github/workflows/smoke**'
- '**Makefile'
- '**.go'
- '**.proto'
- 'go.mod'
- 'go.sum'
jobs:

smoke-extra:
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'smoke-test-extra')
name: Run extra smoke tests
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true

- name: install vagrant
run: sudo apt-get update && sudo apt-get install -y vagrant virtualbox

- name: freebsd-amd64
run: make smoke-vagrant/freebsd-amd64

- name: openbsd-amd64
run: make smoke-vagrant/openbsd-amd64

- name: netbsd-amd64
run: make smoke-vagrant/netbsd-amd64

- name: linux-386
run: make smoke-vagrant/linux-386

- name: linux-amd64-ipv6disable
run: make smoke-vagrant/linux-amd64-ipv6disable

timeout-minutes: 30
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/smoke/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ mkdir ./build
cp ../../../../build/linux-amd64/nebula .
cp ../../../../build/linux-amd64/nebula-cert .

if [ "$1" ]
then
cp "../../../../build/$1/nebula" "$1-nebula"
fi

HOST="lighthouse1" \
AM_LIGHTHOUSE=true \
../genconfig.sh >lighthouse1.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke/genconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ listen:
port: ${LISTEN_PORT:-4242}
tun:
dev: ${TUN_DEV:-nebula1}
dev: ${TUN_DEV:-tun0}
firewall:
inbound_action: reject
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke/smoke-relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ docker exec host4 sh -c 'kill 1'
docker exec host3 sh -c 'kill 1'
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1
sleep 5

if [ "$(jobs -r)" ]
then
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/smoke/smoke-vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/bash

set -e -x

set -o pipefail

export VAGRANT_CWD="$PWD/vagrant-$1"

mkdir -p logs

cleanup() {
echo
echo " *** cleanup"
echo

set +e
if [ "$(jobs -r)" ]
then
docker kill lighthouse1 host2
fi
vagrant destroy -f
}

trap cleanup EXIT

CONTAINER="nebula:${NAME:-smoke}"

docker run --name lighthouse1 --rm "$CONTAINER" -config lighthouse1.yml -test
docker run --name host2 --rm "$CONTAINER" -config host2.yml -test

vagrant up
vagrant ssh -c "cd /nebula && /nebula/$1-nebula -config host3.yml -test"

docker run --name lighthouse1 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm "$CONTAINER" -config lighthouse1.yml 2>&1 | tee logs/lighthouse1 | sed -u 's/^/ [lighthouse1] /' &
sleep 1
docker run --name host2 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm "$CONTAINER" -config host2.yml 2>&1 | tee logs/host2 | sed -u 's/^/ [host2] /' &
sleep 1
vagrant ssh -c "cd /nebula && sudo sh -c 'echo \$\$ >/nebula/pid && exec /nebula/$1-nebula -config host3.yml'" &
sleep 15

# grab tcpdump pcaps for debugging
docker exec lighthouse1 tcpdump -i nebula1 -q -w - -U 2>logs/lighthouse1.inside.log >logs/lighthouse1.inside.pcap &
docker exec lighthouse1 tcpdump -i eth0 -q -w - -U 2>logs/lighthouse1.outside.log >logs/lighthouse1.outside.pcap &
docker exec host2 tcpdump -i nebula1 -q -w - -U 2>logs/host2.inside.log >logs/host2.inside.pcap &
docker exec host2 tcpdump -i eth0 -q -w - -U 2>logs/host2.outside.log >logs/host2.outside.pcap &
# vagrant ssh -c "tcpdump -i nebula1 -q -w - -U" 2>logs/host3.inside.log >logs/host3.inside.pcap &
# vagrant ssh -c "tcpdump -i eth0 -q -w - -U" 2>logs/host3.outside.log >logs/host3.outside.pcap &

docker exec host2 ncat -nklv 0.0.0.0 2000 &
vagrant ssh -c "ncat -nklv 0.0.0.0 2000" &
#docker exec host2 ncat -e '/usr/bin/echo host2' -nkluv 0.0.0.0 3000 &
#vagrant ssh -c "ncat -e '/usr/bin/echo host3' -nkluv 0.0.0.0 3000" &

set +x
echo
echo " *** Testing ping from lighthouse1"
echo
set -x
docker exec lighthouse1 ping -c1 192.168.100.2
docker exec lighthouse1 ping -c1 192.168.100.3

set +x
echo
echo " *** Testing ping from host2"
echo
set -x
docker exec host2 ping -c1 192.168.100.1
# Should fail because not allowed by host3 inbound firewall
! docker exec host2 ping -c1 192.168.100.3 -w5 || exit 1

set +x
echo
echo " *** Testing ncat from host2"
echo
set -x
# Should fail because not allowed by host3 inbound firewall
#! docker exec host2 ncat -nzv -w5 192.168.100.3 2000 || exit 1
#! docker exec host2 ncat -nzuv -w5 192.168.100.3 3000 | grep -q host3 || exit 1

set +x
echo
echo " *** Testing ping from host3"
echo
set -x
vagrant ssh -c "ping -c1 192.168.100.1"
vagrant ssh -c "ping -c1 192.168.100.2"

set +x
echo
echo " *** Testing ncat from host3"
echo
set -x
#vagrant ssh -c "ncat -nzv -w5 192.168.100.2 2000"
#vagrant ssh -c "ncat -nzuv -w5 192.168.100.2 3000" | grep -q host2

vagrant ssh -c "sudo xargs kill </nebula/pid"
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1

if [ "$(jobs -r)" ]
then
echo "nebula still running after SIGTERM sent" >&2
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/smoke/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ docker exec host4 sh -c 'kill 1'
docker exec host3 sh -c 'kill 1'
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1
sleep 5

if [ "$(jobs -r)" ]
then
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-freebsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/freebsd14"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-linux-386/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial32"

config.vm.synced_folder "../build", "/nebula"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"

config.vm.synced_folder "../build", "/nebula"

config.vm.provision :shell do |shell|
shell.inline = <<-EOF
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="ipv6.disable=1"/' /etc/default/grub
update-grub
EOF
shell.privileged = true
shell.reboot = true
end
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-netbsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/netbsd9"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-openbsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/openbsd7"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand All @@ -37,6 +37,9 @@ jobs:
- name: End 2 end
run: make e2evv

- name: Build test mobile
run: make build-test-mobile

- uses: actions/upload-artifact@v3
with:
name: e2e packet flow
Expand All @@ -50,9 +53,9 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand All @@ -74,9 +77,9 @@ jobs:

- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build nebula
Expand Down
Loading

0 comments on commit 46a8095

Please sign in to comment.