From 9a30f4d5cbe31b1c0a5d9d4f04abd6e121de7a70 Mon Sep 17 00:00:00 2001 From: Tim Beatham Date: Fri, 5 Jan 2024 18:22:05 +0000 Subject: [PATCH] Submitting --- Containerfile | 2 +- examples/meshtomesh/docker-compose.yaml | 95 ------------------- examples/meshtomesh/shared/configuration.yaml | 14 --- examples/simple/docker-compose.yaml | 23 ++--- examples/simple/shared/configuration.yaml | 42 +++++--- 5 files changed, 44 insertions(+), 132 deletions(-) delete mode 100644 examples/meshtomesh/docker-compose.yaml delete mode 100644 examples/meshtomesh/shared/configuration.yaml diff --git a/Containerfile b/Containerfile index cc4d845..2b25533 100644 --- a/Containerfile +++ b/Containerfile @@ -9,4 +9,4 @@ RUN apt-get update && apt-get install -y \ vim WORKDIR /wgmesh RUN go mod tidy -RUN go build -o /usr/local/bin ./... +RUN go build -o /usr/local/bin ./... \ No newline at end of file diff --git a/examples/meshtomesh/docker-compose.yaml b/examples/meshtomesh/docker-compose.yaml deleted file mode 100644 index 8a4eaa0..0000000 --- a/examples/meshtomesh/docker-compose.yaml +++ /dev/null @@ -1,95 +0,0 @@ -version: '3' -networks: - net-1: - driver: bridge - ipam: - driver: default - config: - - subnet: 10.89.0.0/17 - net-2: - driver: bridge - ipam: - driver: default - config: - - subnet: 10.89.155.0/17 -services: - wg-1: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-1 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-2: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-1 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-3: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-1 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-4: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - sysctls: - - net.ipv6.conf.all.forwarding=1 - networks: - - net-1 - - net-2 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-5: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-2 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-6: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-2 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" - wg-7: - image: wg-mesh-base:latest - cap_add: - - NET_ADMIN - - NET_RAW - tty: true - networks: - - net-2 - volumes: - - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" diff --git a/examples/meshtomesh/shared/configuration.yaml b/examples/meshtomesh/shared/configuration.yaml deleted file mode 100644 index 49aac29..0000000 --- a/examples/meshtomesh/shared/configuration.yaml +++ /dev/null @@ -1,14 +0,0 @@ -certificatePath: "/wgmesh/cert/cert.pem" -privateKeyPath: "/wgmesh/cert/priv.pem" -caCertificatePath: "/wgmesh/cert/cacert.pem" -skipCertVerification: true -timeout: 5 -gRPCPort: "21906" -advertiseRoutes: true -clusterSize: 32 -syncRate: 1 -interClusterChance: 0.15 -branchRate: 3 -infectionCount: 3 -heartBeatTime: 10 -pruneTime: 20 diff --git a/examples/simple/docker-compose.yaml b/examples/simple/docker-compose.yaml index aa7c47d..9fd3b6a 100644 --- a/examples/simple/docker-compose.yaml +++ b/examples/simple/docker-compose.yaml @@ -1,14 +1,9 @@ version: '3' networks: net-1: - driver: bridge - ipam: - driver: default - config: - - subnet: 10.89.0.0/17 services: wg-1: - image: wg-mesh-base:latest + image: localhost/smegmesh-base:latest cap_add: - NET_ADMIN - NET_RAW @@ -17,9 +12,11 @@ services: - net-1 volumes: - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" + command: "smegd /shared/configuration.yaml" + sysctls: + - net.ipv6.conf.all.forwarding=1 wg-2: - image: wg-mesh-base:latest + image: localhost/smegmesh-base:latest cap_add: - NET_ADMIN - NET_RAW @@ -28,9 +25,11 @@ services: - net-1 volumes: - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" + command: "smegd /shared/configuration.yaml" + sysctls: + - net.ipv6.conf.all.forwarding=1 wg-3: - image: wg-mesh-base:latest + image: localhost/smegmesh-base:latest cap_add: - NET_ADMIN - NET_RAW @@ -39,4 +38,6 @@ services: - net-1 volumes: - ./shared:/shared - command: "wgmeshd /shared/configuration.yaml" + command: "smegd /shared/configuration.yaml" + sysctls: + - net.ipv6.conf.all.forwarding=1 diff --git a/examples/simple/shared/configuration.yaml b/examples/simple/shared/configuration.yaml index 49aac29..c722ac8 100644 --- a/examples/simple/shared/configuration.yaml +++ b/examples/simple/shared/configuration.yaml @@ -1,14 +1,34 @@ -certificatePath: "/wgmesh/cert/cert.pem" -privateKeyPath: "/wgmesh/cert/priv.pem" -caCertificatePath: "/wgmesh/cert/cacert.pem" +# Paths to the certificates modify +# if not running from Smegmesh +certificatePath: "./cert/cert.pem" +privateKeyPath: "./cert/priv.pem" +caCertificatePath: "./cert/cacert.pem" skipCertVerification: true +# timeout is the configured grpc timeout timeout: 5 -gRPCPort: "21906" -advertiseRoutes: true -clusterSize: 32 -syncRate: 1 -interClusterChance: 0.15 -branchRate: 3 +# gRPC port to run the solution +gRPCPort: 4000 +# whether or not to run go profiler +profile: false +# stubWg: whether to install WireGuard configurations +# if true just tests the control plane +stubWg: false +heartbeatInterval: 60 +branch: 3 +pullInterval: 20 infectionCount: 3 -heartBeatTime: 10 -pruneTime: 20 +interClusterChance: 0.15 +syncInterval: 2 +clusterSize: 64 +logLevel: "info" +baseConfiguration: + # ipDiscovery: specifies how to find your IP address + ipDiscovery: "outgoing" + # alternative to ipDiscovery specify an actual endpoint yourself with publicEndpoint: "xxxx" + # role is the role that you are playing (peer | client) + # peers can only bootstrap meshes + role: "peer" + # advertise meshes to other meshes + advertiseRoute: true + # advertise default routes + advertiseDefaults: true \ No newline at end of file