Merge pull request #6542 from overleaf/jpa-em-code-sharing-workspaces

[misc] npm workspaces

GitOrigin-RevId: 87aa72db6637fb238d7cd35b0a48ac3ed58ab3eb
This commit is contained in:
Jakob Ackermann 2022-02-07 11:46:51 +00:00 committed by Copybot
parent 42d78528ae
commit ae0c347f27
111 changed files with 80687 additions and 92611 deletions

View file

@ -4,6 +4,7 @@ access-token-encryptor
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -5,10 +5,10 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "mocha test/**/*.js", "test": "mocha test/**/*.js",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test" "test:ci": "npm run test"
}, },
"author": "", "author": "",
@ -19,11 +19,11 @@
}, },
"devDependencies": { "devDependencies": {
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
"chai": "^4.3.4", "chai": "^4.3.6",
"@overleaf/logger": "^2.2.0", "@overleaf/logger": "^2.2.0",
"mocha": "^6.2.2", "mocha": "^8.4.0",
"nock": "0.15.2", "nock": "0.15.2",
"sandboxed-module": "^2.0.3", "sandboxed-module": "^2.0.4",
"sinon": "^7.5.0" "sinon": "^9.2.4"
} }
} }

View file

@ -4,6 +4,7 @@ logger
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -10,10 +10,10 @@
"version": "3.1.0", "version": "3.1.0",
"scripts": { "scripts": {
"test": "mocha --grep=$MOCHA_GREP test/**/*.js", "test": "mocha --grep=$MOCHA_GREP test/**/*.js",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"test:ci": "npm run test" "test:ci": "npm run test"
}, },
"dependencies": { "dependencies": {
@ -24,11 +24,11 @@
"yn": "^4.0.0" "yn": "^4.0.0"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"mocha": "^8.4.0", "mocha": "^8.4.0",
"sandboxed-module": "^2.0.4", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.2", "sinon": "^9.2.4",
"sinon-chai": "^3.5.0" "sinon-chai": "^3.7.0"
}, },
"peerDependencies": { "peerDependencies": {
"@overleaf/metrics": ">= 4.0.0" "@overleaf/metrics": ">= 4.0.0"

View file

@ -4,6 +4,7 @@ metrics
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -16,19 +16,19 @@
}, },
"devDependencies": { "devDependencies": {
"bunyan": "^1.0.0", "bunyan": "^1.0.0",
"chai": "^4.2.0", "chai": "^4.3.6",
"mocha": "^8.0.1", "mocha": "^8.4.0",
"sandboxed-module": "^2.0.4", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.2" "sinon": "^9.2.4"
}, },
"scripts": { "scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"test:unit": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/unit", "test:unit": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/unit",
"test:acceptance": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/acceptance", "test:acceptance": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/acceptance",
"test": "npm run test:unit && npm run test:acceptance", "test": "npm run test:unit && npm run test:acceptance",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test" "test:ci": "npm run test"
}, },
"peerDependencies": { "peerDependencies": {

View file

@ -4,6 +4,7 @@ o-error
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -21,15 +21,15 @@
"build": "npm run --silent typecheck && npm run --silent test && npm run --silent declaration:build && npm run --silent update-readme", "build": "npm run --silent typecheck && npm run --silent test && npm run --silent declaration:build && npm run --silent update-readme",
"declaration:build": "rm -f index.d.ts && tsc --allowJs --declaration --emitDeclarationOnly --moduleResolution node --target ES6 index.js", "declaration:build": "rm -f index.d.ts && tsc --allowJs --declaration --emitDeclarationOnly --moduleResolution node --target ES6 index.js",
"declaration:check": "git diff --exit-code -- index.d.ts", "declaration:check": "git diff --exit-code -- index.d.ts",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"prepublishOnly": "npm run --silent declaration:build && npm run --silent declaration:check", "prepublishOnly": "npm run --silent declaration:build && npm run --silent declaration:check",
"test": "mocha", "test": "mocha",
"test:coverage": "nyc --reporter=lcov --reporter=text-summary npm run test", "test:coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
"typecheck": "tsc --allowJs --checkJs --noEmit --moduleResolution node --strict --target ES6 *.js test/**/*.js", "typecheck": "tsc --allowJs --checkJs --noEmit --moduleResolution node --strict --target ES6 *.js test/**/*.js",
"update-readme": "doc/update-readme.js", "update-readme": "doc/update-readme.js",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run typecheck && npm run test" "test:ci": "npm run typecheck && npm run test"
}, },
"author": "Overleaf (https://www.overleaf.com)", "author": "Overleaf (https://www.overleaf.com)",
@ -38,7 +38,7 @@
"devDependencies": { "devDependencies": {
"@types/chai": "^4.3.0", "@types/chai": "^4.3.0",
"@types/node": "^14.18.1", "@types/node": "^14.18.1",
"chai": "^4.3.4", "chai": "^4.3.6",
"jsdoc-to-markdown": "^7.1.0", "jsdoc-to-markdown": "^7.1.0",
"markdown-toc": "^1.2.0", "markdown-toc": "^1.2.0",
"mocha": "^9.1.3", "mocha": "^9.1.3",

View file

@ -4,6 +4,7 @@ object-persistor
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -6,10 +6,10 @@
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run test:unit", "test": "npm run lint && npm run format && npm run test:unit",
"test:unit": "mocha", "test:unit": "mocha",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test:ci": "npm run test:unit" "test:ci": "npm run test:unit"
}, },
"repository": { "repository": {
@ -19,7 +19,7 @@
"author": "Overleaf (https://www.overleaf.com/)", "author": "Overleaf (https://www.overleaf.com/)",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"dependencies": { "dependencies": {
"@google-cloud/storage": "^5.1.2", "@google-cloud/storage": "~5.1.2",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"aws-sdk": "^2.718.0", "aws-sdk": "^2.718.0",
"fast-crc32c": "^2.0.0", "fast-crc32c": "^2.0.0",
@ -30,12 +30,12 @@
"tiny-async-pool": "^1.1.0" "tiny-async-pool": "^1.1.0"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.0.1", "mocha": "^8.4.0",
"mongodb": "^3.5.9", "mongodb": "^3.5.9",
"sandboxed-module": "^2.0.4", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.2", "sinon": "^9.2.4",
"sinon-chai": "^3.5.0" "sinon-chai": "^3.7.0"
} }
} }

