feat: SPA sites

This commit is contained in:
2026-04-25 19:11:25 +02:00
committed by klemek
parent 46a23d2ed0
commit f4f00a290c
9 changed files with 133 additions and 12 deletions
+8
View File
@@ -20,6 +20,7 @@ class Registry:
TOKEN_FILE = ".token" # noqa: S105
REDIRECT_FILE = ".redirect"
PROXY_FILE = ".proxy"
SPA_FILE = ".spa"
def __init__(self, params: Parameters) -> None:
self.logger: logging.Logger = logging.getLogger(self.__class__.__name__)
@@ -45,6 +46,7 @@ class Registry:
token_hash=self.data_dir.get_file(path, self.TOKEN_FILE),
redirect=self.data_dir.get_file(path, self.REDIRECT_FILE),
proxy=self.data_dir.get_file(path, self.PROXY_FILE),
spa=self.data_dir.get_file(path, self.SPA_FILE),
)
self.logger.info("Updated %s", self.pages[path])
@@ -91,6 +93,12 @@ class Registry:
self.pages[path].proxy = proxy
self.logger.debug("Updated %s", self.pages[path])
def set_spa(self, path: str, spa: str) -> None:
if path in self.pages and (self.pages[path].spa != spa):
self.data_dir.set_file(path, self.SPA_FILE, spa)
self.pages[path].spa = spa
self.logger.debug("Updated %s", self.pages[path])
def remove(self, path: str) -> None:
if path in self.pages:
page = self.pages[path]