mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: add message to inform sandbox upgrade (#1111)
This commit is contained in:
1 parent
4dda4feb2c
commit
0002801058
1 file changed
+5
@@ -219,12 +219,14 @@ export async function versionCheck(reportWarn: (str: string) => void, reportErro
|
||||
let sandboxVersion: string;
|
||||
let sandboxCgroup: number;
|
||||
let sandboxCgroupControllers: string[] | null;
|
||||
let fixSymlinkEscape: boolean;
|
||||
try {
|
||||
const version = await client.version();
|
||||
sandboxVersion = version.buildVersion.split('v')[1];
|
||||
const config = await client.config();
|
||||
sandboxCgroup = config.runnerConfig?.cgroupType || 0;
|
||||
sandboxCgroupControllers = config.runnerConfig?.cgroupControllers || null;
|
||||
fixSymlinkEscape = config.fixSymlinkEscape ?? false;
|
||||
} catch (e) {
|
||||
if (e?.code === 'ECONNREFUSED') reportError('Failed to connect to sandbox, please check sandbox_host config and if your sandbox is running.');
|
||||
else reportError('Your sandbox version is tooooooo low! Please upgrade!');
|
||||
@@ -242,6 +244,9 @@ export async function versionCheck(reportWarn: (str: string) => void, reportErro
|
||||
reportWarn('The memory cgroup controller is not enabled. This could result in inaccurate memory usage measurements.');
|
||||
}
|
||||
}
|
||||
if (!fixSymlinkEscape) {
|
||||
reportError('Your sandbox version is vulnerable to symlink escape issue, please upgrade!');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user