View file

@ -4,6 +4,7 @@ redis-wrapper
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

File diff suppressed because it is too large Load diff

View file

@ -11,10 +11,10 @@
"repository": "github:overleaf/redis-wrapper", "repository": "github:overleaf/redis-wrapper",
"license": "ISC", "license": "ISC",
"scripts": { "scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test": "mocha --recursive test/unit/src/", "test": "mocha --recursive test/unit/src/",
"test:ci": "npm run test" "test:ci": "npm run test"
}, },
@ -26,9 +26,9 @@
}, },
"devDependencies": { "devDependencies": {
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"chai": "^4.3.4", "chai": "^4.3.6",
"@overleaf/logger": "^2.3.0", "@overleaf/logger": "^2.3.0",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "^2.0.4", "sandboxed-module": "^2.0.4",
"sinon": "^9.2.4" "sinon": "^9.2.4"
} }

View file

@ -1,58 +1,41 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
let defaults, possibleConfigFiles, settingsExist
const fs = require('fs') const fs = require('fs')
const path = require('path') const Path = require('path')
const env = (process.env.NODE_ENV || 'development').toLowerCase()
const { merge } = require('./merge') const { merge } = require('./merge')
const defaultSettingsPath = path.join( const CWD = process.cwd()
__dirname, const NODE_ENV = (process.env.NODE_ENV || 'development').toLowerCase()
'../../../config/settings.defaults' const SHARELATEX_CONFIG = process.env.SHARELATEX_CONFIG
)
if (fs.existsSync(`${defaultSettingsPath}.js`)) { let settings
console.log(`Using default settings from ${defaultSettingsPath}.js`) let settingsExist = false
defaults = require(`${defaultSettingsPath}.js`) const defaultsPath = pathIfExists(Path.join(CWD, 'config/settings.defaults.js'))
if (defaultsPath) {
console.log(`Using default settings from ${defaultsPath}`)
settings = require(defaultsPath)
settingsExist = true settingsExist = true
} else if (fs.existsSync(`${defaultSettingsPath}.coffee`)) {
// TODO: remove this in the next major version
throw new Error(
`CoffeeScript settings file ${defaultSettingsPath}.coffee is no longer supported, please convert to JavaScript`
)
} else { } else {
defaults = {} settings = {}
settingsExist = false
} }
if (process.env.SHARELATEX_CONFIG) { const overridesPath =
possibleConfigFiles = [process.env.SHARELATEX_CONFIG] pathIfExists(SHARELATEX_CONFIG) ||
} else { pathIfExists(Path.join(CWD, `config/settings.${NODE_ENV}.js`))
possibleConfigFiles = [ if (overridesPath) {
path.join(process.cwd(), `config/settings.${env}.js`), console.log(`Using settings from ${overridesPath}`)
path.join(__dirname, `../../../config/settings.${env}.js`), settings = merge(require(overridesPath), settings)
// TODO: remove these in the next major version
path.join(process.cwd(), `config/settings.${env}.coffee`),
path.join(__dirname, `../../../config/settings.${env}.coffee`),
]
}
for (const file of possibleConfigFiles) {
if (fs.existsSync(file)) {
// TODO: remove this in the next major version
if (file.endsWith('.coffee')) {
throw new Error(
`CoffeeScript settings file ${file} is no longer supported, please convert to JavaScript`
)
}
console.log('Using settings from ' + file)
module.exports = merge(require(file), defaults)
settingsExist = true settingsExist = true
break
}
} }
if (!settingsExist) { if (!settingsExist) {
console.warn("No settings or defaults found. I'm flying blind.") console.warn("No settings or defaults found. I'm flying blind.")
} }
module.exports = defaults module.exports = settings
function pathIfExists(path) {
if (path && fs.existsSync(path)) {
return path
}
return null
}

