mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Merge branch 'dev' of github.com:bunkerity/bunkerweb into dev
This commit is contained in:
commit
d4ef6fdffe
7 changed files with 40 additions and 47 deletions
15
.github/workflows/tests-ui-linux.yml
vendored
15
.github/workflows/tests-ui-linux.yml
vendored
|
|
@ -72,28 +72,21 @@ jobs:
|
|||
echo "127.0.0.1 www.example.com" | sudo tee -a /etc/hosts
|
||||
echo "127.0.0.1 app1.example.com" | sudo tee -a /etc/hosts
|
||||
# BunkerWeb
|
||||
echo "SERVER_NAME=www.example.com" | sudo tee /etc/bunkerweb/variables.env
|
||||
echo "SERVER_NAME=" | sudo tee /etc/bunkerweb/variables.env
|
||||
echo "HTTP_PORT=80" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "HTTPS_PORT=443" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo 'DNS_RESOLVERS=9.9.9.9 8.8.8.8 8.8.4.4' | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo 'API_LISTEN_IP=127.0.0.1' | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "MULTISITE=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "LOG_LEVEL=info" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "USE_BUNKERNET=no" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "USE_BLACKLIST=no" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "SEND_ANONYMOUS_REPORT=no" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "DISABLE_DEFAULT_SERVER=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "USE_CLIENT_CACHE=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "USE_GZIP=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "DATASTORE_MEMORY_SIZE=384m" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_USE_UI=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_SERVE_FILES=no" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_USE_REVERSE_PROXY=yes" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_REVERSE_PROXY_URL=/admin" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_REVERSE_PROXY_HOST=http://127.0.0.1:7000" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
echo "www.example.com_INTERCEPTED_ERROR_CODES=400 405 413 429 500 501 502 503 504" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
|
||||
echo "ADMIN_USERNAME=admin" | sudo tee /etc/bunkerweb/ui.env
|
||||
echo "ADMIN_PASSWORD=S\$cr3tP@ssw0rd" | sudo tee -a /etc/bunkerweb/ui.env
|
||||
echo "UI_HOST=http://127.0.0.1:7000" | sudo tee -a /etc/bunkerweb/variables.env
|
||||
sudo touch /etc/bunkerweb/ui.env
|
||||
|
||||
sudo chown nginx:nginx /etc/bunkerweb/variables.env /etc/bunkerweb/ui.env
|
||||
sudo chmod 777 /etc/bunkerweb/variables.env /etc/bunkerweb/ui.env
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
4
src/ui/templates/login.html
vendored
4
src/ui/templates/login.html
vendored
|
|
@ -71,11 +71,11 @@
|
|||
class="mx-4 lg:mx-0 col-span-2 lg:col-span-1 bg-none lg:bg-gray-50 h-full flex flex-col items-center justify-center"
|
||||
>
|
||||
<div
|
||||
class="bg-gray-50 rounded px-4 sm:px-12 py-16 w-full max-w-[400px]"
|
||||
class="bg-gray-50 rounded px-8 sm:px-12 py-16 w-full max-w-[400px]"
|
||||
>
|
||||
<div class="flex justify-center">
|
||||
<img
|
||||
class="lg:hidden max-w-60 max-h-30 mb-6"
|
||||
class="lg:hidden w-full max-w-60 max-h-30 mb-6"
|
||||
src="images/BUNKERWEB-print-hd.png"
|
||||
alt="logo"
|
||||
class="logo"
|
||||
|
|
|
|||
39
src/ui/templates/profile.html
vendored
39
src/ui/templates/profile.html
vendored
|
|
@ -1,10 +1,9 @@
|
|||
{% extends "base.html" %} {% block content %} {% set current_endpoint =
|
||||
url_for(request.endpoint)[1:].split("/")[-1].strip() %}
|
||||
|
||||
|
||||
<div
|
||||
data-service-content
|
||||
class="md:max-w-[600px] first-letter:w-full overflow-hidden overflow-y-auto overflow-x-auto col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border"
|
||||
class="md:max-w-[600px] first-letter:w-full overflow-hidden overflow-y-auto overflow-x-auto col-span-12 p-4 relative break-words bg-white shadow-xl dark:bg-slate-850 dark:shadow-dark-xl rounded-2xl bg-clip-border"
|
||||
>
|
||||
<h5 class="my-2 font-bold dark:text-white/90 mx-2">SETTINGS</h5>
|
||||
<!-- desktop tabs -->
|
||||
|
|
@ -134,13 +133,13 @@ url_for(request.endpoint)[1:].split("/")[-1].strip() %}
|
|||
method="POST"
|
||||
autocomplete="off"
|
||||
>
|
||||
<div class="col-span-12">
|
||||
<h5
|
||||
class="text-xl my-1 transition duration-300 ease-in-out text-md font-bold m-0"
|
||||
>
|
||||
PROFILE
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-span-12">
|
||||
<h5
|
||||
class="text-xl my-1 transition duration-300 ease-in-out text-md font-bold m-0"
|
||||
>
|
||||
PROFILE
|
||||
</h5>
|
||||
</div>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input
|
||||
type="hidden"
|
||||
|
|
@ -364,18 +363,18 @@ url_for(request.endpoint)[1:].split("/")[-1].strip() %}
|
|||
<form
|
||||
data-plugin-item="totp"
|
||||
class="hidden grid grid-cols-12 w-full justify-items-center"
|
||||
id="profile-form"
|
||||
id="totp-form"
|
||||
action="profile"
|
||||
method="POST"
|
||||
autocomplete="off"
|
||||
>
|
||||
<div class="col-span-12">
|
||||
<h5
|
||||
class="text-xl my-1 transition duration-300 ease-in-out text-md font-bold m-0"
|
||||
>
|
||||
TOTP
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-span-12">
|
||||
<h5
|
||||
class="text-xl my-1 transition duration-300 ease-in-out text-md font-bold m-0"
|
||||
>
|
||||
TOTP
|
||||
</h5>
|
||||
</div>
|
||||
<h5
|
||||
class="{% if not is_totp %} text-red-500 {% else %} text-green-500 {% endif %} uppercase col-span-12 text-sm my-2 font-bold dark:text-white/90 mx-2"
|
||||
>
|
||||
|
|
@ -551,9 +550,9 @@ url_for(request.endpoint)[1:].split("/")[-1].strip() %}
|
|||
<div class="col-span-12 flex justify-center mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
id="profile-button"
|
||||
name="profile-button"
|
||||
value="profile"
|
||||
id="totp-button"
|
||||
name="totp-button"
|
||||
value="totp"
|
||||
class="{% if not is_totp %}valid-btn{% else %}delete-btn{% endif %}"
|
||||
>
|
||||
{% if not is_totp %} enable totp {% else %} disable totp {% endif %}
|
||||
|
|
|
|||
12
src/ui/templates/totp.html
vendored
12
src/ui/templates/totp.html
vendored
|
|
@ -71,11 +71,11 @@
|
|||
class="mx-4 col-span-2 bg-none h-full flex flex-col items-center justify-center"
|
||||
>
|
||||
<div
|
||||
class="bg-gray-50 rounded px-4 sm:px-12 py-16 w-full max-w-[400px]"
|
||||
class="bg-gray-50 rounded px-8 sm:px-12 py-16 w-full max-w-[400px]"
|
||||
>
|
||||
<div class="flex justify-center">
|
||||
<img
|
||||
class="max-w-60 max-h-30 mb-6"
|
||||
class="w-full max-w-60 max-h-30 mb-6"
|
||||
src="images/BUNKERWEB-print-hd.png"
|
||||
alt="logo"
|
||||
class="logo"
|
||||
|
|
@ -128,14 +128,6 @@
|
|||
<!-- particles -->
|
||||
<div class="-z-10 fixed bg-primary">
|
||||
<div id="particles-js" class="login-img [&>*]:bg-primary"></div>
|
||||
<div class="hidden lg:flex justify-center">
|
||||
<img
|
||||
class="max-w-60 max-h-30"
|
||||
src="images/BUNKERWEB-print-hd-blanc.png"
|
||||
alt="logo"
|
||||
class="images login-logo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script src="js/tsparticles.bundle.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from contextlib import suppress
|
||||
from datetime import datetime, timedelta
|
||||
from functools import partial
|
||||
from os import getenv, listdir
|
||||
from os import getenv, listdir, sep
|
||||
from os.path import join
|
||||
from pathlib import Path
|
||||
from time import sleep
|
||||
|
|
@ -20,11 +20,20 @@ from selenium.webdriver.remote.webelement import WebElement
|
|||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.common.exceptions import ElementClickInterceptedException, TimeoutException, WebDriverException
|
||||
|
||||
default_server = "127.0.0.1"
|
||||
|
||||
integration_path = Path(sep, "usr", "share", "bunkerweb", "INTEGRATION")
|
||||
os_release_path = Path(sep, "etc", "os-release")
|
||||
if getenv("KUBERNETES_MODE", "no").lower() == "yes" or getenv("SWARM_MODE", "no").lower() == "yes" or getenv("AUTOCONF_MODE", "no").lower() == "yes":
|
||||
default_server = "192.168.0.2"
|
||||
elif os_release_path.is_file() and "Alpine" in os_release_path.read_text(encoding="utf-8"):
|
||||
default_server = "192.168.0.2"
|
||||
|
||||
ready = False
|
||||
retries = 0
|
||||
while not ready:
|
||||
with suppress(RequestException):
|
||||
status_code = get("http://127.0.0.1/setup").status_code
|
||||
status_code = get(f"http://{default_server}/setup").status_code
|
||||
|
||||
if status_code > 500 and status_code != 502:
|
||||
print("An error occurred with the server, exiting ...", flush=True)
|
||||
|
|
@ -179,9 +188,9 @@ with driver_func() as driver:
|
|||
driver.maximize_window()
|
||||
driver_wait = WebDriverWait(driver, 60)
|
||||
|
||||
print("Navigating to http://127.0.0.1/setup ...", flush=True)
|
||||
print(f"Navigating to http://{default_server}/setup ...", flush=True)
|
||||
|
||||
driver.get("http://127.0.0.1/setup")
|
||||
driver.get(f"http://{default_server}/setup")
|
||||
|
||||
### WIZARD PAGE
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue