1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-04 09:31:12 +03:00

Add --force-localserver-for-auth CL arg to EDMarketConnector

This commit is contained in:
Athanasius 2021-01-23 13:38:08 +00:00
parent 409e851840
commit 5093fb58ee
2 changed files with 16 additions and 0 deletions

View File

@ -68,6 +68,11 @@ if __name__ == '__main__': # noqa: C901
action='store_true'
)
parser.add_argument('--force-localserver-for-auth',
help='Force EDMC to use a localhost webserver for Frontier Auth callback',
action='store_true'
)
args = parser.parse_args()
if args.trace:
@ -76,6 +81,9 @@ if __name__ == '__main__': # noqa: C901
else:
edmclogger.set_channels_loglevel(logging.DEBUG)
if args.force_localserver_for_auth:
config.set_auth_force_localserver()
def no_other_instance_running() -> bool: # noqa: CCR001
"""
Ensure only one copy of the app is running for the configured journal directory.

View File

@ -117,6 +117,7 @@ class AbstractConfig(abc.ABC):
identifier: str
__in_shutdown = False # Is the application currently shutting down ?
__auth_force_localserver = False # Should we use localhost for auth callback ?
def __init__(self) -> None:
self.home_path = pathlib.Path.home()
@ -128,6 +129,13 @@ class AbstractConfig(abc.ABC):
def shutting_down(self) -> bool:
return self.__in_shutdown
def set_auth_force_localserver(self):
self.__auth_force_localserver = True
@property
def auth_force_localserver(self) -> bool:
return self.__auth_force_localserver
@property
def app_dir(self) -> str:
"""Return a string version of app_dir."""