CDN listing, upload and sync
All selections share one configured bucket. Sync copies/overwrites files and does not prune, compare hashes or roll back earlier uploads. Each put constructs an S3 client; no queue or worker is implemented here. Listing ignores continuation tokens. CDN upload does not create DAM records. CDN deletion immediately calls authenticated DELETE objects?key, then DeleteObject and removes the row; the server does not test existence first.
sequenceDiagram
actor U as Administrator
participant P as CDN page
participant R as CDN handlers
participant F as Staged output filesystem
participant M as MinIO helper
participant B as Configured bucket
U->>P: Open or refresh
P->>R: Authenticated GET objects
R->>M: listCdnObjects
M->>B: One ListObjectsV2
B-->>P: Object summaries through handler
alt Upload object
U->>P: Select file and key
P->>R: Authenticated PUT base64 JSON
R->>M: Decode and putCdnObject
M->>B: PutObject with supplied contentType
else Sync staged files
U->>P: Sync from output
P->>R: Authenticated POST sync with database
R->>R: Map backend to local / development / test
R->>F: stat and walk public directory
alt Directory absent
R-->>P: skipped true and uploaded 0
else Directory present
loop Each regular file, sequentially
R->>F: Read complete file
R->>M: putCdnObject without explicit contentType
M->>B: PutObject at relative key
end
R-->>P: Count and sourceDir
end
end
P->>R: Reload list
P->>P: Show result
Source evidence
- core/admin/app/pages/admin/cdn/index.vue:105 — const onSync
- core/admin/server/utils/minio-client.ts:50 — export const listCdnObjects
- core/admin/server/utils/minio-client.ts:121 — export const syncPublicAssetsToMinio
- core/admin/server/api/admin/cdn/sync.post.ts:13 — export default defineEventHandler
- core/admin/server/api/admin/cdn/objects.put.ts:14 — export default defineEventHandler
- core/admin/server/api/admin/cdn/objects.delete.ts:8 — export default defineEventHandler
- core/admin/server/utils/admin-database.ts:22 — const SYS_ENV_FOR_DATABASE