mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-31 20:58:04 +00:00
fix: harden blueprint deployment guardrails (#1027)
* fix: harden blueprint deployment guardrails * fix: update Docker toolchain to Go 1.26.3 * fix: repair Dockerfile tr argument split across lines * fix: bump protobufjs to clear npm audit high-severity advisories
This commit is contained in:
@@ -17,6 +17,7 @@ interface ComposeShape {
|
||||
}
|
||||
|
||||
interface ComposeService {
|
||||
image?: string | null;
|
||||
volumes?: Array<string | ComposeServiceVolume> | null;
|
||||
tmpfs?: string | string[] | null;
|
||||
}
|
||||
@@ -208,6 +209,20 @@ export class BlueprintAnalyzer {
|
||||
return false;
|
||||
}
|
||||
|
||||
static extractImageRefs(composeContent: string): string[] {
|
||||
const doc = (parseYaml(composeContent) ?? {}) as ComposeShape;
|
||||
const services = doc.services ?? {};
|
||||
const seen = new Set<string>();
|
||||
const images: string[] = [];
|
||||
for (const serviceDef of Object.values(services)) {
|
||||
const image = typeof serviceDef?.image === 'string' ? serviceDef.image.trim() : '';
|
||||
if (!image || image.startsWith('sha256:') || seen.has(image)) continue;
|
||||
seen.add(image);
|
||||
images.push(image);
|
||||
}
|
||||
return images;
|
||||
}
|
||||
|
||||
private static extractNamedVolumes(composeContent: string): Set<string> {
|
||||
try {
|
||||
const doc = (parseYaml(composeContent) ?? {}) as ComposeShape;
|
||||
|
||||
Reference in New Issue
Block a user