diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..bcead33 --- /dev/null +++ b/Containerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/golang:bookworm +COPY ./ /wgmesh +RUN apt-get update && apt-get install -y \ + wireguard \ + wireguard-tools \ + iproute2 \ + iputils-ping \ + tmux \ + vim +WORKDIR /wgmesh +RUN go build -o /usr/local/bin ./... diff --git a/Dockerfile b/Dockerfile new file mode 120000 index 0000000..5240dc0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +Containerfile \ No newline at end of file diff --git a/examples/meshtomesh/docker-compose.yaml b/examples/meshtomesh/docker-compose.yaml new file mode 100644 index 0000000..8a4eaa0 --- /dev/null +++ b/examples/meshtomesh/docker-compose.yaml @@ -0,0 +1,95 @@ +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 new file mode 100644 index 0000000..01bb357 --- /dev/null +++ b/examples/meshtomesh/shared/configuration.yaml @@ -0,0 +1,14 @@ +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 +keepAliveTime: 10 +pruneTime: 20 diff --git a/examples/simple/docker-compose.yaml b/examples/simple/docker-compose.yaml new file mode 100644 index 0000000..aa7c47d --- /dev/null +++ b/examples/simple/docker-compose.yaml @@ -0,0 +1,42 @@ +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 + 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" diff --git a/examples/simple/shared/configuration.yaml b/examples/simple/shared/configuration.yaml new file mode 100644 index 0000000..01bb357 --- /dev/null +++ b/examples/simple/shared/configuration.yaml @@ -0,0 +1,14 @@ +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 +keepAliveTime: 10 +pruneTime: 20