mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
5.0a85
This commit is contained in:
parent
c2d9f747fa
commit
933594b059
3 changed files with 8 additions and 5 deletions
|
@ -15,6 +15,8 @@ import logging
|
|||
help="Enable/disable the Discord bot.")
|
||||
@click.option("--webserver/--no-webserver", default=None,
|
||||
help="Enable/disable the Web server.")
|
||||
@click.option("--webserver-port", default=8001,
|
||||
help="The port on which the web server will listen on.")
|
||||
@click.option("-d", "--database", type=str, default=None,
|
||||
help="The PostgreSQL database path.")
|
||||
@click.option("-p", "--packs", type=str, multiple=True, default=[],
|
||||
|
@ -30,6 +32,7 @@ import logging
|
|||
def run(telegram: typing.Optional[bool],
|
||||
discord: typing.Optional[bool],
|
||||
webserver: typing.Optional[bool],
|
||||
webserver_port: typing.Optional[int],
|
||||
database: typing.Optional[str],
|
||||
packs: typing.Tuple[str],
|
||||
network_address: typing.Optional[str],
|
||||
|
@ -169,7 +172,7 @@ def run(telegram: typing.Optional[bool],
|
|||
tables=constellation_tables)
|
||||
webserver_process = multiprocessing.Process(name="Constellation Webserver",
|
||||
target=constellation.run_blocking,
|
||||
args=(verbose,),
|
||||
args=("0.0.0.0", webserver_port, verbose,),
|
||||
daemon=True)
|
||||
webserver_process.start()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
semantic = "5.0a84"
|
||||
semantic = "5.0a85"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(semantic)
|
||||
|
|
|
@ -79,7 +79,7 @@ class Constellation:
|
|||
def set_secret(self, username: str, password: str):
|
||||
return keyring.set_password(f"Royalnet/{self.secrets_name}", username, password)
|
||||
|
||||
def run_blocking(self, verbose):
|
||||
def run_blocking(self, address: str, port: int, verbose: bool):
|
||||
if verbose:
|
||||
core_logger = logging.root
|
||||
core_logger.setLevel(logging.DEBUG)
|
||||
|
@ -88,5 +88,5 @@ class Constellation:
|
|||
core_logger.addHandler(stream_handler)
|
||||
core_logger.debug("Logging setup complete.")
|
||||
self._init_sentry()
|
||||
log.info("Running constellation server...")
|
||||
uvicorn.run(self.starlette)
|
||||
log.info(f"Running constellation server on {address}:{port}...")
|
||||
uvicorn.run(self.starlette, host=address, port=port)
|
||||
|
|
Loading…
Reference in a new issue