Schema: cache.image im Projekt und optionaler Asset-cachePath
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- project.schema.json: cache.image.{path, autoCleanup.{maxAge,maxFiles,tempMaxAge}};
Server-only-Knöpfe (enabled, interval, Laufbudgets) sind bewusst nicht vorgesehen.
- asset.schema.json: cachePath optional, ohne Pflicht-Verzeichnis, verweist auf
cache.image.path als Default.
- index.d.ts und Beispiel-YAML nachgezogen.
This commit is contained in:
1 parent
8ca80136f4
commit
5458214ad9
4 files changed
+57
-5
No files matched your search
@@ -1,7 +1,13 @@
|
||||
# Beispiel für einen Asset-Eintrag mit Bildverarbeitung (imageProcessing)
|
||||
# (tibi-server, ProjectConfig.assets[]) — validiert gegen schemas/config/asset.schema.json.
|
||||
# Hinweis: cachePath muss ein existierendes Verzeichnis ausserhalb des Quellpfads
|
||||
# sein; die Ajv-Validierung prueft nur Form und Wertebereiche, keine Dateisystempfade.
|
||||
# Hinweis: cachePath ist optional. Explizit gesetzt ist er projektkontrolliert und
|
||||
# folgt den normalen Pfad-Gates: relativ zur config.yml, ".." nur mit
|
||||
# security.allowUpperPaths, absolut nur mit security.allowAbsolutePaths.
|
||||
# Ohne cachePath gilt cache.image.path (Standard ../cache/image,
|
||||
# operator-gesetzt, ".." dort ohne Flag erlaubt); ein Projekt kann ihn per
|
||||
# cache.image.path überschreiben.
|
||||
# Der Projekt-Namespace wird immer angehängt; das Verzeichnis wird beim ersten
|
||||
# Render angelegt. Die Ajv-Validierung prueft nur Form und Wertebereiche.
|
||||
name: product-images
|
||||
path: ./media/products
|
||||
imageProcessing:
|
||||
|
||||
Vendored
+8
-1
@@ -421,7 +421,14 @@ declare global {
|
||||
/** Asset image processing block (`imageProcessing`) */
|
||||
export interface AssetImageProcessingConfig {
|
||||
access: "public"
|
||||
cachePath: string
|
||||
/**
|
||||
* Optional cache directory. An explicit value is project-controlled:
|
||||
* relative to the project's config.yml, ".." needs
|
||||
* security.allowUpperPaths, absolute needs security.allowAbsolutePaths.
|
||||
* Omit to use cache.image.path (default ../cache/image).
|
||||
* The project namespace is appended; the directory is created lazily.
|
||||
*/
|
||||
cachePath?: string
|
||||
allowOriginal?: boolean
|
||||
defaultFilter?: string
|
||||
allowedInputTypes?: Array<"image/jpeg" | "image/png" | "image/webp">
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
]
|
||||
},
|
||||
"cachePath": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"description": "Optional cache directory for filtered variants. An explicit value is project-controlled: relative to the project's config.yml, \"..\" needs security.allowUpperPaths, absolute needs security.allowAbsolutePaths. Omit it to use cache.image.path (default ../cache/image). The project namespace is appended and the directory is created lazily.",
|
||||
"pattern": "^.+$"
|
||||
},
|
||||
"allowOriginal": {
|
||||
"type": "boolean"
|
||||
@@ -73,7 +75,6 @@
|
||||
},
|
||||
"required": [
|
||||
"access",
|
||||
"cachePath",
|
||||
"imageFilter"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -345,6 +345,44 @@
|
||||
"type": "string",
|
||||
"description": "Base directory for snapshot data, relative to configDir. Default: '{configDir}/snapshots'."
|
||||
},
|
||||
"cache": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Per-project cache settings. Same key names as the server's cache.image block.",
|
||||
"properties": {
|
||||
"image": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Derived image cache (filtered variants). Every value may only tighten cache.image.* of the server; path follows the usual security gates.",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Cache root for this project, relative to its config.yml. '..' needs security.allowUpperPaths, absolute needs security.allowAbsolutePaths."
|
||||
},
|
||||
"autoCleanup": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Retention limits; the switch, the schedule and the per-run I/O budget are server-controlled.",
|
||||
"properties": {
|
||||
"maxAge": {
|
||||
"type": "string",
|
||||
"description": "How long an unused variant may stay (Go duration, e.g. '168h'). Only shorter than cache.image.autoCleanup.maxAge."
|
||||
},
|
||||
"maxFiles": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "Maximum cache entries per cache directory. Only lower than cache.image.autoCleanup.maxFiles."
|
||||
},
|
||||
"tempMaxAge": {
|
||||
"type": "string",
|
||||
"description": "Lifetime of abandoned .tmp-* files (Go duration). Only shorter than cache.image.autoCleanup.tempMaxAge."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"snapshots": {
|
||||
"type": "array",
|
||||
"description": "List of snapshot profiles for automated point-in-time backups.",
|
||||
|
||||
Reference in new issue
Block a user