diff --git a/services/clsi/README.md b/services/clsi/README.md index c566e34726..a3f05de77d 100644 --- a/services/clsi/README.md +++ b/services/clsi/README.md @@ -29,7 +29,7 @@ The CLSI can be configured through the following environment variables: - `PROCESS_LIFE_SPAN_LIMIT_MS` - Process life span limit in milliseconds - `SMOKE_TEST` - Whether to run smoke tests - `TEXLIVE_IMAGE` - The TeX Live Docker image to use for sibling containers, e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker/texlive-full:2026.1` -- `TEX_LIVE_IMAGE_NAME_OVERRIDE` - The name of the registry for the Docker image e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker` +- `TEX_LIVE_DOCKER_IMAGE_ROOT` - The name of the registry for the Docker image e.g. `us-east1-docker.pkg.dev/overleaf-ops/ol-docker` - `TEXLIVE_IMAGE_USER` - When using sibling containers, the user to run as in the TeX Live image. Defaults to `tex` - `TEXLIVE_OPENOUT_ANY` - Sets the `openout_any` environment variable for TeX Live (see the `\openout` primitive [documentation](http://tug.org/texinfohtml/web2c.html#tex-invocation)) diff --git a/services/clsi/app/js/CompileController.js b/services/clsi/app/js/CompileController.js index bd7663146c..a64dc76551 100644 --- a/services/clsi/app/js/CompileController.js +++ b/services/clsi/app/js/CompileController.js @@ -168,7 +168,7 @@ function compile(req, res, next) { draft: request.draft, png2pdf: request.png2pdf, imageName: request.imageName - ? request.imageName + ? Path.basename(request.imageName) : undefined, rootResourcePath: request.rootResourcePath, stopOnFirstError: request.stopOnFirstError, diff --git a/services/clsi/app/js/DockerRunner.js b/services/clsi/app/js/DockerRunner.js index ecfc6b5b54..02185cc1c0 100644 --- a/services/clsi/app/js/DockerRunner.js +++ b/services/clsi/app/js/DockerRunner.js @@ -41,8 +41,8 @@ const DockerRunner = { } if (Settings.texliveImageNameOveride != null) { - const img = image.split('/') - image = `${Settings.texliveImageNameOveride}/${img[2]}` + const img = Path.basename(image) + image = `${Settings.texliveImageNameOveride}/${img}` } if (compileGroup === 'synctex-output') { @@ -238,6 +238,7 @@ const DockerRunner = { const match = image.match(/:([0-9]+)\.[0-9]+|:TL([0-9]+)/) // the rolling build does not follow our .. convention const year = match ? match[1] || match[2] : 'rolling' + env.PATH = `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/${year}/bin/x86_64-linux/` const options = { Cmd: command, diff --git a/services/clsi/config/settings.defaults.cjs b/services/clsi/config/settings.defaults.cjs index f71483b7da..69ba48b454 100644 --- a/services/clsi/config/settings.defaults.cjs +++ b/services/clsi/config/settings.defaults.cjs @@ -98,7 +98,7 @@ module.exports = { parallelFileDownloads: parseInt(process.env.FILESTORE_PARALLEL_FILE_DOWNLOADS, 10) || 1, filestoreDomainOveride: process.env.FILESTORE_DOMAIN_OVERRIDE, - texliveImageNameOveride: process.env.TEX_LIVE_IMAGE_NAME_OVERRIDE, + texliveImageNameOveride: process.env.TEX_LIVE_DOCKER_IMAGE_ROOT, texliveOpenoutAny: process.env.TEXLIVE_OPENOUT_ANY, texliveMaxPrintLine: process.env.TEXLIVE_MAX_PRINT_LINE, enablePdfCaching: process.env.ENABLE_PDF_CACHING === 'true', diff --git a/services/web/app/src/Features/Project/ProjectOptionsHandler.mjs b/services/web/app/src/Features/Project/ProjectOptionsHandler.mjs index 6cdae2bb72..ca173c9cf1 100644 --- a/services/web/app/src/Features/Project/ProjectOptionsHandler.mjs +++ b/services/web/app/src/Features/Project/ProjectOptionsHandler.mjs @@ -45,7 +45,7 @@ const ProjectOptionsHandler = { if (!isAllowed) { throw new OError('invalid imageName', { imageName }) } - return settings.imageRoot + '/' + imageName + return imageName }, async setImageName(projectId, imageName) { diff --git a/services/web/modules/sandboxed-compiles/index.mjs b/services/web/modules/sandboxed-compiles/index.mjs index d494a3eec4..456b03aaa0 100644 --- a/services/web/modules/sandboxed-compiles/index.mjs +++ b/services/web/modules/sandboxed-compiles/index.mjs @@ -20,3 +20,6 @@ if (process.env.SANDBOXED_COMPILES === 'true') { } Settings.currentImageName = process.env.TEX_LIVE_DOCKER_IMAGE } + +const SandboxedCompilesModule = {} +export default SandboxedCompilesModule