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