add pipeline
This commit is contained in:
Vendored
+7
-4
@@ -1,6 +1,6 @@
|
||||
import Docker from 'dockerode';
|
||||
import { config } from '../../config.js';
|
||||
import { resolveWorkspacePath } from '../../lib/sandbox.js';
|
||||
import { resolveWorkspacePath, SandboxViolationError } from '../../lib/sandbox.js';
|
||||
import { logger } from '../../lib/logger.js';
|
||||
class DockerManager {
|
||||
docker;
|
||||
@@ -83,10 +83,13 @@ export function validateVolumeMount(spec) {
|
||||
if (!source || !target) {
|
||||
throw new Error(`Invalid volume mount "${spec}": source and target are required.`);
|
||||
}
|
||||
const absoluteSource = resolveWorkspacePath(config.workspaceRoot, source);
|
||||
if (absoluteSource.toLowerCase().startsWith('\\\\.\\pipe\\docker_engine') || source.includes('/var/run/docker.sock')) {
|
||||
throw new Error(`Refusing to mount the Docker socket: "${source}".`);
|
||||
const normalizedSource = source.toLowerCase().replaceAll('/', '\\');
|
||||
if (normalizedSource.startsWith('\\\\.\\pipe\\docker_engine') ||
|
||||
normalizedSource.startsWith('\\.\\pipe\\docker_engine') ||
|
||||
source.includes('/var/run/docker.sock')) {
|
||||
throw new SandboxViolationError(`Refusing to mount the Docker socket: "${source}".`);
|
||||
}
|
||||
const absoluteSource = resolveWorkspacePath(config.workspaceRoot, source);
|
||||
return { source: absoluteSource, target, mode };
|
||||
}
|
||||
export function isAllowListedImage(image) {
|
||||
|
||||
Reference in New Issue
Block a user