mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Sandboxed compiles: cwd argument was added to CommandRunner
see upstream commit ce6f9b8
This commit is contained in:
@@ -26,6 +26,7 @@ const DockerRunner = {
|
|||||||
timeout,
|
timeout,
|
||||||
environment,
|
environment,
|
||||||
compileGroup,
|
compileGroup,
|
||||||
|
cwd,
|
||||||
callback
|
callback
|
||||||
) {
|
) {
|
||||||
command = command.map(arg =>
|
command = command.map(arg =>
|
||||||
@@ -82,7 +83,8 @@ const DockerRunner = {
|
|||||||
volumes,
|
volumes,
|
||||||
timeout,
|
timeout,
|
||||||
environment,
|
environment,
|
||||||
compileGroup
|
compileGroup,
|
||||||
|
cwd
|
||||||
)
|
)
|
||||||
const fingerprint = DockerRunner._fingerprintContainer(options)
|
const fingerprint = DockerRunner._fingerprintContainer(options)
|
||||||
const name = `project-${projectId}-${fingerprint}`
|
const name = `project-${projectId}-${fingerprint}`
|
||||||
@@ -217,7 +219,8 @@ const DockerRunner = {
|
|||||||
volumes,
|
volumes,
|
||||||
timeout,
|
timeout,
|
||||||
environment,
|
environment,
|
||||||
compileGroup
|
compileGroup,
|
||||||
|
cwd
|
||||||
) {
|
) {
|
||||||
const timeoutInSeconds = timeout / 1000
|
const timeoutInSeconds = timeout / 1000
|
||||||
|
|
||||||
@@ -245,7 +248,9 @@ const DockerRunner = {
|
|||||||
const options = {
|
const options = {
|
||||||
Cmd: command,
|
Cmd: command,
|
||||||
Image: image,
|
Image: image,
|
||||||
WorkingDir: '/compile',
|
WorkingDir: cwd
|
||||||
|
? Path.posix.join('/compile', cwd)
|
||||||
|
: '/compile',
|
||||||
NetworkDisabled: true,
|
NetworkDisabled: true,
|
||||||
Memory: 1024 * 1024 * 1024 * 1024, // 1 Gb
|
Memory: 1024 * 1024 * 1024 * 1024, // 1 Gb
|
||||||
User: Settings.clsi.docker.user,
|
User: Settings.clsi.docker.user,
|
||||||
|
|||||||
Reference in New Issue
Block a user