Skip to content

eftechcombr/wireguard

Repository files navigation

Wireguard

Docker build latest on ghcr

Overview

This repository provides a containerized Wireguard VPN solution, including health checks and Helm charts for Kubernetes deployment.


Quick Start

1. Generate Public and Private Keys

docker run -i --rm eftechcombr/wireguard wg genkey | tee ./etc/privatekey | docker run -i --rm eftechcombr/wireguard wg pubkey > ./etc/publickey

2. Configuration

  • Place your Wireguard configuration in etc/wg0.conf.
  • Keys should be stored in etc/privatekey and etc/publickey.

3. Build and Run with Docker

docker build -t eftechcombr/wireguard .
docker run --rm -it \
  --cap-add=NET_ADMIN \
  -v $(pwd)/etc:/etc/wireguard \
  eftechcombr/wireguard

4. Health Check

A health check script is provided:

python wireguard_healthcheck.py

Environment Variables

Variable Description Default
WG_CONF Path to Wireguard config file /etc/wireguard/wg0.conf
WG_PRIVATE_KEY Path to private key file /etc/wireguard/privatekey
WG_PUBLIC_KEY Path to public key file /etc/wireguard/publickey
WG_INTERFACE Wireguard interface name wg0

Helm Chart

Helm charts are available in the charts/ directory for Kubernetes deployment.

Install with Helm

helm install wireguard ./charts

Customize values in charts/values.yaml as needed.


File Structure

etc/
  privatekey
  publickey
  wg0.conf
charts/
  Chart.yaml
  values.yaml
  templates/
    configmap.yaml
    deployment.yaml
    namespace.yaml
    secret.yaml
    service.yaml
wireguard_healthcheck.py
Dockerfile
entrypoint.sh

Useful Commands

  • Generate keys: see above
  • Run health check: python wireguard_healthcheck.py
  • Build Docker image: docker build -t eftechcombr/wireguard .
  • Run container: see above
  • Deploy with Helm: see above

References


License

MIT

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •