ADDED wgsync/makefile Index: wgsync/makefile ================================================================== --- wgsync/makefile +++ wgsync/makefile @@ -0,0 +1,30 @@ +pq-inc != pkg-config --cflags libpq +pq-lib != pkg-config --libs libpq + +cc-flags = -std=c2x $(pq-inc) +ld-flags = $(pq-lib) + +B = build + +# link rule +.PHONY: wgsync +$B/wgsync: $B/wgsync.o $B/wireguard.o | $B/ + $(CC) $(ld-flags) $^ -o $@ + +# build rules +$B/%.o: src/%.c | $B/ + $(CC) $(cc-flags) -c $< -o $@ + +$B/wireguard.o: ext/wglib/wireguard.c ext/wglib/wireguard.h | $B/ + $(CC) -std=c11 -c $< -o $@ + +# dep listings +$B/wgsync.o: ext/wglib/wireguard.h + +# fetch rules +%/: + mkdir -p $@ + +wg-lib-uri = https://git.zx2c4.com/wireguard-tools/plain/contrib/embeddable-wg-library +ext/wglib/%: | ext/wglib/ + curl $(wg-lib-uri)/$* >$@ ADDED wgsync/src/wgsync.c Index: wgsync/src/wgsync.c ================================================================== --- wgsync/src/wgsync.c +++ wgsync/src/wgsync.c @@ -0,0 +1,5 @@ +#include + +int main(int argc, char** argv) { + return 0; +} ADDED wgsync/wgsync.ct Index: wgsync/wgsync.ct ================================================================== --- wgsync/wgsync.ct +++ wgsync/wgsync.ct @@ -0,0 +1,2 @@ +# wgsync +wgsync is a utility used to sync VPN keys and rules between the kernel and a postgres database. it can run either as a oneshot utility or a daemon that re-syncs the configuration every time a signal is sent.