readd get_title_port_ssl

This commit is contained in:
2024-01-09 17:49:18 -05:00
parent 261d09aaef
commit c680c2d4e9
10 changed files with 53 additions and 40 deletions

View File

@ -84,6 +84,16 @@ class ServerConfig:
self.__config, "core", "title", "proxy_port", default=0
)
@property
def proxy_port_ssl(self) -> int:
"""
What port the proxy is listening for secure connections on. This will be sent
instead of 'port' if is_using_proxy is True and this value is non-zero
"""
return CoreConfig.get_config_field(
self.__config, "core", "title", "proxy_port_ssl", default=0
)
@property
def log_dir(self) -> str:
return CoreConfig.get_config_field(

View File

@ -40,9 +40,17 @@ class Utils:
def get_title_port(cls, cfg: CoreConfig):
if cls.real_title_port is not None: return cls.real_title_port
cls.real_title_port = cfg.server.proxy_port if cfg.server.is_using_proxy else cfg.server.port
cls.real_title_port = cfg.server.proxy_port if cfg.server.is_using_proxy and cfg.server.proxy_port else cfg.server.port
return cls.real_title_port
@classmethod
def get_title_port_ssl(cls, cfg: CoreConfig):
if cls.real_title_port_ssl is not None: return cls.real_title_port_ssl
cls.real_title_port_ssl = cfg.server.proxy_port_ssl if cfg.server.is_using_proxy and cfg.server.proxy_port_ssl else Utils.get_title_port(cfg)
return cls.real_title_port_ssl
def create_sega_auth_key(aime_id: int, game: str, place_id: int, keychip_id: str, b64_secret: str, exp_seconds: int = 86400, err_logger: str = 'aimedb') -> Optional[str]:
logger = logging.getLogger(err_logger)