From 23b7a6de6415488d3712c367eb9c198ed4e728fd Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 1 Oct 2021 00:17:58 -0400 Subject: [PATCH] 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! --- Makefile | 3 ++- usr/local/man/man8/wggen.8 | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 usr/local/man/man8/wggen.8 diff --git a/Makefile b/Makefile index b7659fd..a72bd24 100644 --- 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 new file mode 100644 index 0000000..3427f78 --- /dev/null +++ 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//private.key +client's private key +.It Pa /etc/wg//public.key +client's public key +.It Pa /etc/wg//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 -- libgit2 1.1.1