mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Allow selecting a TeX Live image for a project
This commit is contained in:
@@ -24,7 +24,6 @@ const ProjectOptionsHandler = {
|
||||
if (!imageName || !Array.isArray(settings.allowedImageNames)) {
|
||||
return
|
||||
}
|
||||
imageName = imageName.toLowerCase()
|
||||
const isAllowed = settings.allowedImageNames.find(
|
||||
allowed => imageName === allowed.imageName
|
||||
)
|
||||
@@ -32,7 +31,7 @@ const ProjectOptionsHandler = {
|
||||
throw new Error(`invalid imageName: ${imageName}`)
|
||||
}
|
||||
const conditions = { _id: projectId }
|
||||
const update = { imageName: settings.imageRoot + '/' + imageName }
|
||||
const update = { imageName: imageName }
|
||||
return Project.updateOne(conditions, update, {})
|
||||
},
|
||||
|
||||
|
||||
@@ -1073,6 +1073,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) {
|
||||
|
||||
Reference in New Issue
Block a user