feat:添加wireguard-easy到列表

This commit is contained in:
okxlin 2023-07-27 01:56:07 +08:00
parent 637047e98d
commit fd2e47fc53
14 changed files with 395 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,6 @@
CONTAINER_NAME="wireguard-easy"
DATA_PATH="./data"
HOST_ADDRESS="172.17.0.1"
PANEL_APP_PORT_HTTP="40074"
WEBUI_PWD="password"
WIREGUARD_PORT="51820"

View File

@ -0,0 +1,42 @@
additionalProperties:
formFields:
- default: 40074
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: WebUI Port
labelZh: 网页端口
required: true
rule: paramPort
type: number
- default: 51820
edit: true
envKey: WIREGUARD_PORT
labelEn: Wireguard port
labelZh: Wireguard端口
required: true
rule: paramPort
type: number
- default: ./data
edit: true
envKey: DATA_PATH
labelEn: Data folder path
labelZh: 数据文件夹路径
required: true
type: text
- default: "password"
edit: true
envKey: WEBUI_PWD
labelEn: Webui password
labelZh: 网页密码
random: false
required: true
rule: paramComplexity
type: password
- default: 172.17.0.1
edit: true
envKey: HOST_ADDRESS
labelEn: Local IP address (must change item)
labelZh: 本机IP地址(必改项)
required: true
rule: paramCommon
type: text

View File

@ -0,0 +1,38 @@
version: "3"
services:
wg-easy:
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
environment:
- WG_HOST=${HOST_ADDRESS}
- PASSWORD=${WEBUI_PWD}
- WG_PORT=${WIREGUARD_PORT}
# Optional:
# - WG_DEFAULT_ADDRESS=10.8.0.x
# - WG_DEFAULT_DNS=1.1.1.1
# - WG_MTU=1420
# - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
# - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt
# - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt
# - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt
# - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt
volumes:
- ${DATA_PATH}:/etc/wireguard
ports:
- "${WIREGUARD_PORT}:${WIREGUARD_PORT}/udp"
- "${PANEL_APP_PORT_HTTP}:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
image: weejewel/wg-easy:7
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

View File

