commit 56fa2f2258ef62a337b3f01981e55a83f1894ebf Author: Vincent Batts Date: Tue Apr 20 15:05:13 2021 +0000 Initial commit Signed-off-by: Vincent Batts diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..204b93d --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..673d1bd --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# wgconf + +The wireguard configuration file is a botched up INI, that allows duplicate `[Peer]` sections. +Because of this, none of the existing INI parsers handle it correctly (only results in the first or last section, depending on the parser). + +Ideally, the lexer could just smoothly go between JSON/YAML. + +## References + +- https://github.com/WireGuard/wireguard-windows/tree/master/conf - only for windows? +- https://github.com/tailscale/tailscale/blob/670838c45f232f2355c9f2ea587cbcef348410f4/wgengine/wgcfg/parser.go - only over the uapi + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1536d8e --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.thisco.de/vbatts/wgconf + +go 1.16