feat: integrity check jobs (missing files, untracked files, checksums) (#24205)

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
Signed-off-by: izzy <me@insrt.uk>
This commit is contained in:
Paul Makles
2026-06-10 21:02:27 +02:00
committed by GitHub
parent 4ead3e697d
commit 74878628c8
66 changed files with 5711 additions and 27 deletions
+471 -2
View File
@@ -564,6 +564,298 @@
"x-immich-state": "Alpha"
}
},
"/admin/integrity/report": {
"get": {
"description": "Get all flagged items by integrity report type",
"operationId": "getIntegrityReport",
"parameters": [
{
"name": "cursor",
"required": false,
"in": "query",
"description": "Cursor for pagination",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"description": "Number of items per page",
"schema": {
"maximum": 9007199254740991,
"exclusiveMinimum": true,
"default": 500,
"type": "integer",
"minimum": 0
}
},
{
"name": "type",
"required": true,
"in": "query",
"schema": {
"$ref": "#/components/schemas/IntegrityReport"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IntegrityReportResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Get integrity report by type",
"tags": [
"Maintenance (admin)"
],
"x-immich-admin-only": true,
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3.0.0",
"state": "Alpha"
}
],
"x-immich-permission": "maintenance",
"x-immich-state": "Alpha"
}
},
"/admin/integrity/report/{id}": {
"delete": {
"description": "Delete a given report item and perform corresponding deletion (e.g. trash asset, delete file)",
"operationId": "deleteIntegrityReport",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Delete integrity report item",
"tags": [
"Maintenance (admin)"
],
"x-immich-admin-only": true,
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3.0.0",
"state": "Alpha"
}
],
"x-immich-permission": "maintenance",
"x-immich-state": "Alpha"
}
},
"/admin/integrity/report/{id}/file": {
"get": {
"description": "Download the untracked/broken file if one exists",
"operationId": "getIntegrityReportFile",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Download flagged file",
"tags": [
"Maintenance (admin)"
],
"x-immich-admin-only": true,
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3.0.0",
"state": "Alpha"
}
],
"x-immich-permission": "maintenance",
"x-immich-state": "Alpha"
}
},
"/admin/integrity/report/{type}/csv": {
"get": {
"description": "Get all integrity report entries for a given type as a CSV",
"operationId": "getIntegrityReportCsv",
"parameters": [
{
"name": "type",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/IntegrityReport"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Export integrity report by type as CSV",
"tags": [
"Maintenance (admin)"
],
"x-immich-admin-only": true,
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3.0.0",
"state": "Alpha"
}
],
"x-immich-permission": "maintenance",
"x-immich-state": "Alpha"
}
},
"/admin/integrity/summary": {
"get": {
"description": "Get a count of the items flagged in each integrity report",
"operationId": "getIntegrityReportSummary",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IntegrityReportSummaryResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"summary": "Get integrity report summary",
"tags": [
"Maintenance (admin)"
],
"x-immich-admin-only": true,
"x-immich-history": [
{
"version": "v3.0.0",
"state": "Added"
},
{
"version": "v3.0.0",
"state": "Alpha"
}
],
"x-immich-permission": "maintenance",
"x-immich-state": "Alpha"
}
},
"/admin/maintenance": {
"post": {
"description": "Put Immich into or take it out of maintenance mode",
@@ -15943,6 +16235,10 @@
"name": "Faces",
"description": "A face is a detected human face within an asset, which can be associated with a person. Faces are normally detected via machine learning, but can also be created via manually."
},
{
"name": "Integrity (admin)",
"description": "Endpoints for viewing and managing integrity reports."
},
{
"name": "Jobs",
"description": "Queues and background jobs are used for processing tasks asynchronously. Queues can be paused and resumed as needed."
@@ -18780,6 +19076,75 @@
],
"type": "string"
},
"IntegrityReport": {
"description": "Integrity report type",
"enum": [
"untracked_file",
"missing_file",
"checksum_mismatch"
],
"type": "string"
},
"IntegrityReportResponseDto": {
"properties": {
"items": {
"items": {
"properties": {
"id": {
"description": "Integrity report item id",
"type": "string"
},
"path": {
"description": "Integrity report item path",
"type": "string"
},
"type": {
"$ref": "#/components/schemas/IntegrityReport"
}
},
"required": [
"id",
"type",
"path"
],
"type": "object"
},
"type": "array"
},
"nextCursor": {
"type": "string"
}
},
"required": [
"items"
],
"type": "object"
},
"IntegrityReportSummaryResponseDto": {
"properties": {
"checksum_mismatch": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"missing_file": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"untracked_file": {
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
}
},
"required": [
"checksum_mismatch",
"missing_file",
"untracked_file"
],
"type": "object"
},
"JobCreateDto": {
"properties": {
"name": {
@@ -18849,7 +19214,17 @@
"VersionCheck",
"OcrQueueAll",
"Ocr",
"WorkflowAssetTrigger"
"WorkflowAssetTrigger",
"IntegrityUntrackedFilesQueueAll",
"IntegrityUntrackedFiles",
"IntegrityUntrackedRefresh",
"IntegrityMissingFilesQueueAll",
"IntegrityMissingFiles",
"IntegrityMissingFilesRefresh",
"IntegrityChecksumFiles",
"IntegrityChecksumFilesRefresh",
"IntegrityDeleteReportType",
"IntegrityDeleteReports"
],
"type": "string"
},
@@ -19223,7 +19598,16 @@
"user-cleanup",
"memory-cleanup",
"memory-create",
"backup-database"
"backup-database",
"integrity-missing-files",
"integrity-untracked-files",
"integrity-checksum-mismatch",
"integrity-missing-files-refresh",
"integrity-untracked-files-refresh",
"integrity-checksum-mismatch-refresh",
"integrity-missing-files-delete-all",
"integrity-untracked-files-delete-all",
"integrity-checksum-mismatch-delete-all"
],
"type": "string"
},
@@ -21092,6 +21476,7 @@
"backupDatabase",
"ocr",
"workflow",
"integrityCheck",
"editor"
],
"type": "string"
@@ -21226,6 +21611,9 @@
"facialRecognition": {
"$ref": "#/components/schemas/QueueResponseLegacyDto"
},
"integrityCheck": {
"$ref": "#/components/schemas/QueueResponseLegacyDto"
},
"library": {
"$ref": "#/components/schemas/QueueResponseLegacyDto"
},
@@ -21270,6 +21658,7 @@
"editor",
"faceDetection",
"facialRecognition",
"integrityCheck",
"library",
"metadataExtraction",
"migration",
@@ -24932,6 +25321,9 @@
"image": {
"$ref": "#/components/schemas/SystemConfigImageDto"
},
"integrityChecks": {
"$ref": "#/components/schemas/SystemConfigIntegrityChecks"
},
"job": {
"$ref": "#/components/schemas/SystemConfigJobDto"
},
@@ -24991,6 +25383,7 @@
"backup",
"ffmpeg",
"image",
"integrityChecks",
"job",
"library",
"logging",
@@ -25249,6 +25642,78 @@
],
"type": "object"
},
"SystemConfigIntegrityChecks": {
"description": "Integrity checks config",
"properties": {
"checksumFiles": {
"$ref": "#/components/schemas/SystemConfigIntegrityChecksumJob"
},
"missingFiles": {
"$ref": "#/components/schemas/SystemConfigIntegrityJob"
},
"untrackedFiles": {
"$ref": "#/components/schemas/SystemConfigIntegrityJob"
}
},
"required": [
"checksumFiles",
"missingFiles",
"untrackedFiles"
],
"type": "object"
},
"SystemConfigIntegrityChecksumJob": {
"description": "Integrity checksum job config",
"properties": {
"cronExpression": {
"description": "Cron expression for when the integrity check should run",
"pattern": "(((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7}",
"type": "string"
},
"enabled": {
"description": "Enabled",
"type": "boolean"
},
"percentageLimit": {
"description": "Percentage limit of the integrity checksum job",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
},
"timeLimit": {
"description": "How long the integrity checksum job may run for",
"maximum": 9007199254740991,
"minimum": 0,
"type": "integer"
}
},
"required": [
"cronExpression",
"enabled",
"percentageLimit",
"timeLimit"
],
"type": "object"
},
"SystemConfigIntegrityJob": {
"description": "Integrity job config",
"properties": {
"cronExpression": {
"description": "Cron expression for when the integrity check should run",
"pattern": "(((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7}",
"type": "string"
},
"enabled": {
"description": "Enabled",
"type": "boolean"
}
},
"required": [
"cronExpression",
"enabled"
],
"type": "object"
},
"SystemConfigJobDto": {
"properties": {
"backgroundTask": {
@@ -25260,6 +25725,9 @@
"faceDetection": {
"$ref": "#/components/schemas/JobSettingsDto"
},
"integrityCheck": {
"$ref": "#/components/schemas/JobSettingsDto"
},
"library": {
"$ref": "#/components/schemas/JobSettingsDto"
},
@@ -25298,6 +25766,7 @@
"backgroundTask",
"editor",
"faceDetection",
"integrityCheck",
"library",
"metadataExtraction",
"migration",