mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-17 13:06:18 +00:00
update worker versioning and settings for cluster compatibility
This commit is contained in:
@@ -33,7 +33,6 @@ def get_cluster_settings():
|
|||||||
|
|
||||||
|
|
||||||
def get_worker(request):
|
def get_worker(request):
|
||||||
min_worker_version = 1
|
|
||||||
success = True
|
success = True
|
||||||
ip_address = get_ip_address(request)
|
ip_address = get_ip_address(request)
|
||||||
token = request.GET.get('token', '')
|
token = request.GET.get('token', '')
|
||||||
@@ -56,7 +55,7 @@ def get_worker(request):
|
|||||||
worker.error_status = ''
|
worker.error_status = ''
|
||||||
worker.save()
|
worker.save()
|
||||||
|
|
||||||
if worker_version < min_worker_version:
|
if worker_version < settings.CLUSTER_WORKER_MINIMUM_VERSION:
|
||||||
worker.error_status = 'update_required'
|
worker.error_status = 'update_required'
|
||||||
worker.save()
|
worker.save()
|
||||||
return worker, False
|
return worker, False
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from django.conf import settings
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.shortcuts import get_object_or_404, redirect, render
|
from django.shortcuts import get_object_or_404, redirect, render
|
||||||
@@ -21,7 +22,7 @@ def cluster_main(request):
|
|||||||
context = {
|
context = {
|
||||||
'page_title': page_title,
|
'page_title': page_title,
|
||||||
'workers': workers,
|
'workers': workers,
|
||||||
'current_worker_version': 10,
|
'current_worker_version': settings.CLUSTER_WORKER_CURRENT_VERSION,
|
||||||
'cluster_settings': cluster_settings
|
'cluster_settings': cluster_settings
|
||||||
}
|
}
|
||||||
return render(request, 'cluster/workers_list.html', context)
|
return render(request, 'cluster/workers_list.html', context)
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ MASTER_SERVER_ADDRESS = os.environ.get('MASTER_SERVER_ADDRESS')
|
|||||||
TOKEN = os.environ.get('TOKEN')
|
TOKEN = os.environ.get('TOKEN')
|
||||||
WIREGUARD_DIR = '/etc/wireguard'
|
WIREGUARD_DIR = '/etc/wireguard'
|
||||||
DNS_DIR = '/etc/dnsmasq'
|
DNS_DIR = '/etc/dnsmasq'
|
||||||
WORKER_VERSION = 10
|
WORKER_VERSION = 11
|
||||||
REQUEST_TIMEOUT = 10
|
REQUEST_TIMEOUT = 20
|
||||||
|
|
||||||
class ClusterWorker:
|
class ClusterWorker:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -170,4 +170,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|||||||
|
|
||||||
WIREGUARD_WEBADMIN_VERSION = 9970
|
WIREGUARD_WEBADMIN_VERSION = 9970
|
||||||
|
|
||||||
|
CLUSTER_WORKER_CURRENT_VERSION = 11
|
||||||
|
CLUSTER_WORKER_MINIMUM_VERSION = 11
|
||||||
|
|
||||||
from wireguard_webadmin.production_settings import *
|
from wireguard_webadmin.production_settings import *
|
||||||
|
|||||||
Reference in New Issue
Block a user