Convert step-by-step sections to the steps component
This commit is contained in:
@@ -5,15 +5,6 @@ description: Install and configure WireGuard VPN to securely access your homelab
|
||||
|
||||
|
||||
:ellipsis{left=0px width=40rem top=10rem blur=140px zIndex=60}
|
||||
# Wireguard
|
||||
|
||||
::note
|
||||
🎯 __Goals:__
|
||||
|
||||
- Install Wireguard
|
||||
- Configure clients
|
||||
- Access the secure network
|
||||
::
|
||||
|
||||
## Introduction
|
||||
Using a VPN allows remote access to a server’s local resources without exposing them to the internet. It’s a clean and secure way to access services like SSH without exposing the port publicly. With a VPN, you can securely connect to your network from anywhere and make devices on different networks communicate.
|
||||
@@ -72,6 +63,9 @@ root
|
||||
└── .env
|
||||
```
|
||||
|
||||
::steps{level="3"}
|
||||
### Deploy the stack
|
||||
|
||||
Open Dockge, click **Compose**, and name the stack `wg_easy`.
|
||||
|
||||
Copy the following configuration:
|
||||
@@ -145,25 +139,48 @@ Deploy the stack and access the local web UI at `http://server-ip:51821`.
|
||||
If the deployment fails, check your firewall rules.
|
||||
::
|
||||
|
||||
### Create your account
|
||||
|
||||
Once connected, follow the web UI instructions to:
|
||||
|
||||
- Create your admin account and password.
|
||||
- Set the host field (use your public IP or domain name).
|
||||
|
||||
### Configure the tunnel
|
||||
|
||||
Then go to *Administrator → Admin Panel → Config*:
|
||||
|
||||
- Change `Allowed IPs` from `0.0.0.0/24` to `10.8.0.0/24` for **split tunneling**.
|
||||
- Remove IPv6 (it often causes unnecessary issues).
|
||||
|
||||
### Done !
|
||||
::
|
||||
|
||||
### Retrieve Configuration Files
|
||||
|
||||
To configure clients:
|
||||
|
||||
1. Access the web UI: `http://server-ip:51821`
|
||||
2. Create a new client
|
||||
3. Edit the client and add `10.8.0.0/24` to `Server Allowed IPs`
|
||||
4. (Optional) Set `Persistent Keep Alive` to `25` if it’s a permanently connected client
|
||||
5. Save, download, and rename the file to `wg0.conf` (or `wg1.conf`, etc.)
|
||||
::steps{level="4"}
|
||||
#### Access the web UI
|
||||
|
||||
Go to `http://server-ip:51821`.
|
||||
|
||||
#### Create a new client
|
||||
|
||||
#### Edit the client
|
||||
|
||||
Add `10.8.0.0/24` to `Server Allowed IPs`.
|
||||
|
||||
#### (Optional) Set Persistent Keep Alive
|
||||
|
||||
Set it to `25` if it’s a permanently connected client.
|
||||
|
||||
#### Save and rename the file
|
||||
|
||||
Save, download, and rename the file to `wg0.conf` (or `wg1.conf`, etc.)
|
||||
|
||||
#### Done !
|
||||
::
|
||||
|
||||
## Client Server Setup
|
||||
::note
|
||||
@@ -182,7 +199,8 @@ root
|
||||
└── compose.yaml
|
||||
```
|
||||
|
||||
Create the folder:
|
||||
::steps{level="3"}
|
||||
### Create the folder
|
||||
|
||||
```bash [Terminal]
|
||||
sudo mkdir -p /docker/wireguard/config/wg_confs
|
||||
@@ -192,7 +210,7 @@ sudo mkdir -p /docker/wireguard/config/wg_confs
|
||||
✨ **Tip:** You can use [File Browser](/serveex/files/file-browser) instead of the terminal to edit and upload files.
|
||||
::
|
||||
|
||||
Create the `wg0.conf` file:
|
||||
### Create the wg0.conf file
|
||||
|
||||
```bash [Terminal]
|
||||
sudo nano /docker/wireguard/config/wg_confs/wg0.conf
|
||||
@@ -207,6 +225,8 @@ sudo cp ~/wg0.conf /docker/wireguard/config/wg_confs
|
||||
```
|
||||
::
|
||||
|
||||
### Create the compose file
|
||||
|
||||
Create the `compose.yaml` file in `/docker/wireguard`:
|
||||
|
||||
```yaml [compose.yaml]
|
||||
@@ -229,12 +249,16 @@ services:
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
Start the container:
|
||||
### Start the container
|
||||
|
||||
```bash [Terminal]
|
||||
cd /docker/wireguard
|
||||
sudo docker compose up -d
|
||||
```
|
||||
|
||||
### Done !
|
||||
::
|
||||
|
||||
::note
|
||||
|
||||
Repeat this setup for each client.
|
||||
|
||||
@@ -5,17 +5,6 @@ description: Use Cloudflare Tunnels and Zero Trust to expose homelab services wi
|
||||
|
||||
|
||||
:ellipsis{left=0px width=40rem top=10rem blur=140px zIndex=60}
|
||||
# Cloudflare Zero Trust
|
||||
|
||||
::note
|
||||
🎯 __Goals:__
|
||||
|
||||
- Understand the concept of Cloudflare Tunnels
|
||||
- Configure your Cloudflare account
|
||||
- Configure SWAG
|
||||
- Manage multiple tunnels
|
||||
::
|
||||
|
||||

|
||||
|
||||
## Introduction
|
||||
@@ -34,8 +23,7 @@ Simply put, Cloudflare Tunnels allow you to:
|
||||
Here we’ll explain how to integrate SWAG with Cloudflare tunnels.
|
||||
|
||||
::warning
|
||||
|
||||
- __Warning:__
|
||||
__Warning:__
|
||||
- Do not use Cloudflare tunnels to expose a mail server
|
||||
- Do not use Cloudflare tunnels to expose a video service like Jellyfin. Unlike Plex, [Jellyfin has no cloud relay](/serveex/media/jellyfin) and is exposed directly through SWAG in this guide, so make sure it stays behind plain port forwarding rather than a Cloudflare tunnel
|
||||
- Do not use Cloudflare tunnels for the BitTorrent protocol (if you followed [this guide](/serveex/media/qbittorrent), everything is fine)
|
||||
@@ -50,7 +38,7 @@ If you only have one server to protect behind Cloudflare, you can delete all exi
|
||||
|
||||
If you have subdomains pointing to other servers, you can still define them in the DNS zone using A records.
|
||||
|
||||
If you have several servers and tunnels under one domain, [see here](http://192.168.7.80:8005/serveex/cloudflare/#gerer-plusieurs-tunnels-pour-plusieurs-serveurs).
|
||||
If you have several servers and tunnels under one domain, [see here](#managing-multiple-tunnels-for-multiple-servers).
|
||||
|
||||
### API Key
|
||||
|
||||
@@ -85,7 +73,8 @@ SWAG supports two Docker Mods:
|
||||
|
||||
These two mods, merged into the SWAG container, require some configuration.
|
||||
|
||||
### Tunnel Configuration
|
||||
::steps{level="3"}
|
||||
### Configure the tunnel
|
||||
|
||||
Create a file `tunnelconfig.yml` to reference in your SWAG `compose.yaml`.
|
||||
|
||||
@@ -113,7 +102,7 @@ ingress:
|
||||
|
||||
Press :kbd{value="Ctrl+O"}, then :kbd{value="Enter"} to save, and :kbd{value="Ctrl+X"} to exit.
|
||||
|
||||
### Cloudflare Real IP Configuration
|
||||
### Configure Cloudflare Real IP
|
||||
|
||||
Now configure _Cloudflare Real IP_.
|
||||
|
||||
@@ -134,7 +123,7 @@ set_real_ip_from 127.0.0.1;
|
||||
|
||||
Save with :kbd{value="Ctrl+O"}, then :kbd{value="Enter"}, and exit with :kbd{value="Ctrl+X"}.
|
||||
|
||||
### Docker Compose
|
||||
### Deploy the SWAG stack
|
||||
|
||||
In Dockge, edit your SWAG stack with this:
|
||||
|
||||
@@ -227,26 +216,35 @@ Then confirm your tunnel appears under _Networks > Tunnels_ in [Cloudflare Zero
|
||||

|
||||
::
|
||||
|
||||
### Done !
|
||||
::
|
||||
|
||||
## Managing Multiple Tunnels for Multiple Servers
|
||||
By default, all subdomains of your domain are routed through the single tunnel. But if you have a second server, just change the tunnel name in that SWAG instance.
|
||||
By default, all subdomains of your domain are routed through the single tunnel. But if you have a second server, just change the tunnel name in that SWAG instance, and redirect subdomains to the correct tunnel in your DNS zone.
|
||||
|
||||
In your DNS zone, redirect subdomains to the correct tunnel.
|
||||
::steps{level="3"}
|
||||
### Change the tunnel name
|
||||
|
||||
Go to _Networks > Tunnels_ in [Cloudflare Zero Trust](https://one.dash.cloudflare.com/).
|
||||
In the second server's SWAG stack, set a different `TUNNEL_NAME` in the `.env` file, then redeploy.
|
||||
|
||||
Note the tunnel IDs:
|
||||
### Find the tunnel IDs
|
||||
|
||||
Go to _Networks > Tunnels_ in [Cloudflare Zero Trust](https://one.dash.cloudflare.com/) and note the tunnel IDs:
|
||||
|
||||

|
||||
|
||||
Then in the [Cloudflare DNS dashboard](https://dash.cloudflare.com/), click your domain name.
|
||||
### Add CNAME records
|
||||
|
||||
Click `Add Record` and add these two CNAME records (include `.cfargotunnel.com`):
|
||||
In the [Cloudflare DNS dashboard](https://dash.cloudflare.com/), click your domain name, then `Add Record` and add these two CNAME records (include `.cfargotunnel.com`):
|
||||
|
||||
| Type | Name | Target |
|
||||
|---------|--------------|----------------------------------------|
|
||||
| `CNAME` | `subdomain1` | `yourtunnelid1.cfargotunnel.com` |
|
||||
| `CNAME` | `subdomain2` | `yourtunnelid2.cfargotunnel.com` |
|
||||
|
||||
### Done !
|
||||
::
|
||||
|
||||
If you have many subdomains, point them to the above reference subdomains.
|
||||
|
||||
This way, if a tunnel ID changes, you only update one DNS record.
|
||||
|
||||
Reference in New Issue
Block a user