From a8c93fd8d1a26ca63aaab306d189c536268117a2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 11 Feb 2021 19:37:45 +0100 Subject: [PATCH] enable web config --- config_webrx.py | 5 ----- htdocs/include/header.include.html | 2 +- owrx/controllers/admin.py | 5 ----- owrx/controllers/template.py | 7 +------ 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/config_webrx.py b/config_webrx.py index 7ee98ee..354f2d8 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -375,8 +375,3 @@ pskreporter_callsign = "N0CALL" # in addition to these settings also make sure that receiver_gps contains your correct location wsprnet_enabled = False wsprnet_callsign = "N0CALL" - -# === Web admin settings === -# this feature is experimental at the moment. it should not be enabled on shared receivers since it allows remote -# changes to the receiver settings. enable for testing in controlled environment only. -# webadmin_enabled = False diff --git a/htdocs/include/header.include.html b/htdocs/include/header.include.html index 56aac5c..44e53a2 100644 --- a/htdocs/include/header.include.html +++ b/htdocs/include/header.include.html @@ -11,7 +11,7 @@

Log

Receiver

Map
- ${settingslink} +
Settings
diff --git a/owrx/controllers/admin.py b/owrx/controllers/admin.py index dd87a5c..2ed0093 100644 --- a/owrx/controllers/admin.py +++ b/owrx/controllers/admin.py @@ -1,5 +1,4 @@ from .session import SessionStorage -from owrx.config import Config from owrx.users import UserList from urllib import parse @@ -34,10 +33,6 @@ class AuthorizationMixin(object): return self.user is not None and self.user.is_enabled() and not self.user.must_change_password def handle_request(self): - config = Config.get() - if "webadmin_enabled" not in config or not config["webadmin_enabled"]: - self.send_response("Web Admin is disabled", code=403) - return if self.isAuthorized(): super().handle_request() else: diff --git a/owrx/controllers/template.py b/owrx/controllers/template.py index 6e02782..6746012 100644 --- a/owrx/controllers/template.py +++ b/owrx/controllers/template.py @@ -1,7 +1,6 @@ from . import Controller import pkg_resources from string import Template -from owrx.config import Config class TemplateController(Controller): @@ -20,11 +19,7 @@ class TemplateController(Controller): class WebpageController(TemplateController): def template_variables(self): - settingslink = "" - pm = Config.get() - if "webadmin_enabled" in pm and pm["webadmin_enabled"]: - settingslink = """
Settings
""" - header = self.render_template("include/header.include.html", settingslink=settingslink) + header = self.render_template("include/header.include.html") return {"header": header}