Centralize prettier configuration to root level (#30501)

* Merge all .prettierignore files into top-level config

* Merge all .prettierrc files into top-level config

* Replace service-specific glob patterns in package.json format scripts with `prettier .`

* Add template files with Jinja2, Go template, envsubst, and Handlebars syntax to .prettierignore

* Ignore GitHub templates

* Ignore PUG templates to format them separately with `format:pug`

* Encourage double quotes for YAML, YML files

* Move prettier for PUG source format script to the root

* Move prettier for styles source format script to the root

* Remove prettier for jenkins files from web

* Remove prettier source format script from all services

* Make .prettierrc more readable

* Update format scripts by file type

* Organise `.prettierignore`

* Add `--cache` flag to prettier scripts for faster runs

* Format all files with prettier

* Format all or format services

* Remove `format`/`format:fix` scripts from services since now it runs from root `package.json`

* Avoid conlficts with yamllint configuration

* Remove `--cache` flag from prettier scripts

* Update all service Makefiles to use root-level prettier configuration

* Update all Jenkinsfile to use root-level prettier configuration

* Ignore auto-generated files by build_scripts

* Update package-lock.json

* Update root Makefile format targets

* Update SP Jenkinsfile format target

* Update E2E Makefile format script

* Udpate `format_js` to work in both local and CI env

* Add docker-mailtrap to .prettierignore

docker-mailtrap is a third-party git-ignored directory used for testing

* Added Docker env detection to prevent nested Docker spawning

* Ignore handlebars templates

* Add cryptographic files and test output to `.prettierignore`

* Add terraform modules to `.gitignore`

* Remove prettier-plugin-groovy

* Use npx directly instead of Docker for local formatting for faster formatting

* Auto-generate Makefiles

* Revert "Remove prettier-plugin-groovy"

This reverts commit 194a33589a2e1e4d2225d10c67e9f025e4222025.

* Mount monorepo root in RUN_LINT_FORMAT for prettier config access

* Prettier ignores all `node_modules` by default regardless of location

* Show only changed files in format output

* Ignore LICENSE files

* Enable prettier on rendered build_scripts outputs

* Ignoring all the template folders by prettier

* Remove the public/minjs entry since it does not exist

* Remove all non-existent paths

* Sync `.prettierignore` with ignored files by `.gitignore` and `.dockerignore` files

* Revert "Auto-generate Makefiles"

This reverts commit c0233e490de1bc95fe437219d65e0b66e0331ec9.

* Revert "Use npx directly instead of Docker for local formatting for faster formatting"

This reverts commit 1d2b2cf1a6c6974c76885852a90dd55e84167e41.

* Ignore dashboard JSON files

* Ignore files generated by bin/update_build_scripts

* Remove unsupported file types from `.prettierignore`

* Ignore test fixture generated files

* Ignore README file types by prettier

* Ignore generate snapshots by prettier

* Allow to format generated bin/update_build_scripts by prettier

* Ensure build script outputs prettier-compatible tsconfig.json

* Fix build script output to match prettier formatting
- Fix Jinja2 whitespace in docker-compose templates
- Change YAML quotes from single to double

* Don't read cryptographic files by prettier

* Ignore google verification files by prettier

* Revert npx prettier formatting

* Ignore domain verification files

* Show only changed files in format output

* Make `.github` prettier

* Allow all files to be formatted in jobs by prettier

* Allow server-ce/server-pro files to be formatted by prettier

* Ignore more folders in clsi, filestory, git-bridge by prettier

* Update build script with `RUN_LINTING_CI_MONOREPO`

* Ignore docker-mailtrap and downloads in server-ce by prettier

* Restore prettier configs and prettierignore for V1 since it has its own prettier (an older version)

* Source format

GitOrigin-RevId: 637adc3cc422d1f20c86d6ebc8ec514d60758287
This commit is contained in:
Rebeka Dekany
2026-02-03 16:05:22 +01:00
committed by Copybot
parent 9b10da6eaf
commit a648015db8
141 changed files with 770 additions and 992 deletions
+11 -8
View File
@@ -4,7 +4,6 @@ about: Report a bug
title: '' title: ''
labels: type:bug labels: type:bug
assignees: '' assignees: ''
--- ---
<!-- <!--
@@ -18,11 +17,10 @@ Note: If you are using www.overleaf.com and have a problem,
--> -->
<!-- BUG REPORT TEMPLATE --> <!-- BUG REPORT TEMPLATE -->
## Steps to Reproduce ## Steps to Reproduce
<!-- Describe the steps leading up to when / where you found the bug. --> <!-- Describe the steps leading up to when / where you found the bug. -->
<!-- Screenshots may be helpful here. --> <!-- Screenshots may be helpful here. -->
@@ -31,23 +29,28 @@ Note: If you are using www.overleaf.com and have a problem,
3. 3.
## Expected Behaviour ## Expected Behaviour
<!-- What should have happened when you completed the steps above? --> <!-- What should have happened when you completed the steps above? -->
## Observed Behaviour ## Observed Behaviour
<!-- What actually happened when you completed the steps above? --> <!-- What actually happened when you completed the steps above? -->
<!-- Screenshots may be helpful here. --> <!-- Screenshots may be helpful here. -->
## Context ## Context
<!-- How has this issue affected you? What were you trying to accomplish? --> <!-- How has this issue affected you? What were you trying to accomplish? -->
## Technical Info ## Technical Info
<!-- Provide any technical details that may be applicable (or N/A if not applicable). --> <!-- Provide any technical details that may be applicable (or N/A if not applicable). -->
* URL: - URL:
* Browser Name and version: - Browser Name and version:
* Operating System and version (desktop or mobile): - Operating System and version (desktop or mobile):
* Signed in as: - Signed in as:
* Project and/or file: - Project and/or file:
## Analysis ## Analysis
<!--- Optionally, document investigation of / suggest a fix for the bug, e.g. 'comes from this line / commit' --> <!--- Optionally, document investigation of / suggest a fix for the bug, e.g. 'comes from this line / commit' -->
+2 -2
View File
@@ -1,10 +1,10 @@
## Description ## Description
<!-- Goal of the pull request --> <!-- Goal of the pull request -->
## Related issues / Pull Requests ## Related issues / Pull Requests
<!-- Fixes #xyz, Contributes to #xyz, Related to #xyz-->
<!-- Fixes #xyz, Contributes to #xyz, Related to #xyz-->
## Contributor Agreement ## Contributor Agreement
+5 -10
View File
@@ -1,11 +1,9 @@
Contributing to Overleaf # Contributing to Overleaf
==========================
Thank you for reading this! If you'd like to report a bug or join in the development Thank you for reading this! If you'd like to report a bug or join in the development
of Overleaf, then here are some notes on how to do that. of Overleaf, then here are some notes on how to do that.
Reporting bugs and opening issues ## Reporting bugs and opening issues
---------------------------------
If you'd like to report a bug or open an issue, please **[check if there is an existing issue](https://github.com/overleaf/overleaf/issues).** If you'd like to report a bug or open an issue, please **[check if there is an existing issue](https://github.com/overleaf/overleaf/issues).**
If there is then please add any more information that you have, or give it a 👍. If there is then please add any more information that you have, or give it a 👍.
@@ -16,8 +14,7 @@ If you can include a screenshot for front end issues that is very helpful.
**Note**: If you are using [www.overleaf.com](www.overleaf.com) and have a problem, or if you would like to request a new feature, please contact the Support team at support@overleaf.com. Raise an issue here only to report bugs in the Community Edition release of Overleaf. **Note**: If you are using [www.overleaf.com](www.overleaf.com) and have a problem, or if you would like to request a new feature, please contact the Support team at support@overleaf.com. Raise an issue here only to report bugs in the Community Edition release of Overleaf.
Pull Requests ## Pull Requests
-------------
See [our wiki](https://github.com/overleaf/overleaf/wiki) See [our wiki](https://github.com/overleaf/overleaf/wiki)
for how to manage the Overleaf development environment and for our developer guidelines. for how to manage the Overleaf development environment and for our developer guidelines.
@@ -28,13 +25,11 @@ to get your changes merged into Overleaf.
If you're looking for something to work on, have a look at the [open issues](https://github.com/overleaf/overleaf/issues). If you're looking for something to work on, have a look at the [open issues](https://github.com/overleaf/overleaf/issues).
Security ## Security
--------
Please see [our security policy](https://github.com/overleaf/overleaf/security/policy) if you would like to report a potential security vulnerability. Please see [our security policy](https://github.com/overleaf/overleaf/security/policy) if you would like to report a potential security vulnerability.
Contributor License Agreement ## Contributor License Agreement
-----------------------------
Before we can accept any contributions of code, we need you to agree to our Before we can accept any contributions of code, we need you to agree to our
[Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLSef79XH3mb7yIiMzZw-yALEegS-wyFetvjTiNBfZvf_IHD2KA/viewform?usp=sf_link). [Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLSef79XH3mb7yIiMzZw-yALEegS-wyFetvjTiNBfZvf_IHD2KA/viewform?usp=sf_link).
-1
View File
@@ -65,7 +65,6 @@ in which to run the Overleaf services. Baseimage uses the `runit` service
manager to manage services, and we add our init-scripts from the `server-ce/runit` manager to manage services, and we add our init-scripts from the `server-ce/runit`
folder. folder.
## Contributing ## Contributing
Please see the [CONTRIBUTING](CONTRIBUTING.md) file for information on contributing to the development of Overleaf. Please see the [CONTRIBUTING](CONTRIBUTING.md) file for information on contributing to the development of Overleaf.
+7 -6
View File
@@ -63,8 +63,8 @@ services:
dockerfile: services/filestore/Dockerfile dockerfile: services/filestore/Dockerfile
env_file: env_file:
- dev.env - dev.env
# environment: # environment:
# - ENABLE_CONVERSIONS=true # - ENABLE_CONVERSIONS=true
volumes: volumes:
- filestore-public-files:/overleaf/services/filestore/public_files - filestore-public-files:/overleaf/services/filestore/public_files
- filestore-template-files:/overleaf/services/filestore/template_files - filestore-template-files:/overleaf/services/filestore/template_files
@@ -75,7 +75,7 @@ services:
context: .. context: ..
dockerfile: services/history-v1/Dockerfile dockerfile: services/history-v1/Dockerfile
env_file: env_file:
- dev.env - dev.env
environment: environment:
OVERLEAF_EDITOR_ANALYTICS_BUCKET: "/buckets/analytics" OVERLEAF_EDITOR_ANALYTICS_BUCKET: "/buckets/analytics"
OVERLEAF_EDITOR_BLOBS_BUCKET: "/buckets/blobs" OVERLEAF_EDITOR_BLOBS_BUCKET: "/buckets/blobs"
@@ -84,7 +84,7 @@ services:
OVERLEAF_EDITOR_ZIPS_BUCKET: "/buckets/zips" OVERLEAF_EDITOR_ZIPS_BUCKET: "/buckets/zips"
PERSISTOR_BACKEND: fs PERSISTOR_BACKEND: fs
volumes: volumes:
- history-v1-buckets:/buckets - history-v1-buckets:/buckets
mongo: mongo:
image: mongo:6.0 image: mongo:6.0
@@ -114,7 +114,7 @@ services:
context: .. context: ..
dockerfile: services/project-history/Dockerfile dockerfile: services/project-history/Dockerfile
env_file: env_file:
- dev.env - dev.env
real-time: real-time:
build: build:
@@ -166,7 +166,8 @@ services:
context: .. context: ..
dockerfile: services/web/Dockerfile dockerfile: services/web/Dockerfile
target: webpack target: webpack
command: ["npx", "webpack", "serve", "--config", "webpack.config.dev-env.js"] command:
["npx", "webpack", "serve", "--config", "webpack.config.dev-env.js"]
ports: ports:
- "127.0.0.1:80:3808" - "127.0.0.1:80:3808"
volumes: volumes:
+21 -21
View File
@@ -1,23 +1,23 @@
version: '2.2' version: "2.2"
services: services:
sharelatex: sharelatex:
ports: ports:
- 30000:30000 - 30000:30000
- 30150:30150 - 30150:30150
- 30120:30120 - 30120:30120
- 30050:30050 - 30050:30050
- 30420:30420 - 30420:30420
- 30030:30030 - 30030:30030
- 30160:30160 - 30160:30160
- 30360:30360 - 30360:30360
- 30130:30130 - 30130:30130
- 30100:30100 - 30100:30100
- 30540:30540 - 30540:30540
- 30640:30640 - 30640:30640
- 40000:40000 - 40000:40000
# Server Pro # Server Pro
- 30070:30070 - 30070:30070
- 30400:30400 - 30400:30400
environment: environment:
DEBUG_NODE: 'true' DEBUG_NODE: "true"
+126 -128
View File
@@ -1,151 +1,149 @@
services: services:
sharelatex: sharelatex:
restart: always restart: always
# Server Pro users: # Server Pro users:
# image: quay.io/sharelatex/sharelatex-pro # image: quay.io/sharelatex/sharelatex-pro
image: sharelatex/sharelatex image: sharelatex/sharelatex
container_name: sharelatex container_name: sharelatex
depends_on: depends_on:
mongo: mongo:
condition: service_healthy condition: service_healthy
redis: redis:
condition: service_started condition: service_started
ports: ports:
- 80:80 - 80:80
stop_grace_period: 60s stop_grace_period: 60s
volumes: volumes:
- ~/sharelatex_data:/var/lib/overleaf - ~/sharelatex_data:/var/lib/overleaf
######################################################################## ########################################################################
#### Server Pro: Uncomment the following line to mount the docker #### #### Server Pro: Uncomment the following line to mount the docker ####
#### socket, required for Sibling Containers to work #### #### socket, required for Sibling Containers to work ####
######################################################################## ########################################################################
# - /var/run/docker.sock:/var/run/docker.sock # - /var/run/docker.sock:/var/run/docker.sock
environment: environment:
OVERLEAF_APP_NAME: Overleaf Community Edition
OVERLEAF_APP_NAME: Overleaf Community Edition OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex
OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex # Same property, unfortunately with different names in
# different locations
OVERLEAF_REDIS_HOST: redis
REDIS_HOST: redis
# Same property, unfortunately with different names in ENABLED_LINKED_FILE_TYPES: "project_file,project_output_file"
# different locations
OVERLEAF_REDIS_HOST: redis
REDIS_HOST: redis
ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file' # Enables Thumbnail generation using ImageMagick
ENABLE_CONVERSIONS: "true"
# Enables Thumbnail generation using ImageMagick # Disables email confirmation requirement
ENABLE_CONVERSIONS: 'true' EMAIL_CONFIRMATION_DISABLED: "true"
# Disables email confirmation requirement ## Set for SSL via nginx-proxy
EMAIL_CONFIRMATION_DISABLED: 'true' #VIRTUAL_HOST: 103.112.212.22
## Set for SSL via nginx-proxy # OVERLEAF_SITE_URL: http://overleaf.example.com
#VIRTUAL_HOST: 103.112.212.22 # OVERLEAF_NAV_TITLE: Overleaf Community Edition
# OVERLEAF_HEADER_IMAGE_URL: http://example.com/mylogo.png
# OVERLEAF_ADMIN_EMAIL: support@it.com
# OVERLEAF_SITE_URL: http://overleaf.example.com # OVERLEAF_LEFT_FOOTER: '[{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]'
# OVERLEAF_NAV_TITLE: Overleaf Community Edition # OVERLEAF_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]'
# OVERLEAF_HEADER_IMAGE_URL: http://example.com/mylogo.png
# OVERLEAF_ADMIN_EMAIL: support@it.com
# OVERLEAF_LEFT_FOOTER: '[{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]' # OVERLEAF_EMAIL_FROM_ADDRESS: "hello@example.com"
# OVERLEAF_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]'
# OVERLEAF_EMAIL_FROM_ADDRESS: "hello@example.com" # OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID:
# OVERLEAF_EMAIL_AWS_SES_SECRET_KEY:
# OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID: # OVERLEAF_EMAIL_SMTP_HOST: smtp.example.com
# OVERLEAF_EMAIL_AWS_SES_SECRET_KEY: # OVERLEAF_EMAIL_SMTP_PORT: 587
# OVERLEAF_EMAIL_SMTP_SECURE: false
# OVERLEAF_EMAIL_SMTP_USER:
# OVERLEAF_EMAIL_SMTP_PASS:
# OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH: true
# OVERLEAF_EMAIL_SMTP_IGNORE_TLS: false
# OVERLEAF_EMAIL_SMTP_NAME: '127.0.0.1'
# OVERLEAF_EMAIL_SMTP_LOGGER: true
# OVERLEAF_CUSTOM_EMAIL_FOOTER: "This system is run by department x"
# OVERLEAF_EMAIL_SMTP_HOST: smtp.example.com # ENABLE_CRON_RESOURCE_DELETION: true
# OVERLEAF_EMAIL_SMTP_PORT: 587
# OVERLEAF_EMAIL_SMTP_SECURE: false
# OVERLEAF_EMAIL_SMTP_USER:
# OVERLEAF_EMAIL_SMTP_PASS:
# OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH: true
# OVERLEAF_EMAIL_SMTP_IGNORE_TLS: false
# OVERLEAF_EMAIL_SMTP_NAME: '127.0.0.1'
# OVERLEAF_EMAIL_SMTP_LOGGER: true
# OVERLEAF_CUSTOM_EMAIL_FOOTER: "This system is run by department x"
# ENABLE_CRON_RESOURCE_DELETION: true ################
## Server Pro ##
################
################ ## The Community Edition is intended for use in environments where all users are trusted and is not appropriate for
## Server Pro ## ## scenarios where isolation of users is required. Sandboxed Compiles are not available in the Community Edition,
################ ## so the following environment variables must be commented out to avoid compile issues.
##
## Sandboxed Compiles: https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles
SANDBOXED_COMPILES: "true"
### Bind-mount source for /var/lib/overleaf/data/compiles inside the container.
SANDBOXED_COMPILES_HOST_DIR_COMPILES: "/home/user/sharelatex_data/data/compiles"
### Bind-mount source for /var/lib/overleaf/data/output inside the container.
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: "/home/user/sharelatex_data/data/output"
### Backwards compatibility (before Server Pro 5.5)
DOCKER_RUNNER: "true"
SANDBOXED_COMPILES_SIBLING_CONTAINERS: "true"
## The Community Edition is intended for use in environments where all users are trusted and is not appropriate for ## Works with test LDAP server shown at bottom of docker compose
## scenarios where isolation of users is required. Sandboxed Compiles are not available in the Community Edition, # OVERLEAF_LDAP_URL: 'ldap://ldap:389'
## so the following environment variables must be commented out to avoid compile issues. # OVERLEAF_LDAP_SEARCH_BASE: 'ou=people,dc=planetexpress,dc=com'
## # OVERLEAF_LDAP_SEARCH_FILTER: '(uid={{username}})'
## Sandboxed Compiles: https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles # OVERLEAF_LDAP_BIND_DN: 'cn=admin,dc=planetexpress,dc=com'
SANDBOXED_COMPILES: 'true' # OVERLEAF_LDAP_BIND_CREDENTIALS: 'GoodNewsEveryone'
### Bind-mount source for /var/lib/overleaf/data/compiles inside the container. # OVERLEAF_LDAP_EMAIL_ATT: 'mail'
SANDBOXED_COMPILES_HOST_DIR_COMPILES: '/home/user/sharelatex_data/data/compiles' # OVERLEAF_LDAP_NAME_ATT: 'cn'
### Bind-mount source for /var/lib/overleaf/data/output inside the container. # OVERLEAF_LDAP_LAST_NAME_ATT: 'sn'
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: '/home/user/sharelatex_data/data/output' # OVERLEAF_LDAP_UPDATE_USER_DETAILS_ON_LOGIN: 'true'
### Backwards compatibility (before Server Pro 5.5)
DOCKER_RUNNER: 'true'
SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true'
## Works with test LDAP server shown at bottom of docker compose # OVERLEAF_TEMPLATES_USER_ID: "578773160210479700917ee5"
# OVERLEAF_LDAP_URL: 'ldap://ldap:389' # OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS: '[ {"name":"All Templates","url":"/templates/all"}]'
# OVERLEAF_LDAP_SEARCH_BASE: 'ou=people,dc=planetexpress,dc=com'
# OVERLEAF_LDAP_SEARCH_FILTER: '(uid={{username}})'
# OVERLEAF_LDAP_BIND_DN: 'cn=admin,dc=planetexpress,dc=com'
# OVERLEAF_LDAP_BIND_CREDENTIALS: 'GoodNewsEveryone'
# OVERLEAF_LDAP_EMAIL_ATT: 'mail'
# OVERLEAF_LDAP_NAME_ATT: 'cn'
# OVERLEAF_LDAP_LAST_NAME_ATT: 'sn'
# OVERLEAF_LDAP_UPDATE_USER_DETAILS_ON_LOGIN: 'true'
# OVERLEAF_TEMPLATES_USER_ID: "578773160210479700917ee5" # OVERLEAF_PROXY_LEARN: "true"
# OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS: '[ {"name":"All Templates","url":"/templates/all"}]'
mongo:
restart: always
image: mongo:6.0
container_name: mongo
command: "--replSet overleaf"
volumes:
- ~/mongo_data:/data/db
- ./bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
environment:
MONGO_INITDB_DATABASE: sharelatex
extra_hosts:
# Required when using the automatic database setup for initializing the replica set.
# This override is not needed when running the setup after starting up mongo.
- mongo:127.0.0.1
healthcheck:
test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
# OVERLEAF_PROXY_LEARN: "true" redis:
restart: always
image: redis:6.2
container_name: redis
volumes:
- ~/redis_data:/data
mongo: # ldap:
restart: always # restart: always
image: mongo:6.0 # image: rroemhild/test-openldap
container_name: mongo # container_name: ldap
command: '--replSet overleaf'
volumes:
- ~/mongo_data:/data/db
- ./bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
environment:
MONGO_INITDB_DATABASE: sharelatex
extra_hosts:
# Required when using the automatic database setup for initializing the replica set.
# This override is not needed when running the setup after starting up mongo.
- mongo:127.0.0.1
healthcheck:
test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
redis: # See https://github.com/jwilder/nginx-proxy for documentation on how to configure the nginx-proxy container,
restart: always # and https://github.com/overleaf/overleaf/wiki/HTTPS-reverse-proxy-using-Nginx for an example of some recommended
image: redis:6.2 # settings. We recommend using a properly managed nginx instance outside of the Overleaf Server Pro setup,
container_name: redis # but the example here can be used if you'd prefer to run everything with docker-compose
volumes:
- ~/redis_data:/data
# ldap: # nginx-proxy:
# restart: always # image: jwilder/nginx-proxy
# image: rroemhild/test-openldap # container_name: nginx-proxy
# container_name: ldap # ports:
# - "80:80"
# See https://github.com/jwilder/nginx-proxy for documentation on how to configure the nginx-proxy container, # - "443:443"
# and https://github.com/overleaf/overleaf/wiki/HTTPS-reverse-proxy-using-Nginx for an example of some recommended # volumes:
# settings. We recommend using a properly managed nginx instance outside of the Overleaf Server Pro setup, # - /var/run/docker.sock:/tmp/docker.sock:ro
# but the example here can be used if you'd prefer to run everything with docker-compose # - /home/overleaf/tmp:/etc/nginx/certs
# nginx-proxy:
# image: jwilder/nginx-proxy
# container_name: nginx-proxy
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - /var/run/docker.sock:/tmp/docker.sock:ro
# - /home/overleaf/tmp:/etc/nginx/certs
@@ -4,11 +4,9 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -1,6 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js"]
"**/*.js",
]
} }
+1 -3
View File
@@ -4,11 +4,9 @@
"description": "utilities for node-fetch", "description": "utilities for node-fetch",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+2 -3
View File
@@ -1,10 +1,9 @@
## v3.1.1 ## v3.1.1
* Handle malformed requests in the req serializer - Handle malformed requests in the req serializer
## v3.0.0 ## v3.0.0
* Improve logging in Google Cloud Platform. Set environment variable `GCP_LOGGING=true` to enable. - Improve logging in Google Cloud Platform. Set environment variable `GCP_LOGGING=true` to enable.
This version of the metrics module only works with versions of the `@overleaf/metrics` module greater than v4.0.0 This version of the metrics module only works with versions of the `@overleaf/metrics` module greater than v4.0.0
+1 -3
View File
@@ -10,9 +10,7 @@
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"version": "3.1.1", "version": "3.1.1",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+2 -2
View File
@@ -1,9 +1,9 @@
## v4.1.0 ## v4.1.0
* Allows skipping the `sampleRate` argument. - Allows skipping the `sampleRate` argument.
## v4.0.0 ## v4.0.0
* Send unmodified request and response to logger. - Send unmodified request and response to logger.
This version of the metrics module only works with versions of the `@overleaf/logger` module greater than v3.0.0 This version of the metrics module only works with versions of the `@overleaf/logger` module greater than v3.0.0
+1 -3
View File
@@ -35,9 +35,7 @@
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"test:acceptance": "mocha --recursive --exit --grep=$MOCHA_GREP test/acceptance", "test:acceptance": "mocha --recursive --exit --grep=$MOCHA_GREP test/acceptance",
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -4,12 +4,10 @@
"description": "utilities to help working with mongo", "description": "utilities to help working with mongo",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+67 -53
View File
@@ -16,23 +16,23 @@ Light-weight helpers for handling JavaScript Errors in node.js and the browser.
<!-- toc --> <!-- toc -->
- [Long Stack Traces with `OError.tag`](#long-stack-traces-with-oerrortag) - [Long Stack Traces with `OError.tag`](#long-stack-traces-with-oerrortag)
* [The Problem](#the-problem) - [The Problem](#the-problem)
* [The Solution](#the-solution) - [The Solution](#the-solution)
* [Adding More Info](#adding-more-info) - [Adding More Info](#adding-more-info)
* [`async`/`await`](#asyncawait) - [`async`/`await`](#asyncawait)
* [Better Async Stack Traces in Node 12+](#better-async-stack-traces-in-node-12) - [Better Async Stack Traces in Node 12+](#better-async-stack-traces-in-node-12)
* [Caveat: Shared Error Instances](#caveat-shared-error-instances) - [Caveat: Shared Error Instances](#caveat-shared-error-instances)
- [Create Custom Error Classes](#create-custom-error-classes) - [Create Custom Error Classes](#create-custom-error-classes)
* [Attaching Extra Info](#attaching-extra-info) - [Attaching Extra Info](#attaching-extra-info)
* [Wrapping an Internal Error](#wrapping-an-internal-error) - [Wrapping an Internal Error](#wrapping-an-internal-error)
- [OError API Reference](#oerror-api-reference) - [OError API Reference](#oerror-api-reference)
* [new OError(message, [info], [cause])](#new-oerrormessage-info-cause) - [new OError(message, [info], [cause])](#new-oerrormessage-info-cause)
* [oError.withInfo(info) ⇒ this](#oerrorwithinfoinfo--this) - [oError.withInfo(info) ⇒ this](#oerrorwithinfoinfo--this)
* [oError.withCause(cause) ⇒ this](#oerrorwithcausecause--this) - [oError.withCause(cause) ⇒ this](#oerrorwithcausecause--this)
* [OError.maxTags : Number](#oerrormaxtags--number) - [OError.maxTags : Number](#oerrormaxtags--number)
* [OError.tag(error, [message], [info]) ⇒ Error](#oerrortagerror-message-info--error) - [OError.tag(error, [message], [info]) ⇒ Error](#oerrortagerror-message-info--error)
* [OError.getFullInfo(error) ⇒ Object](#oerrorgetfullinfoerror--object) - [OError.getFullInfo(error) ⇒ Object](#oerrorgetfullinfoerror--object)
* [OError.getFullStack(error) ⇒ string](#oerrorgetfullstackerror--string) - [OError.getFullStack(error) ⇒ string](#oerrorgetfullstackerror--string)
- [References](#references) - [References](#references)
<!-- tocstop --> <!-- tocstop -->
@@ -345,52 +345,56 @@ caused by:
## OError API Reference ## OError API Reference
<a name="OError"></a> <a name="OError"></a>
* [OError](#OError)
* [new OError(message, [info], [cause])](#new_OError_new) - [OError](#OError)
* _instance_ - [new OError(message, [info], [cause])](#new_OError_new)
* [.withInfo(info)](#OError+withInfo) ⇒ <code>this</code> - _instance_
* [.withCause(cause)](#OError+withCause) ⇒ <code>this</code> - [.withInfo(info)](#OError+withInfo) ⇒ <code>this</code>
* _static_ - [.withCause(cause)](#OError+withCause) ⇒ <code>this</code>
* [.maxTags](#OError.maxTags) : <code>Number</code> - _static_
* [.tag(error, [message], [info])](#OError.tag) <code>Error</code> - [.maxTags](#OError.maxTags) : <code>Number</code>
* [.getFullInfo(error)](#OError.getFullInfo) ⇒ <code>Object</code> - [.tag(error, [message], [info])](#OError.tag) ⇒ <code>Error</code>
* [.getFullStack(error)](#OError.getFullStack) ⇒ <code>string</code> - [.getFullInfo(error)](#OError.getFullInfo) ⇒ <code>Object</code>
- [.getFullStack(error)](#OError.getFullStack) ⇒ <code>string</code>
<a name="new_OError_new"></a> <a name="new_OError_new"></a>
### new OError(message, [info], [cause]) ### new OError(message, [info], [cause])
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | ------- | ------------------- | ----------------------------------------- |
| message | <code>string</code> | as for built-in Error | | message | <code>string</code> | as for built-in Error |
| [info] | <code>Object</code> | extra data to attach to the error | | [info] | <code>Object</code> | extra data to attach to the error |
| [cause] | <code>Error</code> | the internal error that caused this error | | [cause] | <code>Error</code> | the internal error that caused this error |
<a name="OError+withInfo"></a> <a name="OError+withInfo"></a>
### oError.withInfo(info) ⇒ <code>this</code> ### oError.withInfo(info) ⇒ <code>this</code>
Set the extra info object for this error. Set the extra info object for this error.
**Kind**: instance method of [<code>OError</code>](#OError) **Kind**: instance method of [<code>OError</code>](#OError)
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | ----- | ------------------- | --------------------------------- |
| info | <code>Object</code> | extra data to attach to the error | | info | <code>Object</code> | extra data to attach to the error |
<a name="OError+withCause"></a> <a name="OError+withCause"></a>
### oError.withCause(cause) ⇒ <code>this</code> ### oError.withCause(cause) ⇒ <code>this</code>
Wrap the given error, which caused this error. Wrap the given error, which caused this error.
**Kind**: instance method of [<code>OError</code>](#OError) **Kind**: instance method of [<code>OError</code>](#OError)
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | ----- | ------------------ | ----------------------------------------- |
| cause | <code>Error</code> | the internal error that caused this error | | cause | <code>Error</code> | the internal error that caused this error |
<a name="OError.maxTags"></a> <a name="OError.maxTags"></a>
### OError.maxTags : <code>Number</code> ### OError.maxTags : <code>Number</code>
Maximum number of tags to apply to any one error instance. This is to avoid Maximum number of tags to apply to any one error instance. This is to avoid
a resource leak in the (hopefully unlikely) case that a singleton error a resource leak in the (hopefully unlikely) case that a singleton error
instance is returned to many callbacks. If tags have been dropped, the full instance is returned to many callbacks. If tags have been dropped, the full
@@ -402,19 +406,21 @@ Defaults to 100. Must be at least 1.
<a name="OError.tag"></a> <a name="OError.tag"></a>
### OError.tag(error, [message], [info]) ⇒ <code>Error</code> ### OError.tag(error, [message], [info]) ⇒ <code>Error</code>
Tag debugging information onto any error (whether an OError or not) and Tag debugging information onto any error (whether an OError or not) and
return it. return it.
**Kind**: static method of [<code>OError</code>](#OError) **Kind**: static method of [<code>OError</code>](#OError)
**Returns**: <code>Error</code> - the modified `error` argument **Returns**: <code>Error</code> - the modified `error` argument
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | --------- | ------------------- | ----------------------------------- |
| error | <code>Error</code> | the error to tag | | error | <code>Error</code> | the error to tag |
| [message] | <code>string</code> | message with which to tag `error` | | [message] | <code>string</code> | message with which to tag `error` |
| [info] | <code>Object</code> | extra data with wich to tag `error` | | [info] | <code>Object</code> | extra data with wich to tag `error` |
**Example** _(An error in a callback)_
**Example** *(An error in a callback)*
```js ```js
function findUser(name, callback) { function findUser(name, callback) {
fs.readFile('/etc/passwd', (err, data) => { fs.readFile('/etc/passwd', (err, data) => {
@@ -423,13 +429,17 @@ function findUser(name, callback) {
}) })
} }
``` ```
**Example** *(A possible error in a callback)*
**Example** _(A possible error in a callback)_
```js ```js
function cleanup(callback) { function cleanup(callback) {
fs.unlink('/tmp/scratch', (err) => callback(err && OError.tag(err))) fs.unlink('/tmp/scratch', err => callback(err && OError.tag(err)))
} }
``` ```
**Example** *(An error with async/await)*
**Example** _(An error with async/await)_
```js ```js
async function cleanup() { async function cleanup() {
try { try {
@@ -439,30 +449,34 @@ async function cleanup() {
} }
} }
``` ```
<a name="OError.getFullInfo"></a> <a name="OError.getFullInfo"></a>
### OError.getFullInfo(error) ⇒ <code>Object</code> ### OError.getFullInfo(error) ⇒ <code>Object</code>
The merged info from any `tag`s and causes on the given error. The merged info from any `tag`s and causes on the given error.
If an info property is repeated, the last one wins. If an info property is repeated, the last one wins.
**Kind**: static method of [<code>OError</code>](#OError) **Kind**: static method of [<code>OError</code>](#OError)
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | ----- | ----------------------------------------------------------------- | ----------------------------------------- |
| error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) | | error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) |
<a name="OError.getFullStack"></a> <a name="OError.getFullStack"></a>
### OError.getFullStack(error) ⇒ <code>string</code> ### OError.getFullStack(error) ⇒ <code>string</code>
Return the `stack` property from `error`, including the `stack`s for any Return the `stack` property from `error`, including the `stack`s for any
tagged errors added with `OError.tag` and for any `cause`s. tagged errors added with `OError.tag` and for any `cause`s.
**Kind**: static method of [<code>OError</code>](#OError) **Kind**: static method of [<code>OError</code>](#OError)
| Param | Type | Description | | Param | Type | Description |
| --- | --- | --- | | ----- | ----------------------------------------------------------------- | ----------------------------------------- |
| error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) | | error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) |
<!-- END API REFERENCE --> <!-- END API REFERENCE -->
## References ## References
+1 -3
View File
@@ -20,9 +20,7 @@
"build": "npm run --silent test", "build": "npm run --silent test",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
@@ -1 +0,0 @@
node_modules
+3 -3
View File
@@ -46,9 +46,9 @@ Uploads a stream to the backend.
- `key`: The key for the uploaded object - `key`: The key for the uploaded object
- `readStream`: The data stream to upload - `readStream`: The data stream to upload
- `opts` (optional): - `opts` (optional):
- `sourceMd5`: The md5 hash of the source data, if known. The uploaded data will be compared against this and the operation will fail if it does not match. If omitted, the md5 is calculated as the data is uploaded instead, and verified against the backend. This is not supported in `S3Persistor` as it performs [its own integrity protections](https://aws.amazon.com/blogs/aws/introducing-default-data-integrity-protections-for-new-objects-in-amazon-s3/). Setting `sourceMd5` with `S3Persistor` will result in an error being thrown. - `sourceMd5`: The md5 hash of the source data, if known. The uploaded data will be compared against this and the operation will fail if it does not match. If omitted, the md5 is calculated as the data is uploaded instead, and verified against the backend. This is not supported in `S3Persistor` as it performs [its own integrity protections](https://aws.amazon.com/blogs/aws/introducing-default-data-integrity-protections-for-new-objects-in-amazon-s3/). Setting `sourceMd5` with `S3Persistor` will result in an error being thrown.
- `contentType`: The content type to write in the object metadata - `contentType`: The content type to write in the object metadata
- `contentEncoding`: The content encoding to write in the object metadata - `contentEncoding`: The content encoding to write in the object metadata
##### Notes ##### Notes
+1 -3
View File
@@ -4,12 +4,10 @@
"description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them", "description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -4,9 +4,7 @@
"description": "Library shared between the editor server and clients.", "description": "Library shared between the editor server and clients.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -4,12 +4,10 @@
"description": "utilities to help working with promises", "description": "utilities to help working with promises",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -11,9 +11,7 @@
"scripts": { "scripts": {
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'", "test": "npm run lint && npm run types:check && npm run test:unit",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -15,9 +15,7 @@
"scripts": { "scripts": {
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'", "test": "npm run lint && npm run types:check && npm run test:unit",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+3 -5
View File
@@ -1,16 +1,14 @@
@overleaf/settings # @overleaf/settings
===================
A small module to allow global config settings to be set for all services A small module to allow global config settings to be set for all services
within the Overleaf architecture. within the Overleaf architecture.
Settings file location ## Settings file location
----------------------
You can specify a custom location for the settings file by setting the You can specify a custom location for the settings file by setting the
`OVERLEAF_CONFIG` environment variable. E.g. `OVERLEAF_CONFIG` environment variable. E.g.
$ export OVERLEAF_CONFIG=/home/james/config/settings.development.js $ export OVERLEAF_CONFIG=/home/james/config/settings.development.js
Otherwise, the settings will be loaded from `config/settings.NODE_ENV.js`, Otherwise, the settings will be loaded from `config/settings.NODE_ENV.js`,
where `NODE_ENV` is another environment variable, or defaults to `development`. where `NODE_ENV` is another environment variable, or defaults to `development`.
+1 -3
View File
@@ -7,9 +7,7 @@
"scripts": { "scripts": {
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'", "test": "npm run lint && npm run types:check && npm run test:unit",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -4,12 +4,10 @@
"description": "stream handling utilities", "description": "stream handling utilities",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -3
View File
@@ -10,9 +10,7 @@
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run types:check && npm run test:unit",
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .", "lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .", "lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
+1 -5
View File
@@ -1,8 +1,4 @@
{ {
"extends": "../../tsconfig.backend.json", "extends": "../../tsconfig.backend.json",
"include": [ "include": ["**/*.js", "**/*.cjs", "**/*.ts"]
"**/*.js",
"**/*.cjs",
"**/*.ts"
]
} }
+1 -1
View File
@@ -40,6 +40,7 @@
"patch-package": "^8.0.0" "patch-package": "^8.0.0"
}, },
"devDependencies": { "devDependencies": {
"@prettier/plugin-pug": "^3.4.0",
"@types/chai": "^4.3.0", "@types/chai": "^4.3.0",
"@types/chai-as-promised": "^7.1.8", "@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6", "@types/mocha": "^10.0.6",
@@ -58397,7 +58398,6 @@
"@pollyjs/adapter-node-http": "^6.0.6", "@pollyjs/adapter-node-http": "^6.0.6",
"@pollyjs/core": "^6.0.6", "@pollyjs/core": "^6.0.6",
"@pollyjs/persister-fs": "^6.0.6", "@pollyjs/persister-fs": "^6.0.6",
"@prettier/plugin-pug": "^3.4.0",
"@replit/codemirror-emacs": "overleaf/codemirror-emacs#4394c03858f27053f8768258e9493866e06e938e", "@replit/codemirror-emacs": "overleaf/codemirror-emacs#4394c03858f27053f8768258e9493866e06e938e",
"@replit/codemirror-indentation-markers": "overleaf/codemirror-indentation-markers#371ce3b56f453a392eb0d3b85ab019c185c68e1f", "@replit/codemirror-indentation-markers": "overleaf/codemirror-indentation-markers#371ce3b56f453a392eb0d3b85ab019c185c68e1f",
"@replit/codemirror-vim": "overleaf/codemirror-vim#1bef138382d948018f3f9b8a4d7a70ab61774e4b", "@replit/codemirror-vim": "overleaf/codemirror-vim#1bef138382d948018f3f9b8a4d7a70ab61774e4b",
+9 -4
View File
@@ -5,6 +5,7 @@
"patch-package": "^8.0.0" "patch-package": "^8.0.0"
}, },
"devDependencies": { "devDependencies": {
"@prettier/plugin-pug": "^3.4.0",
"@types/chai": "^4.3.0", "@types/chai": "^4.3.0",
"@types/chai-as-promised": "^7.1.8", "@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6", "@types/mocha": "^10.0.6",
@@ -41,10 +42,14 @@
} }
}, },
"scripts": { "scripts": {
"format": "prettier --list-different $PWD/'**/*.js'", "format": "prettier --list-different",
"format:fix": "prettier --write $PWD/'**/*.js'", "format:fix": "prettier --write --list-different",
"format:jenkins": "prettier --list-different $PWD/'**/Jenkinsfile'", "format:styles": "prettier --list-different '**/*.{css,scss}'",
"format:jenkins:fix": "prettier --write $PWD/'**/Jenkinsfile'", "format:styles:fix": "prettier --write --list-different '**/*.{css,scss}'",
"format:pug": "prettier --list-different '**/*.pug'",
"format:pug:fix": "prettier --write --list-different '**/*.pug'",
"format:jenkins": "prettier --list-different '**/Jenkinsfile'",
"format:jenkins:fix": "prettier --write --list-different '**/Jenkinsfile'",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"postinstall": "patch-package" "postinstall": "patch-package"
+22 -23
View File
@@ -1,11 +1,10 @@
--- ---
steps: steps:
- id: build_base - id: build_base
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
dir: server-ce dir: server-ce
args: args:
- 'build-base' - "build-base"
- id: tag_main_latest_base - id: tag_main_latest_base
name: gcr.io/cloud-builders/docker name: gcr.io/cloud-builders/docker
script: | script: |
@@ -26,7 +25,7 @@ steps:
exit 0 exit 0
automapSubstitutions: true automapSubstitutions: true
waitFor: waitFor:
- '-' - "-"
- id: build_community - id: build_community
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
dir: server-ce dir: server-ce
@@ -51,27 +50,27 @@ timeout: 3600s
options: options:
machineType: E2_HIGHCPU_32 machineType: E2_HIGHCPU_32
env: env:
- 'BRANCH_NAME=${BRANCH_NAME}' - "BRANCH_NAME=${BRANCH_NAME}"
# docker build # docker build
- 'OVERLEAF_BASE_BRANCH=${_IMAGE_BASE_BRANCH}' - "OVERLEAF_BASE_BRANCH=${_IMAGE_BASE_BRANCH}"
- 'OVERLEAF_BASE_LATEST=${_IMAGE_BASE_LATEST}' - "OVERLEAF_BASE_LATEST=${_IMAGE_BASE_LATEST}"
- 'OVERLEAF_BASE_TAG=${_IMAGE_BASE}' - "OVERLEAF_BASE_TAG=${_IMAGE_BASE}"
- 'OVERLEAF_BRANCH=${_IMAGE_TAG_BRANCH}' - "OVERLEAF_BRANCH=${_IMAGE_TAG_BRANCH}"
- 'OVERLEAF_LATEST=${_IMAGE_TAG_LATEST}' - "OVERLEAF_LATEST=${_IMAGE_TAG_LATEST}"
- 'OVERLEAF_TAG=${_IMAGE_TAG}' - "OVERLEAF_TAG=${_IMAGE_TAG}"
images: images:
- '${_IMAGE_BASE}' - "${_IMAGE_BASE}"
- '${_IMAGE_BASE_BRANCH}' - "${_IMAGE_BASE_BRANCH}"
- '${_IMAGE_TAG}' - "${_IMAGE_TAG}"
- '${_IMAGE_TAG_BRANCH}' - "${_IMAGE_TAG_BRANCH}"
substitutions: substitutions:
_IMAGE_BASE: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}' _IMAGE_BASE: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}"
_IMAGE_BASE_BRANCH: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}' _IMAGE_BASE_BRANCH: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}"
_IMAGE_BASE_LATEST: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:latest' _IMAGE_BASE_LATEST: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:latest"
_IMAGE_TAG_BRANCH: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}' _IMAGE_TAG_BRANCH: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}"
_IMAGE_TAG_LATEST: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:latest' _IMAGE_TAG_LATEST: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:latest"
_IMAGE_TAG: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}' _IMAGE_TAG: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}"
tags: tags:
- 'overleaf-public' - "overleaf-public"
- '${BRANCH_NAME}' - "${BRANCH_NAME}"
- '${SHORT_SHA}' - "${SHORT_SHA}"
+6 -6
View File
@@ -1,24 +1,24 @@
version: '2.2' version: "2.2"
services: services:
sharelatex: sharelatex:
ports: ports:
- "127.0.0.1:80:80" - "127.0.0.1:80:80"
environment: environment:
OVERLEAF_SITE_URL: 'http://localhost' OVERLEAF_SITE_URL: "http://localhost"
host-admin: host-admin:
ports: ports:
- "127.0.0.1:8081:80" - "127.0.0.1:8081:80"
environment: environment:
NATIVE_CYPRESS: 'true' NATIVE_CYPRESS: "true"
ACCESS_CONTROL_ALLOW_ORIGIN: 'http://localhost' ACCESS_CONTROL_ALLOW_ORIGIN: "http://localhost"
saml: saml:
ports: ports:
- 127.0.0.1:8082:80 - 127.0.0.1:8082:80
environment: environment:
SAML_BASE_URL_PATH: 'http://localhost:8082/simplesaml/' SAML_BASE_URL_PATH: "http://localhost:8082/simplesaml/"
SAML_TEST_SP_LOCATION: 'http://localhost/saml/callback' SAML_TEST_SP_LOCATION: "http://localhost/saml/callback"
mailtrap: mailtrap:
ports: ports:
+16 -16
View File
@@ -10,18 +10,18 @@ services:
mailtrap: mailtrap:
condition: service_started condition: service_started
environment: environment:
OVERLEAF_SITE_URL: 'http://sharelatex' OVERLEAF_SITE_URL: "http://sharelatex"
OVERLEAF_APP_NAME: E2E test OVERLEAF_APP_NAME: E2E test
OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex?directConnection=true OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex?directConnection=true
OVERLEAF_REDIS_HOST: redis OVERLEAF_REDIS_HOST: redis
REDIS_HOST: redis REDIS_HOST: redis
OVERLEAF_EMAIL_FROM_ADDRESS: 'welcome@example.com' OVERLEAF_EMAIL_FROM_ADDRESS: "welcome@example.com"
OVERLEAF_EMAIL_SMTP_HOST: 'mailtrap' OVERLEAF_EMAIL_SMTP_HOST: "mailtrap"
OVERLEAF_EMAIL_SMTP_PORT: '25' OVERLEAF_EMAIL_SMTP_PORT: "25"
OVERLEAF_EMAIL_SMTP_IGNORE_TLS: 'true' OVERLEAF_EMAIL_SMTP_IGNORE_TLS: "true"
ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file' ENABLED_LINKED_FILE_TYPES: "project_file,project_output_file"
ENABLE_CONVERSIONS: 'true' ENABLE_CONVERSIONS: "true"
EMAIL_CONFIRMATION_DISABLED: 'true' EMAIL_CONFIRMATION_DISABLED: "true"
healthcheck: healthcheck:
test: curl --fail http://localhost:3000/status test: curl --fail http://localhost:3000/status
interval: 3s interval: 3s
@@ -31,11 +31,11 @@ services:
mailtrap: mailtrap:
image: mailtrap image: mailtrap
environment: environment:
MAILTRAP_PASSWORD: 'password-for-mailtrap' MAILTRAP_PASSWORD: "password-for-mailtrap"
mongo: mongo:
image: mongo:8.0.11 image: mongo:8.0.11
command: '--replSet overleaf' command: "--replSet overleaf"
volumes: volumes:
- ../bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js - ../bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
- ../bin/shared/mongodb-docker-entrypoint-wait.sh:/mongodb-docker-entrypoint-wait.sh - ../bin/shared/mongodb-docker-entrypoint-wait.sh:/mongodb-docker-entrypoint-wait.sh
@@ -129,9 +129,9 @@ services:
restart: always restart: always
image: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/saml-test image: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/saml-test
environment: environment:
SAML_TEST_SP_ENTITY_ID: 'sharelatex-test-saml' SAML_TEST_SP_ENTITY_ID: "sharelatex-test-saml"
SAML_BASE_URL_PATH: 'http://saml/simplesaml/' SAML_BASE_URL_PATH: "http://saml/simplesaml/"
SAML_TEST_SP_LOCATION: 'http://sharelatex/saml/callback' SAML_TEST_SP_LOCATION: "http://sharelatex/saml/callback"
ldap: ldap:
restart: always restart: always
@@ -140,6 +140,6 @@ services:
# REF: https://github.com/moby/moby/issues/8231#issuecomment-63877553 # REF: https://github.com/moby/moby/issues/8231#issuecomment-63877553
# REF: https://github.com/moby/moby/issues/8231#issuecomment-63871343 # REF: https://github.com/moby/moby/issues/8231#issuecomment-63871343
command: command:
- 'bash' - "bash"
- '-c' - "-c"
- 'ulimit -n 1024 && exec bash /run.sh' - "ulimit -n 1024 && exec bash /run.sh"
-2
View File
@@ -6,8 +6,6 @@
"scripts": { "scripts": {
"cypress:open": "cypress open --e2e --browser chrome", "cypress:open": "cypress open --e2e --browser chrome",
"cypress:run": "cypress run --e2e --browser chrome", "cypress:run": "cypress run --e2e --browser chrome",
"format": "prettier --list-different $PWD/'**/*.{js,mjs,ts,tsx}'",
"format:fix": "prettier --write $PWD/'**/*.{js,mjs,ts,tsx}'",
"lint": "eslint --max-warnings 0 --format unix --ext .js,.jsx,.mjs,.ts,.tsx .", "lint": "eslint --max-warnings 0 --format unix --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:fix": "eslint --fix --ext .js,.jsx,.mjs,.ts,.tsx ." "lint:fix": "eslint --fix --ext .js,.jsx,.mjs,.ts,.tsx ."
}, },
+5 -6
View File
@@ -52,11 +52,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -77,13 +76,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/chat
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/chat
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/chat
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+2 -4
View File
@@ -1,10 +1,8 @@
overleaf/chat # overleaf/chat
===============
The backend API that powers the chat service in Overleaf The backend API that powers the chat service in Overleaf
License ## License
-------
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file. The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
+56 -56
View File
@@ -3,12 +3,12 @@ x-stoplight:
id: okoe8mh50pjec id: okoe8mh50pjec
info: info:
title: chat title: chat
version: '1.0' version: "1.0"
servers: servers:
- url: 'http://chat:3010' - url: "http://chat:3010"
x-exegesis-controller: messagesController x-exegesis-controller: messagesController
paths: paths:
'/project/{projectId}/messages': "/project/{projectId}/messages":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -19,14 +19,14 @@ paths:
summary: Get Global messages summary: Get Global messages
tags: [] tags: []
responses: responses:
'201': "201":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
operationId: getGlobalMessages operationId: getGlobalMessages
description: Get global messages for the project with Project ID provided description: Get global messages for the project with Project ID provided
parameters: parameters:
@@ -42,21 +42,21 @@ paths:
summary: Send Global message summary: Send Global message
operationId: sendGlobalMessage operationId: sendGlobalMessage
responses: responses:
'201': "201":
description: OK description: OK
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
examples: examples:
example-1: example-1:
value: value:
user_id: string user_id: string
content: string content: string
description: 'UserID and Content of the message to be posted. ' description: "UserID and Content of the message to be posted. "
description: Send global message for the project with Project ID provided description: Send global message for the project with Project ID provided
'/project/{projectId}/messages/{messageId}': "/project/{projectId}/messages/{messageId}":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -72,13 +72,13 @@ paths:
summary: Get single global message summary: Get single global message
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
'404': "404":
description: Message not found description: Message not found
operationId: getGlobalMessage operationId: getGlobalMessage
description: Get a single global message by message ID for the project with Project ID provided description: Get a single global message by message ID for the project with Project ID provided
@@ -86,10 +86,10 @@ paths:
summary: Delete global message summary: Delete global message
operationId: deleteGlobalMessage operationId: deleteGlobalMessage
responses: responses:
'204': "204":
description: No Content description: No Content
description: 'Delete global message' description: "Delete global message"
'/project/{projectId}/thread/{threadId}/messages': "/project/{projectId}/thread/{threadId}/messages":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -105,19 +105,19 @@ paths:
summary: Send message summary: Send message
operationId: sendMessage operationId: sendMessage
responses: responses:
'201': "201":
description: Created description: Created
description: Add a message to the thread with thread ID provided from the Project with Project ID provided. description: Add a message to the thread with thread ID provided from the Project with Project ID provided.
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
description: |- description: |-
JSON object with : JSON object with :
- user_id: Id of the user - user_id: Id of the user
- content: Content of the message - content: Content of the message
'/project/{projectId}/threads': "/project/{projectId}/threads":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -128,20 +128,20 @@ paths:
summary: Get Threads summary: Get Threads
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
$ref: '#/components/schemas/Thread' $ref: "#/components/schemas/Thread"
examples: {} examples: {}
'404': "404":
description: Not Found description: Not Found
operationId: getThreads operationId: getThreads
description: Get the list of threads for the project with Project ID provided description: Get the list of threads for the project with Project ID provided
'/project/{projectId}/thread/{threadId}/messages/{messageId}/edit': "/project/{projectId}/thread/{threadId}/messages/{messageId}/edit":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -162,9 +162,9 @@ paths:
summary: Edit message summary: Edit message
operationId: editMessage operationId: editMessage
responses: responses:
'204': "204":
description: No Content description: No Content
'404': "404":
description: Not Found description: Not Found
requestBody: requestBody:
content: content:
@@ -186,7 +186,7 @@ paths:
- user_id: Id of the user (optional) - user_id: Id of the user (optional)
description: | description: |
Update message with Message ID provided from the Thread ID and Project ID provided Update message with Message ID provided from the Thread ID and Project ID provided
'/project/{projectId}/messages/{messageId}/edit': "/project/{projectId}/messages/{messageId}/edit":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -202,9 +202,9 @@ paths:
summary: Edit global message summary: Edit global message
operationId: editGlobalMessage operationId: editGlobalMessage
responses: responses:
'204': "204":
description: No Content description: No Content
'404': "404":
description: Not Found description: Not Found
requestBody: requestBody:
content: content:
@@ -226,7 +226,7 @@ paths:
- user_id: Id of the user (optional) - user_id: Id of the user (optional)
description: | description: |
Update global message with Message ID provided from the Project ID provided Update global message with Message ID provided from the Project ID provided
'/project/{projectId}/thread/{threadId}/messages/{messageId}': "/project/{projectId}/thread/{threadId}/messages/{messageId}":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -247,13 +247,13 @@ paths:
summary: Get thread message summary: Get thread message
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
'404': "404":
description: Message not found description: Message not found
operationId: getThreadMessage operationId: getThreadMessage
description: Get a specific message by message ID from the thread with Thread ID and Project ID provided description: Get a specific message by message ID from the thread with Thread ID and Project ID provided
@@ -261,10 +261,10 @@ paths:
summary: Delete message summary: Delete message
operationId: deleteMessage operationId: deleteMessage
responses: responses:
'204': "204":
description: No Content description: No Content
description: 'Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided' description: "Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided"
'/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}': "/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -290,9 +290,9 @@ paths:
summary: Delete message written by a given user summary: Delete message written by a given user
operationId: deleteUserMessage operationId: deleteUserMessage
responses: responses:
'204': "204":
description: No Content description: No Content
'/project/{projectId}/thread/{threadId}/resolve': "/project/{projectId}/thread/{threadId}/resolve":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -308,7 +308,7 @@ paths:
summary: Resolve Thread summary: Resolve Thread
operationId: resolveThread operationId: resolveThread
responses: responses:
'204': "204":
description: No Content description: No Content
requestBody: requestBody:
content: content:
@@ -324,7 +324,7 @@ paths:
JSON object with : JSON object with :
- user_id: Id of the user. - user_id: Id of the user.
description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved. description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
'/project/{projectId}/thread/{threadId}/reopen': "/project/{projectId}/thread/{threadId}/reopen":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -340,12 +340,12 @@ paths:
summary: Reopen Thread summary: Reopen Thread
operationId: reopenThread operationId: reopenThread
responses: responses:
'204': "204":
description: No Content description: No Content
description: |- description: |-
Reopen Thread with ThreadID and ProjectID provided. Reopen Thread with ThreadID and ProjectID provided.
i.e unmark it as resolved. i.e unmark it as resolved.
'/project/{projectId}/thread/{threadId}': "/project/{projectId}/thread/{threadId}":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -361,13 +361,13 @@ paths:
summary: Get Thread summary: Get Thread
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Thread' $ref: "#/components/schemas/Thread"
'404': "404":
description: Thread not found description: Thread not found
operationId: getThread operationId: getThread
description: Get a thread with ThreadID and ProjectID provided description: Get a thread with ThreadID and ProjectID provided
@@ -375,10 +375,10 @@ paths:
summary: Delete thread summary: Delete thread
operationId: deleteThread operationId: deleteThread
responses: responses:
'204': "204":
description: No Content description: No Content
description: Delete thread with ThreadID and ProjectID provided description: Delete thread with ThreadID and ProjectID provided
'/project/{projectId}/resolved-thread-ids': "/project/{projectId}/resolved-thread-ids":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -389,9 +389,9 @@ paths:
summary: Get resolved thread ids summary: Get resolved thread ids
operationId: getResolvedThreadIds operationId: getResolvedThreadIds
responses: responses:
'200': "200":
description: Resolved thread ids description: Resolved thread ids
'/project/{projectId}': "/project/{projectId}":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -402,15 +402,15 @@ paths:
summary: Destroy project summary: Destroy project
operationId: destroyProject operationId: destroyProject
responses: responses:
'204': "204":
description: No Content description: No Content
description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.' description: "Delete all threads from Project with Project ID provided, and all messages in those threads."
/status: /status:
get: get:
summary: Check status summary: Check status
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
@@ -423,7 +423,7 @@ paths:
summary: Check status summary: Check status
tags: [] tags: []
responses: responses:
'200': "200":
description: OK description: OK
content: content:
application/json: application/json:
@@ -432,7 +432,7 @@ paths:
description: chat is alive description: chat is alive
operationId: getStatus operationId: getStatus
description: Check that the Chat service is alive description: Check that the Chat service is alive
'/project/{projectId}/duplicate-comment-threads': "/project/{projectId}/duplicate-comment-threads":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -453,7 +453,7 @@ paths:
items: items:
type: string type: string
responses: responses:
'200': "200":
content: content:
application/json: application/json:
schema: schema:
@@ -463,7 +463,7 @@ paths:
type: object type: object
description: Mapping of old thread ids to their duplicated thread ids description: Mapping of old thread ids to their duplicated thread ids
description: Duplicate a list of comment threads description: Duplicate a list of comment threads
'/project/{projectId}/generate-thread-data': "/project/{projectId}/generate-thread-data":
parameters: parameters:
- schema: - schema:
type: string type: string
@@ -484,7 +484,7 @@ paths:
items: items:
type: string type: string
responses: responses:
'200': "200":
content: content:
application/json: application/json:
schema: schema:
@@ -514,4 +514,4 @@ components:
id: 0ppt3jw4h5bua id: 0ppt3jw4h5bua
type: array type: array
items: items:
$ref: '#/components/schemas/Message' $ref: "#/components/schemas/Message"
+1 -2
View File
@@ -20,7 +20,6 @@ services:
mongo: mongo:
condition: service_started condition: service_started
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -41,7 +40,6 @@ services:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -49,6 +47,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
mongo: mongo:
image: mongo:8.0.11 image: mongo:8.0.11
command: --replSet overleaf --notablescan command: --replSet overleaf --notablescan
-1
View File
@@ -62,4 +62,3 @@ services:
# replica set. This override is not needed when running the setup after # replica set. This override is not needed when running the setup after
# starting up mongo. # starting up mongo.
- mongo:127.0.0.1 - mongo:127.0.0.1
-2
View File
@@ -12,8 +12,6 @@
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+5 -6
View File
@@ -52,11 +52,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/clsi/reports:/overleaf/services/clsi/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/clsi/reports:/overleaf/services/clsi/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/clsi/reports:/overleaf/services/clsi/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -77,13 +76,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/clsi
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/clsi
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/clsi
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
-2
View File
@@ -16,7 +16,6 @@ services:
NODE_OPTIONS: "--unhandled-rejections=strict" NODE_OPTIONS: "--unhandled-rejections=strict"
VITEST_NO_CACHE: true VITEST_NO_CACHE: true
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -43,7 +42,6 @@ services:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
-1
View File
@@ -51,4 +51,3 @@ services:
SANDBOXED_COMPILES_HOST_DIR_COMPILES: $PWD/compiles SANDBOXED_COMPILES_HOST_DIR_COMPILES: $PWD/compiles
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: $PWD/output SANDBOXED_COMPILES_HOST_DIR_OUTPUT: $PWD/output
command: npm run --silent test:acceptance command: npm run --silent test:acceptance
-2
View File
@@ -12,8 +12,6 @@
"test:unit": "npm run test:unit:_run", "test:unit": "npm run test:unit:_run",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
@@ -1,3 +1,3 @@
{ {
"draft": true "draft": true
} }
@@ -1,3 +1,3 @@
{ {
"draft": true "draft": true
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "latex" "compiler": "latex"
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "xelatex" "compiler": "xelatex"
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "latex" "compiler": "latex"
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "lualatex" "compiler": "lualatex"
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "lualatex" "compiler": "lualatex"
} }
@@ -1,3 +1,3 @@
{ {
"compiler": "xelatex" "compiler": "xelatex"
} }
+5 -6
View File
@@ -52,11 +52,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/contacts/reports:/overleaf/services/contacts/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/contacts/reports:/overleaf/services/contacts/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/contacts/reports:/overleaf/services/contacts/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -77,13 +76,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/contacts
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/contacts
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/contacts
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+2 -4
View File
@@ -1,10 +1,8 @@
overleaf/contacts # overleaf/contacts
===================
An API for tracking contacts of a user An API for tracking contacts of a user
License ## License
-------
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file. The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
+1 -2
View File
@@ -20,7 +20,6 @@ services:
mongo: mongo:
condition: service_started condition: service_started
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -41,7 +40,6 @@ services:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -49,6 +47,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
mongo: mongo:
image: mongo:8.0.11 image: mongo:8.0.11
command: --replSet overleaf --notablescan command: --replSet overleaf --notablescan
-1
View File
@@ -62,4 +62,3 @@ services:
# replica set. This override is not needed when running the setup after # replica set. This override is not needed when running the setup after
# starting up mongo. # starting up mongo.
- mongo:127.0.0.1 - mongo:127.0.0.1
-2
View File
@@ -12,8 +12,6 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+5 -6
View File
@@ -54,11 +54,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/docstore/reports:/overleaf/services/docstore/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/docstore/reports:/overleaf/services/docstore/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/docstore/reports:/overleaf/services/docstore/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -79,13 +78,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/docstore
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/docstore
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/docstore
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+2 -4
View File
@@ -1,10 +1,8 @@
overleaf/docstore # overleaf/docstore
===================
A CRUD API for storing and updating text documents in projects A CRUD API for storing and updating text documents in projects
License ## License
-------
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file. The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
+2 -2
View File
@@ -22,7 +22,6 @@ services:
mongo: mongo:
condition: service_started condition: service_started
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -48,7 +47,6 @@ services:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -56,6 +54,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
mongo: mongo:
image: mongo:8.0.11 image: mongo:8.0.11
command: --replSet overleaf --notablescan command: --replSet overleaf --notablescan
@@ -70,6 +69,7 @@ services:
# replica set. This override is not needed when running the setup after # replica set. This override is not needed when running the setup after
# starting up mongo. # starting up mongo.
- mongo:127.0.0.1 - mongo:127.0.0.1
gcs: gcs:
image: fsouza/fake-gcs-server:1.52.3 image: fsouza/fake-gcs-server:1.52.3
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"] command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
-2
View File
@@ -12,8 +12,6 @@
"test:unit": "npm run test:unit:_run", "test:unit": "npm run test:unit:_run",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
+5 -6
View File
@@ -55,11 +55,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/reports:/overleaf/services/document-updater/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/reports:/overleaf/services/document-updater/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/reports:/overleaf/services/document-updater/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -80,13 +79,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/document-updater
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/document-updater
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/document-updater
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+2 -5
View File
@@ -1,12 +1,9 @@
overleaf/document-updater # overleaf/document-updater
===========================
An API for applying incoming updates to documents in real-time. An API for applying incoming updates to documents in real-time.
License ## License
-------
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file. The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
Copyright (c) Overleaf, 2014-2019. Copyright (c) Overleaf, 2014-2019.
@@ -3,4 +3,3 @@ This folder contains a modified version of the ShareJS source code, forked from
The original CoffeeScript code has been decaffeinated to JavaScript, and further modified. Some folders have been removed. See https://github.com/josephg/ShareJS/blob/v0.5.0/src/types/README.md for the original README. The original CoffeeScript code has been decaffeinated to JavaScript, and further modified. Some folders have been removed. See https://github.com/josephg/ShareJS/blob/v0.5.0/src/types/README.md for the original README.
The original code, and the current modified code in this directory, are published under the MIT license. The original code, and the current modified code in this directory, are published under the MIT license.
@@ -3,7 +3,6 @@ This directory contains all the operational transform code. Each file defines a
Most of the types in here are for testing or demonstration. The only types which are sent to the webclient Most of the types in here are for testing or demonstration. The only types which are sent to the webclient
are `text` and `json`. are `text` and `json`.
# An OT type # An OT type
All OT types have the following fields: All OT types have the following fields:
@@ -18,7 +17,6 @@ Given op1, op2, `apply(s, op2, transform(op1, op2, 'left')) == apply(s, op1, tra
Transform and apply must never modify their arguments. Transform and apply must never modify their arguments.
Optional properties: Optional properties:
`tp2`: _(bool)_ True if the transform function supports TP2. This allows p2p architectures to work. `tp2`: _(bool)_ True if the transform function supports TP2. This allows p2p architectures to work.
@@ -29,14 +27,12 @@ Optional properties:
`normalize(op) -> op`: Fix up an op to make it valid. Eg, remove skips of size zero. `normalize(op) -> op`: Fix up an op to make it valid. Eg, remove skips of size zero.
`api`: _(object)_ Set of helper methods which will be mixed in to the client document object for manipulating documents. See below. `api`: _(object)_ Set of helper methods which will be mixed in to the client document object for manipulating documents. See below.
# Examples # Examples
`count` and `simple` are two trivial OT type definitions if you want to take a look. JSON defines `count` and `simple` are two trivial OT type definitions if you want to take a look. JSON defines
the ot-for-JSON type (see the wiki for documentation) and all the text types define different text the ot-for-JSON type (see the wiki for documentation) and all the text types define different text
implementations. (I still have no idea which one I like the most, and they're fun to write!) implementations. (I still have no idea which one I like the most, and they're fun to write!)
# API # API
Types can also define API functions. These methods are mixed into the client's Doc object when a document is created. Types can also define API functions. These methods are mixed into the client's Doc object when a document is created.
@@ -27,7 +27,6 @@ services:
redis_test: redis_test:
condition: service_healthy condition: service_healthy
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -55,7 +54,6 @@ services:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -63,6 +61,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
redis_test: redis_test:
image: redis:7.4.3 image: redis:7.4.3
healthcheck: healthcheck:
@@ -83,4 +83,3 @@ services:
# replica set. This override is not needed when running the setup after # replica set. This override is not needed when running the setup after
# starting up mongo. # starting up mongo.
- mongo:127.0.0.1 - mongo:127.0.0.1
-2
View File
@@ -12,8 +12,6 @@
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"benchmark:apply": "node benchmarks/apply", "benchmark:apply": "node benchmarks/apply",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },
-1
View File
@@ -1 +0,0 @@
node_modules
+5 -6
View File
@@ -52,11 +52,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/filestore/reports:/overleaf/services/filestore/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/filestore/reports:/overleaf/services/filestore/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/filestore/reports:/overleaf/services/filestore/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -77,13 +76,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/filestore
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/filestore
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/filestore
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+10 -12
View File
@@ -1,21 +1,19 @@
overleaf/filestore # overleaf/filestore
====================
An API for CRUD operations on binary files stored in S3 An API for CRUD operations on binary files stored in S3
filestore acts as a proxy between the CLSIs and (currently) Amazon S3 storage, presenting a RESTful HTTP interface to the CLSIs on port 3009 by default. Urls are mapped to node functions in https://github.com/overleaf/filestore/blob/master/app.coffee . URLs are of the form: filestore acts as a proxy between the CLSIs and (currently) Amazon S3 storage, presenting a RESTful HTTP interface to the CLSIs on port 3009 by default. Urls are mapped to node functions in https://github.com/overleaf/filestore/blob/master/app.coffee . URLs are of the form:
* `/project/:project_id/file/:file_id` - `/project/:project_id/file/:file_id`
* `/template/:template_id/v/:version/:format` - `/template/:template_id/v/:version/:format`
* `/project/:project_id/public/:public_file_id` - `/project/:project_id/public/:public_file_id`
* `/project/:project_id/size` - `/project/:project_id/size`
* `/bucket/:bucket/key/*` - `/bucket/:bucket/key/*`
* `/shutdown` - `/shutdown`
* `/status` - returns HTTP 200 `filestore is up` or HTTP 503 when shutting down - `/status` - returns HTTP 200 `filestore is up` or HTTP 503 when shutting down
* `/health_check` - `/health_check`
License ## License
-------
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file. The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
+5 -5
View File
@@ -20,7 +20,6 @@ services:
NODE_OPTIONS: "--unhandled-rejections=strict" NODE_OPTIONS: "--unhandled-rejections=strict"
VITEST_NO_CACHE: true VITEST_NO_CACHE: true
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -29,7 +28,7 @@ services:
MONGO_HOST: mongo MONGO_HOST: mongo
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000 AWS_S3_ENDPOINT: https://minio:9000
AWS_S3_PATH_STYLE: 'true' AWS_S3_PATH_STYLE: "true"
DELETE_OBJECTS_MD5_FALLBACK: true DELETE_OBJECTS_MD5_FALLBACK: true
AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY
@@ -64,7 +63,6 @@ services:
user: node user: node
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -72,6 +70,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
certs: certs:
build: build:
dockerfile_inline: | dockerfile_inline: |
@@ -83,7 +82,7 @@ services:
working_dir: /certs working_dir: /certs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
if [ ! -f private.key ] || [ ! -f public.crt ]; then if [ ! -f private.key ] || [ ! -f public.crt ]; then
/certgen -host minio /certgen -host minio
@@ -115,7 +114,7 @@ services:
- minio-certs:/root/.mc/certs/CAs - minio-certs:/root/.mc/certs/CAs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
sleep 1 sleep 1
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \ mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
@@ -218,6 +217,7 @@ services:
mc admin policy create s3 overleaf-filestore policy-filestore.json mc admin policy create s3 overleaf-filestore policy-filestore.json
mc admin policy attach s3 overleaf-filestore \ mc admin policy attach s3 overleaf-filestore \
--user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID --user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
gcs: gcs:
image: fsouza/fake-gcs-server:1.52.3 image: fsouza/fake-gcs-server:1.52.3
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"] command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
+4 -3
View File
@@ -41,7 +41,7 @@ services:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000 AWS_S3_ENDPOINT: https://minio:9000
AWS_S3_PATH_STYLE: 'true' AWS_S3_PATH_STYLE: "true"
DELETE_OBJECTS_MD5_FALLBACK: true DELETE_OBJECTS_MD5_FALLBACK: true
AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY
@@ -85,7 +85,7 @@ services:
working_dir: /certs working_dir: /certs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
if [ ! -f private.key ] || [ ! -f public.crt ]; then if [ ! -f private.key ] || [ ! -f public.crt ]; then
/certgen -host minio /certgen -host minio
@@ -117,7 +117,7 @@ services:
- minio-certs:/root/.mc/certs/CAs - minio-certs:/root/.mc/certs/CAs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
sleep 1 sleep 1
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \ mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
@@ -220,6 +220,7 @@ services:
mc admin policy create s3 overleaf-filestore policy-filestore.json mc admin policy create s3 overleaf-filestore policy-filestore.json
mc admin policy attach s3 overleaf-filestore \ mc admin policy attach s3 overleaf-filestore \
--user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID --user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
gcs: gcs:
image: fsouza/fake-gcs-server:1.52.3 image: fsouza/fake-gcs-server:1.52.3
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"] command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
-2
View File
@@ -12,8 +12,6 @@
"start": "node app.js", "start": "node app.js",
"nodemon": "node --watch app.js", "nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js", "test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs", "test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
+3 -4
View File
@@ -3,7 +3,7 @@
## Docker ## Docker
The `Dockerfile` contains all the requirements for building and running the The `Dockerfile` contains all the requirements for building and running the
writelatex-git-bridge. writelatex-git-bridge.
```bash ```bash
# build the image # build the image
@@ -17,8 +17,8 @@ docker run -v `pwd`/conf/local.json:/conf/runtime.json writelatex-git-bridge
### Required packages ### Required packages
* `maven` (for building, running tests and packaging) - `maven` (for building, running tests and packaging)
* `jdk-8` (for compiling and running) - `jdk-8` (for compiling and running)
### Commands ### Commands
@@ -114,7 +114,6 @@ The configuration file is in `.json` format.
You have to restart the server for configuration changes to take effect. You have to restart the server for configuration changes to take effect.
## Creating OAuth app ## Creating OAuth app
In dev-env, run the following command in mongo to create the oauth application In dev-env, run the following command in mongo to create the oauth application
+28 -28
View File
@@ -1,30 +1,30 @@
{ {
"port": 8080, "port": 8080,
"bindIp": "127.0.0.1", "bindIp": "127.0.0.1",
"idleTimeout": 30000, "idleTimeout": 30000,
"rootGitDirectory": "/tmp/wlgb", "rootGitDirectory": "/tmp/wlgb",
"allowedCorsOrigins": "https://localhost", "allowedCorsOrigins": "https://localhost",
"apiBaseUrl": "https://localhost/api/v0", "apiBaseUrl": "https://localhost/api/v0",
"postbackBaseUrl": "https://localhost", "postbackBaseUrl": "https://localhost",
"serviceName": "Overleaf", "serviceName": "Overleaf",
"oauth2Server": "https://localhost", "oauth2Server": "https://localhost",
"repoStore": { "repoStore": {
"maxFileNum": 2000, "maxFileNum": 2000,
"maxFileSize": 52428800 "maxFileSize": 52428800
}, },
"swapStore": { "swapStore": {
"type": "s3", "type": "s3",
"awsAccessKey": "asdf", "awsAccessKey": "asdf",
"awsSecret": "asdf", "awsSecret": "asdf",
"s3BucketName": "com.overleaf.testbucket", "s3BucketName": "com.overleaf.testbucket",
"awsRegion": "us-east-1" "awsRegion": "us-east-1"
}, },
"swapJob": { "swapJob": {
"minProjects": 50, "minProjects": 50,
"lowGiB": 128, "lowGiB": 128,
"highGiB": 256, "highGiB": 256,
"intervalMillis": 3600000, "intervalMillis": 3600000,
"compressionMethod": "gzip" "compressionMethod": "gzip"
}, },
"sqliteHeapLimitBytes": 512000000 "sqliteHeapLimitBytes": 512000000
} }
+5 -6
View File
@@ -57,11 +57,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/history-v1/reports:/overleaf/services/history-v1/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/history-v1/reports:/overleaf/services/history-v1/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/history-v1/reports:/overleaf/services/history-v1/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -82,13 +81,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/history-v1
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/history-v1
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/history-v1
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint
+2
View File
@@ -3,11 +3,13 @@
The history service uses knex to manage PostgreSQL migrations. The history service uses knex to manage PostgreSQL migrations.
To create a new migrations, run: To create a new migrations, run:
``` ```
npx knex migrate:make migration_name npx knex migrate:make migration_name
``` ```
To apply migrations, run: To apply migrations, run:
``` ```
npx knex migrate:latest npx knex migrate:latest
``` ```
@@ -59,10 +59,10 @@
"zipTimeoutMs": "ZIP_STORE_ZIP_TIMEOUT_MS" "zipTimeoutMs": "ZIP_STORE_ZIP_TIMEOUT_MS"
}, },
"backupStore": { "backupStore": {
"chunksBucket":"BACKUP_OVERLEAF_EDITOR_CHUNKS_BUCKET", "chunksBucket": "BACKUP_OVERLEAF_EDITOR_CHUNKS_BUCKET",
"deksBucket":"BACKUP_OVERLEAF_EDITOR_DEKS_BUCKET", "deksBucket": "BACKUP_OVERLEAF_EDITOR_DEKS_BUCKET",
"globalBlobsBucket":"BACKUP_OVERLEAF_EDITOR_GLOBAL_BLOBS_BUCKET", "globalBlobsBucket": "BACKUP_OVERLEAF_EDITOR_GLOBAL_BLOBS_BUCKET",
"projectBlobsBucket":"BACKUP_OVERLEAF_EDITOR_PROJECT_BLOBS_BUCKET" "projectBlobsBucket": "BACKUP_OVERLEAF_EDITOR_PROJECT_BLOBS_BUCKET"
}, },
"healthCheckBlobs": "HEALTH_CHECK_BLOBS", "healthCheckBlobs": "HEALTH_CHECK_BLOBS",
"healthCheckProjects": "HEALTH_CHECK_PROJECTS", "healthCheckProjects": "HEALTH_CHECK_PROJECTS",
+4 -4
View File
@@ -24,10 +24,10 @@
"bucket": "overleaf-development-zips" "bucket": "overleaf-development-zips"
}, },
"backupStore": { "backupStore": {
"chunksBucket":"overleaf-development-history-chunks", "chunksBucket": "overleaf-development-history-chunks",
"deksBucket":"overleaf-development-history-deks", "deksBucket": "overleaf-development-history-deks",
"globalBlobsBucket":"overleaf-development-history-global-blobs", "globalBlobsBucket": "overleaf-development-history-global-blobs",
"projectBlobsBucket":"overleaf-development-history-project-blobs" "projectBlobsBucket": "overleaf-development-history-project-blobs"
}, },
"backupPersistor": { "backupPersistor": {
"keyEncryptionKeys": "[{\"key\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"salt\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}]", "keyEncryptionKeys": "[{\"key\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"salt\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}]",
+4 -4
View File
@@ -22,10 +22,10 @@
"bucket": "overleaf-test-zips" "bucket": "overleaf-test-zips"
}, },
"backupStore": { "backupStore": {
"chunksBucket":"overleaf-test-history-chunks", "chunksBucket": "overleaf-test-history-chunks",
"deksBucket":"overleaf-test-history-deks", "deksBucket": "overleaf-test-history-deks",
"globalBlobsBucket":"overleaf-test-history-global-blobs", "globalBlobsBucket": "overleaf-test-history-global-blobs",
"projectBlobsBucket":"overleaf-test-history-project-blobs" "projectBlobsBucket": "overleaf-test-history-project-blobs"
}, },
"backupPersistor": { "backupPersistor": {
"keyEncryptionKeys": "[{\"key\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"salt\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}]", "keyEncryptionKeys": "[{\"key\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"salt\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"}]",
+6 -5
View File
@@ -30,7 +30,6 @@ services:
redis_test: redis_test:
condition: service_healthy condition: service_healthy
test_acceptance: test_acceptance:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -44,7 +43,7 @@ services:
MONGO_HOST: mongo MONGO_HOST: mongo
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000 AWS_S3_ENDPOINT: https://minio:9000
AWS_S3_PATH_STYLE: 'true' AWS_S3_PATH_STYLE: "true"
DELETE_OBJECTS_MD5_FALLBACK: true DELETE_OBJECTS_MD5_FALLBACK: true
AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY
@@ -79,7 +78,6 @@ services:
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 -- entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
command: npm run test:acceptance command: npm run test:acceptance
tar: tar:
build: . build: .
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
@@ -87,6 +85,7 @@ services:
- ./:/tmp/build/ - ./:/tmp/build/
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs . command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
user: root user: root
redis_test: redis_test:
image: redis:7.4.3 image: redis:7.4.3
healthcheck: healthcheck:
@@ -108,6 +107,7 @@ services:
# replica set. This override is not needed when running the setup after # replica set. This override is not needed when running the setup after
# starting up mongo. # starting up mongo.
- mongo:127.0.0.1 - mongo:127.0.0.1
postgres: postgres:
image: postgres:10 image: postgres:10
environment: environment:
@@ -132,7 +132,7 @@ services:
working_dir: /certs working_dir: /certs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
if [ ! -f private.key ] || [ ! -f public.crt ]; then if [ ! -f private.key ] || [ ! -f public.crt ]; then
/certgen -host minio /certgen -host minio
@@ -164,7 +164,7 @@ services:
- minio-certs:/root/.mc/certs/CAs - minio-certs:/root/.mc/certs/CAs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
sleep 1 sleep 1
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \ mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
@@ -267,6 +267,7 @@ services:
mc admin policy create s3 overleaf-history policy-history.json mc admin policy create s3 overleaf-history policy-history.json
mc admin policy attach s3 overleaf-history \ mc admin policy attach s3 overleaf-history \
--user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID --user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
gcs: gcs:
image: fsouza/fake-gcs-server:1.52.3 image: fsouza/fake-gcs-server:1.52.3
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"] command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
+4 -3
View File
@@ -60,7 +60,7 @@ services:
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
AWS_S3_ENDPOINT: https://minio:9000 AWS_S3_ENDPOINT: https://minio:9000
AWS_S3_PATH_STYLE: 'true' AWS_S3_PATH_STYLE: "true"
DELETE_OBJECTS_MD5_FALLBACK: true DELETE_OBJECTS_MD5_FALLBACK: true
AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY
@@ -138,7 +138,7 @@ services:
working_dir: /certs working_dir: /certs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
if [ ! -f private.key ] || [ ! -f public.crt ]; then if [ ! -f private.key ] || [ ! -f public.crt ]; then
/certgen -host minio /certgen -host minio
@@ -170,7 +170,7 @@ services:
- minio-certs:/root/.mc/certs/CAs - minio-certs:/root/.mc/certs/CAs
entrypoint: sh entrypoint: sh
command: command:
- '-cex' - "-cex"
- | - |
sleep 1 sleep 1
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \ mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
@@ -273,6 +273,7 @@ services:
mc admin policy create s3 overleaf-history policy-history.json mc admin policy create s3 overleaf-history policy-history.json
mc admin policy attach s3 overleaf-history \ mc admin policy attach s3 overleaf-history \
--user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID --user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
gcs: gcs:
image: fsouza/fake-gcs-server:1.52.3 image: fsouza/fake-gcs-server:1.52.3
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"] command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
-2
View File
@@ -64,8 +64,6 @@
"start": "node app.js", "start": "node app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP", "test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
@@ -1,9 +1,9 @@
Scripts in this directory were used when we cleaned up the global blobs table, Scripts in this directory were used when we cleaned up the global blobs table,
ensuring that it only contained global blobs. The scripts are meant to be run in this order: ensuring that it only contained global blobs. The scripts are meant to be run in this order:
* `01-create-blob-hashes-table.sql` - `01-create-blob-hashes-table.sql`
* `02-set-global-flag.sql` - `02-set-global-flag.sql`
* `03-create-global-blobs-table.sql` - `03-create-global-blobs-table.sql`
* `04-swap-global-blob-tables.sql` - `04-swap-global-blob-tables.sql`
The `rollback.sql` can be run to reverse the effect of `03-swap-global-blob-tables.sql`. The `rollback.sql` can be run to reverse the effect of `03-swap-global-blob-tables.sql`.
+5 -6
View File
@@ -53,11 +53,10 @@ clean:
# 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:24.13.0 npm run --silent RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/notifications/reports:/overleaf/services/notifications/reports $(IMAGE_CI) npm run --silent RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/notifications/reports:/overleaf/services/notifications/reports $(IMAGE_CI) npm run --silent
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/notifications/reports:/overleaf/services/notifications/reports -w /overleaf $(IMAGE_CI) npm run --silent
# Same but from the top of the monorepo
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
SHELLCHECK_OPTS = \ SHELLCHECK_OPTS = \
--shell=bash \ --shell=bash \
@@ -78,13 +77,13 @@ shellcheck_fix:
done done
format: format:
$(RUN_LINTING) format $(RUN_LINTING_MONOREPO) format -- services/notifications
format_ci: format_ci:
$(RUN_LINTING_CI) format $(RUN_LINTING_CI_MONOREPO) format -- services/notifications
format_fix: format_fix:
$(RUN_LINTING) format:fix $(RUN_LINTING_MONOREPO) format:fix -- services/notifications
lint: lint:
$(RUN_LINTING) lint $(RUN_LINTING) lint

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