Manage a community vpn/dns network
 
 
 
 
Go to file
Cloud9 GF4 wgapi b5580ddb92 Added helpful comment 2021-10-23 15:49:54 -06:00
admin Seperated environment, fixed bugs 2021-10-22 00:34:09 -06:00
app Added helpful comment 2021-10-23 15:49:54 -06:00
includes Nsupdate in production only; removed CIDR part from user.peers ip addresses 2021-10-22 01:29:43 -06:00
systemd Fixed systemd unit files 2021-10-23 15:44:55 -06:00
.dockerignore Seperated environment, fixed bugs 2021-10-22 00:34:09 -06:00
.gitignore Seperated environment, fixed bugs 2021-10-22 00:34:09 -06:00
Dockerfile Improved dockerfile speed, better docker-compose.yml.sample, debugging nsupdate 2021-10-22 00:58:02 -06:00
LICENSE.md Must be GPLv2 2021-10-14 17:03:14 -06:00
README.md Must be GPLv2 2021-10-14 17:03:14 -06:00
docker-compose.yml.sample Improved dockerfile speed, better docker-compose.yml.sample, debugging nsupdate 2021-10-22 00:58:02 -06:00
env.json.sample Seperated environment, fixed bugs 2021-10-22 00:34:09 -06:00
index.js Seperated environment, fixed bugs 2021-10-22 00:34:09 -06:00
package-lock.json package lock 2021-10-23 15:44:25 -06:00
package.json Updated version to 1.0.4 2021-10-18 17:18:42 -06:00

README.md

wgapi

NodeJS server to add and remove wireguard configs

Installation

Docker

Install docker and docker-compose. Then create a project directory and pull the docker-compose.yml file

$ sudo mkdir /srv/wgapi
$ cd /srv/wgapi
$ sudo wget https://gitea.gf4.pw/gf4/wgapi/raw/branch/master/docker-compose.yml

Edit the compose file according to its comments. Then you can start the service.

docker-compose up -d

The API will modify your wireguard configuration file. Changes will not take effect unless the interface is restarted periodically. One way of doing this is with a systemd timer.

TODO: Add systemd timer and instructions

NOTE: The API is not protected by any authentication. As it stands, anyone can connect to your API and access your wireguard network! Be sure to protect it with authentication in a web proxy or by blocking access with a firewall.

Usage

Once the server is listening, there are two endpoints that clients can direct requests to.

Add

This endpoint adds a peer to the wireguard server.

TODO: Write how to use it.

Delete

This endpoint deletes a peer from the server.

TODO: Write how to use it.

Notes

After a config has been downloaded by a client, the user is free to modify it to peer with friends' hosts.

TODO: Add instructions on how to do this.

License (GPLv2)

Copyright © 2021 Keith Irwin

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.