mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-11-27 07:06:03 +01:00
improve cluster node compose and instructions
This commit is contained in:
@@ -130,10 +130,23 @@
|
||||
<div class="card card-outline card-secondary">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-download"></i> {% trans 'Installation' %}</h3></div>
|
||||
<div class="card-body">
|
||||
<p>{% blocktrans trimmed %}
|
||||
Copy <code>cluster_node.yml</code> (and <code>cluster_node-gateway.yml</code> to publish App Gateway applications)
|
||||
from the <a href="https://github.com/eduardogsilva/wireguard_webadmin" target="_blank" rel="noopener noreferrer">project repository</a>
|
||||
to the worker, and create a <code>.env</code> file next to them:
|
||||
<div class="btn-group btn-group-sm mb-3" role="group">
|
||||
<button type="button" class="btn btn-primary worker-mode" data-compose-file="cluster_node.yml">{% trans 'VPN only' %}</button>
|
||||
<button type="button" class="btn btn-outline-primary worker-mode" data-compose-file="cluster_node-gateway.yml">{% trans 'VPN and App Gateway' %}</button>
|
||||
</div>
|
||||
|
||||
<p class="mb-1"><strong>1.</strong> {% blocktrans trimmed %}
|
||||
Download the compose file from the
|
||||
<a href="https://github.com/eduardogsilva/wireguard_webadmin" target="_blank" rel="noopener noreferrer">project repository</a>
|
||||
to an empty directory on the worker:
|
||||
{% endblocktrans %}</p>
|
||||
<div class="position-relative">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary position-absolute copy-button" style="top: 6px; right: 6px;" data-target="#worker-download" title="{% trans 'Copy' %}"><i class="far fa-copy"></i></button>
|
||||
<pre id="worker-download" class="p-2 pr-5" style="white-space: pre-wrap;">wget -O <span class="worker-compose-file">cluster_node.yml</span> https://raw.githubusercontent.com/eduardogsilva/wireguard_webadmin/main/<span class="worker-compose-file">cluster_node.yml</span></pre>
|
||||
</div>
|
||||
|
||||
<p class="mb-1"><strong>2.</strong> {% blocktrans trimmed %}
|
||||
Create a <code>.env</code> file in the same directory:
|
||||
{% endblocktrans %}</p>
|
||||
<div class="position-relative">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary position-absolute copy-button" style="top: 6px; right: 6px;" data-target="#worker-env" title="{% trans 'Copy' %}"><i class="far fa-copy"></i></button>
|
||||
@@ -142,20 +155,15 @@ TOKEN={{ worker.token }}
|
||||
TIMEZONE={{ time_zone }}</pre>
|
||||
</div>
|
||||
|
||||
<p class="mb-1"><strong>{% trans 'VPN only' %}</strong></p>
|
||||
<p class="mb-1"><strong>3.</strong> {% trans 'Start the worker:' %}</p>
|
||||
<div class="position-relative">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary position-absolute copy-button" style="top: 6px; right: 6px;" data-target="#worker-vpn" title="{% trans 'Copy' %}"><i class="far fa-copy"></i></button>
|
||||
<pre id="worker-vpn" class="p-2 pr-5">docker compose -f cluster_node.yml up -d</pre>
|
||||
</div>
|
||||
|
||||
<p class="mb-1"><strong>{% trans 'VPN and App Gateway' %}</strong></p>
|
||||
<div class="position-relative">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary position-absolute copy-button" style="top: 6px; right: 6px;" data-target="#worker-gateway" title="{% trans 'Copy' %}"><i class="far fa-copy"></i></button>
|
||||
<pre id="worker-gateway" class="p-2 pr-5" style="white-space: pre-wrap;">docker compose -f cluster_node.yml -f cluster_node-gateway.yml up -d</pre>
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary position-absolute copy-button" style="top: 6px; right: 6px;" data-target="#worker-up" title="{% trans 'Copy' %}"><i class="far fa-copy"></i></button>
|
||||
<pre id="worker-up" class="p-2 pr-5">docker compose -f <span class="worker-compose-file">cluster_node.yml</span> up -d</pre>
|
||||
</div>
|
||||
|
||||
<ul class="text-muted mb-0">
|
||||
<li>{% trans 'To update, run docker compose pull followed by the same up -d command, always with every compose file of the worker.' %}</li>
|
||||
<li>{% trans 'To update, run docker compose pull followed by the same up -d command.' %}</li>
|
||||
<li>{% trans 'To switch between VPN only and VPN and App Gateway, download the other compose file to the same directory and start it with up -d --remove-orphans. The worker data is kept.' %}</li>
|
||||
<li>{% trans 'Applications published by workers must use DNS validation or self-signed certificates: certificates are issued by this primary server and distributed to the workers.' %}</li>
|
||||
<li>{% trans 'Publish the WireGuard ports (51820-51839/udp) and, with the App Gateway, ports 80 and 443 of the worker.' %}</li>
|
||||
</ul>
|
||||
@@ -166,6 +174,12 @@ TIMEZONE={{ time_zone }}</pre>
|
||||
{% block custom_page_scripts %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.worker-mode').click(function () {
|
||||
$('.worker-mode').removeClass('btn-primary').addClass('btn-outline-primary');
|
||||
$(this).removeClass('btn-outline-primary').addClass('btn-primary');
|
||||
$('.worker-compose-file').text($(this).data('compose-file'));
|
||||
});
|
||||
|
||||
$('.copy-button').click(function () {
|
||||
var button = $(this);
|
||||
navigator.clipboard.writeText($(button.data('target')).text()).then(function () {
|
||||
|
||||
@@ -1,14 +1,45 @@
|
||||
# App Gateway for cluster nodes. Use together with testing-cluster_node.yml:
|
||||
# docker compose -f testing-cluster_node.yml -f testing-cluster_node-gateway.yml up -d
|
||||
# Cluster node with WireGuard and the App Gateway (Caddy + auth-gateway).
|
||||
# For a VPN only node, use cluster_node.yml instead.
|
||||
services:
|
||||
cluster-node:
|
||||
container_name: cluster-node
|
||||
restart: unless-stopped
|
||||
image: eduardosilva/wireguard-webadmin-cluster-node:testing
|
||||
environment:
|
||||
- MASTER_SERVER_ADDRESS=${MASTER_SERVER_ADDRESS}
|
||||
- COMPOSE_VERSION=c2a
|
||||
- TZ=${TIMEZONE}
|
||||
- TOKEN=${TOKEN}
|
||||
volumes:
|
||||
- cluster_node_wireguard:/etc/wireguard
|
||||
- cluster_node_dnsmasq_conf:/etc/dnsmasq/
|
||||
- cluster_node_caddy_json:/caddy_json_export/
|
||||
- cluster_node_caddy_certificates:/caddy_certificates/
|
||||
ports:
|
||||
# Ports for WireGuard instances.
|
||||
- "51820-51839:51820-51839/udp"
|
||||
# Caddy shares the network of cluster-node, so its ports are published here
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_MODULE
|
||||
sysctls:
|
||||
- net.ipv4.conf.all.src_valid_mark=1
|
||||
- net.ipv4.ip_forward=1
|
||||
|
||||
cluster-node-dns:
|
||||
container_name: cluster-node-dns
|
||||
restart: unless-stopped
|
||||
image: eduardosilva/wireguard_webadmin_dns:testing
|
||||
# Shares the network of cluster-node, so DNS is answered directly on the WireGuard interfaces
|
||||
network_mode: "service:cluster-node"
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
volumes:
|
||||
- cluster_node_dnsmasq_conf:/etc/dnsmasq/
|
||||
depends_on:
|
||||
- cluster-node
|
||||
|
||||
cluster-node-caddy:
|
||||
container_name: cluster-node-caddy
|
||||
@@ -41,6 +72,8 @@ services:
|
||||
- cluster_node_auth_gateway_data:/data
|
||||
|
||||
volumes:
|
||||
cluster_node_wireguard:
|
||||
cluster_node_dnsmasq_conf:
|
||||
cluster_node_caddy_json:
|
||||
cluster_node_caddy_certificates:
|
||||
cluster_node_caddy_data:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# Cluster node with WireGuard only. To also publish App Gateway applications, use cluster_node-gateway.yml instead.
|
||||
services:
|
||||
cluster-node:
|
||||
container_name: cluster-node
|
||||
|
||||
Reference in New Issue
Block a user