diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 3c2980ef80..089b69c474 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto { * @memberof SystemConfigServerDto */ 'externalDomain': string; + /** + * + * @type {string} + * @memberof SystemConfigServerDto + */ + 'loginPageMessage': string; } /** * diff --git a/docs/docs/install/environment-variables.md b/docs/docs/install/environment-variables.md index 2a09a98242..68b44835c8 100644 --- a/docs/docs/install/environment-variables.md +++ b/docs/docs/install/environment-variables.md @@ -30,15 +30,14 @@ These environment variables are used by the `docker-compose.yml` file and do **N ## General -| Variable | Description | Default | Services | -| :-------------------------- | :------------------------------------------- | :-----------------: | :------------------------------------------- | -| `TZ` | Timezone | | microservices | -| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web | -| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices | -| `IMMICH_MEDIA_LOCATION` | Media Location | `./upload` | server, microservices | -| `PUBLIC_LOGIN_PAGE_MESSAGE` | Public Login Page Message | | web | -| `IMMICH_CONFIG_FILE` | Path to config file | | server | -| `IMMICH_WEB_ROOT` | Path of root index.html | `/usr/src/app/www'` | server | +| Variable | Description | Default | Services | +| :---------------------- | :------------------------------------------- | :-----------------: | :------------------------------------------- | +| `TZ` | Timezone | | microservices | +| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web | +| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices | +| `IMMICH_MEDIA_LOCATION` | Media Location | `./upload` | server, microservices | +| `IMMICH_CONFIG_FILE` | Path to config file | | server | +| `IMMICH_WEB_ROOT` | Path of root index.html | `/usr/src/app/www'` | server | :::tip diff --git a/mobile/openapi/doc/SystemConfigServerDto.md b/mobile/openapi/doc/SystemConfigServerDto.md index f749fb587d..ead49eeb4f 100644 Binary files a/mobile/openapi/doc/SystemConfigServerDto.md and b/mobile/openapi/doc/SystemConfigServerDto.md differ diff --git a/mobile/openapi/lib/model/system_config_server_dto.dart b/mobile/openapi/lib/model/system_config_server_dto.dart index ffd0ac69c3..5b1e035b8c 100644 Binary files a/mobile/openapi/lib/model/system_config_server_dto.dart and b/mobile/openapi/lib/model/system_config_server_dto.dart differ diff --git a/mobile/openapi/test/system_config_server_dto_test.dart b/mobile/openapi/test/system_config_server_dto_test.dart index 4d5dcae2b6..5d10e0d7a2 100644 Binary files a/mobile/openapi/test/system_config_server_dto_test.dart and b/mobile/openapi/test/system_config_server_dto_test.dart differ diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index 4b2d620ea0..240a2d3810 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -9371,10 +9371,14 @@ "properties": { "externalDomain": { "type": "string" + }, + "loginPageMessage": { + "type": "string" } }, "required": [ - "externalDomain" + "externalDomain", + "loginPageMessage" ], "type": "object" }, diff --git a/server/src/domain/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts index b13e3c9fad..7c3f707843 100644 --- a/server/src/domain/server-info/server-info.service.ts +++ b/server/src/domain/server-info/server-info.service.ts @@ -78,14 +78,10 @@ export class ServerInfoService { async getConfig(): Promise { const config = await this.configCore.getConfig(); - - // TODO move to system config - const loginPageMessage = process.env.PUBLIC_LOGIN_PAGE_MESSAGE || ''; - const isInitialized = await this.userRepository.hasAdmin(); return { - loginPageMessage, + loginPageMessage: config.server.loginPageMessage, trashDays: config.trash.days, oauthButtonText: config.oauth.buttonText, isInitialized, diff --git a/server/src/domain/system-config/dto/system-config-server.dto.ts b/server/src/domain/system-config/dto/system-config-server.dto.ts index 0b5cb35508..83a2b0df9b 100644 --- a/server/src/domain/system-config/dto/system-config-server.dto.ts +++ b/server/src/domain/system-config/dto/system-config-server.dto.ts @@ -3,4 +3,7 @@ import { IsString } from 'class-validator'; export class SystemConfigServerDto { @IsString() externalDomain!: string; + + @IsString() + loginPageMessage!: string; } diff --git a/server/src/domain/system-config/system-config.core.ts b/server/src/domain/system-config/system-config.core.ts index 8aaab1c9ed..f4ed674cf6 100644 --- a/server/src/domain/system-config/system-config.core.ts +++ b/server/src/domain/system-config/system-config.core.ts @@ -129,6 +129,7 @@ export const defaults = Object.freeze({ }, server: { externalDomain: '', + loginPageMessage: '', }, }); diff --git a/server/src/domain/system-config/system-config.service.spec.ts b/server/src/domain/system-config/system-config.service.spec.ts index 1f71a0beb8..f489d29b93 100644 --- a/server/src/domain/system-config/system-config.service.spec.ts +++ b/server/src/domain/system-config/system-config.service.spec.ts @@ -102,6 +102,7 @@ const updatedConfig = Object.freeze({ }, server: { externalDomain: '', + loginPageMessage: '', }, storageTemplate: { enabled: false, diff --git a/server/src/infra/entities/system-config.entity.ts b/server/src/infra/entities/system-config.entity.ts index 9033ec387e..28faccfcb9 100644 --- a/server/src/infra/entities/system-config.entity.ts +++ b/server/src/infra/entities/system-config.entity.ts @@ -85,6 +85,7 @@ export enum SystemConfigKey { PASSWORD_LOGIN_ENABLED = 'passwordLogin.enabled', SERVER_EXTERNAL_DOMAIN = 'server.externalDomain', + SERVER_LOGIN_PAGE_MESSAGE = 'server.loginPageMessage', STORAGE_TEMPLATE_ENABLED = 'storageTemplate.enabled', STORAGE_TEMPLATE_HASH_VERIFICATION_ENABLED = 'storageTemplate.hashVerificationEnabled', @@ -248,5 +249,6 @@ export interface SystemConfig { }; server: { externalDomain: string; + loginPageMessage: string; }; } diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 3c2980ef80..089b69c474 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto { * @memberof SystemConfigServerDto */ 'externalDomain': string; + /** + * + * @type {string} + * @memberof SystemConfigServerDto + */ + 'loginPageMessage': string; } /** * diff --git a/web/src/lib/components/admin-page/settings/server/server-settings.svelte b/web/src/lib/components/admin-page/settings/server/server-settings.svelte index 16c1eabfc5..c951bb940c 100644 --- a/web/src/lib/components/admin-page/settings/server/server-settings.svelte +++ b/web/src/lib/components/admin-page/settings/server/server-settings.svelte @@ -92,6 +92,15 @@ bind:value={serverConfig.externalDomain} isEdited={serverConfig.externalDomain !== savedConfig.externalDomain} /> + + +
handleReset(detail)}