diff --git a/lnbits/core/views/generic.py b/lnbits/core/views/generic.py index dcd7e8c8..3140f72a 100644 --- a/lnbits/core/views/generic.py +++ b/lnbits/core/views/generic.py @@ -389,6 +389,9 @@ async def manifest(usr: str): @core_html_routes.get("/admin", response_class=HTMLResponse) async def index(request: Request, user: User = Depends(check_admin)): + if not settings.lnbits_admin_ui: + raise HTTPException(status_code=HTTPStatus.NOT_FOUND) + WALLET = get_wallet_class() _, balance = await WALLET.status() diff --git a/lnbits/helpers.py b/lnbits/helpers.py index cfff7bba..77b72e25 100644 --- a/lnbits/helpers.py +++ b/lnbits/helpers.py @@ -107,6 +107,7 @@ def template_renderer(additional_folders: List = None) -> Jinja2Templates: t.env.globals["SITE_DESCRIPTION"] = settings.lnbits_site_description t.env.globals["LNBITS_THEME_OPTIONS"] = settings.lnbits_theme_options t.env.globals["LNBITS_VERSION"] = settings.lnbits_commit + t.env.globals["LNBITS_ADMIN_UI"] = settings.lnbits_admin_ui t.env.globals["EXTENSIONS"] = [ e for e in get_valid_extensions() diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html index 1d4e1063..7cba2256 100644 --- a/lnbits/templates/base.html +++ b/lnbits/templates/base.html @@ -185,7 +185,10 @@ :elevated="$q.screen.lt.md" > - + + {% endblock %} {% block page_container %}