From bf24f87fd74d8f062beb5d78ff6bfab22f68f052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Wed, 18 Oct 2023 02:37:00 +0200 Subject: [PATCH] Add more information on database configuration, and allow using a .env file --- README.md | 11 +++++++++-- argos/server/settings.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ca56bf..6e062df 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,20 @@ source venv/bin/activate pip install -e . ``` -Once all the dependencies are in place, here is how to run the server: +Then, you can run the server: ```bash argos server ``` -The server will read a `config.yaml` file at startup, and will populate the tasks specified in it. See the configuration section below for more information on how to configure the checks you want to run. +You can specify the environment variables to configure the server, or you can put them in an `.env` file: + +```bash +ARGOS_DATABASE_URL=postgresql://localhost/argos +ARGOS_YAML_FILE=config.yaml +``` + +The server will read a `yaml` file at startup, and will populate the tasks specified in it. See the configuration section below for more information on how to configure the checks you want to run. And here is how to run the agent: diff --git a/argos/server/settings.py b/argos/server/settings.py index 9af019b..a4a95a1 100644 --- a/argos/server/settings.py +++ b/argos/server/settings.py @@ -10,7 +10,7 @@ from argos.schemas.config import Config class Settings(BaseSettings): - model_config = SettingsConfigDict(env_prefix="argos_") + model_config = SettingsConfigDict(env_prefix="argos_", env_file=".env") app_env: str database_url: str yaml_file: str