mirror of
https://github.com/immich-app/immich.git
synced 2025-01-16 16:56:46 +01:00
feat(server)!: move welcome message to settings (#6157)
* feat(server): move welcome message to settings * chore: open api
This commit is contained in:
parent
52e92e9bb4
commit
f8d64be13c
13 changed files with 42 additions and 15 deletions
6
cli/src/api/open-api/api.ts
generated
6
cli/src/api/open-api/api.ts
generated
|
@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto {
|
||||||
* @memberof SystemConfigServerDto
|
* @memberof SystemConfigServerDto
|
||||||
*/
|
*/
|
||||||
'externalDomain': string;
|
'externalDomain': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SystemConfigServerDto
|
||||||
|
*/
|
||||||
|
'loginPageMessage': string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -30,15 +30,14 @@ These environment variables are used by the `docker-compose.yml` file and do **N
|
||||||
|
|
||||||
## General
|
## General
|
||||||
|
|
||||||
| Variable | Description | Default | Services |
|
| Variable | Description | Default | Services |
|
||||||
| :-------------------------- | :------------------------------------------- | :-----------------: | :------------------------------------------- |
|
| :---------------------- | :------------------------------------------- | :-----------------: | :------------------------------------------- |
|
||||||
| `TZ` | Timezone | | microservices |
|
| `TZ` | Timezone | | microservices |
|
||||||
| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web |
|
| `NODE_ENV` | Environment (production, development) | `production` | server, microservices, machine learning, web |
|
||||||
| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices |
|
| `LOG_LEVEL` | Log Level (verbose, debug, log, warn, error) | `log` | server, microservices |
|
||||||
| `IMMICH_MEDIA_LOCATION` | Media Location | `./upload` | 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_CONFIG_FILE` | Path to config file | | server |
|
| `IMMICH_WEB_ROOT` | Path of root index.html | `/usr/src/app/www'` | server |
|
||||||
| `IMMICH_WEB_ROOT` | Path of root index.html | `/usr/src/app/www'` | server |
|
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
|
|
BIN
mobile/openapi/doc/SystemConfigServerDto.md
generated
BIN
mobile/openapi/doc/SystemConfigServerDto.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/system_config_server_dto.dart
generated
BIN
mobile/openapi/lib/model/system_config_server_dto.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/system_config_server_dto_test.dart
generated
BIN
mobile/openapi/test/system_config_server_dto_test.dart
generated
Binary file not shown.
|
@ -9371,10 +9371,14 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"externalDomain": {
|
"externalDomain": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"loginPageMessage": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"externalDomain"
|
"externalDomain",
|
||||||
|
"loginPageMessage"
|
||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
|
|
@ -78,14 +78,10 @@ export class ServerInfoService {
|
||||||
|
|
||||||
async getConfig(): Promise<ServerConfigDto> {
|
async getConfig(): Promise<ServerConfigDto> {
|
||||||
const config = await this.configCore.getConfig();
|
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();
|
const isInitialized = await this.userRepository.hasAdmin();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loginPageMessage,
|
loginPageMessage: config.server.loginPageMessage,
|
||||||
trashDays: config.trash.days,
|
trashDays: config.trash.days,
|
||||||
oauthButtonText: config.oauth.buttonText,
|
oauthButtonText: config.oauth.buttonText,
|
||||||
isInitialized,
|
isInitialized,
|
||||||
|
|
|
@ -3,4 +3,7 @@ import { IsString } from 'class-validator';
|
||||||
export class SystemConfigServerDto {
|
export class SystemConfigServerDto {
|
||||||
@IsString()
|
@IsString()
|
||||||
externalDomain!: string;
|
externalDomain!: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
loginPageMessage!: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,7 @@ export const defaults = Object.freeze<SystemConfig>({
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
externalDomain: '',
|
externalDomain: '',
|
||||||
|
loginPageMessage: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ const updatedConfig = Object.freeze<SystemConfig>({
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
externalDomain: '',
|
externalDomain: '',
|
||||||
|
loginPageMessage: '',
|
||||||
},
|
},
|
||||||
storageTemplate: {
|
storageTemplate: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
|
|
@ -85,6 +85,7 @@ export enum SystemConfigKey {
|
||||||
PASSWORD_LOGIN_ENABLED = 'passwordLogin.enabled',
|
PASSWORD_LOGIN_ENABLED = 'passwordLogin.enabled',
|
||||||
|
|
||||||
SERVER_EXTERNAL_DOMAIN = 'server.externalDomain',
|
SERVER_EXTERNAL_DOMAIN = 'server.externalDomain',
|
||||||
|
SERVER_LOGIN_PAGE_MESSAGE = 'server.loginPageMessage',
|
||||||
|
|
||||||
STORAGE_TEMPLATE_ENABLED = 'storageTemplate.enabled',
|
STORAGE_TEMPLATE_ENABLED = 'storageTemplate.enabled',
|
||||||
STORAGE_TEMPLATE_HASH_VERIFICATION_ENABLED = 'storageTemplate.hashVerificationEnabled',
|
STORAGE_TEMPLATE_HASH_VERIFICATION_ENABLED = 'storageTemplate.hashVerificationEnabled',
|
||||||
|
@ -248,5 +249,6 @@ export interface SystemConfig {
|
||||||
};
|
};
|
||||||
server: {
|
server: {
|
||||||
externalDomain: string;
|
externalDomain: string;
|
||||||
|
loginPageMessage: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
6
web/src/api/open-api/api.ts
generated
6
web/src/api/open-api/api.ts
generated
|
@ -4038,6 +4038,12 @@ export interface SystemConfigServerDto {
|
||||||
* @memberof SystemConfigServerDto
|
* @memberof SystemConfigServerDto
|
||||||
*/
|
*/
|
||||||
'externalDomain': string;
|
'externalDomain': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SystemConfigServerDto
|
||||||
|
*/
|
||||||
|
'loginPageMessage': string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -92,6 +92,15 @@
|
||||||
bind:value={serverConfig.externalDomain}
|
bind:value={serverConfig.externalDomain}
|
||||||
isEdited={serverConfig.externalDomain !== savedConfig.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">
|
<div class="ml-4">
|
||||||
<SettingButtonsRow
|
<SettingButtonsRow
|
||||||
on:reset={({ detail }) => handleReset(detail)}
|
on:reset={({ detail }) => handleReset(detail)}
|
||||||
|
|
Loading…
Reference in a new issue