generate the smoke config files
This commit is contained in:
parent
73c6d555b5
commit
c321e40d24
|
@ -10,7 +10,10 @@ mkdir ./build
|
|||
|
||||
cp ../../../../nebula .
|
||||
cp ../../../../nebula-cert .
|
||||
cp ../*.yml .
|
||||
|
||||
HOST="lighthouse1" AM_LIGHTHOUSE=true ../genconfig.sh >lighthouse1.yml
|
||||
HOST="host2" LIGHTHOUSES="192.168.100.1 172.17.0.2:4242" ../genconfig.sh >host2.yml
|
||||
HOST="host3" LIGHTHOUSES="192.168.100.1 172.17.0.2:4242" ../genconfig.sh >host3.yml
|
||||
|
||||
./nebula-cert ca -name "Smoke Test"
|
||||
./nebula-cert sign -name "lighthouse1" -ip "192.168.100.1/24"
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
if [ "$STATIC_HOSTS" ] || [ "$LIGHTHOUSES" ]
|
||||
then
|
||||
echo "static_host_map:"
|
||||
echo "$STATIC_HOSTS" | while read -r NEBULA_IP STATIC
|
||||
do
|
||||
[ -z "$NEBULA_IP" ] || echo " '$NEBULA_IP': ['$STATIC']"
|
||||
done
|
||||
echo "$LIGHTHOUSES" | while read -r NEBULA_IP STATIC
|
||||
do
|
||||
[ -z "$NEBULA_IP" ] || echo " '$NEBULA_IP': ['$STATIC']"
|
||||
done
|
||||
echo
|
||||
fi
|
||||
|
||||
lighthouse_hosts() {
|
||||
if [ "$LIGHTHOUSES" ]
|
||||
then
|
||||
echo
|
||||
echo "$LIGHTHOUSES" | while read -r NEBULA_IP STATIC
|
||||
do
|
||||
echo " - '$NEBULA_IP'"
|
||||
done
|
||||
else
|
||||
echo "[]"
|
||||
fi
|
||||
}
|
||||
|
||||
cat <<EOF
|
||||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /${HOST}.crt
|
||||
key: /${HOST}.key
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: ${AM_LIGHTHOUSE:-false}
|
||||
hosts: $(lighthouse_hosts)
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: ${LISTEN_PORT:-4242}
|
||||
|
||||
tun:
|
||||
dev: ${TUN_DEV:-nebula1}
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
EOF
|
|
@ -1,31 +0,0 @@
|
|||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /host2.crt
|
||||
key: /host2.key
|
||||
|
||||
static_host_map:
|
||||
"192.168.100.1": ["172.17.0.2:4242"]
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: false
|
||||
interval: 60
|
||||
hosts:
|
||||
- "192.168.100.1"
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
|
@ -1,31 +0,0 @@
|
|||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /host3.crt
|
||||
key: /host3.key
|
||||
|
||||
static_host_map:
|
||||
"192.168.100.1": ["172.17.0.2:4242"]
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: false
|
||||
interval: 60
|
||||
hosts:
|
||||
- "192.168.100.1"
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
|
@ -1,25 +0,0 @@
|
|||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /lighthouse1.crt
|
||||
key: /lighthouse1.key
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: true
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
Loading…
Reference in New Issue