Allow selecting a TeX Live image for a project

This commit is contained in:
yu-i-i
2024-12-06 12:45:15 +01:00
parent 37a6c5286a
commit c2c27d3032
4 changed files with 12 additions and 11 deletions
+1 -7
View File
@@ -496,13 +496,7 @@ if (process.env.SANDBOXED_COMPILES === 'true') {
dockerRunner: true,
docker: {
image: process.env.TEX_LIVE_DOCKER_IMAGE,
env: {
HOME: '/tmp',
PATH:
process.env.COMPILER_PATH ||
'/usr/local/bin:/usr/bin:/bin',
},
user: 'www-data',
user: process.env.TEX_LIVE_DOCKER_USER || 'www-data',
}
}
+2 -3
View File
@@ -235,10 +235,9 @@ const DockerRunner = {
}
}
// set the path based on the image year
const match = image.match(/:([0-9]+)\.[0-9]+/)
const match = image.match(/:([0-9]+)\.[0-9]+|:TL([0-9]+)/)
// the rolling build does not follow our <year>.<version>.<patch> convention
const year = match ? match[1] : 'rolling'
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,
@@ -39,7 +39,6 @@ const ProjectOptionsHandler = {
if (!imageName || !Array.isArray(settings.allowedImageNames)) {
return undefined
}
imageName = imageName.toLowerCase()
const isAllowed = settings.allowedImageNames.find(
allowed => imageName === allowed.imageName
)
+9
View File
@@ -1089,6 +1089,15 @@ module.exports = {
managedUsers: {
enabled: false,
},
allowedImageNames: process.env.SANDBOXED_COMPILES === 'true'
? parseTextExtensions(process.env.ALL_TEX_LIVE_DOCKER_IMAGES)
.map((imageName, index) => ({
imageName,
imageDesc: parseTextExtensions(process.env.ALL_TEX_LIVE_DOCKER_IMAGE_NAMES)[index]
|| imageName.split(':')[1],
}))
: undefined,
}
module.exports.mergeWith = function (overrides) {