wireadmin/README.md

142 lines
5.5 KiB
Markdown
Raw Permalink Normal View History

2024-04-26 23:23:33 +00:00
# WireGuard (Easy Admin UI)
2024-05-29 16:40:18 +00:00
[![CI](https://github.com/wireadmin/wireadmin/actions/workflows/ci.yml/badge.svg)](https://github.com/wireadmin/wireadmin/actions/workflows/ci.yml)
2024-04-26 23:23:33 +00:00
[![GPL-3.0 Licensed](https://img.shields.io/badge/License-GPL3.0-blue.svg?style=flat)](https://opensource.org/licenses/GPL-3.0)
2023-09-29 05:55:03 +00:00
![Screenshot](assets/screenshot-1.png)
2023-12-21 21:34:25 +00:00
| | | |
2024-04-20 20:25:11 +00:00
| :----------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------: |
2023-12-21 21:34:25 +00:00
| <img src="assets/screenshot-2.png" alt="screenshot" style="width:100%;max-height:300px;"/> | <img src="assets/screenshot-4.png" alt="screenshot" style="width:100%;max-height:300px;"/> | <img src="assets/screenshot-3.png" alt="screenshot" style="width:100%;max-height:300px;"/> |
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
---
- [Features](#features)
- [Build locally](#build-locally)
- [Image](#image)
- [Ports](#ports)
- [Usage](#usage)
- [Docker Compose](#docker-compose)
- [Command line](#command-line)
- [Persistent Data](#persistent-data)
- [Environment variables](#environment-variables)
- [Upgrade](#upgrade)
- [Contributing](#contributing)
- [License](#license)
2023-09-29 05:55:03 +00:00
## Features
2024-04-26 23:23:33 +00:00
- Simple and friendly UI
2023-09-29 05:55:03 +00:00
- Support for multiple users and servers
2023-12-01 15:18:46 +00:00
- Support for **Tor for anonymized connections**
2024-04-26 23:23:33 +00:00
- Server connection statistics
2023-09-29 05:55:03 +00:00
- List, create, delete, or modify any server or user
2024-04-26 23:23:33 +00:00
- Create QR codes
- Easily download the client configurations.
- Automatic Light/Dark Mode
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
## Image
| Registry | Image |
| ------------------------------------------------------------------------------------------------------- | ----------------------------- |
| [Docker Hub](https://hub.docker.com/r/shahradel/wireadmin/) | `shahradel/wireadmin` |
| [GitHub Container Registry](https://github.com/users/shahradelahi/packages/container/package/cfw-proxy) | `ghcr.io/wireadmin/wireadmin` |
## Ports
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
- `53`: Dnsmasq
- `3000`: WebUI
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
And for any additional ports of WireGuard instance, should be exposed through Docker.
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
## Usage
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
### Docker Compose
Docker compose is the recommended way to run this image. You can use the following
[docker compose template](docker-compose.yml), then run the container:
2024-04-20 20:25:11 +00:00
```bash
2024-05-29 16:40:18 +00:00
docker compose up -d
docker compose logs -f
2024-04-20 20:25:11 +00:00
```
2024-05-29 16:40:18 +00:00
### Command line
2024-04-20 20:25:11 +00:00
2024-05-29 16:40:18 +00:00
```shell
$ docker run -d \
--name wireadmin \
-e WG_HOST="<YOUR_SERVER_IP>" \
-e ADMIN_PASSWORD="<ADMIN_PASSWORD>" \
-p "3000:3000/tcp" \
-p "51820:51820/udp" \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
ghcr.io/wireadmin/wireadmin
2024-04-20 20:25:11 +00:00
```
2024-05-29 16:40:18 +00:00
> 💡 Replace `<YOUR_SERVER_IP>` with the IP address of your server.
2024-05-29 16:40:18 +00:00
> 💡 Replace `<ADMIN_PASSWORD>` with the password for the admin UI.
2024-05-29 16:40:18 +00:00
The Web UI will now be available on `http://0.0.0.0:3000`.
2024-05-29 16:40:18 +00:00
### Persistent Data
2024-05-29 16:40:18 +00:00
It's important to mount a volume to ensure that your data is not lost during container restarts or updates. Here is the list of required volumes:
2024-04-20 20:25:11 +00:00
2024-05-29 16:40:18 +00:00
- `wireadmin-data`: `/data`
- `tor-data`: `/var/lib/tor`
2024-04-20 20:25:11 +00:00
2024-05-29 16:40:18 +00:00
To create a docker volume, use the following command:
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
```bash
$ docker volume create "<volume>" --driver local
2023-09-29 05:55:03 +00:00
```
2024-05-29 16:40:18 +00:00
> 💡 Replace `<volume>` with the name of the volume.
2024-04-26 23:23:33 +00:00
2024-05-29 16:40:18 +00:00
Finally, to mount the volumes with `-v` flag in the `docker run` command:
2024-04-26 23:23:33 +00:00
2024-05-29 16:40:18 +00:00
```bash
$ docker run -d \
-v wireadmin-data:/data \
-v tor-data:/var/lib/tor \
ghcr.io/wireadmin/wireadmin
```
2024-04-26 23:23:33 +00:00
2024-05-29 16:40:18 +00:00
### Environment variables
2023-09-29 05:55:03 +00:00
These options can be configured by setting environment variables using `-e KEY="VALUE"` in the `docker run` command.
2024-05-29 16:40:18 +00:00
| Option | Description | Default | Optional |
| ----------------- | ----------------------------------------------------------------------------------- | ------------------- | -------- |
| `WG_HOST` | The public IP address of the WireGuard server. | - | |
| `ADMIN_PASSWORD` | The password for the web UI. | `insecure-password` | |
| `HOST` | The hostname for the WebUI. | `127.0.0.1` | ✔️ |
| `PORT` | The port for the WebUI. | `3000` | ✔️ |
| `TOR_USE_BRIDGES` | Set this to `1` and then mount the bridges file at `/etc/tor/torrc.d/bridges.conf`. | - | ✔️ |
| `TOR_*` | The `Torrc` proxy configuration. (e.g. `SocksPort` as `TOR_SOCKS_PORT="9050"`) | - | ✔️ |
## Upgrade
Recreate the container whenever I push an update:
```bash
$ docker compose pull
$ docker compose up -d
```
## Contributing
2023-09-29 05:55:03 +00:00
2024-05-29 16:40:18 +00:00
Want to contribute? Awesome! To show your support is to star the project, or to raise issues
on [GitHub](https://github.com/wireadmin/wireadmin)
2023-12-12 10:04:15 +00:00
2024-05-29 16:40:18 +00:00
Thanks again for your support, it is much appreciated! 🙏
2023-12-12 10:04:15 +00:00
2023-09-29 05:55:03 +00:00
## License
2024-05-29 16:40:18 +00:00
[GPL-3.0](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi)