1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02:00

feat(server)!: move welcome message to settings (#6157)

* feat(server): move welcome message to settings

* chore: open api
This commit is contained in:
Jason Rasmussen 2024-01-04 00:00:17 -05:00 committed by GitHub
parent 52e92e9bb4
commit f8d64be13c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 15 deletions

View File

@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto {
* @memberof SystemConfigServerDto
*/
'externalDomain': string;
/**
*
* @type {string}
* @memberof SystemConfigServerDto
*/
'loginPageMessage': string;
}
/**
*

View File

@ -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

Binary file not shown.

View File

@ -9371,10 +9371,14 @@
"properties": {
"externalDomain": {
"type": "string"
},
"loginPageMessage": {
"type": "string"
}
},
"required": [
"externalDomain"
"externalDomain",
"loginPageMessage"
],
"type": "object"
},

View File

@ -78,14 +78,10 @@ export class ServerInfoService {
async getConfig(): Promise<ServerConfigDto> {
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,

View File

@ -3,4 +3,7 @@ import { IsString } from 'class-validator';
export class SystemConfigServerDto {
@IsString()
externalDomain!: string;
@IsString()
loginPageMessage!: string;
}

View File

@ -129,6 +129,7 @@ export const defaults = Object.freeze<SystemConfig>({
},
server: {
externalDomain: '',
loginPageMessage: '',
},
});

View File

@ -102,6 +102,7 @@ const updatedConfig = Object.freeze<SystemConfig>({
},
server: {
externalDomain: '',
loginPageMessage: '',
},
storageTemplate: {
enabled: false,

View File

@ -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;
};
}

View File

@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto {
* @memberof SystemConfigServerDto
*/
'externalDomain': string;
/**
*
* @type {string}
* @memberof SystemConfigServerDto
*/
'loginPageMessage': string;
}
/**
*

View File

@ -92,6 +92,15 @@
bind:value={serverConfig.externalDomain}
isEdited={serverConfig.externalDomain !== savedConfig.externalDomain}
/>
<SettingInputField
inputType={SettingInputFieldType.TEXT}
label="WELCOME MESSAGE"
desc="A message that is displayed on the login page."
bind:value={serverConfig.loginPageMessage}
isEdited={serverConfig.loginPageMessage !== savedConfig.loginPageMessage}
/>
<div class="ml-4">
<SettingButtonsRow
on:reset={({ detail }) => handleReset(detail)}