@ -0,0 +1,115 @@
# WireGuard Easy
[![Build & Publish Docker Image to Docker Hub](https://github.com/WeeJeWel/wg-easy/actions/workflows/deploy.yml/badge.svg?branch=production)](https://github.com/WeeJeWel/wg-easy/actions/workflows/deploy.yml)
[![Lint](https://github.com/WeeJeWel/wg-easy/actions/workflows/lint.yml/badge.svg?branch=master)](https://github.com/WeeJeWel/wg-easy/actions/workflows/lint.yml)
[![Docker](https://img.shields.io/docker/v/weejewel/wg-easy/latest)](https://hub.docker.com/r/weejewel/wg-easy)
[![Docker](https://img.shields.io/docker/pulls/weejewel/wg-easy.svg)](https://hub.docker.com/r/weejewel/wg-easy)
[![Sponsor](https://img.shields.io/github/sponsors/weejewel)](https://github.com/sponsors/WeeJeWel)
![GitHub Stars](https://img.shields.io/github/stars/weejewel/wg-easy)
You have found the easiest way to install & manage WireGuard on any Linux host!
<p align="center">
<img src="https://github.com/wg-easy/wg-easy/raw/master/assets/screenshot.png" width="802" />
</p>
## Features
* All-in-one: WireGuard + Web UI.
* Easy installation, simple to use.
* List, create, edit, delete, enable & disable clients.
* Show a client's QR code.
* Download a client's configuration file.
* Statistics for which clients are connected.
* Tx/Rx charts for each connected client.
* Gravatar support.
## Requirements
* A host with a kernel that supports WireGuard (all modern kernels).
* A host with Docker installed.
## Installation
### 1. Install Docker
If you haven't installed Docker yet, install it by running:
```bash
$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker $(whoami)
$ exit
```
And log in again.
### 2. Run WireGuard Easy
To automatically install & run wg-easy, simply run:
<pre>
$ docker run -d \
--name=wg-easy \
-e WG_HOST=<b>🚨YOUR_SERVER_IP</b> \
-e PASSWORD=<b>🚨YOUR_ADMIN_PASSWORD</b> \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--restart unless-stopped \
weejewel/wg-easy
</pre>
> 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname.
>
> 💡 Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI.
The Web UI will now be available on `http://0.0.0.0:51821`.
> 💡 Your configuration files will be saved in `~/.wg-easy`
### 3. Sponsor
Are you enjoying this project? [Buy me a beer!](https://github.com/sponsors/WeeJeWel) 🍻
## Options
These options can be configured by setting environment variables using `-e KEY="VALUE"` in the `docker run` command.
| Env | Default | Example | Description |
| - | - | - | - |
| `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. |
| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. |
| `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. |
| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will always listen on `51820` inside the Docker container. |
| `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. |
| `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. |
| `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. |
| `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use. |
| `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use. |
| `WG_PRE_UP` | `...` | - | See [config.js](https://github.com/WeeJeWel/wg-easy/blob/master/src/config.js#L19) for the default value. |
| `WG_POST_UP` | `...` | `iptables ...` | See [config.js](https://github.com/WeeJeWel/wg-easy/blob/master/src/config.js#L20) for the default value. |
| `WG_PRE_DOWN` | `...` | - | See [config.js](https://github.com/WeeJeWel/wg-easy/blob/master/src/config.js#L27) for the default value. |
| `WG_POST_DOWN` | `...` | `iptables ...` | See [config.js](https://github.com/WeeJeWel/wg-easy/blob/master/src/config.js#L28) for the default value. |
> If you change `WG_PORT`, make sure to also change the exposed port.
## Updating
To update to the latest version, simply run:
```bash
docker stop wg-easy
docker rm wg-easy
docker pull weejewel/wg-easy
```
And then run the `docker run -d \ ...` command above again.
## Common Use Cases
* [Using WireGuard-Easy with Pi-Hole](https://github.com/WeeJeWel/wg-easy/wiki/Using-WireGuard-Easy-with-Pi-Hole)
* [Using WireGuard-Easy with nginx/SSL](https://github.com/WeeJeWel/wg-easy/wiki/Using-WireGuard-Easy-with-nginx-SSL)

View File

@ -0,0 +1,20 @@
name: WireGuard Easy
tags:
- 工具
title: 运行WireGuard VPN +基于Web的管理UI的最简单方法
type: 工具
description: 运行WireGuard VPN +基于Web的管理UI的最简单方法
additionalProperties:
key: wireguard-easy
name: WireGuard Easy
tags:
- Tool
shortDescZh: 运行WireGuard VPN +基于Web的管理UI的最简单方法
shortDescEn: The easiest way to run WireGuard VPN + Web-based Admin UI
type: tool
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://www.wireguard.com/
github: https://github.com/wg-easy/wg-easy
document: https://www.wireguard.com/

View File

@ -0,0 +1,6 @@
CONTAINER_NAME="wireguard-easy"
DATA_PATH="./data"
HOST_ADDRESS="172.17.0.1"
PANEL_APP_PORT_HTTP="40074"
WEBUI_PWD="password"
WIREGUARD_PORT="51820"

View File

@ -0,0 +1,42 @@
additionalProperties:
formFields:
- default: 40074
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: WebUI Port
labelZh: 网页端口
required: true
rule: paramPort
type: number
- default: 51820
edit: true
envKey: WIREGUARD_PORT
labelEn: Wireguard port
labelZh: Wireguard端口
required: true
rule: paramPort
type: number
- default: ./data
edit: true
envKey: DATA_PATH
labelEn: Data folder path
labelZh: 数据文件夹路径
required: true
type: text
- default: "password"
edit: true
envKey: WEBUI_PWD
labelEn: Webui password
labelZh: 网页密码
random: false
required: true
rule: paramComplexity
type: password
- default: 172.17.0.1
edit: true
envKey: HOST_ADDRESS
labelEn: Local IP address (must change item)
labelZh: 本机IP地址(必改项)
required: true
rule: paramCommon
type: text

View File

@ -0,0 +1,38 @@
version: "3"
services:
wg-easy:
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
environment:
- WG_HOST=${HOST_ADDRESS}
- PASSWORD=${WEBUI_PWD}
- WG_PORT=${WIREGUARD_PORT}
# Optional:
# - WG_DEFAULT_ADDRESS=10.8.0.x
# - WG_DEFAULT_DNS=1.1.1.1
# - WG_MTU=1420
# - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
# - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt
# - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt
# - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt
# - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt
volumes:
- ${DATA_PATH}:/etc/wireguard
ports:
- "${WIREGUARD_PORT}:${WIREGUARD_PORT}/udp"
- "${PANEL_APP_PORT_HTTP}:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
image: weejewel/wg-easy:latest
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -0,0 +1,6 @@
CONTAINER_NAME="wireguard-easy"
DATA_PATH="./data"
HOST_ADDRESS="172.17.0.1"
PANEL_APP_PORT_HTTP="40074"
WEBUI_PWD="password"
WIREGUARD_PORT="51820"

View File

@ -0,0 +1,42 @@
additionalProperties:
formFields:
- default: 40074
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: WebUI Port
labelZh: 网页端口
required: true
rule: paramPort
type: number
- default: 51820
edit: true
envKey: WIREGUARD_PORT
labelEn: Wireguard port
labelZh: Wireguard端口
required: true
rule: paramPort
type: number
- default: ./data
edit: true
envKey: DATA_PATH
labelEn: Data folder path
labelZh: 数据文件夹路径
required: true
type: text
- default: "password"
edit: true
envKey: WEBUI_PWD
labelEn: Webui password
labelZh: 网页密码
random: false
required: true
rule: paramComplexity
type: password
- default: 172.17.0.1
edit: true
envKey: HOST_ADDRESS
labelEn: Local IP address (must change item)
labelZh: 本机IP地址(必改项)
required: true
rule: paramCommon
type: text

View File

@ -0,0 +1,38 @@
version: "3"
services:
wg-easy:
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
environment:
- WG_HOST=${HOST_ADDRESS}
- PASSWORD=${WEBUI_PWD}
- WG_PORT=${WIREGUARD_PORT}
# Optional:
# - WG_DEFAULT_ADDRESS=10.8.0.x
# - WG_DEFAULT_DNS=1.1.1.1
# - WG_MTU=1420
# - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
# - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt
# - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt
# - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt
# - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt
volumes:
- ${DATA_PATH}:/etc/wireguard
ports:
- "${WIREGUARD_PORT}:${WIREGUARD_PORT}/udp"
- "${PANEL_APP_PORT_HTTP}:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
image: weejewel/wg-easy:nightly
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

View File

@ -1,4 +1,4 @@
name: wireguard-ui
name: WireGuard-UI
tags:
- 工具
title: Wireguard网络界面
@ -6,7 +6,7 @@ type: 工具
description: Wireguard网络界面
additionalProperties:
key: wireguard-ui
name: wireguard-ui
name: WireGuard-UI
tags:
- Tool
shortDescZh: Wireguard网络界面