diff options
author | Nick Hainke <vincent@systemli.org> | 2021-02-04 16:34:02 +0100 |
---|---|---|
committer | Polynomdivision <vincent@systemli.org> | 2021-02-06 22:41:29 +0100 |
commit | 3a6949dfaffda130a2945f714305bcafb8ac98fa (patch) | |
tree | ac65a98ee6d241f574ec803382789c1307f258f9 /net/wg-installer/Makefile | |
parent | d29ec52a5895f06dd9f31062b52ebb7f2ac0f49f (diff) |
wg-installer: add wg-installer
This tool can be used to automatically create wireguard tunnels. Using
rpcd a new wireguard interface is created on the server where the client
can connect to.
Wiregurad server automatically installs a user and associated ACL to use
the wireguard-installer-server features. The user is called wginstaller
and so is the password.
Get Usage:
wg-client-installer get_usage --ip 127.0.0.1 --user wginstaller
--password wginstaller
Register Interface:
wg-client-installer register --ip 127.0.0.1 --user wginstaller
--password wginstaller --bandwidth 10 --mtu 1400
Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'net/wg-installer/Makefile')
-rw-r--r-- | net/wg-installer/Makefile | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/net/wg-installer/Makefile b/net/wg-installer/Makefile new file mode 100644 index 000000000..d43407b03 --- /dev/null +++ b/net/wg-installer/Makefile @@ -0,0 +1,69 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=wg-installer +PKG_RELEASE:=$(AUTORELEASE) + +PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org> + +include $(INCLUDE_DIR)/package.mk + +Build/Compile= + +define Package/wg-installer/Default + SECTION:=net + CATEGORY:=Network + TITLE:=WireGuard Installer + URL:=https://github.com/Freifunk-Spalter/ + PKGARCH:=all + DEPENDS:=+kmod-wireguard +owipcalc +endef + +define Package/wg-installer-server + $(call Package/wg-installer/Default) + TITLE+= (server) + DEPENDS:=+rpcd +uhttpd +uhttpd-mod-ubus +owipcalc +endef + +define Package/wg-installer-server/install + $(INSTALL_DIR) $(1)/usr/share/wginstaller/ + $(INSTALL_BIN) ./wg-server/lib/install_wginstaller_user.sh $(1)/usr/share/wginstaller/install_wginstaller_user.sh + $(INSTALL_BIN) ./wg-server/lib/wg_functions.sh $(1)/usr/share/wginstaller/wg_functions.sh + $(INSTALL_BIN) ./common/wg.sh $(1)/usr/share/wginstaller/wg.sh + + $(INSTALL_DIR) $(1)/usr/libexec/rpcd/ + $(INSTALL_BIN) ./wg-server/wginstaller.sh $(1)/usr/libexec/rpcd/wginstaller + + $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d + $(CP) ./wg-server/config/wginstaller.json $(1)/usr/share/rpcd/acl.d/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./wg-server/config/wgserver.conf $(1)/etc/config/wgserver +endef + +define Package/wg-installer-server/postinst + #!/bin/sh + if [ -z $${IPKG_INSTROOT} ] ; then + . /usr/share/wginstaller/install_wginstaller_user.sh + fi +endef + +define Package/wg-installer-client + $(call Package/wg-installer/Default) + TITLE+= (client) + DEPENDS:=+curl +wireguard-tools +endef + +define Package/wg-installer-client/install + $(INSTALL_DIR) $(1)/usr/share/wginstaller/ + $(INSTALL_BIN) ./wg-client/lib/rpcd_ubus.sh $(1)/usr/share/wginstaller/rpcd_ubus.sh + $(INSTALL_BIN) ./common/wg.sh $(1)/usr/share/wginstaller/wg.sh + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./wg-client/wg-client-installer.sh $(1)/usr/bin/wg-client-installer + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./wg-client/config/wgclient.conf $(1)/etc/config/wgclient +endef + +$(eval $(call BuildPackage,wg-installer-server)) +$(eval $(call BuildPackage,wg-installer-client)) |