Manage a community vpn/dns network
 
 
 
 
Go to file
wgapi Cloud9 62179c8833 Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
admin Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
app Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
includes Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
systemd v1.0 hackathon 2021-10-14 16:53:42 -06:00
.dockerignore Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
.gitignore Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
Dockerfile Specified node version (15+ needed for crypto.webcrypto) 2021-10-15 14:09:50 -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 Cleanup, added intraserver comms (#4) 2021-10-18 10:35:18 -06:00
index.js Moved mess of js files to directories 2021-10-18 10:49:32 -06:00
package-lock.json Cleanup, added intraserver comms (#4) 2021-10-18 10:35:18 -06:00
package.json Update version 2021-10-18 10:37:34 -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.