From 79a0c629b7d7d187ac04ad4069adfe8aa927cac3 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 3 Jul 2022 12:27:56 +0200 Subject: refactor: Clarify which environment variables the app consumes --- README.md | 16 +++------------- server/src/Data/Static/AppEnvironmentVariables.cs | 12 ++++++++++++ server/src/Program.cs | 1 + 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f84c4c6..8ed5fea 100644 --- a/README.md +++ b/README.md @@ -12,19 +12,9 @@ To run it you need .NET 6 and a PostgreSQL instance. ### Environment -The server is configured through environments variables, -in development [user-secret](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets) is a nifty tool. - -All environment variables the server needs to function properly is specified -in [src/server/Data/Static/AppEnvironmentVariables.cs](./server/src/Data/Static/AppEnvironmentVariables.cs),w -at a bare minimum these variables needs to be set: - -``` -DB_HOST= -DB_USER= -DB_PASSWORD= -DB_NAME= -``` +The server is configured through environments variables, in development [user-secret](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets) is a nifty tool. + +All environment variables the server needs to function properly is specified in [src/server/Data/Static/AppEnvironmentVariables.cs](./server/src/Data/Static/AppEnvironmentVariables.cs). ### Building and Developing diff --git a/server/src/Data/Static/AppEnvironmentVariables.cs b/server/src/Data/Static/AppEnvironmentVariables.cs index 4555bfb..2a2d591 100644 --- a/server/src/Data/Static/AppEnvironmentVariables.cs +++ b/server/src/Data/Static/AppEnvironmentVariables.cs @@ -2,8 +2,20 @@ namespace IOL.GreatOffice.Api.Data.Static; public static class AppEnvironmentVariables { + /// + /// An access token that can be used to access the Hashicorp Vault instance that is available at VAULT_URL + /// public const string VAULT_TOKEN = "VAULT_TOKEN"; + /// + /// An url pointing to the Hashicorp Vault instance the app should use + /// public const string VAULT_URL = "VAULT_URL"; + /// + /// The vault key name for the main configuration json object, described by + /// public const string MAIN_CONFIG_SHEET = "MAIN_CONFIG_SHEET"; + /// + /// The duration of which to keep a local cached version of the configuration + /// public const string VAULT_CACHE_TTL = "CONFIG_CACHE_TTL"; } diff --git a/server/src/Program.cs b/server/src/Program.cs index d7bbf9f..0d6b3d3 100644 --- a/server/src/Program.cs +++ b/server/src/Program.cs @@ -103,6 +103,7 @@ public static class Program options.UseMicrosoftDependencyInjectionJobFactory(); options.RegisterJobs(); }); + builder.Services.AddQuartzHostedService(options => { options.WaitForJobsToComplete = true; }); -- cgit v1.3