config

System config files for garbash.com
git clone git://git.garbash.com/alex/config
Log | Files | Refs | README | LICENSE

commit 23b7a6de6415488d3712c367eb9c198ed4e728fd
parent d5f8fafe3b09600e16bbd88e40e7163dca66b0ef
Author: alex <alex@garbash.com>
Date:   Fri,  1 Oct 2021 00:17:58 -0400

wggen: Add man page!

I'm a huge fan of mdoc(7), so it was a lot of fun to whip this
up--it's really my first ever true man page for a tool I wrote!

Diffstat:
MMakefile | 3++-
Ausr/local/man/man8/wggen.8 | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -4,7 +4,8 @@ FILES = /etc/httpd.conf \ /etc/mail/smtpd.conf \ /var/git/stagit-post-receive \ /usr/local/bin/newrepo \ - /usr/local/bin/wggen + /usr/local/bin/wggen \ + /usr/local/man/man8/wggen.8 .PHONY: pull pull: diff --git a/usr/local/man/man8/wggen.8 b/usr/local/man/man8/wggen.8 @@ -0,0 +1,62 @@ +.Dd $Mdocdate$ +.Dt WGGEN 8 +.Os +.Sh NAME +.Nm wggen +.Nd generate new wireguard peers +.Sh SYNOPSIS +.Nm +.Ar hostname +.Sh DESCRIPTION +.Nm +is a simple wireguard config management tool. +Currently, it has one function: adding new wireguard peers. +Given a +.Ar hostname , +it will find the next available IP +and create a private key, public key, and +.Xr wg-quick 8 +config that can be given to the end user (see +.Sx FILES ) . +.Pp +.Nm +will then update the +.Xr hostname.if 5 +file for the wireguard interface and restart the endpoint with +.Xr netstart 8 . +.Sh ENVIRONMENT +.Bl -tag -width "HOSTFILE" +.It Ev DATADIR +Alternate location to store the list of hosts and keys instead of +.Pa /etc/wg +.It Ev HOSTFILE +Alternate file to store the host allocation instead of +.Pa /DATADIR/hosts +.El +.Sh FILES +.Bl -tag -width Ds +.It Pa /etc/wg/hosts +master list of host to IP allocation +.It Pa /etc/wg/<hostname>/private.key +client's private key +.It Pa /etc/wg/<hostname>/public.key +client's public key +.It Pa /etc/wg/<hostname>/client.conf +.Xr wg-quick 8 +config (contains public and private keys, as well as IP address) +.El +.Sh EXAMPLES +Generate a new key for a laptop: +.Bd -literal -offset indent +# wggen alex-laptop +# mail -s "Your wg-quick config" alex < /etc/wg/alex-laptop/client.conf +.Ed +.Sh SEE ALSO +.Xr wg 4 , +.Xr ifconfig 8 , +.Xr wg-quick 8 +.Sh HISTORY +Added via ~alex and ~anthony on 9/29/21 to garbash to make it easy to give users +(read: themselves) new wireguard configs. +For the full story behind the hack, see: +.Lk https://garbash.com/~alex/notes/009-wireguard.txt