mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Merge pull request #825 from bunkerity/ui
Merge branch "ui" into branch "dev"
This commit is contained in:
commit
a950f55e76
10 changed files with 69 additions and 1150 deletions
|
|
@ -2,4 +2,4 @@
|
|||
location ~ ^/.well-known/acme-challenge/ {
|
||||
root /var/tmp/bunkerweb/lets-encrypt;
|
||||
auth_basic off;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ logger = setup_logger("DEFAULT-SERVER-CERT", getenv("LOG_LEVEL", "INFO"))
|
|||
status = 0
|
||||
|
||||
try:
|
||||
|
||||
cert_path = Path(sep, "var", "cache", "bunkerweb", "default-server-cert")
|
||||
cert_path.mkdir(parents=True, exist_ok=True)
|
||||
if not cert_path.joinpath("cert.pem").is_file():
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -27,7 +27,11 @@ class Popover {
|
|||
const btn = el.closest("svg");
|
||||
//toggle curr popover
|
||||
const popover = btn.parentElement.querySelector(`[data-popover-content]`);
|
||||
popover.classList.add("transition-all", "delay-200", "opacity-0");
|
||||
popover.classList.remove("hidden");
|
||||
setTimeout(() => {
|
||||
popover.classList.remove("opacity-0");
|
||||
}, 10);
|
||||
}
|
||||
|
||||
hidePopover(el) {
|
||||
|
|
@ -35,6 +39,7 @@ class Popover {
|
|||
//toggle curr popover
|
||||
const popover = btn.parentElement.querySelector(`[data-popover-content]`);
|
||||
popover.classList.add("hidden");
|
||||
popover.classList.remove("transition-all", "delay-200");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
2
src/ui/templates/base.html
vendored
2
src/ui/templates/base.html
vendored
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
<!-- info -->
|
||||
<main
|
||||
class="absolute xl:pl-75 w-full px-2 sm:px-6 pb-0 pt-20 sm:pt-6 min-h-[80vh] h-full flex flex-col justify-between"
|
||||
class="xl:pl-75 w-full px-2 sm:px-6 pb-0 pt-20 sm:pt-6 min-h-[80vh] h-full flex flex-col justify-between"
|
||||
>
|
||||
<div
|
||||
class="max-w-[1920px] grid gap-y-4 gap-3 sm:gap-4 lg:gap-6 grid-cols-12 w-full"
|
||||
|
|
|
|||
2
src/ui/templates/settings_plugins.html
vendored
2
src/ui/templates/settings_plugins.html
vendored
|
|
@ -105,6 +105,7 @@ data-plugin-item="{{plugin['id']}}"
|
|||
data-default-value="{{global_config[setting]['value']}}"
|
||||
data-default-method="{{global_config[setting]['method']}}"
|
||||
aria-controls="{{value['id']}}-dropdown"
|
||||
type="button"
|
||||
class="custom-select-btn"
|
||||
>
|
||||
{% for item in value['select'] %} {% if global_config[setting]['value'] and
|
||||
|
|
@ -319,6 +320,7 @@ data-plugin-item="{{plugin['id']}}"
|
|||
data-setting-select="{{value['id']}}"
|
||||
data-default-value="{{value['default']}}"
|
||||
aria-controls="{{value['id']}}-dropdown"
|
||||
type="button"
|
||||
class="custom-select-btn"
|
||||
>
|
||||
{% for item in value['select'] %} {% if value['default'] == item %}
|
||||
|
|
|
|||
1165
src/ui/templates/setup.html
vendored
1165
src/ui/templates/setup.html
vendored
File diff suppressed because one or more lines are too long
|
|
@ -15,6 +15,7 @@ services:
|
|||
API_WHITELIST_IP: "127.0.0.0/8 10.20.30.0/24"
|
||||
USE_BUNKERNET: "no"
|
||||
USE_BLACKLIST: "no"
|
||||
SEND_ANONYMOUS_REPORT: "no"
|
||||
DISABLE_DEFAULT_SERVER: "yes"
|
||||
USE_CLIENT_CACHE: "yes"
|
||||
USE_GZIP: "yes"
|
||||
|
|
@ -22,9 +23,8 @@ services:
|
|||
www.example.com_USE_UI: "yes"
|
||||
www.example.com_SERVE_FILES: "no"
|
||||
www.example.com_USE_REVERSE_PROXY: "yes"
|
||||
www.example.com_REVERSE_PROXY_URL: "/admin/"
|
||||
www.example.com_REVERSE_PROXY_URL: "/admin"
|
||||
www.example.com_REVERSE_PROXY_HOST: "http://bw-ui:7000"
|
||||
www.example.com_REVERSE_PROXY_KEEPALIVE: "yes"
|
||||
www.example.com_INTERCEPTED_ERROR_CODES: "400 405 413 429 500 501 502 503 504"
|
||||
labels:
|
||||
- "bunkerweb.INSTANCE=yes"
|
||||
|
|
@ -78,17 +78,16 @@ services:
|
|||
networks:
|
||||
bw-services:
|
||||
ipv4_address: 192.168.0.4
|
||||
|
||||
ui-tests:
|
||||
build: .
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
extra_hosts:
|
||||
- "www.example.com:192.168.0.2"
|
||||
- "app1.example.com:192.168.0.2"
|
||||
networks:
|
||||
bw-services:
|
||||
ipv4_address: 192.168.0.3
|
||||
# ui-tests:
|
||||
# build: .
|
||||
# environment:
|
||||
# - PYTHONUNBUFFERED=1
|
||||
# extra_hosts:
|
||||
# - "www.example.com:192.168.0.2"
|
||||
# - "app1.example.com:192.168.0.2"
|
||||
# networks:
|
||||
# bw-services:
|
||||
# ipv4_address: 192.168.0.3
|
||||
|
||||
volumes:
|
||||
bw-data:
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ services:
|
|||
LOG_LEVEL: "info"
|
||||
USE_BUNKERNET: "no"
|
||||
USE_BLACKLIST: "no"
|
||||
SEND_ANONYMOUS_REPORT: "no"
|
||||
DISABLE_DEFAULT_SERVER: "yes"
|
||||
USE_CLIENT_CACHE: "yes"
|
||||
USE_GZIP: "yes"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ ready = False
|
|||
retries = 0
|
||||
while not ready:
|
||||
with suppress(RequestException):
|
||||
status_code = get("http://www.example.com/admin").status_code
|
||||
status_code = get("http://www.example.com/admin/login").status_code
|
||||
|
||||
if status_code > 500 and status_code != 502:
|
||||
print("An error occurred with the server, exiting ...", flush=True)
|
||||
|
|
@ -116,7 +116,7 @@ def assert_alert_message(driver, message: str):
|
|||
|
||||
print(f'Message "{message}" found in one of the messages in the list', flush=True)
|
||||
|
||||
assert_button_click(driver, "//aside[@data-flash-sidebar='']/*[local-name() = 'svg']")
|
||||
assert_button_click(driver, "//button[@data-flash-sidebar-close='']/*[local-name() = 'svg']")
|
||||
|
||||
|
||||
def access_page(
|
||||
|
|
@ -178,9 +178,9 @@ with driver_func() as driver:
|
|||
driver.maximize_window()
|
||||
driver_wait = WebDriverWait(driver, 60)
|
||||
|
||||
print("Navigating to http://www.example.com/admin ...", flush=True)
|
||||
print("Navigating to http://www.example.com/admin/login ...", flush=True)
|
||||
|
||||
driver.get("http://www.example.com/admin")
|
||||
driver.get("http://www.example.com/admin/login")
|
||||
|
||||
### LOGIN PAGE
|
||||
|
||||
|
|
@ -1171,7 +1171,7 @@ location /hello {
|
|||
exit(1)
|
||||
|
||||
assert_button_click(driver, instances[0])
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "submit-settings"))
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "submit-data"))
|
||||
|
||||
sleep(3)
|
||||
|
||||
|
|
@ -1184,7 +1184,7 @@ location /hello {
|
|||
print("Logs found, trying auto refresh ...", flush=True)
|
||||
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "live-update"))
|
||||
assert_button_click(driver, "//button[@id='submit-settings' and contains(text(), 'Go Live')]")
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "submit-live"))
|
||||
|
||||
sleep(3)
|
||||
|
||||
|
|
@ -1202,7 +1202,7 @@ location /hello {
|
|||
print("Auto refresh is working, deactivating it ...", flush=True)
|
||||
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "live-update"))
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "submit-settings"))
|
||||
assert_button_click(driver, safe_get_element(driver, By.ID, "submit-data"))
|
||||
|
||||
sleep(3)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue