2022-04-04 19:37:31 +02:00
/* eslint-disable @typescript-eslint/no-inferrable-types */
2020-01-28 18:36:52 +01:00
import 'reflect-metadata' ;
2022-12-30 15:35:07 +01:00
import {
AfterJobTrigger ,
JobScheduleDTO ,
JobTrigger ,
JobTriggerType ,
NeverJobTrigger ,
PeriodicJobTrigger ,
ScheduledJobTrigger ,
} from '../../entities/job/JobScheduleDTO' ;
2022-12-28 19:12:18 +01:00
import {
ClientConfig ,
2022-12-28 22:12:53 +01:00
ClientGPXCompressingConfig ,
ClientMediaConfig ,
ClientMetaFileConfig ,
ClientPhotoConfig ,
ClientPhotoConvertingConfig ,
2022-12-28 19:12:18 +01:00
ClientServiceConfig ,
2022-12-28 22:12:53 +01:00
ClientSharingConfig ,
ClientThumbnailConfig ,
ClientUserConfig ,
ClientVideoConfig ,
ConfigPriority ,
TAGS
2022-12-28 19:12:18 +01:00
} from '../public/ClientConfig' ;
2022-06-24 22:59:08 +02:00
import { SubConfigClass } from 'typeconfig/src/decorators/class/SubConfigClass' ;
import { ConfigProperty } from 'typeconfig/src/decorators/property/ConfigPropoerty' ;
import { DefaultsJobs } from '../../entities/job/JobDTO' ;
2022-12-28 22:12:53 +01:00
import { SearchQueryDTO , SearchQueryTypes , TextSearch , } from '../../entities/SearchQueryDTO' ;
2022-06-24 22:59:08 +02:00
import { SortingMethods } from '../../entities/SortingMethods' ;
import { UserRoles } from '../../entities/UserDTO' ;
2020-01-28 18:36:52 +01:00
2023-01-01 23:29:13 +01:00
declare let $localize : ( s : TemplateStringsArray ) = > string ;
2022-12-28 19:12:18 +01:00
if ( typeof $localize === 'undefined' ) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
global . $localize = ( s ) = > s ;
}
2023-01-01 23:29:13 +01:00
2021-04-18 15:48:35 +02:00
export enum DatabaseType {
2022-04-04 19:37:31 +02:00
mysql = 2 ,
sqlite = 3 ,
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2021-04-18 15:48:35 +02:00
export enum LogLevel {
2022-04-04 19:37:31 +02:00
error = 1 ,
warn = 2 ,
info = 3 ,
verbose = 4 ,
debug = 5 ,
silly = 6 ,
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2021-04-18 15:48:35 +02:00
export enum SQLLogLevel {
2022-04-04 19:37:31 +02:00
none = 1 ,
error = 2 ,
all = 3 ,
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2021-04-18 15:48:35 +02:00
export enum ReIndexingSensitivity {
2022-04-04 19:37:31 +02:00
low = 1 ,
medium = 2 ,
high = 3 ,
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2021-04-18 15:48:35 +02:00
export enum FFmpegPresets {
2022-04-04 19:37:31 +02:00
ultrafast = 1 ,
superfast = 2 ,
veryfast = 3 ,
faster = 4 ,
fast = 5 ,
medium = 6 ,
slow = 7 ,
slower = 8 ,
veryslow = 9 ,
placebo = 10 ,
2021-04-18 15:48:35 +02:00
}
2020-02-08 09:59:18 +01:00
2021-04-18 15:48:35 +02:00
export type videoCodecType = 'libvpx-vp9' | 'libx264' | 'libvpx' | 'libx265' ;
2022-04-04 19:37:31 +02:00
export type videoResolutionType =
| 240
| 360
| 480
| 720
| 1080
| 1440
| 2160
| 4320 ;
2021-04-18 15:48:35 +02:00
export type videoFormatType = 'mp4' | 'webm' ;
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class MySQLConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
envAlias : 'MYSQL_HOST' ,
tags :
{
name : $localize ` Host ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
} )
2021-04-18 15:48:35 +02:00
host : string = 'localhost' ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
envAlias : 'MYSQL_PORT' , min : 0 , max : 65535 ,
tags :
{
name : $localize ` Port ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
} )
2021-04-18 15:48:35 +02:00
port : number = 3306 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
envAlias : 'MYSQL_DATABASE' ,
tags :
{
name : $localize ` Database ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
} )
2021-04-18 15:48:35 +02:00
database : string = 'pigallery2' ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
envAlias : 'MYSQL_USERNAME' ,
tags :
{
name : $localize ` Username ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
} )
2021-04-18 15:48:35 +02:00
username : string = '' ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
envAlias : 'MYSQL_PASSWORD' , type : 'password' ,
tags :
{
name : $localize ` Password ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
}
} )
2021-04-18 15:48:35 +02:00
password : string = '' ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class SQLiteConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Sqlite db filename ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Sqlite will save the db with this filename. ` ,
} )
2021-04-18 15:48:35 +02:00
DBFileName : string = 'sqlite.db' ;
}
2020-12-28 22:08:57 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-01-13 23:55:29 +01:00
export class UserConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Name ` ,
priority : ConfigPriority.underTheHood
}
} )
2022-01-13 23:55:29 +01:00
name : string ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : UserRoles ,
tags :
{
name : $localize ` Role ` ,
priority : ConfigPriority.underTheHood
} ,
} )
2022-12-28 22:12:53 +01:00
role : UserRoles = UserRoles . User ;
2022-01-13 23:55:29 +01:00
2023-01-06 18:22:49 +01:00
@ConfigProperty < string , ServerConfig , TAGS > ( {
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Password ` ,
2022-12-28 22:12:53 +01:00
priority : ConfigPriority.underTheHood ,
relevant : ( c : UserConfig ) = > ! c . encrypted
2022-12-28 19:12:18 +01:00
} ,
description : $localize ` Unencrypted, temporary password. App will encrypt it and delete this. `
} )
2022-12-28 22:12:53 +01:00
password : string ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Encrypted password ` ,
priority : ConfigPriority.underTheHood ,
secret : true
} ,
} )
2022-04-04 19:37:31 +02:00
encryptedPassword : string | undefined ;
2022-01-13 23:55:29 +01:00
2022-12-28 22:12:53 +01:00
@ConfigProperty ( {
tags :
{
priority : ConfigPriority.underTheHood ,
relevant : ( ) = > false // never render this on UI. Only used to indicate that encryption is done.
} as TAGS ,
} )
encrypted : boolean ;
constructor ( name? : string , password? : string , role? : UserRoles ) {
if ( name ) {
this . name = name ;
}
if ( typeof role !== 'undefined' ) {
this . role = role ;
}
if ( password ) {
this . password = password ;
}
2022-01-13 23:55:29 +01:00
}
}
2020-12-28 22:08:57 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerDataBaseConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty < DatabaseType , ServerConfig > ( {
2021-04-18 15:48:35 +02:00
type : DatabaseType ,
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Type ` ,
2023-01-05 23:11:58 +01:00
priority : ConfigPriority.advanced ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { db : true } ,
2023-01-05 23:11:58 +01:00
githubIssue : 573
} as TAGS ,
description : $localize ` SQLite is recommended. `
2021-04-18 15:48:35 +02:00
} )
type : DatabaseType = DatabaseType . sqlite ;
2020-01-28 18:36:52 +01:00
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Database folder ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
2023-01-07 11:34:50 +01:00
description : $localize ` All file-based data will be stored here (sqlite database, job history data). ` ,
2022-12-28 19:12:18 +01:00
} )
2021-04-18 15:48:35 +02:00
dbFolder : string = 'db' ;
2020-01-28 18:36:52 +01:00
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` SQLite ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { db : true } ,
2022-12-28 19:12:18 +01:00
relevant : ( c : any ) = > c . type === DatabaseType . sqlite ,
}
} )
2021-04-18 15:48:35 +02:00
sqlite? : SQLiteConfig = new SQLiteConfig ( ) ;
2020-12-28 22:08:57 +01:00
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` MySQL ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { db : true } ,
2022-12-28 19:12:18 +01:00
relevant : ( c : any ) = > c . type === DatabaseType . mysql ,
}
} )
2021-04-18 15:48:35 +02:00
mysql? : MySQLConfig = new MySQLConfig ( ) ;
2022-01-13 23:55:29 +01:00
2022-12-28 19:12:18 +01:00
}
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerUserConfig extends ClientUserConfig {
2022-01-14 11:12:53 +01:00
@ConfigProperty ( {
arrayType : UserConfig ,
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Enforced users ` ,
2022-12-28 22:12:53 +01:00
priority : ConfigPriority.underTheHood ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2023-01-06 18:22:49 +01:00
uiOptional : true ,
githubIssue : 575
2022-12-28 22:12:53 +01:00
} as TAGS ,
2023-01-06 19:01:24 +01:00
description : $localize ` Creates these users in the DB during startup if they do not exist. If a user with this name exist, it won't be overwritten, even if the role is different. ` ,
2022-01-14 11:12:53 +01:00
} )
2022-01-20 19:45:25 +01:00
enforcedUsers : UserConfig [ ] = [ ] ;
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2022-12-28 19:12:18 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerThumbnailConfig extends ClientThumbnailConfig {
@ConfigProperty ( {
tags :
{
name : $localize ` Enforced users ` ,
priority : ConfigPriority.underTheHood
} ,
2023-01-07 11:34:50 +01:00
description : $localize ` if true, 'lanczos3' will used to scale photos, otherwise faster but lower quality 'nearest'. `
2022-12-28 19:12:18 +01:00
} )
2022-11-21 22:28:13 +01:00
useLanczos3 : boolean = true ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
max : 100 , min : 1 , type : 'unsignedInt' ,
tags :
{
name : $localize ` Converted photo and thumbnail quality ` ,
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Between 0-100. `
} )
2022-11-21 22:28:13 +01:00
quality = 80 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'ratio' ,
tags :
{
name : $localize ` Person face margin ` ,
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Person face size ratio on the face thumbnail. `
} )
2021-04-18 15:48:35 +02:00
personFaceMargin : number = 0.6 ; // in ration [0-1]
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerGPXCompressingConfig extends ClientGPXCompressingConfig {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` OnTheFly *.gpx compression ` ,
priority : ConfigPriority.advanced ,
uiDisabled : ( sc : ServerGPXCompressingConfig , c : ServerConfig ) = > ! c . Map . enabled || ! sc . enabled || ! c . MetaFile . gpx
} ,
description : $localize ` Enables on the fly *.gpx compression. ` ,
2022-06-24 22:59:08 +02:00
} )
onTheFly : boolean = true ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Min distance ` ,
priority : ConfigPriority.underTheHood ,
2022-12-30 23:44:53 +01:00
unit : 'm' ,
2022-12-28 19:12:18 +01:00
uiDisabled : ( sc : ServerGPXCompressingConfig , c : ServerConfig ) = > ! c . Map . enabled || ! sc . enabled || ! c . MetaFile . gpx
2022-12-30 23:44:53 +01:00
} as TAGS ,
2022-12-28 19:12:18 +01:00
description : $localize ` Filters out entry that are closer than this in meters. `
} )
2022-06-24 22:59:08 +02:00
minDistance : number = 5 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Min time delta ` ,
priority : ConfigPriority.underTheHood ,
2022-12-30 15:35:07 +01:00
unit : 'ms' ,
2022-12-28 19:12:18 +01:00
uiDisabled : ( sc : ServerGPXCompressingConfig , c : ServerConfig ) = > ! c . Map . enabled || ! sc . enabled || ! c . MetaFile . gpx
2022-12-30 15:35:07 +01:00
} as TAGS ,
2022-12-28 19:12:18 +01:00
description : $localize ` Filters out entry that are closer than this in time in milliseconds. `
} )
2022-06-24 22:59:08 +02:00
minTimeDistance : number = 5000 ;
}
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerMetaFileConfig extends ClientMetaFileConfig {
@ConfigProperty ( {
tags :
{
name : $localize ` GPX compression ` ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.advanced ,
uiJob : [ {
job : DefaultsJobs [ DefaultsJobs [ 'GPX Compression' ] ] ,
relevant : ( c ) = > c . MetaFile . GPXCompressing . enabled
} ]
} as TAGS
2022-12-28 19:12:18 +01:00
} )
2022-06-24 22:59:08 +02:00
GPXCompressing : ServerGPXCompressingConfig = new ServerGPXCompressingConfig ( ) ;
}
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerSharingConfig extends ClientSharingConfig {
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Update timeout ` ,
priority : ConfigPriority.underTheHood ,
unit : 'ms'
} as TAGS ,
description : $localize ` After creating a sharing link, it can be updated for this long. `
} )
2021-04-18 15:48:35 +02:00
updateTimeout : number = 1000 * 60 * 5 ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerIndexingConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Index cache timeout ` ,
priority : ConfigPriority.underTheHood ,
unit : 'ms'
} as TAGS ,
description : $localize ` If there was no indexing in this time, it reindexes. (skipped if indexes are in DB and sensitivity is low). `
} )
2021-04-18 15:48:35 +02:00
cachedFolderTimeout : number = 1000 * 60 * 60 ; // Do not rescans the folder if seems ok
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : ReIndexingSensitivity ,
tags :
{
name : $localize ` Folder reindexing sensitivity ` ,
priority : ConfigPriority.advanced
} ,
description : $localize ` Set the reindexing sensitivity. High value check the folders for change more often. `
} )
2021-04-18 15:48:35 +02:00
reIndexingSensitivity : ReIndexingSensitivity = ReIndexingSensitivity . low ;
@ConfigProperty ( {
arrayType : 'string' ,
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Exclude Folder List ` ,
priority : ConfigPriority.advanced ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true , db : true } ,
2022-12-28 19:12:18 +01:00
uiOptional : true ,
uiAllowSpaces : true
} as TAGS ,
description : $localize ` Folders to exclude from indexing. If an entry starts with '/' it is treated as an absolute path. If it doesn't start with '/' but contains a '/', the path is relative to the image directory. If it doesn't contain a '/', any folder with this name will be excluded. ` ,
2021-04-18 15:48:35 +02:00
} )
excludeFolderList : string [ ] = [ '.Trash-1000' , '.dtrash' , '$RECYCLE.BIN' ] ;
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
arrayType : 'string' ,
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Exclude File List ` ,
priority : ConfigPriority.advanced ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true , db : true } ,
2022-12-30 23:44:53 +01:00
uiOptional : true ,
hint : $localize ` .ignore;.pg2ignore `
2022-12-28 19:12:18 +01:00
} as TAGS ,
description : $localize ` Files that mark a folder to be excluded from indexing. Any folder that contains a file with this name will be excluded from indexing. ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
excludeFileList : string [ ] = [ ] ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerThreadingConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Threading ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Runs directory scanning and thumbnail generation in a different thread. `
} )
2021-04-18 15:48:35 +02:00
enabled : boolean = true ;
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Thumbnail threads ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Number of threads that are used to generate thumbnails. If 0, number of 'CPU cores -1' threads will be used. ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
thumbnailThreads : number = 0 ; // if zero-> CPU count -1
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerDuplicatesConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Max duplicates ` ,
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Maximum number of duplicates to list. `
} )
listingLimit : number = 1000 ;
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerLogConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : LogLevel ,
tags : {
name : $localize ` Level ` ,
priority : ConfigPriority.advanced ,
} ,
description : $localize ` Logging level. `
} )
2021-04-18 15:48:35 +02:00
level : LogLevel = LogLevel . info ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : SQLLogLevel ,
tags : {
name : $localize ` Sql Level ` ,
priority : ConfigPriority.underTheHood ,
} ,
description : $localize ` Logging level for SQL queries. `
} )
2021-04-18 15:48:35 +02:00
sqlLevel : SQLLogLevel = SQLLogLevel . error ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Server timing ` ,
priority : ConfigPriority.underTheHood ,
} ,
2023-01-07 11:34:50 +01:00
description : $localize ` If enabled, the app ads "Server-Timing" http header to the response. `
2022-12-28 19:12:18 +01:00
} )
2022-02-26 12:34:04 +01:00
logServerTiming : boolean = false ;
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-30 15:35:07 +01:00
export class NeverJobTriggerConfig implements NeverJobTrigger {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : JobTriggerType } )
2021-04-18 15:48:35 +02:00
readonly type = JobTriggerType . never ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-30 15:35:07 +01:00
export class ScheduledJobTriggerConfig implements ScheduledJobTrigger {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : JobTriggerType } )
2021-04-18 15:48:35 +02:00
readonly type = JobTriggerType . scheduled ;
2020-01-28 18:36:52 +01:00
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : 'unsignedInt' } )
2022-04-04 19:37:31 +02:00
time : number ; // data time
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-30 15:35:07 +01:00
export class PeriodicJobTriggerConfig implements PeriodicJobTrigger {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : JobTriggerType } )
2021-04-18 15:48:35 +02:00
readonly type = JobTriggerType . periodic ;
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : 'unsignedInt' , max : 7 } )
2022-12-30 15:35:07 +01:00
periodicity : number | undefined = 7 ; // 0-6: week days 7 every day
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : 'unsignedInt' , max : 23 * 60 + 59 } )
2022-12-30 15:35:07 +01:00
atTime : number | undefined = 0 ; // day time
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-30 15:35:07 +01:00
export class AfterJobTriggerConfig implements AfterJobTrigger {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { type : JobTriggerType } )
2021-04-18 15:48:35 +02:00
readonly type = JobTriggerType . after ;
@ConfigProperty ( )
2022-04-04 19:37:31 +02:00
afterScheduleName : string | undefined ; // runs after schedule
2020-01-28 18:36:52 +01:00
2021-04-18 15:48:35 +02:00
constructor ( afterScheduleName? : string ) {
this . afterScheduleName = afterScheduleName ;
2020-01-28 18:36:52 +01:00
}
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class JobScheduleConfig implements JobScheduleDTO {
@ConfigProperty ( )
name : string ;
@ConfigProperty ( )
jobName : string ;
@ConfigProperty ( )
2022-12-30 15:35:07 +01:00
config : Record < string , string | number | string [ ] | number [ ] > = { } ;
2021-04-18 15:48:35 +02:00
@ConfigProperty ( )
2022-12-30 15:35:07 +01:00
allowParallelRun : boolean = false ;
2021-04-18 15:48:35 +02:00
@ConfigProperty ( {
2022-12-30 15:35:07 +01:00
type : NeverJobTriggerConfig ,
2021-04-18 15:48:35 +02:00
typeBuilder : ( v : JobTrigger ) = > {
const type = typeof v . type === 'number' ? v.type : JobTriggerType [ v . type ] ;
switch ( type ) {
case JobTriggerType . after :
2022-12-30 15:35:07 +01:00
return AfterJobTriggerConfig ;
2021-04-18 15:48:35 +02:00
case JobTriggerType . never :
2022-12-30 15:35:07 +01:00
return NeverJobTriggerConfig ;
2021-04-18 15:48:35 +02:00
case JobTriggerType . scheduled :
2022-12-30 15:35:07 +01:00
return ScheduledJobTriggerConfig ;
2021-04-18 15:48:35 +02:00
case JobTriggerType . periodic :
2022-12-30 15:35:07 +01:00
return PeriodicJobTriggerConfig ;
2020-01-28 18:36:52 +01:00
}
2021-04-18 15:48:35 +02:00
return null ;
2022-04-04 19:37:31 +02:00
} ,
2021-04-18 15:48:35 +02:00
} )
2022-04-04 19:37:31 +02:00
trigger :
2022-12-30 15:35:07 +01:00
| AfterJobTriggerConfig
| NeverJobTriggerConfig
| PeriodicJobTriggerConfig
| ScheduledJobTriggerConfig ;
2022-04-04 19:37:31 +02:00
constructor (
name : string ,
jobName : string ,
trigger :
2022-12-30 15:35:07 +01:00
| AfterJobTriggerConfig
| NeverJobTriggerConfig
| PeriodicJobTriggerConfig
| ScheduledJobTriggerConfig ,
config : any = { } ,
allowParallelRun : boolean = false
2022-04-04 19:37:31 +02:00
) {
2021-04-18 15:48:35 +02:00
this . name = name ;
this . jobName = jobName ;
this . config = config ;
this . allowParallelRun = allowParallelRun ;
this . trigger = trigger ;
2020-01-28 18:36:52 +01:00
}
2021-04-18 15:48:35 +02:00
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerJobConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Max saved progress ` ,
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Job history size. `
} )
2022-12-18 23:47:13 +01:00
maxSavedProgress : number = 20 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Processing batch size ` ,
priority : ConfigPriority.underTheHood
} ,
description : $localize ` Jobs load this many photos or videos form the DB for processing at once. `
} )
2022-12-18 23:47:13 +01:00
mediaProcessingBatchSize : number = 1000 ;
2023-01-04 23:07:50 +01:00
@ConfigProperty ( {
arrayType : JobScheduleConfig ,
tags : {
name : $localize ` Scheduled jobs ` ,
2023-01-05 23:11:58 +01:00
priority : ConfigPriority.advanced
}
2023-01-04 23:07:50 +01:00
} )
2021-04-18 15:48:35 +02:00
scheduled : JobScheduleConfig [ ] = [
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs . Indexing ] ,
2021-04-18 15:48:35 +02:00
DefaultsJobs [ DefaultsJobs . Indexing ] ,
2022-12-30 15:35:07 +01:00
new NeverJobTriggerConfig ( ) ,
2023-01-04 23:07:50 +01:00
{ indexChangesOnly : true } // set config explicitly, so it is not undefined on the UI
2021-04-18 15:48:35 +02:00
) ,
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'Preview Filling' ] ] ,
2022-01-17 23:05:10 +01:00
DefaultsJobs [ DefaultsJobs [ 'Preview Filling' ] ] ,
2022-12-30 15:35:07 +01:00
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'Indexing' ] ] ) ,
2022-04-04 19:37:31 +02:00
{ }
2022-01-17 23:05:10 +01:00
) ,
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'Thumbnail Generation' ] ] ,
2021-04-18 15:48:35 +02:00
DefaultsJobs [ DefaultsJobs [ 'Thumbnail Generation' ] ] ,
2022-12-30 15:35:07 +01:00
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'Preview Filling' ] ] ) ,
2022-06-24 22:59:08 +02:00
{ sizes : [ 240 ] , indexedOnly : true }
2021-04-18 15:48:35 +02:00
) ,
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'Photo Converting' ] ] ,
2021-04-18 15:48:35 +02:00
DefaultsJobs [ DefaultsJobs [ 'Photo Converting' ] ] ,
2022-12-30 15:35:07 +01:00
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'Thumbnail Generation' ] ] ) ,
2022-06-24 22:59:08 +02:00
{ indexedOnly : true }
2021-04-18 15:48:35 +02:00
) ,
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'Video Converting' ] ] ,
2021-04-18 15:48:35 +02:00
DefaultsJobs [ DefaultsJobs [ 'Video Converting' ] ] ,
2022-12-30 15:35:07 +01:00
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'Photo Converting' ] ] ) ,
{ indexedOnly : true }
) ,
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'GPX Compression' ] ] ,
DefaultsJobs [ DefaultsJobs [ 'GPX Compression' ] ] ,
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'Video Converting' ] ] ) ,
2022-06-24 22:59:08 +02:00
{ indexedOnly : true }
2021-04-18 15:48:35 +02:00
) ,
2022-04-04 19:37:31 +02:00
new JobScheduleConfig (
DefaultsJobs [ DefaultsJobs [ 'Temp Folder Cleaning' ] ] ,
2021-04-18 15:48:35 +02:00
DefaultsJobs [ DefaultsJobs [ 'Temp Folder Cleaning' ] ] ,
2022-12-30 15:35:07 +01:00
new AfterJobTriggerConfig ( DefaultsJobs [ DefaultsJobs [ 'GPX Compression' ] ] ) ,
2022-06-24 22:59:08 +02:00
{ indexedOnly : true }
2021-04-18 15:48:35 +02:00
) ,
] ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class VideoTranscodingConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Bit rate ` ,
priority : ConfigPriority.advanced ,
unit : 'bps'
} ,
description : $localize ` Target bit rate of the output video will be scaled down this this. This should be less than the upload rate of your home server. `
} )
2021-04-18 15:48:35 +02:00
bitRate : number = 5 * 1024 * 1024 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags :
{
name : $localize ` Resolution ` ,
priority : ConfigPriority.advanced ,
uiOptions : [ 720 , 1080 , 1440 , 2160 , 4320 ] ,
unit : 'px'
} ,
description : $localize ` The height of the output video will be scaled down to this, while keeping the aspect ratio. `
} )
2021-04-18 15:48:35 +02:00
resolution : videoResolutionType = 720 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'positiveFloat' ,
tags :
{
name : $localize ` FPS ` ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.underTheHood ,
2022-12-28 19:12:18 +01:00
uiOptions : [ 24 , 25 , 30 , 48 , 50 , 60 ]
} ,
description : $localize ` Target frame per second (fps) of the output video will be scaled down this this. `
} )
2021-04-18 15:48:35 +02:00
fps : number = 25 ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags :
{
name : $localize ` Format ` ,
priority : ConfigPriority.advanced ,
uiOptions : [ 'mp4' , 'webm' ]
}
} )
2021-04-18 15:48:35 +02:00
format : videoFormatType = 'mp4' ;
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` MP4 codec ` ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.underTheHood ,
2022-12-28 19:12:18 +01:00
uiOptions : [ 'libx264' , 'libx265' ] ,
relevant : ( c : any ) = > c . format === 'mp4'
}
} )
mp4Codec : videoCodecType = 'libx264' ;
@ConfigProperty ( {
tags :
{
name : $localize ` Webm Codec ` ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.underTheHood ,
2022-12-28 19:12:18 +01:00
uiOptions : [ 'libvpx' , 'libvpx-vp9' ] ,
relevant : ( c : any ) = > c . format === 'webm'
}
} )
webmCodec : videoCodecType = 'libvpx' ;
@ConfigProperty ( {
type : 'unsignedInt' , max : 51 ,
tags :
{
name : $localize ` CRF ` ,
priority : ConfigPriority.underTheHood ,
} ,
description : $localize ` The range of the Constant Rate Factor (CRF) scale is 0– 51, where 0 is lossless, 23 is the default, and 51 is worst quality possible. ` ,
2021-04-18 15:48:35 +02:00
} )
crf : number = 23 ;
@ConfigProperty ( {
type : FFmpegPresets ,
2022-12-28 19:12:18 +01:00
tags :
{
name : $localize ` Preset ` ,
priority : ConfigPriority.advanced ,
} ,
description : $localize ` A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). ` ,
2021-04-18 15:48:35 +02:00
} )
preset : FFmpegPresets = FFmpegPresets . medium ;
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
arrayType : 'string' ,
2022-12-28 19:12:18 +01:00
tags : {
name : $localize ` Custom Options ` ,
priority : ConfigPriority.underTheHood ,
hint : '-pass 2; -minrate 1M; -maxrate 1M; -bufsize 2M' ,
uiAllowSpaces : true
} ,
description : $localize ` It will be sent to ffmpeg as it is, as custom options. ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
customOptions : string [ ] = [ ] ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerVideoConfig extends ClientVideoConfig {
@ConfigProperty ( {
tags : {
name : $localize ` Video transcoding ` ,
priority : ConfigPriority.advanced ,
uiDisabled : ( sb : ClientVideoConfig ) = > ! sb . enabled
} ,
description : $localize ` To ensure smooth video playback, video transcoding is recommended to a lower bit rate than the server's upload rate. The transcoded videos will be save to the thumbnail folder. You can trigger the transcoding manually, but you can also create an automatic encoding job in advanced settings mode. `
} )
2021-04-18 15:48:35 +02:00
transcoding : VideoTranscodingConfig = new VideoTranscodingConfig ( ) ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class PhotoConvertingConfig extends ClientPhotoConvertingConfig {
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags : {
name : $localize ` On the fly converting ` ,
priority : ConfigPriority.underTheHood ,
uiDisabled : ( sc : PhotoConvertingConfig ) = >
! sc . enabled
} ,
description : $localize ` Converts photos on the fly, when they are requested. ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
onTheFly : boolean = true ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags : {
name : $localize ` Resolution ` ,
priority : ConfigPriority.advanced ,
2022-12-30 23:44:53 +01:00
uiOptions : [ 720 , 1080 , 1440 , 2160 , 4320 ] ,
unit : 'px' ,
2022-12-28 19:12:18 +01:00
uiDisabled : ( sc : PhotoConvertingConfig ) = >
! sc . enabled
} ,
description : $localize ` The shorter edge of the converted photo will be scaled down to this, while keeping the aspect ratio. ` ,
} )
2021-04-18 15:48:35 +02:00
resolution : videoResolutionType = 1080 ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerPhotoConfig extends ClientPhotoConfig {
@ConfigProperty ( {
tags : {
name : $localize ` Photo resizing ` ,
priority : ConfigPriority.advanced ,
}
} )
2021-04-18 15:48:35 +02:00
Converting : PhotoConvertingConfig = new PhotoConvertingConfig ( ) ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-07-06 21:37:19 +02:00
export class ServerPreviewConfig {
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'object' ,
tags : {
name : $localize ` Preview Filter query ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { db : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced ,
uiType : 'SearchQuery'
} ,
description : $localize ` Filters the sub-folders with this search query. If filter results no photo, the app will search again without the filter. ` ,
} )
2022-04-04 19:37:31 +02:00
SearchQuery : SearchQueryDTO = {
type : SearchQueryTypes . any_text ,
text : '' ,
} as TextSearch ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
arrayType : SortingMethods ,
tags : {
name : $localize ` Preview Sorting ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { db : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.advanced
} ,
description : $localize ` If multiple preview is available sorts them by these methods and selects the first one. ` ,
} )
2021-07-06 21:37:19 +02:00
Sorting : SortingMethods [ ] = [
SortingMethods . descRating ,
2022-04-04 19:37:31 +02:00
SortingMethods . descDate ,
2021-07-06 21:37:19 +02:00
] ;
}
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerMediaConfig extends ClientMediaConfig {
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags : {
name : $localize ` Images folder ` ,
priority : ConfigPriority.basic ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
dockerSensitive : true
} ,
description : $localize ` Images are loaded from this folder (read permission required) ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
folder : string = 'demo/images' ;
2022-04-04 19:37:31 +02:00
@ConfigProperty ( {
2022-12-28 19:12:18 +01:00
tags : {
name : $localize ` Temp folder ` ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
priority : ConfigPriority.basic ,
dockerSensitive : true
} ,
description : $localize ` Thumbnails, converted photos, videos will be stored here (write permission required) ` ,
2022-04-04 19:37:31 +02:00
} )
2021-04-18 15:48:35 +02:00
tempFolder : string = 'demo/tmp' ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
type : 'unsignedInt' ,
tags : {
name : $localize ` Metadata read buffer ` ,
priority : ConfigPriority.underTheHood ,
2023-01-07 11:34:50 +01:00
uiResetNeeded : { db : true , server : true } ,
2022-12-28 19:12:18 +01:00
githubIssue : 398 ,
unit : 'bytes'
2023-01-07 11:34:50 +01:00
} as TAGS ,
2022-12-28 19:12:18 +01:00
description : $localize ` Only this many bites will be loaded when scanning photo/video for metadata. Increase this number if your photos shows up as square. ` ,
} )
photoMetadataSize : number = 512 * 1024 ; // only this many bites will be loaded when scanning photo for metadata
@ConfigProperty ( {
tags : {
name : $localize ` Video ` ,
2023-01-05 21:39:59 +01:00
uiIcon : 'video' ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.advanced ,
uiJob : [
{
job : DefaultsJobs [ DefaultsJobs [ 'Video Converting' ] ] ,
relevant : ( c ) = > c . Media . Video . enabled
} ]
} as TAGS ,
2022-12-28 19:12:18 +01:00
description : $localize ` Video support uses ffmpeg. ffmpeg and ffprobe binaries need to be available in the PATH or the @ffmpeg-installer/ffmpeg and @ffprobe-installer/ffprobe optional node packages need to be installed. `
} )
2021-04-18 15:48:35 +02:00
Video : ServerVideoConfig = new ServerVideoConfig ( ) ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Photo ` ,
2023-01-05 21:39:59 +01:00
uiIcon : 'camera-slr' ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.advanced ,
uiJob : [
{
job : DefaultsJobs [ DefaultsJobs [ 'Photo Converting' ] ] ,
relevant : ( c ) = > c . Media . Photo . Converting . enabled
} ]
} as TAGS
2022-12-28 19:12:18 +01:00
} )
2021-04-18 15:48:35 +02:00
Photo : ServerPhotoConfig = new ServerPhotoConfig ( ) ;
2022-12-28 19:12:18 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Thumbnail ` ,
2023-01-05 21:39:59 +01:00
uiIcon : 'grid-three-up' ,
2022-12-30 23:44:53 +01:00
priority : ConfigPriority.advanced ,
uiJob : [ { job : DefaultsJobs [ DefaultsJobs [ 'Thumbnail Generation' ] ] } ]
} as TAGS
2022-12-28 19:12:18 +01:00
} )
2021-04-18 15:48:35 +02:00
Thumbnail : ServerThumbnailConfig = new ServerThumbnailConfig ( ) ;
}
2020-01-28 18:36:52 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerServiceConfig extends ClientServiceConfig {
@ConfigProperty ( {
arrayType : 'string' ,
2023-01-01 16:01:51 +01:00
tags : {
secret : true ,
name : 'sessionSecret'
}
2022-12-28 19:12:18 +01:00
} )
sessionSecret : string [ ] = [ ] ;
@ConfigProperty ( {
type : 'unsignedInt' ,
tags : {
name : $localize ` Session Timeout ` ,
priority : ConfigPriority.underTheHood ,
unit : 'ms'
} ,
description : $localize ` Users kept logged in for this long time. ` ,
} )
sessionTimeout : number = 1000 * 60 * 60 * 24 * 7 ; // in ms
@ConfigProperty ( {
tags : {
name : $localize ` Port ` ,
priority : ConfigPriority.advanced ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
dockerSensitive : true
} ,
description : $localize ` Port number. Port 80 is usually what you need. ` ,
type : 'unsignedInt' , envAlias : 'PORT' , min : 0 , max : 65535
} )
port : number = 80 ;
@ConfigProperty ( {
tags : {
name : $localize ` Host ` ,
priority : ConfigPriority.advanced ,
2023-01-06 20:16:33 +01:00
uiResetNeeded : { server : true } ,
2022-12-28 19:12:18 +01:00
dockerSensitive : true
} ,
description : $localize ` Server will accept connections from this IPv6 or IPv4 address. ` ,
} )
host : string = '0.0.0.0' ;
@ConfigProperty ( {
tags : {
name : $localize ` Threading ` ,
priority : ConfigPriority.underTheHood ,
}
} )
Threading : ServerThreadingConfig = new ServerThreadingConfig ( ) ;
@ConfigProperty ( {
tags : {
name : $localize ` Logs ` ,
priority : ConfigPriority.advanced ,
}
} )
Log : ServerLogConfig = new ServerLogConfig ( ) ;
}
2023-01-06 19:01:24 +01:00
@SubConfigClass ( { softReadonly : true } )
2021-04-18 15:48:35 +02:00
export class ServerEnvironmentConfig {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2022-04-04 19:37:31 +02:00
upTime : string | undefined ;
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2022-04-04 19:37:31 +02:00
appVersion : string | undefined ;
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2022-04-04 19:37:31 +02:00
buildTime : string | undefined ;
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2022-04-04 19:37:31 +02:00
buildCommitHash : string | undefined ;
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2022-04-04 19:37:31 +02:00
isDocker : boolean | undefined ;
2021-04-18 15:48:35 +02:00
}
2020-02-07 23:32:41 +01:00
2023-01-06 19:01:24 +01:00
@SubConfigClass < TAGS > ( { softReadonly : true } )
2022-12-28 19:12:18 +01:00
export class ServerConfig extends ClientConfig {
2022-06-24 22:59:08 +02:00
@ConfigProperty ( { volatile : true } )
2021-04-18 15:48:35 +02:00
Environment : ServerEnvironmentConfig = new ServerEnvironmentConfig ( ) ;
2022-12-28 19:12:18 +01:00
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Server ` ,
uiIcon : 'cog'
} as TAGS ,
} )
2022-12-28 19:12:18 +01:00
Server : ServerServiceConfig = new ServerServiceConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Database ` ,
uiIcon : 'list'
} as TAGS
} )
2022-12-28 19:12:18 +01:00
Database : ServerDataBaseConfig = new ServerDataBaseConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Users ` ,
uiIcon : 'person'
} as TAGS ,
} )
2022-12-28 19:12:18 +01:00
Users : ServerUserConfig = new ServerUserConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Indexing ` ,
uiIcon : 'pie-chart' ,
uiJob : [
{
job : DefaultsJobs [ DefaultsJobs . Indexing ] ,
description : $localize ` If you add a new folder to your gallery, the site indexes it automatically. If you would like to trigger indexing manually, click index button. (Note: search only works among the indexed directories.) `
} , {
job : DefaultsJobs [ DefaultsJobs [ 'Database Reset' ] ] ,
hideProgress : true
} ]
} as TAGS
} )
2022-12-28 19:12:18 +01:00
Indexing : ServerIndexingConfig = new ServerIndexingConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Media ` ,
uiIcon : 'camera-slr'
} as TAGS ,
} )
2022-12-28 19:12:18 +01:00
Media : ServerMediaConfig = new ServerMediaConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Meta file ` ,
uiIcon : 'file'
} as TAGS ,
} )
2022-12-28 19:12:18 +01:00
MetaFile : ServerMetaFileConfig = new ServerMetaFileConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Preview ` ,
uiIcon : 'image' ,
uiJob : [
{
job : DefaultsJobs [ DefaultsJobs [ 'Preview Filling' ] ] ,
} , {
job : DefaultsJobs [ DefaultsJobs [ 'Preview Reset' ] ] ,
hideProgress : true
} ]
} as TAGS
} )
2022-12-28 19:12:18 +01:00
Preview : ServerPreviewConfig = new ServerPreviewConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Sharing ` ,
uiIcon : 'share'
} as TAGS ,
} )
2022-12-28 19:12:18 +01:00
Sharing : ServerSharingConfig = new ServerSharingConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Duplicates ` ,
uiIcon : 'layers'
} as TAGS
} )
2022-12-28 19:12:18 +01:00
Duplicates : ServerDuplicatesConfig = new ServerDuplicatesConfig ( ) ;
2022-12-30 23:44:53 +01:00
@ConfigProperty ( {
tags : {
name : $localize ` Jobs ` ,
uiIcon : 'project'
} as TAGS
} )
2021-04-18 15:48:35 +02:00
Jobs : ServerJobConfig = new ServerJobConfig ( ) ;
2020-01-28 18:36:52 +01:00
}