From 6fa0175baafc98fc8c4d92b2d0c8cbd9373999f9 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sun, 12 Mar 2023 01:59:12 -0500 Subject: [PATCH] print cleanup, remove unused mucha options --- core/allnet.py | 2 +- core/config.py | 18 ------------------ core/mucha.py | 4 ++-- core/title.py | 2 +- example_config/core.yaml | 3 --- titles/cxb/index.py | 4 ++-- 6 files changed, 6 insertions(+), 27 deletions(-) diff --git a/core/allnet.py b/core/allnet.py index 36ea633..2738c8e 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -65,7 +65,7 @@ class AllnetServlet: self.uri_registry[code] = (uri, host) self.logger.info( - f"Allnet serving {len(self.uri_registry)} games on port {core_cfg.allnet.port}" + f"Serving {len(self.uri_registry)} game codes port {core_cfg.allnet.port}" ) def handle_poweron(self, request: Request, _: Dict): diff --git a/core/config.py b/core/config.py index 383f053..9e152c0 100644 --- a/core/config.py +++ b/core/config.py @@ -267,24 +267,6 @@ class MuchaConfig: self.__config, "core", "mucha", "hostname", default="localhost" ) - @property - def port(self) -> int: - return CoreConfig.get_config_field( - self.__config, "core", "mucha", "port", default=8444 - ) - - @property - def ssl_cert(self) -> str: - return CoreConfig.get_config_field( - self.__config, "core", "mucha", "ssl_cert", default="cert/server.pem" - ) - - @property - def signing_key(self) -> str: - return CoreConfig.get_config_field( - self.__config, "core", "mucha", "signing_key", default="cert/billing.key" - ) - class CoreConfig(dict): def __init__(self) -> None: diff --git a/core/mucha.py b/core/mucha.py index 4d2388b..9dfef03 100644 --- a/core/mucha.py +++ b/core/mucha.py @@ -47,7 +47,7 @@ class MuchaServlet: self.mucha_registry.append(game_cd) self.logger.info( - f"Serving {len(self.mucha_registry)} games on port {self.config.mucha.port}" + f"Serving {len(self.mucha_registry)} games" ) def handle_boardauth(self, request: Request, _: Dict) -> bytes: @@ -73,7 +73,7 @@ class MuchaServlet: # TODO: Decrypt S/N resp = MuchaAuthResponse( - f"{self.config.mucha.hostname}{':' + str(self.config.mucha.port) if self.config.server.is_develop else ''}" + f"{self.config.mucha.hostname}{':' + str(self.config.allnet.port) if self.config.server.is_develop else ''}" ) self.logger.debug(f"Mucha response {vars(resp)}") diff --git a/core/title.py b/core/title.py index c9580d2..7a0a99b 100644 --- a/core/title.py +++ b/core/title.py @@ -68,7 +68,7 @@ class TitleServlet: self.logger.error(f"{folder} missing game_code or index in __init__.py") self.logger.info( - f"Serving {len(self.title_registry)} game codes on port {core_cfg.title.port}" + f"Serving {len(self.title_registry)} game codes {'on port ' + str(core_cfg.title.port) if core_cfg.title.port > 0 else ''}" ) def render_GET(self, request: Request, endpoints: dict) -> bytes: diff --git a/example_config/core.yaml b/example_config/core.yaml index 94e89ba..561293c 100644 --- a/example_config/core.yaml +++ b/example_config/core.yaml @@ -48,6 +48,3 @@ mucha: enable: False hostname: "localhost" loglevel: "info" - port: 8444 - ssl_key: "cert/server.key" - ssl_cert: "cert/server.pem" diff --git a/titles/cxb/index.py b/titles/cxb/index.py index d6ab74b..36c762e 100644 --- a/titles/cxb/index.py +++ b/titles/cxb/index.py @@ -98,11 +98,11 @@ class CxbServlet(resource.Resource): ).listen(server.Site(CxbServlet(self.core_cfg, self.cfg_dir))) self.logger.info( - f"Crossbeats title server ready on port {self.game_cfg.server.port} & {self.game_cfg.server.port_secure}" + f"Ready on ports {self.game_cfg.server.port} & {self.game_cfg.server.port_secure}" ) else: self.logger.info( - f"Crossbeats title server ready on port {self.game_cfg.server.port}" + f"Ready on port {self.game_cfg.server.port}" ) def render_POST(self, request: Request):