📝 — Server start is for testing or dev only (fix#35)

This commit is contained in:
Luc Didry 2024-04-11 15:37:45 +02:00
parent 69cf92c83b
commit 199cbd7927
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C
2 changed files with 11 additions and 3 deletions

View file

@ -90,7 +90,11 @@ def agent(server_url, auth, max_tasks, wait_time, log_level):
@click.option("--config", default="config.yaml", help="Path the the configuration file") @click.option("--config", default="config.yaml", help="Path the the configuration file")
@click.option("--reload", is_flag=True, help="Enable hot reloading") @click.option("--reload", is_flag=True, help="Enable hot reloading")
def start(host, port, config, reload): def start(host, port, config, reload):
"""Starts the server""" """Starts the server (use only for testing or development!)
See https://framasoft.frama.io/framaspace/argos/deployment/systemd.html#server
for advices on how to start the server for production.
"""
os.environ["ARGOS_YAML_FILE"] = config os.environ["ARGOS_YAML_FILE"] = config
uvicorn.run("argos.server:app", host=host, port=port, reload=reload) uvicorn.run("argos.server:app", host=host, port=port, reload=reload)

View file

@ -81,7 +81,7 @@ Commands:
generate-token Generate a token, which can be used as an agents... generate-token Generate a token, which can be used as an agents...
migrate Run database migrations migrate Run database migrations
reload-config Read tasks configuration and add/delete tasks in database... reload-config Read tasks configuration and add/delete tasks in database...
start Starts the server start Starts the server (use only for testing or development!)
``` ```
<!--[[[end]]] <!--[[[end]]]
@ -96,7 +96,11 @@ Commands:
```man ```man
Usage: argos server start [OPTIONS] Usage: argos server start [OPTIONS]
Starts the server Starts the server (use only for testing or development!)
See
https://framasoft.frama.io/framaspace/argos/deployment/systemd.html#server
for advices on how to start the server for production.
Options: Options:
--host TEXT Host to bind --host TEXT Host to bind