View file

@ -4,6 +4,7 @@ settings
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--is-library=True --is-library=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

View file

@ -1,5 +0,0 @@
{
"name": "@overleaf/settings",
"version": "2.1.1",
"lockfileVersion": 1
}

View file

@ -1,13 +1,13 @@
{ {
"name": "@overleaf/settings", "name": "@overleaf/settings",
"description": "A centralised settings system for Overleaf", "description": "A centralised settings system for Overleaf",
"version": "2.1.1", "version": "3.0.0",
"repository": "overleaf/settings-module", "repository": "overleaf/settings-module",
"scripts": { "scripts": {
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "../../node_modules/.bin/eslint --fix .", "lint:fix": "eslint --fix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test": "echo noop", "test": "echo noop",
"test:ci": "echo noop" "test:ci": "echo noop"
} }

80763
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,5 +17,30 @@
"format:fix": "prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix ." "lint:fix": "eslint --fix ."
} },
"workspaces": [
"libraries/*",
"services/analytics",
"services/chat",
"services/clsi",
"services/clsi-perf",
"services/contacts",
"services/docstore",
"services/document-updater",
"services/filestore",
"services/github-sync",
"services/k8s-debugger",
"services/notifications",
"services/project-archiver",
"services/project-history",
"services/real-time",
"services/references",
"services/spelling",
"services/templates",
"services/third-party-datastore",
"services/third-party-references",
"services/tpdsworker",
"services/track-changes",
"services/web"
]
} }

View file

@ -1,4 +1,3 @@
.DS_Store .DS_Store
.git/ .git/
libraries/
services/git-bridge services/git-bridge

View file

@ -11,6 +11,8 @@ WORKDIR /overleaf
# ------------------------- # -------------------------
ADD server-ce/genScript.js /overleaf/genScript.js ADD server-ce/genScript.js /overleaf/genScript.js
ADD server-ce/services.js /overleaf/services.js ADD server-ce/services.js /overleaf/services.js
ADD package.json package-lock.json /overleaf/
ADD libraries/ /overleaf/libraries/
ADD services/ /overleaf/services/ ADD services/ /overleaf/services/
# Store the revision # Store the revision
@ -18,6 +20,10 @@ ADD services/ /overleaf/services/
ARG MONOREPO_REVISION ARG MONOREPO_REVISION
RUN echo "monorepo-server-ce,$MONOREPO_REVISION" > /var/www/revisions.txt RUN echo "monorepo-server-ce,$MONOREPO_REVISION" > /var/www/revisions.txt
# Upgrade npm for workspaces support
# ----------------------------------
RUN npm install -g npm@7.24.2
# Install npm dependencies # Install npm dependencies
# ------------------------ # ------------------------
RUN node genScript install | bash RUN node genScript install | bash

View file

