mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-25 19:54:06 +03:00
Single binary build (#10)
Single binary build Use go rice for embedding the static files and templates to the binary file
This commit is contained in:
parent
b741a915ae
commit
9a27cc366f
12 changed files with 169 additions and 34 deletions
47
README.md
47
README.md
|
@ -8,15 +8,24 @@ A web user interface to manage your WireGuard setup.
|
|||
- Retrieve configs using QR code / file
|
||||
|
||||
## Run WireGuard-UI
|
||||
Only docker option for now, please refer to this example of [docker-compose.yml](https://github.com/ngoduykhanh/wireguard-ui/blob/master/docker-compose.yaml).
|
||||
|
||||
Please adjust volume mount points to work with your setup. Then run it:
|
||||
Default username and password are `admin`.
|
||||
|
||||
### Using docker compose
|
||||
|
||||
You can take a look at this example of [docker-compose.yml](https://github.com/ngoduykhanh/wireguard-ui/blob/master/docker-compose.yaml). Please adjust volume mount points to work with your setup. Then run it like below:
|
||||
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
Default username and password are `admin`.
|
||||
### Using binary file
|
||||
|
||||
Download the binary file from the release and run it with command:
|
||||
|
||||
```
|
||||
./wireguard-ui
|
||||
```
|
||||
|
||||
## Auto restart WireGuard daemon
|
||||
WireGuard-UI only takes care of configuration generation. You can use systemd to watch for the changes and restart the service. Following is an example:
|
||||
|
@ -52,6 +61,38 @@ systemctl enable wgui.{path,service}
|
|||
systemctl start wgui.{path,service}
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
### Build docker image
|
||||
|
||||
Go to the project root directory and run the following command:
|
||||
|
||||
```
|
||||
docker build -t wireguard-ui .
|
||||
```
|
||||
|
||||
### Build binary file
|
||||
|
||||
Prepare the assets directory
|
||||
|
||||
```
|
||||
./prepare_assets.sh
|
||||
```
|
||||
|
||||
Then you can embed resources by generating Go source code
|
||||
|
||||
```
|
||||
rice embed-go
|
||||
go build -o wireguard-ui
|
||||
```
|
||||
|
||||
Or, append resources to executable as zip file
|
||||
|
||||
```
|
||||
go build -o wireguard-ui
|
||||
rice append --exec wireguard-ui
|
||||
```
|
||||
|
||||
## Screenshot
|
||||
|
||||

|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue