mirror of https://github.com/wg-easy/wg-easy
Browse Source
* update packages * fix tab issues * consistent imports * use eslint module * update date * improve docs * update docs * format * fix docs, fix cookiepull/1700/head
committed by
GitHub
39 changed files with 2352 additions and 1375 deletions
@ -1,3 +1,5 @@ |
|||||
--- |
--- |
||||
title: 'Optional Configuration' |
title: Optional Configuration |
||||
--- |
--- |
||||
|
|
||||
|
TODO |
||||
|
@ -1,5 +0,0 @@ |
|||||
--- |
|
||||
title: Podman |
|
||||
--- |
|
||||
|
|
||||
TODO |
|
@ -0,0 +1,47 @@ |
|||||
|
--- |
||||
|
title: Migrate from v14 to v15 |
||||
|
--- |
||||
|
|
||||
|
This guide will help you migrate from `v14` to version `v15` of `wg-easy`. |
||||
|
|
||||
|
## Changes |
||||
|
|
||||
|
This is a complete rewrite of the `wg-easy` project. Therefore the configuration files and the way you interact with the project have changed. |
||||
|
|
||||
|
## Migration |
||||
|
|
||||
|
### Backup |
||||
|
|
||||
|
Before you start the migration, make sure to backup your existing configuration files. |
||||
|
|
||||
|
Go into the Web Ui and click the Backup button, this should download a `wg0.json` file. |
||||
|
|
||||
|
Or download the `wg0.json` file from your container volume to your pc. |
||||
|
|
||||
|
You will need this file for the migration |
||||
|
|
||||
|
### Remove old container |
||||
|
|
||||
|
1. Stop the running container |
||||
|
|
||||
|
If you are using `docker run` |
||||
|
|
||||
|
```shell |
||||
|
docker stop wg-easy |
||||
|
``` |
||||
|
|
||||
|
If you are using `docker-compose` |
||||
|
|
||||
|
```shell |
||||
|
docker-compose down |
||||
|
``` |
||||
|
|
||||
|
### Start new container |
||||
|
|
||||
|
Follow the instructions in the [Getting Started](../../usage.md) or [Basic Installation](../../examples/tutorials/basic-installation.md) guide to start the new container. |
||||
|
|
||||
|
In the setup wizard, select that you already already have a configuration file and upload the `wg0.json` file you downloaded in the backup step. |
||||
|
|
||||
|
### Done |
||||
|
|
||||
|
You have now successfully migrated to `v15` of `wg-easy`. |
@ -0,0 +1,52 @@ |
|||||
|
--- |
||||
|
title: Basic Installation |
||||
|
--- |
||||
|
|
||||
|
<!-- TOOD: add docs for pihole, nginx, caddy, traefik --> |
||||
|
|
||||
|
## Requirements |
||||
|
|
||||
|
1. You need to have a host that you can manage |
||||
|
2. You need to have a domain name or a public IP address |
||||
|
3. You need a supported architecture (x86_64, arm64) |
||||
|
4. You need curl installed on your host |
||||
|
|
||||
|
## Install Docker |
||||
|
|
||||
|
Follow the Docs here: <https://docs.docker.com/engine/install/> and install Docker on your host. |
||||
|
|
||||
|
## Install `wg-easy` |
||||
|
|
||||
|
1. Create a directory for the configuration files (you can choose any directory you like): |
||||
|
|
||||
|
```shell |
||||
|
DIR=/docker/wg-easy |
||||
|
sudo mkdir -p $DIR |
||||
|
``` |
||||
|
|
||||
|
2. Download docker compose file |
||||
|
|
||||
|
```shell |
||||
|
sudo curl -o $URL/docker-compose.yml https://raw.githubusercontent.com/wg-easy/wg-easy/master/docker-compose.yml |
||||
|
``` |
||||
|
|
||||
|
3. Start `wg-easy` |
||||
|
|
||||
|
```shell |
||||
|
sudo docker-compose -f $DIR/docker-compose.yml up -d |
||||
|
``` |
||||
|
|
||||
|
## Setup Firewall |
||||
|
|
||||
|
If you are using a firewall, you need to open the following ports: |
||||
|
|
||||
|
- UDP 51820 (WireGuard) |
||||
|
- TCP 51821 (Web UI) |
||||
|
|
||||
|
These ports can be changed, so if you change them you have to update your firewall rules accordingly. |
||||
|
|
||||
|
## Access the Web UI |
||||
|
|
||||
|
Open your browser and navigate to `https://<your-domain>:51821` or `https://<your-ip>:51821`. |
||||
|
|
||||
|
Follow the instructions to set up your WireGuard VPN. |
@ -0,0 +1,5 @@ |
|||||
|
--- |
||||
|
title: Without Docker |
||||
|
--- |
||||
|
|
||||
|
TODO |
@ -0,0 +1,96 @@ |
|||||
|
--- |
||||
|
title: Podman |
||||
|
--- |
||||
|
|
||||
|
This guide will show you how to run `wg-easy` with rootful Podman and nftables. |
||||
|
|
||||
|
## Requirements |
||||
|
|
||||
|
1. Podman installed with version 4.4 or higher |
||||
|
|
||||
|
## Configuration |
||||
|
|
||||
|
Create a Folder for the configuration files: |
||||
|
|
||||
|
```shell |
||||
|
sudo mkdir -p /etc/containers/systemd/wg-easy |
||||
|
sudo mkdir -p /etc/containers/volumes/wg-easy |
||||
|
``` |
||||
|
|
||||
|
Create a file `/etc/containers/systemd/wg-easy/wg-easy.container` with the following content: |
||||
|
|
||||
|
```ini |
||||
|
[Container] |
||||
|
ContainerName=wg-easy |
||||
|
Image=ghcr.io/wg-easy/wg-easy:latest |
||||
|
|
||||
|
Volume=/etc/containers/volumes/wg-easy:/etc/wireguard:Z |
||||
|
Network=wg-easy.network |
||||
|
PublishPort=51820:51820/udp |
||||
|
PublishPort=51821:51821/tcp |
||||
|
|
||||
|
AddCapability=NET_ADMIN |
||||
|
AddCapability=SYS_MODULE |
||||
|
AddCapability=NET_RAW |
||||
|
Sysctl=net.ipv4.ip_forward=1 |
||||
|
Sysctl=net.ipv4.conf.all.src_valid_mark=1 |
||||
|
Sysctl=net.ipv6.conf.all.disable_ipv6=0 |
||||
|
Sysctl=net.ipv6.conf.all.forwarding=1 |
||||
|
Sysctl=net.ipv6.conf.default.forwarding=1 |
||||
|
|
||||
|
[Install] |
||||
|
# this is used to start the container on boot |
||||
|
WantedBy=default.target |
||||
|
``` |
||||
|
|
||||
|
Create a file `/etc/containers/systemd/wg-easy/wg-easy.network` with the following content: |
||||
|
|
||||
|
```ini |
||||
|
[Network] |
||||
|
NetworkName=wg-easy |
||||
|
IPv6=true |
||||
|
``` |
||||
|
|
||||
|
## Load Kernel Modules |
||||
|
|
||||
|
You will need to load the following kernel modules |
||||
|
|
||||
|
```txt |
||||
|
wireguard |
||||
|
nft_masq |
||||
|
``` |
||||
|
|
||||
|
Create a file `/etc/modules-load.d/wg-easy.conf` with the following content: |
||||
|
|
||||
|
```txt |
||||
|
wireguard |
||||
|
nft_masq |
||||
|
``` |
||||
|
|
||||
|
## Start the Container |
||||
|
|
||||
|
```shell |
||||
|
sudo systemctl daemon-reload |
||||
|
sudo systemctl start wg-easy |
||||
|
``` |
||||
|
|
||||
|
## Edit Hooks |
||||
|
|
||||
|
In the Admin Panel of your WireGuard server, go to the `Hooks` tab and add the following hook: |
||||
|
|
||||
|
1. PostUp |
||||
|
|
||||
|
```shell |
||||
|
apk add nftables; nft add table inet wg_table; nft add chain inet wg_table postrouting { type nat hook postrouting priority 100 \; }; nft add rule inet wg_table postrouting ip saddr {{ipv4Cidr}} oifname {{device}} masquerade; nft add rule inet wg_table postrouting ip6 saddr {{ipv6Cidr}} oifname {{device}} masquerade; nft add chain inet wg_table input { type filter hook input priority 0 \; policy drop \; }; nft add rule inet wg_table input udp dport {{port}} accept; nft add chain inet wg_table forward { type filter hook forward priority 0 \; policy drop \; }; nft add rule inet wg_table forward iifname "wg0" accept; nft add rule inet wg_table forward oifname "wg0" accept; |
||||
|
``` |
||||
|
|
||||
|
2. PostDown |
||||
|
|
||||
|
```shell |
||||
|
nft delete table inet wg_table |
||||
|
``` |
||||
|
|
||||
|
<!-- |
||||
|
TODO: improve docs after better nftables support |
||||
|
TODO: fix accept web ui port |
||||
|
--> |
@ -1,6 +1,11 @@ |
|||||
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'; |
|
||||
import eslintConfigPrettier from 'eslint-config-prettier'; |
import eslintConfigPrettier from 'eslint-config-prettier'; |
||||
|
import withNuxt from './.nuxt/eslint.config.mjs'; |
||||
|
|
||||
export default createConfigForNuxt().append(eslintConfigPrettier); |
export default withNuxt([ |
||||
|
{ |
||||
// TODO: add typescript-eslint, import/order, ban raw defineEventHandler
|
rules: { |
||||
|
'import/order': 'warn', |
||||
|
}, |
||||
|
}, |
||||
|
eslintConfigPrettier, |
||||
|
]); |
||||
|
File diff suppressed because it is too large
Loading…
Reference in new issue