@ -5,19 +5,8 @@ console.log('set -ex')
switch (process.argv.pop()) { switch (process.argv.pop()) {
case 'install': case 'install':
for (const service of services) {
console.log('pushd', `services/${service.name}`)
switch (service.name) {
case 'web':
console.log('npm ci') console.log('npm ci')
break break
default:
// TODO(das7pad): revert back to npm ci --only=production (https://github.com/overleaf/issues/issues/4544)
console.log('npm ci')
}
console.log('popd')
}
break
case 'compile': case 'compile':
for (const service of services) { for (const service of services) {
console.log('pushd', `services/${service.name}`) console.log('pushd', `services/${service.name}`)

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/chat WORKDIR /overleaf/services/chat
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/chat/package*.json /overleaf/services/chat/ COPY package.json package-lock.json /overleaf/
COPY services/chat/package.json /overleaf/services/chat/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/chat /overleaf/services/chat COPY services/chat/ /overleaf/services/chat/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ chat
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/chat - .:/overleaf/services/chat
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/chat working_dir: /overleaf/services/chat
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/chat - .:/overleaf/services/chat
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/chat working_dir: /overleaf/services/chat
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "chat-sharelatex", "name": "@overleaf/chat",
"version": "0.1.4", "description": "The backend API that powers Overleaf chat",
"description": "The backend API that powers ShareLaTeX chat", "private": true,
"repository": { "main": "app.js",
"type": "git",
"url": "https://github.com/sharelatex/chat-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
@ -13,15 +10,15 @@
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^3.2.0", "async": "^3.2.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"express": "4.17.1", "express": "4.17.1",
@ -30,13 +27,13 @@
"devDependencies": { "devDependencies": {
"acorn": "^7.1.1", "acorn": "^7.1.1",
"ajv": "^6.12.0", "ajv": "^6.12.0",
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"nodemon": "^2.0.2", "nodemon": "^2.0.2",
"request": "^2.88.2", "request": "^2.88.2",
"sandboxed-module": "^2.0.3", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.0", "sinon": "^9.2.4",
"timekeeper": "^2.2.0" "timekeeper": "^2.2.0"
} }
} }

View file

@ -2,7 +2,7 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/clsi WORKDIR /overleaf/services/clsi
COPY services/clsi/install_deps.sh /overleaf/services/clsi/ COPY services/clsi/install_deps.sh /overleaf/services/clsi/
@ -10,13 +10,19 @@ RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
COPY services/clsi/entrypoint.sh / COPY services/clsi/entrypoint.sh /
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/clsi/package*.json /overleaf/services/clsi/ COPY package.json package-lock.json /overleaf/
COPY services/clsi/package.json /overleaf/services/clsi/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/clsi /overleaf/services/clsi COPY services/clsi/ /overleaf/services/clsi/
FROM app FROM app
RUN mkdir -p cache compiles output \ RUN mkdir -p cache compiles output \

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -5,6 +5,7 @@ clsi
--env-add=ENABLE_PDF_CACHING="true",PDF_CACHING_ENABLE_WORKER_POOL="true" --env-add=ENABLE_PDF_CACHING="true",PDF_CACHING_ENABLE_WORKER_POOL="true"
--env-pass-through=TEXLIVE_IMAGE --env-pass-through=TEXLIVE_IMAGE
--has-custom-cloudbuild=True --has-custom-cloudbuild=True
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -12,6 +12,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/clsi - .:/overleaf/services/clsi
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/clsi working_dir: /overleaf/services/clsi
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -26,6 +28,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/clsi - .:/overleaf/services/clsi
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/clsi working_dir: /overleaf/services/clsi
extends: extends:
file: docker-compose-config.yml file: docker-compose-config.yml

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "node-clsi", "name": "@overleaf/clsi",
"description": "A Node.js implementation of the CLSI LaTeX web-API", "description": "A Node.js implementation of the CLSI LaTeX web-API",
"version": "0.1.4", "private": true,
"repository": { "main": "app.js",
"type": "git",
"url": "https://github.com/sharelatex/clsi-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -13,16 +10,15 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"author": "James Allen <james@sharelatex.com>",
"dependencies": { "dependencies": {
"@overleaf/metrics": "^3.5.1", "@overleaf/metrics": "^3.5.1",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "3.2.0", "async": "3.2.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -34,17 +30,17 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"logger-sharelatex": "^2.2.0", "logger-sharelatex": "^2.2.0",
"p-limit": "^3.1.0", "p-limit": "^3.1.0",
"pdfjs-dist": "^2.7.570", "pdfjs-dist": "~2.7.570",
"request": "^2.88.2", "request": "^2.88.2",
"send": "^0.17.1", "send": "^0.17.1",
"workerpool": "^6.1.5" "workerpool": "^6.1.5"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"nodemon": "^2.0.7", "nodemon": "^2.0.7",
"sandboxed-module": "^2.0.3", "sandboxed-module": "^2.0.4",
"sinon": "~9.0.1", "sinon": "~9.0.1",
"sinon-chai": "^3.7.0", "sinon-chai": "^3.7.0",
"timekeeper": "2.2.0" "timekeeper": "2.2.0"

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/contacts WORKDIR /overleaf/services/contacts
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/contacts/package*.json /overleaf/services/contacts/ COPY package.json package-lock.json /overleaf/
COPY services/contacts/package.json /overleaf/services/contacts/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/contacts /overleaf/services/contacts COPY services/contacts/ /overleaf/services/contacts/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ contacts
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/contacts - .:/overleaf/services/contacts
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/contacts working_dir: /overleaf/services/contacts
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/contacts - .:/overleaf/services/contacts
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/contacts working_dir: /overleaf/services/contacts
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,8 @@
{ {
"name": "contacts-sharelatex", "name": "@overleaf/contacts",
"version": "0.1.0",
"description": "An API for tracking contacts of a user", "description": "An API for tracking contacts of a user",
"author": "ShareLaTeX <team@sharelatex.com>", "private": true,
"repository": { "main": "app.js",
"type": "git",
"url": "https://github.com/sharelatex/contacts-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -14,15 +10,15 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^2.6.3", "async": "^2.6.3",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -32,9 +28,9 @@
"underscore": "~1.13.1" "underscore": "~1.13.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "~2.0.3", "sandboxed-module": "~2.0.3",
"sinon": "~9.0.1", "sinon": "~9.0.1",
"timekeeper": "2.2.0" "timekeeper": "2.2.0"

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/docstore WORKDIR /overleaf/services/docstore
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/docstore/package*.json /overleaf/services/docstore/ COPY package.json package-lock.json /overleaf/
COPY services/docstore/package.json /overleaf/services/docstore/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/docstore /overleaf/services/docstore COPY services/docstore/ /overleaf/services/docstore/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ docstore
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/docstore - .:/overleaf/services/docstore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/docstore working_dir: /overleaf/services/docstore
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/docstore - .:/overleaf/services/docstore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/docstore working_dir: /overleaf/services/docstore
extends: extends:
file: docker-compose-config.yml file: docker-compose-config.yml

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,8 @@
{ {
"name": "docstore-sharelatex", "name": "@overleaf/docstore",
"version": "0.1.2",
"description": "A CRUD API for handling text documents in projects", "description": "A CRUD API for handling text documents in projects",
"author": "ShareLaTeX <team@sharelatex>", "private": true,
"repository": { "main": "app.js",
"type": "git",
"url": "https://github.com/sharelatex/docstore-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -14,17 +10,17 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/object-persistor": "^1.0.1", "@overleaf/object-persistor": "^1.0.1",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^2.6.3", "async": "^2.6.3",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -38,14 +34,11 @@
}, },
"devDependencies": { "devDependencies": {
"@google-cloud/storage": "^5.1.2", "@google-cloud/storage": "^5.1.2",
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "~2.0.4", "sandboxed-module": "~2.0.4",
"sinon": "~9.0.2", "sinon": "~9.0.2",
"sinon-chai": "^3.5.0" "sinon-chai": "^3.7.0"
},
"engines": {
"node": "~6.14.1"
} }
} }

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/document-updater WORKDIR /overleaf/services/document-updater
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/document-updater/package*.json /overleaf/services/document-updater/ COPY package.json package-lock.json /overleaf/
COPY services/document-updater/package.json /overleaf/services/document-updater/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/document-updater /overleaf/services/document-updater COPY services/document-updater/ /overleaf/services/document-updater/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ document-updater
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/document-updater - .:/overleaf/services/document-updater
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/document-updater working_dir: /overleaf/services/document-updater
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/document-updater - .:/overleaf/services/document-updater
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/document-updater working_dir: /overleaf/services/document-updater
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "document-updater-sharelatex", "name": "@overleaf/document-updater",
"version": "0.1.4",
"description": "An API for applying incoming updates to documents in real-time", "description": "An API for applying incoming updates to documents in real-time",
"repository": { "private": true,
"type": "git", "main": "app.js",
"url": "https://github.com/sharelatex/document-updater-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -13,17 +10,17 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.1", "@overleaf/redis-wrapper": "^2.0.1",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^2.5.0", "async": "^2.5.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -35,12 +32,12 @@
"requestretry": "^4.1.2" "requestretry": "^4.1.2"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"cluster-key-slot": "^1.0.5", "cluster-key-slot": "^1.0.5",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "^2.0.4", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.2", "sinon": "^9.2.4",
"timekeeper": "^2.0.0" "timekeeper": "^2.0.0"
} }
} }

View file

@ -2,19 +2,25 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/filestore WORKDIR /overleaf/services/filestore
COPY services/filestore/install_deps.sh /overleaf/services/filestore/ COPY services/filestore/install_deps.sh /overleaf/services/filestore/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/filestore/package*.json /overleaf/services/filestore/ COPY package.json package-lock.json /overleaf/
COPY services/filestore/package.json /overleaf/services/filestore/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/filestore /overleaf/services/filestore COPY services/filestore/ /overleaf/services/filestore/
FROM app FROM app
RUN mkdir -p uploads user_files template_files \ RUN mkdir -p uploads user_files template_files \

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -4,6 +4,7 @@ filestore
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_BUCKET_NAME=fake_user_files,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake_template_files,AWS_S3_PUBLIC_FILES_BUCKET_NAME=fake_public_files,GCS_USER_FILES_BUCKET_NAME=fake_userfiles,GCS_TEMPLATE_FILES_BUCKET_NAME=fake_templatefiles,GCS_PUBLIC_FILES_BUCKET_NAME=fake_publicfiles --env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_BUCKET_NAME=fake_user_files,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake_template_files,AWS_S3_PUBLIC_FILES_BUCKET_NAME=fake_public_files,GCS_USER_FILES_BUCKET_NAME=fake_userfiles,GCS_TEMPLATE_FILES_BUCKET_NAME=fake_templatefiles,GCS_PUBLIC_FILES_BUCKET_NAME=fake_publicfiles
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -12,6 +12,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/filestore - .:/overleaf/services/filestore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/filestore working_dir: /overleaf/services/filestore
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -27,6 +29,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/filestore - .:/overleaf/services/filestore
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/filestore working_dir: /overleaf/services/filestore
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "filestore-sharelatex", "name": "@overleaf/filestore",
"version": "0.1.4",
"description": "An API for CRUD operations on binary files stored in S3", "description": "An API for CRUD operations on binary files stored in S3",
"repository": { "private": true,
"type": "git", "main": "app.js",
"url": "https://github.com/sharelatex/filestore-sharelatex.git"
},
"scripts": { "scripts": {
"test:acceptance:run": "mocha --recursive --reporter spec --timeout 15000 $@ test/acceptance/js", "test:acceptance:run": "mocha --recursive --reporter spec --timeout 15000 $@ test/acceptance/js",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
@ -13,19 +10,19 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.0.0", "@overleaf/o-error": "^3.0.0",
"@overleaf/object-persistor": "^1.0.1", "@overleaf/object-persistor": "^1.0.1",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
"express": "^4.17.1", "express": "^4.17.1",
@ -42,14 +39,14 @@
"devDependencies": { "devDependencies": {
"@google-cloud/storage": "^5.1.2", "@google-cloud/storage": "^5.1.2",
"aws-sdk": "^2.718.0", "aws-sdk": "^2.718.0",
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"disrequire": "^1.1.0", "disrequire": "^1.1.0",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"mongodb": "^3.5.9", "mongodb": "^3.5.9",
"sandboxed-module": "2.0.4", "sandboxed-module": "2.0.4",
"sinon": "9.0.2", "sinon": "9.0.2",
"sinon-chai": "^3.5.0", "sinon-chai": "^3.7.0",
"streamifier": "^0.1.1", "streamifier": "^0.1.1",
"timekeeper": "^2.2.0" "timekeeper": "^2.2.0"
} }

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/notifications WORKDIR /overleaf/services/notifications
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/notifications/package*.json /overleaf/services/notifications/ COPY package.json package-lock.json /overleaf/
COPY services/notifications/package.json /overleaf/services/notifications/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/notifications /overleaf/services/notifications COPY services/notifications/ /overleaf/services/notifications/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ notifications
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/notifications - .:/overleaf/services/notifications
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/notifications working_dir: /overleaf/services/notifications
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/notifications - .:/overleaf/services/notifications
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/notifications working_dir: /overleaf/services/notifications
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{ {
"name": "notifications-sharelatex", "name": "@overleaf/notifications",
"version": "0.0.1",
"description": "An API to handle user notifications", "description": "An API to handle user notifications",
"private": true,
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
@ -10,17 +10,17 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^2.6.3", "async": "^2.6.3",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -31,10 +31,10 @@
"underscore": "1.13.1" "underscore": "1.13.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "^2.0.3", "sandboxed-module": "^2.0.4",
"sinon": "^9.0.1" "sinon": "^9.2.4"
} }
} }

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/real-time WORKDIR /overleaf/services/real-time
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/real-time/package*.json /overleaf/services/real-time/ COPY package.json package-lock.json /overleaf/
COPY services/real-time/package.json /overleaf/services/real-time/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/real-time /overleaf/services/real-time COPY services/real-time/ /overleaf/services/real-time/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ real-time
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/real-time - .:/overleaf/services/real-time
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/real-time working_dir: /overleaf/services/real-time
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/real-time - .:/overleaf/services/real-time
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/real-time working_dir: /overleaf/services/real-time
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,8 @@
{ {
"name": "real-time-sharelatex", "name": "@overleaf/real-time",
"version": "0.1.4", "description": "The socket.io layer of Overleaf for real-time editor interactions",
"description": "The socket.io layer of ShareLaTeX for real-time editor interactions",
"author": "ShareLaTeX <team@sharelatex.com>",
"license": "AGPL-3.0-only",
"private": true, "private": true,
"repository": { "main": "app.js",
"type": "git",
"url": "https://github.com/sharelatex/real-time-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -16,10 +10,10 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@hapi/joi": "^17.1.1", "@hapi/joi": "^17.1.1",
@ -27,7 +21,7 @@
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0", "@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^0.9.0", "async": "^0.9.0",
"base64id": "0.1.0", "base64id": "0.1.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
@ -43,10 +37,10 @@
"underscore": "1.13.1" "underscore": "1.13.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"cookie-signature": "^1.1.0", "cookie-signature": "^1.1.0",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "~0.3.0", "sandboxed-module": "~0.3.0",
"sinon": "^9.2.4", "sinon": "^9.2.4",
"timekeeper": "0.0.4", "timekeeper": "0.0.4",

View file

@ -2,19 +2,25 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/spelling WORKDIR /overleaf/services/spelling
COPY services/spelling/install_deps.sh /overleaf/services/spelling/ COPY services/spelling/install_deps.sh /overleaf/services/spelling/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/spelling/package*.json /overleaf/services/spelling/ COPY package.json package-lock.json /overleaf/
COPY services/spelling/package.json /overleaf/services/spelling/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/spelling /overleaf/services/spelling COPY services/spelling/ /overleaf/services/spelling/
FROM app FROM app
RUN mkdir -p cache \ RUN mkdir -p cache \

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -4,6 +4,7 @@ spelling
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add= --env-add=
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=False --public-repo=False
--script-version=4.0.0 --script-version=4.1.0

View file

@ -12,6 +12,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/spelling - .:/overleaf/services/spelling
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/spelling working_dir: /overleaf/services/spelling
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -27,6 +29,8 @@ services:
target: base target: base
volumes: volumes:
- .:/overleaf/services/spelling - .:/overleaf/services/spelling
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/spelling working_dir: /overleaf/services/spelling
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "spelling-sharelatex", "name": "@overleaf/spelling",
"author": "ShareLaTeX <team@sharelatex.com>",
"description": "A JSON API wrapper around aspell", "description": "A JSON API wrapper around aspell",
"repository": { "private": true,
"type": "git", "main": "app.js",
"url": "https://github.com/sharelatex/spelling-sharelatex.git"
},
"scripts": { "scripts": {
"compile:app": "([ -e app/coffee ] && coffee -m $COFFEE_OPTIONS -o app/js -c app/coffee || echo 'No CoffeeScript folder to compile') && ( [ -e app.coffee ] && coffee -m $COFFEE_OPTIONS -c app.coffee || echo 'No CoffeeScript app to compile')", "compile:app": "([ -e app/coffee ] && coffee -m $COFFEE_OPTIONS -o app/js -c app/coffee || echo 'No CoffeeScript folder to compile') && ( [ -e app.coffee ] && coffee -m $COFFEE_OPTIONS -c app.coffee || echo 'No CoffeeScript app to compile')",
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
@ -18,17 +15,17 @@
"compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests && npm run compile:smoke_tests", "compile:all": "npm run compile:app && npm run compile:unit_tests && npm run compile:acceptance_tests && npm run compile:smoke_tests",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"compile:smoke_tests": "[ ! -e test/smoke/coffee ] && echo 'No smoke tests to compile' || coffee -o test/smoke/js -c test/smoke/coffee", "compile:smoke_tests": "[ ! -e test/smoke/coffee ] && echo 'No smoke tests to compile' || coffee -o test/smoke/js -c test/smoke/coffee",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"version": "0.1.4", "version": "0.1.4",
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"async": "^2.6.3", "async": "^2.6.3",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
@ -39,10 +36,10 @@
"underscore": "1.13.1" "underscore": "1.13.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "2.0.4", "sandboxed-module": "2.0.4",
"sinon": "^9.0.1" "sinon": "^9.2.4"
} }
} }

View file

@ -2,17 +2,23 @@
# Instead run bin/update_build_scripts from # Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment # https://github.com/sharelatex/sharelatex-dev-environment
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/track-changes WORKDIR /overleaf/services/track-changes
# Google Cloud Storage needs a writable $HOME/.config for resumable uploads
# (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
FROM base as app FROM base as app
COPY services/track-changes/package*.json /overleaf/services/track-changes/ COPY package.json package-lock.json /overleaf/
COPY services/track-changes/package.json /overleaf/services/track-changes/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
COPY services/track-changes /overleaf/services/track-changes COPY services/track-changes/ /overleaf/services/track-changes/
FROM app FROM app
USER node USER node

View file

@ -30,7 +30,7 @@ HERE=$(shell pwd)
MONOREPO=$(shell cd ../../ && pwd) MONOREPO=$(shell cd ../../ && pwd)
# Run the linting commands in the scope of the monorepo. # Run the linting commands in the scope of the monorepo.
# Eslint and prettier (plus some configs) are on the root. # Eslint and prettier (plus some configs) are on the root.
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:14.18.3 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
format: format:
$(RUN_LINTING) format $(RUN_LINTING) format

View file

@ -3,6 +3,7 @@ track-changes
--docker-repos=gcr.io/overleaf-ops --docker-repos=gcr.io/overleaf-ops
--env-add=AWS_BUCKET=bucket --env-add=AWS_BUCKET=bucket
--env-pass-through= --env-pass-through=
--node-image=gcr.io/overleaf-ops/node
--node-version=14.18.3 --node-version=14.18.3
--public-repo=True --public-repo=True
--script-version=4.0.0 --script-version=4.1.0

View file

@ -6,9 +6,11 @@ version: "2.3"
services: services:
test_unit: test_unit:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/track-changes - .:/overleaf/services/track-changes
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/track-changes working_dir: /overleaf/services/track-changes
environment: environment:
MOCHA_GREP: ${MOCHA_GREP} MOCHA_GREP: ${MOCHA_GREP}
@ -18,9 +20,11 @@ services:
user: node user: node
test_acceptance: test_acceptance:
image: node:14.18.3 image: gcr.io/overleaf-ops/node:14.18.3
volumes: volumes:
- .:/overleaf/services/track-changes - .:/overleaf/services/track-changes
- ../../node_modules:/overleaf/node_modules
- ../../libraries:/overleaf/libraries
working_dir: /overleaf/services/track-changes working_dir: /overleaf/services/track-changes
environment: environment:
ELASTIC_SEARCH_DSN: es:9200 ELASTIC_SEARCH_DSN: es:9200

View file

@ -11,7 +11,8 @@
"watch": [ "watch": [
"app/js/", "app/js/",
"app.js", "app.js",
"config/" "config/",
"../../libraries/"
], ],
"ext": "js" "ext": "js"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,8 @@
{ {
"name": "history-sharelatex", "name": "@overleaf/track-changes",
"version": "0.1.4",
"description": "An API for saving and compressing individual document updates into a browsable history", "description": "An API for saving and compressing individual document updates into a browsable history",
"repository": { "private": true,
"type": "git", "main": "app.js",
"url": "https://github.com/sharelatex/track-changes-sharelatex.git"
},
"scripts": { "scripts": {
"start": "node $NODE_APP_OPTIONS app.js", "start": "node $NODE_APP_OPTIONS app.js",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
@ -13,18 +10,17 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "nodemon --config nodemon.json", "nodemon": "nodemon --config nodemon.json",
"lint": "../../node_modules/.bin/eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "../../node_modules/.bin/prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different $PWD/'**/*.js'",
"format:fix": "../../node_modules/.bin/prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'",
"lint:fix": "../../node_modules/.bin/eslint --fix ." "lint:fix": "eslint --fix ."
}, },
"dependencies": { "dependencies": {
"@overleaf/logger": "^3.1.0", "@overleaf/logger": "^3.1.0",
"@overleaf/metrics": "^4.0.0", "@overleaf/metrics": "^4.0.0",
"@overleaf/o-error": "^3.4.0", "@overleaf/o-error": "^3.4.0",
"@overleaf/redis-wrapper": "^2.0.0", "@overleaf/redis-wrapper": "^2.0.0",
"@overleaf/settings": "^2.1.1", "@overleaf/settings": "^3.0.0",
"JSONStream": "^1.3.5",
"async": "^2.6.3", "async": "^2.6.3",
"aws-sdk": "^2.643.0", "aws-sdk": "^2.643.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
@ -33,6 +29,7 @@
"byline": "^5.0.0", "byline": "^5.0.0",
"express": "4.17.1", "express": "4.17.1",
"heap": "^0.2.6", "heap": "^0.2.6",
"JSONStream": "^1.3.5",
"line-reader": "^0.4.0", "line-reader": "^0.4.0",
"mongo-uri": "^0.1.2", "mongo-uri": "^0.1.2",
"mongodb": "^3.6.0", "mongodb": "^3.6.0",
@ -44,11 +41,11 @@
"yazl": "^2.5.1" "yazl": "^2.5.1"
}, },
"devDependencies": { "devDependencies": {
"chai": "^4.2.0", "chai": "^4.3.6",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"cli": "^1.0.1", "cli": "^1.0.1",
"memorystream": "0.3.1", "memorystream": "0.3.1",
"mocha": "^8.3.2", "mocha": "^8.4.0",
"sandboxed-module": "~2.0.3", "sandboxed-module": "~2.0.3",
"sinon": "~9.0.1", "sinon": "~9.0.1",
"timekeeper": "2.2.0" "timekeeper": "2.2.0"

View file

@ -113,7 +113,6 @@
"plugin:react-hooks/recommended", "plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended", "plugin:jsx-a11y/recommended",
"standard-jsx", "standard-jsx",
"standard-react",
"prettier" "prettier"
], ],
"globals": { "globals": {
@ -129,6 +128,20 @@
"ExposedSettings": true "ExposedSettings": true
}, },
"rules": { "rules": {
// TODO: remove once https://github.com/standard/eslint-config-standard-react/issues/68 (support eslint@8) is fixed.
// START: inline standard-react rules
// "react/jsx-no-bind": ["error", {
// "allowArrowFunctions": true,
// "allowBind": false,
// "ignoreRefs": true
// },],
"react/no-did-update-set-state": "error",
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/prop-types": "error",
// "react/react-in-jsx-scope": "error",
// END: inline standard-react rules
"react/jsx-no-target-blank": ["error", { "react/jsx-no-target-blank": ["error", {
"allowReferrer": true "allowReferrer": true
}], }],

View file

@ -1,21 +1,24 @@
# the base image is suitable for running web with /overleaf/services/web bind # the base image is suitable for running web with /overleaf/services/web bind
# mounted # mounted
FROM node:14.18.3 as base FROM gcr.io/overleaf-ops/node:14.18.3 as base
WORKDIR /overleaf/services/web WORKDIR /overleaf/services/web
# install_deps changes app files and installs npm packages # install_deps changes app files and installs npm packages
# as such it has to run at a later stage # as such it has to run at a later stage
RUN mkdir /overleaf/services/web/node_modules \ # Google Cloud Storage needs a writable $HOME/.config for resumable uploads
&& chown node:node /overleaf/services/web/node_modules # (see https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream)
RUN mkdir /home/node/.config && chown node:node /home/node/.config
# the deps image is used for caching npm ci # the deps image is used for caching npm ci
FROM base as deps FROM base as deps
COPY services/web/package.json services/web/package-lock.json /overleaf/services/web/ COPY package.json package-lock.json /overleaf/
COPY services/web/package.json /overleaf/services/web/
COPY libraries/ /overleaf/libraries/
RUN npm ci --quiet RUN cd /overleaf && npm ci --quiet
# the dev is suitable for running tests # the dev is suitable for running tests

View file

@ -1,4 +1,4 @@
FROM node:14.18.3 FROM gcr.io/overleaf-ops/node:14.18.3
# Install Google Chrome # Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

Some files were not shown because too many files have changed in this diff Show more