From 9f299c854c9d2d2f1b1127c85a31b787f85fa210 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 19 Jan 2024 14:53:00 +0100 Subject: [PATCH] chore(settings)!: rename userdb app settings --- config/settings.yml | 10 +++++----- src/Settings.hs | 18 ++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/config/settings.yml b/config/settings.yml index 3a56e561d..dd2e31924 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -81,9 +81,6 @@ health-check-ldap-admins-timeout: "_env:HEALTHCHECK_LDAP_ADMINS_TIMEOUT:60" health-check-http-reachable-timeout: "_env:HEALTHCHECK_HTTP_REACHABLE_TIMEOUT:2" health-check-matching-cluster-config-timeout: "_env:HEALTHCHECK_MATCHING_CLUSTER_CONFIG_TIMEOUT:2" -synchronise-ldap-users-within: "_env:SYNCHRONISE_LDAP_WITHIN:1209600" # 14 Tage in Sekunden -synchronise-ldap-users-interval: "_env:SYNCHRONISE_LDAP_INTERVAL:3600" # jede Stunde - synchronise-avs-users-within: "_env:SYNCHRONISE_AVS_WITHIN:5702400" # alle 66 Tage synchronise-avs-users-interval: "_env:SYNCHRONISE_AVS_INTERVAL:21600" # alle 6 Stunden @@ -133,7 +130,7 @@ auto-db-migrate: '_env:AUTO_DB_MIGRATE:true' # External databases used for authentication and user data lookup # If the first user database in the list is unreachable, the application will perform a failover to the next list entry, etc. -user-databases: +user-database: - protocol: "oauth2" config: client-id: "_env:OAUTH2CLIENTID:" @@ -156,7 +153,10 @@ user-databases: timeout: "_env:LDAPTIMEOUT:20" limit: "_env:LDAPLIMIT:10" -ldap-re-test-failover: 60 +userdb-retest-failover: 60 +userdb-sync-within: "_env:USERDB_SYNC_WITHIN:1209600" # 14 Tage in Sekunden +userdb-sync-interval: "_env:USERDB_SYNC_INTERVAL:3600" # jede Stunde + lms-direct: upload-header: "_env:LMSUPLOADHEADER:true" diff --git a/src/Settings.hs b/src/Settings.hs index 8c89aa3ce..2d811865c 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -494,14 +494,13 @@ data AppSettings = AppSettings , appHealthCheckHTTPReachableTimeout :: NominalDiffTime , appHealthCheckMatchingClusterConfigTimeout :: NominalDiffTime - , appSynchroniseLdapUsersWithin :: Maybe NominalDiffTime - , appSynchroniseLdapUsersInterval :: NominalDiffTime + , appUserdbRetestFailover :: DiffTime + , appUserdbSyncWithin :: Maybe NominalDiffTime + , appUserdbSyncInterval :: NominalDiffTime - , appSynchroniseAvsUsersWithin :: Maybe NominalDiffTime + , appSynchroniseAvsUsersWithin :: Maybe NominalDiffTime , appSynchroniseAvsUsersInterval :: NominalDiffTime - , appLdapReTestFailover :: DiffTime - , appSessionFilesExpire :: NominalDiffTime , appKeepUnreferencedFiles :: NominalDiffTime @@ -604,7 +603,7 @@ instance FromJSON AppSettings where Ldap.Tls host _ -> not $ null host Ldap.Plain host -> not $ null host nonEmptyHost (UserDbOAuth2 OAuth2Conf{..}) = not $ or [ null oauth2TenantId, null oauth2ClientId, null oauth2ClientSecret ] - appUserDbConf <- P.fromList . mapMaybe (assertM nonEmptyHost) <$> o .:? "user-databases" .!= [] + appUserDbConf <- P.fromList . mapMaybe (assertM nonEmptyHost) <$> o .:? "user-database" .!= [] appLmsConf <- o .: "lms-direct" appAvsConf <- assertM (not . null . avsPass) <$> o .:? "avs" appLprConf <- o .: "lpr" @@ -669,14 +668,13 @@ instance FromJSON AppSettings where appSessionTimeout <- o .: "session-timeout" - appSynchroniseLdapUsersWithin <- o .:? "synchronise-ldap-users-within" - appSynchroniseLdapUsersInterval <- o .: "synchronise-ldap-users-interval" + appUserdbRetestFailover <- o .: "userdb-retest-failover" + appUserdbSyncWithin <- o .:? "userdb-sync-within" + appUserdbSyncInterval <- o .: "userdb-sync-interval" appSynchroniseAvsUsersWithin <- o .:? "synchronise-avs-users-within" appSynchroniseAvsUsersInterval <- o .: "synchronise-avs-users-interval" - appLdapReTestFailover <- o .: "ldap-re-test-failover" - appSessionFilesExpire <- o .: "session-files-expire" appKeepUnreferencedFiles <- o .:? "keep-unreferenced-files" .!= 0 appInjectFiles <- o .:? "inject-files"