mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
This reverts commit f08812899647bc8e4bc0c0d14d3250eb0b9f5c59. GitOrigin-RevId: 7484cc5d5de6af0a5e4083fed4e8cacd9e1e643f
This commit is contained in:
@@ -42,7 +42,6 @@ function defaultDockerComposeOverride() {
|
||||
environment: {},
|
||||
},
|
||||
'git-bridge': {},
|
||||
mongo: {},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -56,7 +55,7 @@ function readDockerComposeOverride() {
|
||||
if (error.code !== 'ENOENT') {
|
||||
throw error
|
||||
}
|
||||
return defaultDockerComposeOverride()
|
||||
return defaultDockerComposeOverride
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,13 +281,11 @@ function setVarsDockerCompose({
|
||||
}
|
||||
|
||||
if (mongoVersion) {
|
||||
cfg.services.mongo.image = `mongo:${mongoVersion}`
|
||||
cfg.services.mongo = {
|
||||
image: `mongo:${mongoVersion}`,
|
||||
}
|
||||
} else {
|
||||
delete cfg.services.mongo.image
|
||||
}
|
||||
|
||||
if (version === 'latest') {
|
||||
cfg.services.mongo.command = '--replSet overleaf --notablescan'
|
||||
delete cfg.services.mongo
|
||||
}
|
||||
|
||||
writeDockerComposeOverride(cfg)
|
||||
|
||||
@@ -3,7 +3,7 @@ import Path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { promiseMapWithLimit } from '@overleaf/promise-utils'
|
||||
import Settings from '@overleaf/settings'
|
||||
import { connectionPromise, db } from '../app/src/infrastructure/mongodb.mjs'
|
||||
import { db } from '../app/src/infrastructure/mongodb.mjs'
|
||||
import GracefulShutdown from '../app/src/infrastructure/GracefulShutdown.mjs'
|
||||
import ProjectDeleter from '../app/src/Features/Project/ProjectDeleter.mjs'
|
||||
import SplitTestManager from '../app/src/Features/SplitTests/SplitTestManager.mjs'
|
||||
@@ -62,7 +62,7 @@ async function deleteUser(email) {
|
||||
// Hard-delete the users projects.
|
||||
const projects = await db.deletedProjects
|
||||
.find(
|
||||
{ 'deleterData.deletedProjectOwnerId': user._id },
|
||||
{ deletedProjectOwnerId: user._id },
|
||||
{ projection: { deletedProjectId: 1 } }
|
||||
)
|
||||
.toArray()
|
||||
@@ -137,31 +137,10 @@ async function provisionSplitTests() {
|
||||
await SplitTestManager.replaceSplitTests(SPLIT_TESTS)
|
||||
}
|
||||
|
||||
async function checkNoTableScan() {
|
||||
const client = await connectionPromise
|
||||
const { notablescan } = await client
|
||||
.db()
|
||||
.admin()
|
||||
.command({ getParameter: 1, notablescan: 1 })
|
||||
if (!notablescan) {
|
||||
console.error()
|
||||
console.error('!!! mongo is running without --notablescan')
|
||||
console.error()
|
||||
console.error('To fix this, either')
|
||||
console.error('- run "internal$ bin/e2e_test_setup"')
|
||||
console.error(
|
||||
'- or add MONGO_EXTRA_ARGS=--notablescan in config/local.env and apply with "internal$ bin/up mongo"'
|
||||
)
|
||||
console.error()
|
||||
throw new Error('mongo is running without --notablescan')
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
throw new Error('only available in dev-env')
|
||||
}
|
||||
await checkNoTableScan()
|
||||
|
||||
await Promise.all([purgeNewUsers(), provisionUsers(), provisionSplitTests()])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user