1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/common/config/private/IPrivateConfig.ts

100 lines
2.0 KiB
TypeScript
Raw Normal View History

import {ClientConfig} from '../public/ConfigClass';
2019-07-28 04:56:12 +08:00
import {TaskScheduleDTO} from '../../entities/task/TaskScheduleDTO';
2017-07-20 02:47:09 +08:00
export enum DatabaseType {
2018-05-29 02:03:12 +08:00
memory = 1, mysql = 2, sqlite = 3
2017-06-04 21:25:08 +08:00
}
2017-06-04 21:25:08 +08:00
export enum LogLevel {
error = 1, warn = 2, info = 3, verbose = 4, debug = 5, silly = 6
}
export enum SQLLogLevel {
none = 1, error = 2, all = 3
}
export enum ThumbnailProcessingLib {
2018-05-29 02:03:12 +08:00
Jimp = 1,
gm = 2,
sharp = 3
2017-06-04 21:25:08 +08:00
}
export interface MySQLConfig {
host: string;
database: string;
username: string;
password: string;
2017-06-04 21:25:08 +08:00
}
export interface SQLiteConfig {
storage: string;
}
2017-06-04 21:25:08 +08:00
export interface DataBaseConfig {
type: DatabaseType;
mysql?: MySQLConfig;
sqlite?: SQLiteConfig;
2017-06-04 21:25:08 +08:00
}
2017-06-04 21:25:08 +08:00
export interface ThumbnailConfig {
folder: string;
processingLibrary: ThumbnailProcessingLib;
qualityPriority: boolean;
2019-02-15 07:25:55 +08:00
personFaceMargin: number; // in ration [0-1]
2017-06-04 21:25:08 +08:00
}
2017-07-04 01:17:49 +08:00
export interface SharingConfig {
updateTimeout: number;
}
2017-07-28 05:10:16 +08:00
export enum ReIndexingSensitivity {
2018-05-29 02:03:12 +08:00
low = 1, medium = 2, high = 3
2017-07-28 05:10:16 +08:00
}
export interface IndexingConfig {
folderPreviewSize: number;
cachedFolderTimeout: number; // Do not rescans the folder if seems ok
2017-07-28 05:10:16 +08:00
reIndexingSensitivity: ReIndexingSensitivity;
excludeFolderList: string[]
excludeFileList: string[]
2017-07-28 05:10:16 +08:00
}
export interface ThreadingConfig {
enable: boolean;
thumbnailThreads: number;
}
2019-01-19 07:18:20 +08:00
export interface DuplicatesConfig {
listingLimit: number; // maximum number of duplicates to list
}
export interface LogConfig {
level: LogLevel;
sqlLevel: SQLLogLevel;
}
2019-07-28 04:56:12 +08:00
export interface TaskConfig {
scheduled: TaskScheduleDTO[];
}
2017-06-04 21:25:08 +08:00
export interface ServerConfig {
port: number;
2018-12-28 05:14:32 +08:00
host: string;
imagesFolder: string;
thumbnail: ThumbnailConfig;
threading: ThreadingConfig;
database: DataBaseConfig;
2017-07-04 01:17:49 +08:00
sharing: SharingConfig;
sessionTimeout: number;
2017-07-28 05:10:16 +08:00
indexing: IndexingConfig;
2018-12-04 20:52:49 +08:00
photoMetadataSize: number;
2019-01-19 07:18:20 +08:00
duplicates: DuplicatesConfig;
log: LogConfig;
2019-07-28 04:56:12 +08:00
tasks: TaskConfig;
2017-06-04 21:25:08 +08:00
}
2017-07-08 18:43:42 +08:00
export interface IPrivateConfig {
Server: ServerConfig;
2017-07-15 18:47:11 +08:00
Client: ClientConfig.Config;
2017-07-08 18:43:42 +08:00
}