Compare commits
4 Commits
b724b44e90
...
caeb4c6ec5
Author | SHA1 | Date |
---|---|---|
|
caeb4c6ec5 | |
|
1d55a41a2d | |
|
6ef0cdf7b4 | |
|
635734de45 |
|
@ -156,7 +156,11 @@ class Job {
|
|||
'-s',
|
||||
'-c',
|
||||
'/box/submission',
|
||||
'-e',
|
||||
'-E',
|
||||
'HOME=/tmp',
|
||||
...this.runtime.env_vars.flat_map(v => ['-E', v]),
|
||||
'-E',
|
||||
`PISTON_LANGUAGE=${this.runtime.language}`,
|
||||
`--dir=${this.runtime.pkgdir}`,
|
||||
`--dir=/etc:noexec`,
|
||||
`--processes=${this.runtime.max_process_count}`,
|
||||
|
@ -175,10 +179,6 @@ class Job {
|
|||
...args,
|
||||
],
|
||||
{
|
||||
env: {
|
||||
...this.runtime.env_vars,
|
||||
PISTON_LANGUAGE: this.runtime.language,
|
||||
},
|
||||
stdio: 'pipe',
|
||||
}
|
||||
);
|
||||
|
|
|
@ -178,15 +178,7 @@ class Runtime {
|
|||
const env_file = path.join(this.pkgdir, '.env');
|
||||
const env_content = fss.read_file_sync(env_file).toString();
|
||||
|
||||
this._env_vars = {};
|
||||
|
||||
env_content
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map(line => line.split('=', 2))
|
||||
.forEach(([key, val]) => {
|
||||
this._env_vars[key.trim()] = val.trim();
|
||||
});
|
||||
this._env_vars = env_content.trim().split('\n');
|
||||
}
|
||||
|
||||
return this._env_vars;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"chalk": "^4.1.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"nocamel": "^1.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"semver": "^7.5.2",
|
||||
"ws": "^7.5.3",
|
||||
"yargs": "^16.2.0"
|
||||
}
|
||||
|
@ -194,9 +194,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
||||
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
||||
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
|
@ -444,9 +444,9 @@
|
|||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
||||
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
||||
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"chalk": "^4.1.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"nocamel": "^1.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"semver": "^7.5.2",
|
||||
"ws": "^7.5.3",
|
||||
"yargs": "^16.2.0"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue