feat: built-in automatic database backups (#13773)

This commit is contained in:
Zack Pollard 2024-10-31 11:29:42 +00:00 committed by GitHub
parent 30d42e571c
commit 7d933ec97a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 994 additions and 17 deletions

View file

@ -7745,6 +7745,9 @@
"backgroundTask": {
"$ref": "#/components/schemas/JobStatusDto"
},
"backupDatabase": {
"$ref": "#/components/schemas/JobStatusDto"
},
"duplicateDetection": {
"$ref": "#/components/schemas/JobStatusDto"
},
@ -7787,6 +7790,7 @@
},
"required": [
"backgroundTask",
"backupDatabase",
"duplicateDetection",
"faceDetection",
"facialRecognition",
@ -8754,6 +8758,26 @@
],
"type": "object"
},
"DatabaseBackupConfig": {
"properties": {
"cronExpression": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"keepLastAmount": {
"minimum": 1,
"type": "number"
}
},
"required": [
"cronExpression",
"enabled",
"keepLastAmount"
],
"type": "object"
},
"DownloadArchiveInfo": {
"properties": {
"assetIds": {
@ -9289,7 +9313,8 @@
"search",
"sidecar",
"library",
"notifications"
"notifications",
"backupDatabase"
],
"type": "string"
},
@ -11456,8 +11481,22 @@
},
"type": "object"
},
"SystemConfigBackupsDto": {
"properties": {
"database": {
"$ref": "#/components/schemas/DatabaseBackupConfig"
}
},
"required": [
"database"
],
"type": "object"
},
"SystemConfigDto": {
"properties": {
"backup": {
"$ref": "#/components/schemas/SystemConfigBackupsDto"
},
"ffmpeg": {
"$ref": "#/components/schemas/SystemConfigFFmpegDto"
},
@ -11514,6 +11553,7 @@
}
},
"required": [
"backup",
"ffmpeg",
"image",
"job",

View file

@ -535,6 +535,7 @@ export type JobStatusDto = {
};
export type AllJobStatusResponseDto = {
backgroundTask: JobStatusDto;
backupDatabase: JobStatusDto;
duplicateDetection: JobStatusDto;
faceDetection: JobStatusDto;
facialRecognition: JobStatusDto;
@ -1084,6 +1085,14 @@ export type AssetFullSyncDto = {
updatedUntil: string;
userId?: string;
};
export type DatabaseBackupConfig = {
cronExpression: string;
enabled: boolean;
keepLastAmount: number;
};
export type SystemConfigBackupsDto = {
database: DatabaseBackupConfig;
};
export type SystemConfigFFmpegDto = {
accel: TranscodeHWAccel;
accelDecode: boolean;
@ -1232,6 +1241,7 @@ export type SystemConfigUserDto = {
deleteDelay: number;
};
export type SystemConfigDto = {
backup: SystemConfigBackupsDto;
ffmpeg: SystemConfigFFmpegDto;
image: SystemConfigImageDto;
job: SystemConfigJobDto;
@ -3445,7 +3455,8 @@ export enum JobName {
Search = "search",
Sidecar = "sidecar",
Library = "library",
Notifications = "notifications"
Notifications = "notifications",
BackupDatabase = "backupDatabase"
}
export enum JobCommand {
Start = "start",