Documentation correction pull from github

This commit is contained in:
vx3r 2020-01-31 13:06:39 +09:00
parent 28c3c405c7
commit c9fb3c2e29
1 changed files with 16 additions and 19 deletions

View File

@ -13,18 +13,18 @@ Simple Web based configuration generator for [WireGuard](https://wireguard.com).
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/vx3r/wg-gen-web)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/vx3r/wg-gen-web)

## Whay another one ?
## Why another one ?

All WireGuard UI implementations are trying to manage the service by applying configurations and creating network rules.
This implementation only generate configuration and its up to you to create network rules and apply configuration to WireGuard.
For example by monituring generated directory with [inotifywait](https://github.com/inotify-tools/inotify-tools/wiki).
This implementation only generates configuration and its up to you to create network rules and apply configuration to WireGuard.
For example by monitoring generated directory with [inotifywait](https://github.com/inotify-tools/inotify-tools/wiki).

The goal is to run Wg Gen Web in a container and WireGuard on host system.

## Features

* Self-serve and web based
* Automatically select IP from networks chosen for client
* Self-hosted and web based
* Automatically select IP from the netowrk pool assigned to client
* QR-Code for convenient mobile client configuration
* Enable / Disable client
* Generation of `wg0.conf` after any modification
@ -38,7 +38,7 @@ The easiest way to run Wg Gen Web is using the container image
```
docker run --rm -it -v /tmp/wireguard:/data -p 8080:8080 -e "WG_CONF_DIR=/data" vx3r/wg-gen-web:latest
```
Docker compose snipped
Docker compose snippet
```
version: '3.6'
services:
@ -52,16 +52,13 @@ services:
- WG_CONF_DIR=/data
- WG_INTERFACE_NAME=wg0.conf
volumes:
- /mnt/raid-lv-data/docker-persistent-data/wg-gen-web:/data
- /etc/wireguard:/data
```
## How to trigger WireGuard on host
Please note that mapping ```/etc/wireguard``` to ```/data``` inside the docker, will erase your host's current configuration.
If needed, please make sure to backup your files from ```/etc/wireguard```.

Before going further create a symlink from docker mounted volume to `/etc/wireguard`
```
ln -s /mnt/raid-lv-data/docker-persistent-data/wg-gen-web /etc/wireguard
```

### Example with ```systemd```
A workaround would be to change the ```WG_INTERFACE_NAME``` to something different, as it will create a new interface (```wg-auto.conf``` for example), note that if you do so, you will have to adapt your daemon accordingly.
### Automatically apply changes using ```systemd```
Using `systemd.path` monitor for directory changes see [systemd doc](https://www.freedesktop.org/software/systemd/man/systemd.path.html)
```
# /etc/systemd/system/wg-gen-web.path
@ -90,8 +87,8 @@ WantedBy=multi-user.target
```
Which will restart WireGuard service

### Example with ```inotifywait```
Using whatever init system create a daemon running this script
### Automatically apply changes using ```inotifywait```
For any other init system, create a daemon running this script
```
#!/bin/sh
while inotifywait -e modify -e create /etc/wireguard; do
@ -102,9 +99,9 @@ done

## How to use with existing WireGuard configuration

After first run Wg Gen Web will create `server.json` in data directory with alla server informations.
After first run Wg Gen Web will create `server.json` in data directory with all server informations.

Fill free to modify this file in order to use your existing keys
Feel free to modify this file in order to use your existing keys

## What is out of scope

@ -118,4 +115,4 @@ Fill free to modify this file in order to use your existing keys
## License

* Do What the Fuck You Want to Public License. [LICENSE-WTFPL](LICENSE-WTFPL) or http://www.wtfpl.net
* Do What the Fuck You Want to Public License. [LICENSE-WTFPL](LICENSE-WTFPL) or http://www.wtfpl.net