From 76d62e344dcd1e7ffba501f86d33ed5f892998f4 Mon Sep 17 00:00:00 2001 From: MartinSchuhmacher Date: Mon, 5 Aug 2024 18:05:31 +0200 Subject: [PATCH] adding TRAINING_URL env var for different state training locations --- apps/server/src/modules/server/api/dto/config.response.ts | 4 ++++ apps/server/src/modules/server/api/test/server.api.spec.ts | 1 + apps/server/src/modules/server/server.config.ts | 2 ++ config/default.schema.json | 5 +++++ config/development.json | 3 ++- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/server/src/modules/server/api/dto/config.response.ts b/apps/server/src/modules/server/api/dto/config.response.ts index 87fa2771d38..56f2e676c9e 100644 --- a/apps/server/src/modules/server/api/dto/config.response.ts +++ b/apps/server/src/modules/server/api/dto/config.response.ts @@ -203,6 +203,9 @@ export class ConfigResponse { @ApiProperty() SC_TITLE: string; + @ApiProperty() + TRAINING_URL: string; + @ApiProperty() FEATURE_MEDIA_SHELF_ENABLED: boolean; @@ -260,6 +263,7 @@ export class ConfigResponse { this.DOCUMENT_BASE_DIR = config.DOCUMENT_BASE_DIR; this.SC_THEME = config.SC_THEME; this.SC_TITLE = config.SC_TITLE; + this.TRAINING_URL = config.TRAINING_URL; this.FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED = config.FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED; this.MIGRATION_END_GRACE_PERIOD_MS = config.MIGRATION_END_GRACE_PERIOD_MS; diff --git a/apps/server/src/modules/server/api/test/server.api.spec.ts b/apps/server/src/modules/server/api/test/server.api.spec.ts index a0a844e3f99..f73b2a4a753 100644 --- a/apps/server/src/modules/server/api/test/server.api.spec.ts +++ b/apps/server/src/modules/server/api/test/server.api.spec.ts @@ -88,6 +88,7 @@ describe('Server Controller (API)', () => { 'ROCKETCHAT_SERVICE_ENABLED', 'SC_THEME', 'SC_TITLE', + 'TRAINING_URL', 'TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE', 'TEACHER_STUDENT_VISIBILITY__IS_ENABLED_BY_DEFAULT', 'TEACHER_STUDENT_VISIBILITY__IS_VISIBLE', diff --git a/apps/server/src/modules/server/server.config.ts b/apps/server/src/modules/server/server.config.ts index d4d813e3836..c07980faedb 100644 --- a/apps/server/src/modules/server/server.config.ts +++ b/apps/server/src/modules/server/server.config.ts @@ -99,6 +99,7 @@ export interface ServerConfig DOCUMENT_BASE_DIR: string; SC_THEME: SchulcloudTheme; SC_TITLE: string; + TRAINING_URL: string; FEATURE_SHOW_OUTDATED_USERS: boolean; FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED: boolean; FEATURE_ENABLE_LDAP_SYNC_DURING_MIGRATION: boolean; @@ -172,6 +173,7 @@ const config: ServerConfig = { SC_THEME: Configuration.get('SC_THEME') as SchulcloudTheme, SC_TITLE: Configuration.get('SC_TITLE') as string, SC_DOMAIN: Configuration.get('SC_DOMAIN') as string, + TRAINING_URL: Configuration.get('TRAINING_URL') as string, INCOMING_REQUEST_TIMEOUT: Configuration.get('INCOMING_REQUEST_TIMEOUT_API') as number, INCOMING_REQUEST_TIMEOUT_COPY_API: Configuration.get('INCOMING_REQUEST_TIMEOUT_COPY_API') as number, NEST_LOG_LEVEL: Configuration.get('NEST_LOG_LEVEL') as string, diff --git a/config/default.schema.json b/config/default.schema.json index c3cd6b52b43..6f713e265f5 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -708,6 +708,11 @@ "type": "string", "description": "The Schulcloud domain." }, + "TRAINING_URL": { + "type": "string", + "default": "https://lernen.dbildungscloud.de", + "description": "URL for the platform training material" + }, "FEATURE_ADMIN_TOGGLE_STUDENT_LERNSTORE_VIEW_ENABLED": { "type": "boolean", "default": true, diff --git a/config/development.json b/config/development.json index 5cf48962fa7..d7ca49e6e14 100644 --- a/config/development.json +++ b/config/development.json @@ -89,5 +89,6 @@ "BOARD_COLLABORATION_URI": "ws://localhost:4450", "ADMIN_API": { "ALLOWED_API_KEYS": "thisisasupersecureapikeythatisabsolutelysave" - } + }, + "TRAINING_URL": "https://lernen.dbildungscloud.de" }