mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Added 'currentImageName' setting plus migration (#701)
This commit is contained in:
parent
faf78b69e6
commit
f7ac10cc97
2 changed files with 25 additions and 0 deletions
23
server-ce/migrations/11_set_project_image_name.js
Normal file
23
server-ce/migrations/11_set_project_image_name.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const Settings = require('settings-sharelatex')
|
||||
const mongojs = require('mongojs')
|
||||
const db = mongojs(Settings.mongo.url, ['projects'])
|
||||
|
||||
exports.migrate = (client, done) => {
|
||||
console.log(`>> Setting 'imageName' in projects`)
|
||||
|
||||
if (!Settings.currentImageName) {
|
||||
console.log(`>> 'currentImageName' is not defined, no projects updated`)
|
||||
return done()
|
||||
}
|
||||
|
||||
console.log(`>> Setting 'imageName' = ${Settings.currentImageName}`)
|
||||
|
||||
db.projects.update(
|
||||
{ imageName: { $exists: false } },
|
||||
{ $set: { imageName: Settings.currentImageName } },
|
||||
{ multi: true },
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
exports.rollback = (client, done) => done()
|
|
@ -194,6 +194,8 @@ settings =
|
|||
www: {lngCode:process.env["SHARELATEX_SITE_LANGUAGE"] or "en", url: siteUrl}
|
||||
defaultLng: process.env["SHARELATEX_SITE_LANGUAGE"] or "en"
|
||||
|
||||
currentImageName: process.env["TEX_LIVE_DOCKER_IMAGE"]
|
||||
|
||||
apis:
|
||||
web:
|
||||
url: "http://localhost:3000"
|
||||
|
|
Loading…
Reference in a new issue