Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit e8e16a2

Browse files
authored
Update README.md
1 parent 52a4f85 commit e8e16a2

File tree

1 file changed

+74
-59
lines changed

1 file changed

+74
-59
lines changed

README.md

Lines changed: 74 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,30 @@ Current stable release: [v1.3.0](https://github.com/EmbarkStudios/wg-ui/releases
1313
* Optional multi-user support behind an authenticating proxy
1414
* Zero external dependencies - just a single binary using the wireguard kernel module
1515
* Binary and container deployment
16+
* This Ascend version also has a sign out button :D
17+
* Instead of showing the Google ID, your company email is shown
1618

1719
![Screenshot](wireguard-ui.png)
1820

19-
## Running
20-
21-
The easiest way to run wg-ui is using the container image. To test it, run:
22-
23-
```docker run --rm -it --privileged --entrypoint "/wireguard-ui" -v /tmp/wireguard-ui:/data -p 8080:8080 embarkstudios/wireguard-ui:latest --data-dir=/data --log-level=debug```
24-
25-
When running in production, we recommend using the latest release as opposed to `latest`.
26-
27-
Important to know is that you need to have WireGuard installed on the machine in order for this to work, as this is 'just' a UI to manage WireGuard configs.
28-
2921
### Configuration
3022

3123
You can configure wg-ui using commandline flags or environment variables.
3224
To see all available flags run:
3325

3426
```
35-
docker run --rm -it embarkstudios/wireguard-ui:latest -h
3627
./wireguard-ui -h
3728
```
3829

39-
You can alternatively specify each flag through an environment variable of the form `WIREGUARD_UI_<FLAG_NAME>`, where `<FLAG_NAME>` is replaced with the flag name transformed to `CONSTANT_CASE`, e.g.
40-
41-
```docker run --rm -it embarkstudios/wireguard-ui:latest --log-level=debug```
42-
43-
and
44-
45-
```docker run --rm -it -e WIREGUARD_UI_LOG_LEVEL=debug embarkstudios/wireguard-ui:latest```
46-
47-
are the same.
48-
49-
## Docker images
50-
51-
There are two ways to run wg-ui today, you can run it with kernel module installed on your host which is the best way to do it if you want performance.
52-
53-
```
54-
docker pull embarkstudios/wireguard-ui:latest
55-
```
56-
57-
If you however do not have the possibility or interest in having kernel module loaded on your host, there is now a solution for that using a docker image based on wireguard-go. Keep in mind that this runs in userspace and not in kernel module.
58-
59-
```
60-
docker pull embarkstudios/wireguard-ui:userspace
61-
```
62-
63-
Both images are built for `linux/amd64`, `linux/arm64` and `linux/arm/v7`. If you would need it for any other platform you can build wg-ui binaries with help from the documentation.
64-
65-
6630
## Install without Docker
6731

6832
You need to have WireGuard installed on the machine running `wg-ui`.
6933

7034
Unless you use the userspace version with docker you're required to have WireGuard installed on your host machine.
7135

72-
A few installation guides:
36+
Ubuntu installation guide:
7337
[Ubuntu 20.04 LTS](https://www.cyberciti.biz/faq/ubuntu-20-04-set-up-wireguard-vpn-server/)
74-
[CentOS 8](https://www.cyberciti.biz/faq/centos-8-set-up-wireguard-vpn-server/)
75-
[Debian 10](https://www.cyberciti.biz/faq/debian-10-set-up-wireguard-vpn-server/)
7638

77-
### Go installation (Debian)
39+
### Go installation
7840
Install latest version of Go from (https://golang.org/dl/)
7941

8042
```
@@ -90,14 +52,6 @@ export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
9052
export GOPATH=$HOME/go
9153
```
9254

93-
### Install LTS version of nodejs for frontend.
94-
95-
```
96-
sudo apt-get install curl software-properties-common
97-
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
98-
sudo apt-get install nodejs
99-
```
100-
10155
### Fetch wg-ui
10256

10357
```
@@ -110,15 +64,6 @@ git clone https://github.com/EmbarkStudios/wg-ui.git && cd wg-ui
11064
make build
11165
```
11266

113-
### Crosscompiling
114-
115-
```
116-
make build-amd64
117-
```
118-
119-
```
120-
make build-armv5
121-
```
12267

12368
```
12469
make build-armv6
@@ -150,6 +95,76 @@ make build
15095
sudo ./bin/wireguard-ui --log-level=debug --dev-ui-server http://localhost:5000
15196
```
15297

98+
## Setting up Nginx as reverse proxy, and oauth2-proxy as authenticator with Google as provider
99+
100+
Note: This example is running Wireguard-ui on port 8080.
101+
102+
Edit the `/etc/nginx/sites-enables/default` or create a new config with these settings. Note: the ssl certificate and key are both located in `/etc/nginx`:
103+
```
104+
server {
105+
listen [::]:443 ssl;
106+
listen 443 ssl;
107+
server_name server-name;
108+
ssl on;
109+
ssl_certificate ssl/ssl_certificate.cer
110+
ssl_certificate_key ssl/ssl_key.key;
111+
112+
location / {
113+
proxy_pass http://127.0.0.1:4180;
114+
proxy_set_header Host $host;
115+
proxy_set_header X-Real-IP $remote_addr;
116+
proxy_set_header X-Scheme $scheme;
117+
proxy_connect_timeout 1;
118+
proxy_send_timeout 30;
119+
proxy_read_timeout 30;
120+
}
121+
}
122+
123+
server {
124+
listen 80;
125+
listen [::]:80;
126+
server_name server-name;
127+
128+
129+
location / {
130+
if ($host = vpn.ascendntnu.no) {
131+
return 301 https://$host$request_uri;
132+
}
133+
}
134+
}
135+
```
136+
To set up [oauth2-proxy](https://github.com/oauth2-proxy/oauth2-proxy), you have to install the latest version from their GitHub.
137+
Then follow this [guide](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider#google-auth-provider) to get your client ID and secret from Google.
138+
After you have installed it, create a config (for example `/etc/oauth2-proxy.cfg`):
139+
140+
```
141+
prompt = "select_account"
142+
provider = "google"
143+
144+
145+
redirect_url = "https://cp.example.com/oauth2/callback"
146+
reverse_proxy = true
147+
148+
email_domains = [
149+
"yourcompany.com"
150+
]
151+
152+
client_id = "google-client-id"
153+
client_secret = "google-client-secret"
154+
155+
pass_basic_auth = true
156+
pass_user_headers = true
157+
158+
159+
cookie_name = "_oauth2_proxy"
160+
cookie_secret = "cookie-seed"
161+
cookie_expire = "1h"
162+
upstreams = "http://127.0.0.1:8080/"
163+
```
164+
I recommend checking out the official oauth2-proxy [documentation](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/overview) for more settings and configs. It also shows how you can generate your cookie seed.
165+
166+
To run oauth2-proxy, just run `oauth2-proxy --config=/etc/oauth2-proxy.cfg`.
167+
153168
## Contributing
154169

155170
We welcome community contributions to this project.

0 commit comments

Comments
 (0)