diff --git a/src/common/core/ui/confs/default-server-http/ui.conf b/src/common/core/ui/confs/default-server-http/ui.conf index 99336022d..3e3b76c5e 100644 --- a/src/common/core/ui/confs/default-server-http/ui.conf +++ b/src/common/core/ui/confs/default-server-http/ui.conf @@ -38,7 +38,27 @@ location /setup/check { add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; default_type 'text/plain'; content_by_lua_block { - ngx.say("ok") + local logger = require "bunkerweb.logger":new("UI") + local args, err = ngx.req.get_uri_args(1) + if err == "truncated" or not args["server_name"] or args["server_name"] == "" then + logger:log(ngx.NOTICE, "Received standard server name check") + ngx.print("ok") + else + logger:log(ngx.NOTICE, "Received remote server name check for " .. args["server_name"]) + local http = require "resty.http".new() + local res, err = http:request_uri("https://" .. args["server_name"] .. "/setup/check", {ssl_verify = false}) + if not res then + ngx.print("ko") + logger:log(ngx.ERR, "Server name check failed : " .. err) + return + end + if res.status == 200 and res.body == "ok" then + ngx.print("ok") + return + end + logger:log(ngx.ERR, "Server name check failed : status = " .. tostring(res.status) .. " and body != ok") + ngx.print("ko") + end } } diff --git a/src/ui/main.py b/src/ui/main.py index a6079bce1..de02a31fa 100755 --- a/src/ui/main.py +++ b/src/ui/main.py @@ -645,6 +645,9 @@ def setup(): random_url=f"/{''.join(choice(ascii_letters + digits) for _ in range(10))}", ) +@app.route("/setup/loading", methods=["GET"]) +def setup_loading(): + return render_template("setup_loading.html") @app.route("/totp", methods=["GET", "POST"]) @login_required diff --git a/src/ui/templates/setup.html b/src/ui/templates/setup.html index 61a037808..77b01ecd6 100644 --- a/src/ui/templates/setup.html +++ b/src/ui/templates/setup.html @@ -246,6 +246,7 @@
In case of issues, you can also click here to perform a manual check.
LOADING
+