From 506aae5c5d1ad2a07cf7e133642384ad9788bce5 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:22:32 +0200 Subject: [PATCH 01/22] init overleaf 5.0 --- conf/settings.js | 200 +++++++++++++++++++++------------------------ conf/variables.env | 86 +++++++++---------- manifest.toml | 6 +- scripts/_common.sh | 4 +- 4 files changed, 141 insertions(+), 155 deletions(-) diff --git a/conf/settings.js b/conf/settings.js index 886a8fa..39b3d84 100644 --- a/conf/settings.js +++ b/conf/settings.js @@ -18,10 +18,12 @@ const Path = require('path') // These credentials are used for authenticating api requests // between services that may need to go over public channels -const httpAuthUser = 'sharelatex' +const httpAuthUser = process.env.WEB_API_USER const httpAuthPass = process.env.WEB_API_PASSWORD const httpAuthUsers = {} -httpAuthUsers[httpAuthUser] = httpAuthPass +if (httpAuthUser && httpAuthPass) { + httpAuthUsers[httpAuthUser] = httpAuthPass +} const parse = function (option) { if (option != null) { @@ -55,30 +57,30 @@ const settings = { port: __PORT__, allowAnonymousReadAndWriteSharing: - process.env.SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING === 'true', + process.env.OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING === 'true', // Databases // --------- - // ShareLaTeX's main persistent data store is MongoDB (http://www.mongodb.org/) + // Overleaf Community Edition's main persistent data store is MongoDB (http://www.mongodb.org/) // Documentation about the URL connection string format can be found at: // // http://docs.mongodb.org/manual/reference/connection-string/ // // The following works out of the box with Mongo's default settings: mongo: { - url: process.env.SHARELATEX_MONGO_URL || 'mongodb://dockerhost/sharelatex', + url: process.env.OVERLEAF_MONGO_URL || 'mongodb://dockerhost/sharelatex', }, - // Redis is used in ShareLaTeX for high volume queries, like real-time + // Redis is used in Overleaf Community Edition for high volume queries, like real-time // editing, and session management. // // The following config will work with Redis's default settings: redis: { web: (redisConfig = { - host: process.env.SHARELATEX_REDIS_HOST || 'dockerhost', - port: process.env.SHARELATEX_REDIS_PORT || '6379', - password: process.env.SHARELATEX_REDIS_PASS || undefined, + host: process.env.OVERLEAF_REDIS_HOST || 'dockerhost', + port: process.env.OVERLEAF_REDIS_PORT || '6379', + password: process.env.OVERLEAF_REDIS_PASS || undefined, key_schema: { // document-updater blockingKey({ doc_id }) { @@ -177,35 +179,35 @@ const settings = { // Server Config // ------------- - // Where your instance of ShareLaTeX can be found publicly. This is used + // Where your instance of Overleaf Community Edition can be found publicly. This is used // when emails are sent out and in generated links: - siteUrl: (siteUrl = process.env.SHARELATEX_SITE_URL || 'http://localhost'), + siteUrl: (siteUrl = process.env.OVERLEAF_SITE_URL || 'http://localhost'), // Status page URL as displayed on the maintenance/500 pages. - statusPageUrl: process.env.SHARELATEX_STATUS_PAGE_URL, + statusPageUrl: process.env.OVERLEAF_STATUS_PAGE_URL, - // The name this is used to describe your ShareLaTeX Installation - appName: process.env.SHARELATEX_APP_NAME || 'ShareLaTeX (Community Edition)', + // The name this is used to describe your Overleaf Community Edition Installation + appName: process.env.OVERLEAF_APP_NAME || 'Overleaf Community Edition', restrictInvitesToExistingAccounts: - process.env.SHARELATEX_RESTRICT_INVITES_TO_EXISTING_ACCOUNTS === 'true', + process.env.OVERLEAF_RESTRICT_INVITES_TO_EXISTING_ACCOUNTS === 'true', nav: { title: - process.env.SHARELATEX_NAV_TITLE || - process.env.SHARELATEX_APP_NAME || - 'ShareLaTeX Community Edition', + process.env.OVERLEAF_NAV_TITLE || + process.env.OVERLEAF_APP_NAME || + 'Overleaf Community Edition', }, // The email address which users will be directed to as the main point of - // contact for this installation of ShareLaTeX. - adminEmail: process.env.SHARELATEX_ADMIN_EMAIL || 'placeholder@example.com', + // contact for this installation of Overleaf Community Edition. + adminEmail: process.env.OVERLEAF_ADMIN_EMAIL || 'placeholder@example.com', // If provided, a sessionSecret is used to sign cookies so that they cannot be // spoofed. This is recommended. security: { sessionSecret: - process.env.SHARELATEX_SESSION_SECRET || process.env.CRYPTO_RANDOM, + process.env.OVERLEAF_SESSION_SECRET || process.env.CRYPTO_RANDOM, }, // These credentials are used for authenticating api requests @@ -220,36 +222,36 @@ const settings = { // but should be set to true in production. cacheStaticAssets: true, - // If you are running ShareLaTeX over https, set this to true to send the + // If you are running Overleaf Community Edition over https, set this to true to send the // cookie with a secure flag (recommended). - secureCookie: process.env.SHARELATEX_SECURE_COOKIE != null, + secureCookie: process.env.OVERLEAF_SECURE_COOKIE != null, - // If you are running ShareLaTeX behind a proxy (like Apache, Nginx, etc) + // If you are running Overleaf Community Edition behind a proxy (like Apache, Nginx, etc) // then set this to true to allow it to correctly detect the forwarded IP // address and http/https protocol information. - behindProxy: process.env.SHARELATEX_BEHIND_PROXY || false, - trustedProxyIps: process.env.SHARELATEX_TRUSTED_PROXY_IPS, + behindProxy: process.env.OVERLEAF_BEHIND_PROXY || false, + trustedProxyIps: process.env.OVERLEAF_TRUSTED_PROXY_IPS, // The amount of time, in milliseconds, until the (rolling) cookie session expires cookieSessionLength: parseInt( - process.env.SHARELATEX_COOKIE_SESSION_LENGTH || 5 * 24 * 60 * 60 * 1000, // default 5 days + process.env.OVERLEAF_COOKIE_SESSION_LENGTH || 5 * 24 * 60 * 60 * 1000, // default 5 days 10 ), redisLockTTLSeconds: parseInt( - process.env.SHARELATEX_REDIS_LOCK_TTL_SECONDS || '60', + process.env.OVERLEAF_REDIS_LOCK_TTL_SECONDS || '60', 10 ), i18n: { subdomainLang: { www: { - lngCode: process.env.SHARELATEX_SITE_LANGUAGE || 'en', + lngCode: process.env.OVERLEAF_SITE_LANGUAGE || 'en', url: siteUrl, }, }, - defaultLng: process.env.SHARELATEX_SITE_LANGUAGE || 'en', + defaultLng: process.env.OVERLEAF_SITE_LANGUAGE || 'en', }, currentImageName: process.env.TEX_LIVE_DOCKER_IMAGE, @@ -269,7 +271,7 @@ const settings = { user: 'staging', pass: process.env.STAGING_PASSWORD, requestTimeout: parseInt( - process.env.SHARELATEX_HISTORY_V1_HTTP_REQUEST_TIMEOUT || '300000', // default is 5min + process.env.OVERLEAF_HISTORY_V1_HTTP_REQUEST_TIMEOUT || '300000', // default is 5min 10 ), }, @@ -291,48 +293,35 @@ const settings = { // # OPTIONAL CONFIGURABLE SETTINGS -if (process.env.SHARELATEX_LEFT_FOOTER != null) { +if (process.env.OVERLEAF_LEFT_FOOTER != null) { try { - settings.nav.left_footer = JSON.parse(process.env.SHARELATEX_LEFT_FOOTER) + settings.nav.left_footer = JSON.parse(process.env.OVERLEAF_LEFT_FOOTER) } catch (error) { e = error - console.error('could not parse SHARELATEX_LEFT_FOOTER, not valid JSON') + console.error('could not parse OVERLEAF_LEFT_FOOTER, not valid JSON') } } -if (process.env.SHARELATEX_RIGHT_FOOTER != null) { - settings.nav.right_footer = process.env.SHARELATEX_RIGHT_FOOTER +if (process.env.OVERLEAF_RIGHT_FOOTER != null) { + settings.nav.right_footer = process.env.OVERLEAF_RIGHT_FOOTER try { - settings.nav.right_footer = JSON.parse(process.env.SHARELATEX_RIGHT_FOOTER) + settings.nav.right_footer = JSON.parse(process.env.OVERLEAF_RIGHT_FOOTER) } catch (error1) { e = error1 - console.error('could not parse SHARELATEX_RIGHT_FOOTER, not valid JSON') + console.error('could not parse OVERLEAF_RIGHT_FOOTER, not valid JSON') } } -if (process.env.SHARELATEX_HEADER_IMAGE_URL != null) { - settings.nav.custom_logo = process.env.SHARELATEX_HEADER_IMAGE_URL +if (process.env.OVERLEAF_HEADER_IMAGE_URL != null) { + settings.nav.custom_logo = process.env.OVERLEAF_HEADER_IMAGE_URL } -if (process.env.SHARELATEX_HEADER_NAV_LINKS != null) { - console.error(`\ -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# -# WARNING: SHARELATEX_HEADER_NAV_LINKS is no longer supported -# See https://github.com/sharelatex/sharelatex/wiki/Configuring-Headers,-Footers-&-Logo -# -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\ -`) -} - -if (process.env.SHARELATEX_HEADER_EXTRAS != null) { +if (process.env.OVERLEAF_HEADER_EXTRAS != null) { try { - settings.nav.header_extras = JSON.parse( - process.env.SHARELATEX_HEADER_EXTRAS - ) + settings.nav.header_extras = JSON.parse(process.env.OVERLEAF_HEADER_EXTRAS) } catch (error2) { e = error2 - console.error('could not parse SHARELATEX_HEADER_EXTRAS, not valid JSON') + console.error('could not parse OVERLEAF_HEADER_EXTRAS, not valid JSON') } } @@ -340,65 +329,62 @@ if (process.env.SHARELATEX_HEADER_EXTRAS != null) { // ------------- // // You must configure a mail server to be able to send invite emails from -// ShareLaTeX. The config settings are passed to nodemailer. See the nodemailer +// Overleaf Community Edition. The config settings are passed to nodemailer. See the nodemailer // documentation for available options: // // http://www.nodemailer.com/docs/transports -if (process.env.SHARELATEX_EMAIL_FROM_ADDRESS != null) { +if (process.env.OVERLEAF_EMAIL_FROM_ADDRESS != null) { settings.email = { - fromAddress: process.env.SHARELATEX_EMAIL_FROM_ADDRESS, - replyTo: process.env.SHARELATEX_EMAIL_REPLY_TO || '', - driver: process.env.SHARELATEX_EMAIL_DRIVER, + fromAddress: process.env.OVERLEAF_EMAIL_FROM_ADDRESS, + replyTo: process.env.OVERLEAF_EMAIL_REPLY_TO || '', + driver: process.env.OVERLEAF_EMAIL_DRIVER, parameters: { // AWS Creds - AWSAccessKeyID: process.env.SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID, - AWSSecretKey: process.env.SHARELATEX_EMAIL_AWS_SES_SECRET_KEY, + AWSAccessKeyID: process.env.OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID, + AWSSecretKey: process.env.OVERLEAF_EMAIL_AWS_SES_SECRET_KEY, // SMTP Creds - host: process.env.SHARELATEX_EMAIL_SMTP_HOST, - port: process.env.SHARELATEX_EMAIL_SMTP_PORT, - secure: parse(process.env.SHARELATEX_EMAIL_SMTP_SECURE), - ignoreTLS: parse(process.env.SHARELATEX_EMAIL_SMTP_IGNORE_TLS), - name: process.env.SHARELATEX_EMAIL_SMTP_NAME, - logger: process.env.SHARELATEX_EMAIL_SMTP_LOGGER === 'true', + host: process.env.OVERLEAF_EMAIL_SMTP_HOST, + port: process.env.OVERLEAF_EMAIL_SMTP_PORT, + secure: parse(process.env.OVERLEAF_EMAIL_SMTP_SECURE), + ignoreTLS: parse(process.env.OVERLEAF_EMAIL_SMTP_IGNORE_TLS), + name: process.env.OVERLEAF_EMAIL_SMTP_NAME, + logger: process.env.OVERLEAF_EMAIL_SMTP_LOGGER === 'true', }, - textEncoding: process.env.SHARELATEX_EMAIL_TEXT_ENCODING, + textEncoding: process.env.OVERLEAF_EMAIL_TEXT_ENCODING, template: { - customFooter: process.env.SHARELATEX_CUSTOM_EMAIL_FOOTER, + customFooter: process.env.OVERLEAF_CUSTOM_EMAIL_FOOTER, }, } - if (process.env.SHARELATEX_EMAIL_AWS_SES_REGION != null) { - settings.email.parameters.region = - process.env.SHARELATEX_EMAIL_AWS_SES_REGION + if (process.env.OVERLEAF_EMAIL_AWS_SES_REGION != null) { + settings.email.parameters.region = process.env.OVERLEAF_EMAIL_AWS_SES_REGION } if ( - process.env.SHARELATEX_EMAIL_SMTP_USER != null || - process.env.SHARELATEX_EMAIL_SMTP_PASS != null + process.env.OVERLEAF_EMAIL_SMTP_USER != null || + process.env.OVERLEAF_EMAIL_SMTP_PASS != null ) { settings.email.parameters.auth = { - user: process.env.SHARELATEX_EMAIL_SMTP_USER, - pass: process.env.SHARELATEX_EMAIL_SMTP_PASS, + user: process.env.OVERLEAF_EMAIL_SMTP_USER, + pass: process.env.OVERLEAF_EMAIL_SMTP_PASS, } } - if (process.env.SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH != null) { + if (process.env.OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH != null) { settings.email.parameters.tls = { rejectUnauthorized: parse( - process.env.SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH + process.env.OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH ), } } } // i18n -if (process.env.SHARELATEX_LANG_DOMAIN_MAPPING != null) { - settings.i18n.subdomainLang = parse( - process.env.SHARELATEX_LANG_DOMAIN_MAPPING - ) +if (process.env.OVERLEAF_LANG_DOMAIN_MAPPING != null) { + settings.i18n.subdomainLang = parse(process.env.OVERLEAF_LANG_DOMAIN_MAPPING) } // Password Settings @@ -406,24 +392,24 @@ if (process.env.SHARELATEX_LANG_DOMAIN_MAPPING != null) { // These restrict the passwords users can use when registering // opts are from http://antelle.github.io/passfield if ( - process.env.SHARELATEX_PASSWORD_VALIDATION_PATTERN || - process.env.SHARELATEX_PASSWORD_VALIDATION_MIN_LENGTH || - process.env.SHARELATEX_PASSWORD_VALIDATION_MAX_LENGTH + process.env.OVERLEAF_PASSWORD_VALIDATION_PATTERN || + process.env.OVERLEAF_PASSWORD_VALIDATION_MIN_LENGTH || + process.env.OVERLEAF_PASSWORD_VALIDATION_MAX_LENGTH ) { settings.passwordStrengthOptions = { - pattern: process.env.SHARELATEX_PASSWORD_VALIDATION_PATTERN || 'aA$3', + pattern: process.env.OVERLEAF_PASSWORD_VALIDATION_PATTERN || 'aA$3', length: { - min: process.env.SHARELATEX_PASSWORD_VALIDATION_MIN_LENGTH || 8, - max: process.env.SHARELATEX_PASSWORD_VALIDATION_MAX_LENGTH || 72, + min: process.env.OVERLEAF_PASSWORD_VALIDATION_MIN_LENGTH || 8, + max: process.env.OVERLEAF_PASSWORD_VALIDATION_MAX_LENGTH || 72, }, } } // ###################### -// ShareLaTeX Server Pro +// Overleaf Server Pro // ###################### -if (parse(process.env.SHARELATEX_IS_SERVER_PRO) === true) { +if (parse(process.env.OVERLEAF_IS_SERVER_PRO) === true) { settings.bypassPercentageRollouts = true settings.apis.references = { url: 'http://localhost:3040' } } @@ -464,21 +450,21 @@ if (process.env.SANDBOXED_COMPILES === 'true') { // Templates // --------- -if (process.env.SHARELATEX_TEMPLATES_USER_ID) { +if (process.env.OVERLEAF_TEMPLATES_USER_ID) { settings.templates = { mountPointUrl: '/templates', - user_id: process.env.SHARELATEX_TEMPLATES_USER_ID, + user_id: process.env.OVERLEAF_TEMPLATES_USER_ID, } settings.templateLinks = parse( - process.env.SHARELATEX_NEW_PROJECT_TEMPLATE_LINKS + process.env.OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS ) } // /Learn // ------- -if (process.env.SHARELATEX_PROXY_LEARN != null) { - settings.proxyLearn = parse(process.env.SHARELATEX_PROXY_LEARN) +if (process.env.OVERLEAF_PROXY_LEARN != null) { + settings.proxyLearn = parse(process.env.OVERLEAF_PROXY_LEARN) if (settings.proxyLearn) { settings.nav.header_extras = [ { @@ -491,33 +477,33 @@ if (process.env.SHARELATEX_PROXY_LEARN != null) { // /References // ----------- -if (process.env.SHARELATEX_ELASTICSEARCH_URL != null) { +if (process.env.OVERLEAF_ELASTICSEARCH_URL != null) { settings.references.elasticsearch = { - host: process.env.SHARELATEX_ELASTICSEARCH_URL, + host: process.env.OVERLEAF_ELASTICSEARCH_URL, } } // filestore -switch (process.env.SHARELATEX_FILESTORE_BACKEND) { +switch (process.env.OVERLEAF_FILESTORE_BACKEND) { case 's3': settings.filestore = { backend: 's3', stores: { - user_files: process.env.SHARELATEX_FILESTORE_USER_FILES_BUCKET_NAME, + user_files: process.env.OVERLEAF_FILESTORE_USER_FILES_BUCKET_NAME, template_files: - process.env.SHARELATEX_FILESTORE_TEMPLATE_FILES_BUCKET_NAME, + process.env.OVERLEAF_FILESTORE_TEMPLATE_FILES_BUCKET_NAME, }, s3: { key: - process.env.SHARELATEX_FILESTORE_S3_ACCESS_KEY_ID || + process.env.OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID || process.env.AWS_ACCESS_KEY_ID, secret: - process.env.SHARELATEX_FILESTORE_S3_SECRET_ACCESS_KEY || + process.env.OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY || process.env.AWS_SECRET_ACCESS_KEY, - endpoint: process.env.SHARELATEX_FILESTORE_S3_ENDPOINT, - pathStyle: process.env.SHARELATEX_FILESTORE_S3_PATH_STYLE === 'true', + endpoint: process.env.OVERLEAF_FILESTORE_S3_ENDPOINT, + pathStyle: process.env.OVERLEAF_FILESTORE_S3_PATH_STYLE === 'true', region: - process.env.SHARELATEX_FILESTORE_S3_REGION || + process.env.OVERLEAF_FILESTORE_S3_REGION || process.env.AWS_DEFAULT_REGION, }, } diff --git a/conf/variables.env b/conf/variables.env index d3fb155..fbbaa97 100644 --- a/conf/variables.env +++ b/conf/variables.env @@ -1,7 +1,7 @@ -SHARELATEX_APP_NAME="YunoHost Overleaf Community Edition" -SHARELATEX_PORT=__PORT__ +OVERLEAF_APP_NAME="YunoHost Overleaf Community Edition" +OVERLEAF_PORT=__PORT__ -SHARELATEX_CONFIG="__INSTALL_DIR__/settings.js" +OVERLEAF_CONFIG="__INSTALL_DIR__/settings.js" ADMIN_PRIVILEGE_AVAILABLE=true OPTIMISE_PDF=true NODE_ENV=production @@ -11,19 +11,19 @@ WEB_API_USER="__APP__" WEB_API_PASSWORD=__WEB_API_PASSWORD__ CRYPTO_RANDOM=__CRYPTO_RANDOM__ -SHARELATEX_MONGO_URL="mongodb://127.0.0.1:27017/__DB_NAME__" +OVERLEAF_MONGO_URL="mongodb://127.0.0.1:27017/__DB_NAME__" -SHARELATEX_REDIS_HOST="localhost" +OVERLEAF_REDIS_HOST="localhost" REDIS_HOST="localhost" REDIS_PORT=6379 -SHARELATEX_SITE_LANGUAGE="__LANGUAGE__" +OVERLEAF_SITE_LANGUAGE="__LANGUAGE__" ENABLED_LINKED_FILE_TYPES=project_file,project_output_file -SHARELATEX_ALLOW_PUBLIC_ACCESS=true -SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING=true +OVERLEAF_ALLOW_PUBLIC_ACCESS=true +OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING=true # Enables Thumbnail generation using ImageMagick ENABLE_CONVERSIONS=true @@ -40,32 +40,32 @@ TEXMFVAR=__INSTALL_DIR__/tmp/texmf-var # NGINX_WORKER_CONNECTIONS=768 ## Set for TLS via nginx-proxy -SHARELATEX_BEHIND_PROXY=true -SHARELATEX_SECURE_COOKIE=false +OVERLEAF_BEHIND_PROXY=true +OVERLEAF_SECURE_COOKIE=false -SHARELATEX_SITE_URL=https://__DOMAIN__ -# SHARELATEX_NAV_TITLE=Our Overleaf Instance -# SHARELATEX_HEADER_IMAGE_URL=http://somewhere.com/mylogo.png -SHARELATEX_ADMIN_EMAIL=__APP__@__DOMAIN__ +OVERLEAF_SITE_URL=https://__DOMAIN__ +# OVERLEAF_NAV_TITLE=Our Overleaf Instance +# OVERLEAF_HEADER_IMAGE_URL=http://somewhere.com/mylogo.png +OVERLEAF_ADMIN_EMAIL=__APP__@__DOMAIN__ -# SHARELATEX_LEFT_FOOTER=[{"text":"Powered by Overleaf © 2021", "url": "https://www.overleaf.com"}, {"text": "Contact your support team", "url": "mailto:support@example.com"} ] -# SHARELATEX_RIGHT_FOOTER=[{"text":"Hello I am on the Right"}] +# OVERLEAF_LEFT_FOOTER=[{"text":"Powered by Overleaf © 2021", "url": "https://www.overleaf.com"}, {"text": "Contact your support team", "url": "mailto:support@example.com"} ] +# OVERLEAF_RIGHT_FOOTER=[{"text":"Hello I am on the Right"}] -SHARELATEX_EMAIL_FROM_ADDRESS=__APP__@__DOMAIN__ +OVERLEAF_EMAIL_FROM_ADDRESS=__APP__@__DOMAIN__ -# SHARELATEX_EMAIL_AWS_SES_ACCESS_KEY_ID= -# SHARELATEX_EMAIL_AWS_SES_SECRET_KEY= +# OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID= +# OVERLEAF_EMAIL_AWS_SES_SECRET_KEY= -SHARELATEX_EMAIL_SMTP_HOST=__MAIN_DOMAIN__ -SHARELATEX_EMAIL_SMTP_PORT=587 -# SHARELATEX_EMAIL_SMTP_SECURE=true -SHARELATEX_EMAIL_SMTP_USER=__APP__ -SHARELATEX_EMAIL_SMTP_PASS=__MAIL_PWD__ -SHARELATEX_EMAIL_SMTP_NAME=__APP__@__DOMAIN__ -# SHARELATEX_EMAIL_SMTP_LOGGER=false -# SHARELATEX_EMAIL_SMTP_TLS_REJECT_UNAUTH=true -# SHARELATEX_EMAIL_SMTP_IGNORE_TLS=false -# SHARELATEX_CUSTOM_EMAIL_FOOTER=This system is run by department x +OVERLEAF_EMAIL_SMTP_HOST=__MAIN_DOMAIN__ +OVERLEAF_EMAIL_SMTP_PORT=587 +# OVERLEAF_EMAIL_SMTP_SECURE=true +OVERLEAF_EMAIL_SMTP_USER=__APP__ +OVERLEAF_EMAIL_SMTP_PASS=__MAIL_PWD__ +OVERLEAF_EMAIL_SMTP_NAME=__APP__@__DOMAIN__ +# OVERLEAF_EMAIL_SMTP_LOGGER=false +# OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH=true +# OVERLEAF_EMAIL_SMTP_IGNORE_TLS=false +# OVERLEAF_CUSTOM_EMAIL_FOOTER=This system is run by department x OT_JWT_AUTH_KEY=__JWT_KEY__ @@ -83,20 +83,20 @@ OT_JWT_AUTH_KEY=__JWT_KEY__ #LDAP_CONTACTS=false # EXTERNAL_AUTH=ldap -# SHARELATEX_LDAP_URL=ldap://localhost:389 -# SHARELATEX_LDAP_SEARCH_BASE=ou=users,dc=yunohost,dc=org -# SHARELATEX_LDAP_SEARCH_FILTER=(uid={{username}}) -# SHARELATEX_LDAP_BIND_DN=cn=admin,dc=planetexpress,dc=com -# SHARELATEX_LDAP_BIND_CREDENTIALS=GoodNewsEveryone -# SHARELATEX_LDAP_EMAIL_ATT=mail -# SHARELATEX_LDAP_NAME_ATT=cn -# SHARELATEX_LDAP_LAST_NAME_ATT=sn -# SHARELATEX_LDAP_UPDATE_USER_DETAILS_ON_LOGIN=true +# OVERLEAF_LDAP_URL=ldap://localhost:389 +# OVERLEAF_LDAP_SEARCH_BASE=ou=users,dc=yunohost,dc=org +# 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 -# SHARELATEX_TEMPLATES_USER_ID=578773160210479700917ee5 -# SHARELATEX_NEW_PROJECT_TEMPLATE_LINKS=[{"name":"All Templates","url":"/templates/all"}] +# OVERLEAF_TEMPLATES_USER_ID=578773160210479700917ee5 +# OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS=[{"name":"All Templates","url":"/templates/all"}] -# TEX_LIVE_DOCKER_IMAGE=quay.io/sharelatex/texlive-full:2021.1 -# ALL_TEX_LIVE_DOCKER_IMAGES=quay.io/sharelatex/texlive-full:2021.1,quay.io/sharelatex/texlive-full:2020.1 +# TEX_LIVE_DOCKER_IMAGE=quay.io/OVERLEAF/texlive-full:2021.1 +# ALL_TEX_LIVE_DOCKER_IMAGES=quay.io/OVERLEAF/texlive-full:2021.1,quay.io/OVERLEAF/texlive-full:2020.1 -# SHARELATEX_PROXY_LEARN=true \ No newline at end of file +# OVERLEAF_PROXY_LEARN=true \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 8936d35..12eed41 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Overleaf" description.en = "Online real-time collaborative LaTeX editor" description.fr = "Éditeur LaTeX collaboratif en ligne et en temps réel" -version = "2024.01.26~ynh1" +version = "2024.04.09~ynh1" maintainers = [] @@ -51,8 +51,8 @@ ram.runtime = "3G" [resources] [resources.sources] [resources.sources.main] - url = "https://github.com/overleaf/overleaf/archive/fdf8ebe001ec91dc3ab5c23b47bbbb03dc03d1bb.tar.gz" - sha256 = "802e3c0add7690c211fc039f94e1fceffe83040e7e60b0c340f35703087f1704" + url = "https://github.com/overleaf/overleaf/archive/af037ddb439505e1171f51d1a3e676a67fe98c9d.tar.gz" + sha256 = "403e9572b32addb4252de171191200510af70cdb868e90838091183e3ebec9a7" [resources.system_user] allow_email = true diff --git a/scripts/_common.sh b/scripts/_common.sh index 859e2ce..fc8a07f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=18.18.2 +nodejs_version=18.20.1 #================================================= # PERSONAL HELPERS @@ -14,7 +14,7 @@ nodejs_version=18.18.2 # EXPERIMENTAL HELPERS #================================================= -readonly YNH_DEFAULT_MONGO_VERSION=4.4 +readonly YNH_DEFAULT_MONGO_VERSION=5.0 # Declare the actual MongoDB version to use: 4.4 ; 5.0 ; 6.0 # A packager willing to use another version of MongoDB can override the variable into its _common.sh. YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION} From 4ac04e74317a3e3d6063f381c980ff516e8d2343 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 9 Apr 2024 17:22:36 +0000 Subject: [PATCH 02/22] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d0f6ce..63c9d8e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. Overleaf is an open-source online real-time collaborative LaTeX editor. -**Shipped version:** 2024.01.26~ynh1 +**Shipped version:** 2024.04.09~ynh1 ## Screenshots diff --git a/README_eu.md b/README_eu.md index cfb6bc5..c3c5dfe 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. Overleaf is an open-source online real-time collaborative LaTeX editor. -**Paketatutako bertsioa:** 2024.01.26~ynh1 +**Paketatutako bertsioa:** 2024.04.09~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 15b2c31..1757761 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. Overleaf est un éditeur LaTeX collaboratif en ligne et en temps réel open source. -**Version incluse :** 2024.01.26~ynh1 +**Version incluse :** 2024.04.09~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 0837763..cef4184 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. Overleaf is an open-source online real-time collaborative LaTeX editor. -**Versión proporcionada:** 2024.01.26~ynh1 +**Versión proporcionada:** 2024.04.09~ynh1 ## Capturas de pantalla From 0b1ec1ad0fec846a002c66913c2024a62d365509 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 9 Apr 2024 21:26:21 +0200 Subject: [PATCH 03/22] autoupdate --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 12eed41..8ac7900 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,6 +53,7 @@ ram.runtime = "3G" [resources.sources.main] url = "https://github.com/overleaf/overleaf/archive/af037ddb439505e1171f51d1a3e676a67fe98c9d.tar.gz" sha256 = "403e9572b32addb4252de171191200510af70cdb868e90838091183e3ebec9a7" + autoupdate.strategy = "latest_github_commit" [resources.system_user] allow_email = true From f7bedf1e1bb404d84c5733edd14bb6725db08a16 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:02:27 +0200 Subject: [PATCH 04/22] add test upgrade --- tests.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests.toml b/tests.toml index cbbeef1..86bb299 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,5 @@ test_format = 1.0 [default] + +test_upgrade_from.c5e7ec1.name = "Overleaf 4.x" From 40eeed052cc79018b088200768574e9b3bd0b4d6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:19:26 +0200 Subject: [PATCH 05/22] --full_replace=1 --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f16f6b4..bd8ec60 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,7 +84,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir/build" + ynh_setup_source --dest_dir="$install_dir/build" --full_replace=1 fi chmod 750 "$install_dir" From 38d401c803b2bea861c8bf7ef033dadfe169ed14 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:17:30 +0200 Subject: [PATCH 06/22] npm install before npm ci --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index bd8ec60..5fc875d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,6 +149,7 @@ cp "$install_dir/build/server-ce/config/custom-environment-variables.json" "$ins ynh_script_progression --message="Building app... This may take a LOT of time depending of your CPU" --weight=25 pushd "$install_dir/live" ynh_use_nodejs + ynh_exec_warn_less npm install ynh_exec_warn_less npm ci popd From 87ef7060eecdbfcfd5e07e23b5b4962e61ea621a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:45:09 +0200 Subject: [PATCH 07/22] update mongo helper --- scripts/_common.sh | 420 ++++++++++++++++++++++----------------------- 1 file changed, 209 insertions(+), 211 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index fc8a07f..d355291 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -25,100 +25,100 @@ YNH_MONGO_VERSION=${YNH_MONGO_VERSION:-$YNH_DEFAULT_MONGO_VERSION} # example: ynh_mongo_exec --command="db.getMongo().getDBNames().indexOf(\"wekan\")" # # usage: ynh_mongo_exec [--user=user] [--password=password] [--authenticationdatabase=authenticationdatabase] [--database=database] [--host=host] [--port=port] --command="command" [--eval] -# | arg: -u, --user= - The user name to connect as -# | arg: -p, --password= - The user password -# | arg: -d, --authenticationdatabase= - The authenticationdatabase to connect to -# | arg: -d, --database= - The database to connect to -# | arg: -h, --host= - The host to connect to -# | arg: -P, --port= - The port to connect to -# | arg: -c, --command= - The command to evaluate -# | arg: -e, --eval - Evaluate instead of execute the command. +# | arg: -u, --user= - The user name to connect as +# | arg: -p, --password= - The user password +# | arg: -d, --authenticationdatabase= - The authenticationdatabase to connect to +# | arg: -d, --database= - The database to connect to +# | arg: -h, --host= - The host to connect to +# | arg: -P, --port= - The port to connect to +# | arg: -c, --command= - The command to evaluate +# | arg: -e, --eval - Evaluate instead of execute the command. # # ynh_mongo_exec() { - # Declare an array to define the options of this helper. - local legacy_args=upadhPce - local -A args_array=( [u]=user= [p]=password= [a]=authenticationdatabase= [d]=database= [h]=host= [P]=port= [c]=command= [e]=eval ) - local user - local password - local authenticationdatabase - local database - local host - local port - local command - local eval - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - user="${user:-}" - password="${password:-}" - authenticationdatabase="${authenticationdatabase:-}" - database="${database:-}" - host="${host:-}" - port="${port:-}" - eval=${eval:-0} + # Declare an array to define the options of this helper. + local legacy_args=upadhPce + local -A args_array=( [u]=user= [p]=password= [a]=authenticationdatabase= [d]=database= [h]=host= [P]=port= [c]=command= [e]=eval ) + local user + local password + local authenticationdatabase + local database + local host + local port + local command + local eval + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + user="${user:-}" + password="${password:-}" + authenticationdatabase="${authenticationdatabase:-}" + database="${database:-}" + host="${host:-}" + port="${port:-}" + eval=${eval:-0} - # If user is provided - if [ -n "$user" ] - then - user="--username=$user" + # If user is provided + if [ -n "$user" ] + then + user="--username=$user" - # If password is provided - if [ -n "$password" ] - then - password="--password=$password" - fi + # If password is provided + if [ -n "$password" ] + then + password="--password=$password" + fi - # If authenticationdatabase is provided - if [ -n "$authenticationdatabase" ] - then - authenticationdatabase="--authenticationDatabase=$authenticationdatabase" - else - authenticationdatabase="--authenticationDatabase=admin" - fi - else - password="" - authenticationdatabase="" - fi + # If authenticationdatabase is provided + if [ -n "$authenticationdatabase" ] + then + authenticationdatabase="--authenticationDatabase=$authenticationdatabase" + else + authenticationdatabase="--authenticationDatabase=admin" + fi + else + password="" + authenticationdatabase="" + fi - # If host is provided - if [ -n "$host" ] - then - host="--host=$host" - fi + # If host is provided + if [ -n "$host" ] + then + host="--host=$host" + fi - # If port is provided - if [ -n "$port" ] - then - port="--port=$port" - fi + # If port is provided + if [ -n "$port" ] + then + port="--port=$port" + fi - # If eval is not provided - if [ $eval -eq 0 ] - then - # If database is provided - if [ -n "$database" ] - then - database="use $database" - else - database="" - fi + # If eval is not provided + if [ $eval -eq 0 ] + then + # If database is provided + if [ -n "$database" ] + then + database="use $database" + else + database="" + fi - mongosh --quiet --username $user --password $password --authenticationDatabase $authenticationdatabase --host $host --port $port < ./dump.bson # # usage: ynh_mongo_dump_db --database=database -# | arg: -d, --database= - The database name to dump +# | arg: -d, --database= - The database name to dump # | ret: the mongodump output # # ynh_mongo_dump_db() { - # Declare an array to define the options of this helper. - local legacy_args=d - local -A args_array=( [d]=database= ) - local database - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=d + local -A args_array=( [d]=database= ) + local database + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - mongodump --quiet --db="$database" --archive + mongodump --quiet --db="$database" --archive } # Create a user @@ -168,49 +168,49 @@ ynh_mongo_dump_db() { # [internal] # # usage: ynh_mongo_create_user --db_user=user --db_pwd=pwd --db_name=name -# | arg: -u, --db_user= - The user name to create -# | arg: -p, --db_pwd= - The password to identify user by -# | arg: -n, --db_name= - Name of the database to grant privilegies +# | arg: -u, --db_user= - The user name to create +# | arg: -p, --db_pwd= - The password to identify user by +# | arg: -n, --db_name= - Name of the database to grant privilegies # # ynh_mongo_create_user() { - # Declare an array to define the options of this helper. - local legacy_args=unp - local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) - local db_user - local db_name - local db_pwd - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=unp + local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) + local db_user + local db_name + local db_pwd + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - # Create the user and set the user as admin of the db - ynh_mongo_exec --database="$db_name" --command='db.createUser( { user: "'${db_user}'", pwd: "'${db_pwd}'", roles: [ { role: "readWrite", db: "'${db_name}'" } ] } );' + # Create the user and set the user as admin of the db + ynh_mongo_exec --database="$db_name" --command='db.createUser( { user: "'${db_user}'", pwd: "'${db_pwd}'", roles: [ { role: "readWrite", db: "'${db_name}'" } ] } );' - # Add clustermonitoring rights - ynh_mongo_exec --database="$db_name" --command='db.grantRolesToUser("'${db_user}'",[{ role: "clusterMonitor", db: "admin" }]);' + # Add clustermonitoring rights + ynh_mongo_exec --database="$db_name" --command='db.grantRolesToUser("'${db_user}'",[{ role: "clusterMonitor", db: "admin" }]);' } # Check if a mongo database exists # # usage: ynh_mongo_database_exists --database=database -# | arg: -d, --database= - The database for which to check existence +# | arg: -d, --database= - The database for which to check existence # | exit: Return 1 if the database doesn't exist, 0 otherwise # # ynh_mongo_database_exists() { - # Declare an array to define the options of this helper. - local legacy_args=d - local -A args_array=([d]=database=) - local database - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=d + local -A args_array=([d]=database=) + local database + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - if [ $(ynh_mongo_exec --command='db.getMongo().getDBNames().indexOf("'${database}'")' --eval) -lt 0 ] - then - return 1 - else - return 0 - fi + if [ $(ynh_mongo_exec --command='db.getMongo().getDBNames().indexOf("'${database}'")' --eval) -lt 0 ] + then + return 1 + else + return 0 + fi } # Restore a database @@ -218,18 +218,18 @@ ynh_mongo_database_exists() { # example: ynh_mongo_restore_db --database=wekan < ./dump.bson # # usage: ynh_mongo_restore_db --database=database -# | arg: -d, --database= - The database name to restore +# | arg: -d, --database= - The database name to restore # # ynh_mongo_restore_db() { - # Declare an array to define the options of this helper. - local legacy_args=d - local -A args_array=( [d]=database= ) - local database - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=d + local -A args_array=( [d]=database= ) + local database + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - mongorestore --quiet --db="$database" --archive + mongorestore --quiet --db="$database" --archive } # Drop a user @@ -237,123 +237,121 @@ ynh_mongo_restore_db() { # [internal] # # usage: ynh_mongo_drop_user --db_user=user --db_name=name -# | arg: -u, --db_user= - The user to drop -# | arg: -n, --db_name= - Name of the database +# | arg: -u, --db_user= - The user to drop +# | arg: -n, --db_name= - Name of the database # # ynh_mongo_drop_user() { - # Declare an array to define the options of this helper. - local legacy_args=un - local -A args_array=( [u]=db_user= [n]=db_name= ) - local db_user - local db_name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=un + local -A args_array=( [u]=db_user= [n]=db_name= ) + local db_user + local db_name + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - ynh_mongo_exec --database="$db_name" --command='db.dropUser("'$db_user'", {w: "majority", wtimeout: 5000})' + ynh_mongo_exec --database="$db_name" --command='db.dropUser("'$db_user'", {w: "majority", wtimeout: 5000})' } # Create a database, an user and its password. Then store the password in the app's config # # usage: ynh_mongo_setup_db --db_user=user --db_name=name [--db_pwd=pwd] -# | arg: -u, --db_user= - Owner of the database -# | arg: -n, --db_name= - Name of the database -# | arg: -p, --db_pwd= - Password of the database. If not provided, a password will be generated +# | arg: -u, --db_user= - Owner of the database +# | arg: -n, --db_name= - Name of the database +# | arg: -p, --db_pwd= - Password of the database. If not provided, a password will be generated # # After executing this helper, the password of the created database will be available in $db_pwd # It will also be stored as "mongopwd" into the app settings. # # ynh_mongo_setup_db() { - # Declare an array to define the options of this helper. - local legacy_args=unp - local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) - local db_user - local db_name - db_pwd="" - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=unp + local -A args_array=( [u]=db_user= [n]=db_name= [p]=db_pwd= ) + local db_user + local db_name + db_pwd="" + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - local new_db_pwd=$(ynh_string_random) # Generate a random password - # If $db_pwd is not provided, use new_db_pwd instead for db_pwd - db_pwd="${db_pwd:-$new_db_pwd}" + local new_db_pwd=$(ynh_string_random) # Generate a random password + # If $db_pwd is not provided, use new_db_pwd instead for db_pwd + db_pwd="${db_pwd:-$new_db_pwd}" - # Create the user and grant access to the database - ynh_mongo_create_user --db_user="$db_user" --db_pwd="$db_pwd" --db_name="$db_name" + # Create the user and grant access to the database + ynh_mongo_create_user --db_user="$db_user" --db_pwd="$db_pwd" --db_name="$db_name" - # Store the password in the app's config - ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd + # Store the password in the app's config + ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd } # Remove a database if it exists, and the associated user # # usage: ynh_mongo_remove_db --db_user=user --db_name=name -# | arg: -u, --db_user= - Owner of the database -# | arg: -n, --db_name= - Name of the database +# | arg: -u, --db_user= - Owner of the database +# | arg: -n, --db_name= - Name of the database # # ynh_mongo_remove_db() { - # Declare an array to define the options of this helper. - local legacy_args=un - local -A args_array=( [u]=db_user= [n]=db_name= ) - local db_user - local db_name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" + # Declare an array to define the options of this helper. + local legacy_args=un + local -A args_array=( [u]=db_user= [n]=db_name= ) + local db_user + local db_name + # Manage arguments with getopts + ynh_handle_getopts_args "$@" - if ynh_mongo_database_exists --database=$db_name; then # Check if the database exists - ynh_mongo_drop_db --database=$db_name # Remove the database - else - ynh_print_warn --message="Database $db_name not found" - fi + if ynh_mongo_database_exists --database=$db_name; then # Check if the database exists + ynh_mongo_drop_db --database=$db_name # Remove the database + else + ynh_print_warn --message="Database $db_name not found" + fi - # Remove mongo user if it exists - ynh_mongo_drop_user --db_user=$db_user --db_name=$db_name + # Remove mongo user if it exists + ynh_mongo_drop_user --db_user=$db_user --db_name=$db_name } # Install MongoDB and integrate MongoDB service in YunoHost # # usage: ynh_install_mongo [--mongo_version=mongo_version] -# | arg: -m, --mongo_version= - Version of MongoDB to install +# | arg: -m, --mongo_version= - Version of MongoDB to install # # ynh_install_mongo() { - # Declare an array to define the options of this helper. - local legacy_args=m - local -A args_array=([m]=mongo_version=) - local mongo_version - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - mongo_version="${mongo_version:-$YNH_MONGO_VERSION}" + # Declare an array to define the options of this helper. + local legacy_args=m + local -A args_array=([m]=mongo_version=) + local mongo_version + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + mongo_version="${mongo_version:-$YNH_MONGO_VERSION}" - ynh_print_info --message="Installing MongoDB Community Edition ..." - local mongo_debian_release=$(ynh_get_debian_release) + ynh_print_info --message="Installing MongoDB Community Edition..." + local mongo_debian_release=bullseye #$(ynh_get_debian_release) - if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then - ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." + if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then + ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your CPU (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." mongo_version="4.4" fi if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then - ynh_print_warn --message="Switched to buster install as Mongo 4.4 is not compatible with $mongo_debian_release." + ynh_print_warn --message="Switched to Buster install as Mongo 4.4 is not compatible with $mongo_debian_release." mongo_debian_release=buster fi - ynh_install_extra_app_dependencies \ - --repo="deb https://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" \ - --package="mongodb-org mongodb-org-server mongodb-org-tools mongodb-mongosh" \ - --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" - mongodb_servicename=mongod + ynh_install_extra_app_dependencies --repo="deb http://repo.mongodb.org/apt/debian $mongo_debian_release/mongodb-org/$mongo_version main" --package="mongodb-org-server mongodb-org-shell mongodb-database-tools" --key="https://www.mongodb.org/static/pgp/server-$mongo_version.asc" + mongodb_servicename=mongod - # Make sure MongoDB is started and enabled - systemctl enable $mongodb_servicename --quiet - systemctl daemon-reload --quiet - ynh_systemd_action --service_name=$mongodb_servicename --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log" + # Make sure MongoDB is started and enabled + systemctl enable $mongodb_servicename --quiet + systemctl daemon-reload --quiet - # Integrate MongoDB service in YunoHost - yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log" + ynh_systemd_action --service_name=$mongodb_servicename --action=restart --line_match="aiting for connections" --log_path="/var/log/mongodb/$mongodb_servicename.log" - # Store mongo_version into the config of this app - ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version + # Integrate MongoDB service in YunoHost + yunohost service add $mongodb_servicename --description="MongoDB daemon" --log="/var/log/mongodb/$mongodb_servicename.log" + + # Store mongo_version into the config of this app + ynh_app_setting_set --app=$app --key=mongo_version --value=$mongo_version } # Remove MongoDB @@ -364,16 +362,16 @@ ynh_install_mongo() { # # ynh_remove_mongo() { - # Only remove the mongodb service if it is not installed. - if ! ynh_package_is_installed --package="mongodb*" - then - ynh_print_info --message="Removing MongoDB service..." - mongodb_servicename=mongod - # Remove the mongodb service - yunohost service remove $mongodb_servicename - ynh_secure_remove --file="/var/lib/mongodb" - ynh_secure_remove --file="/var/log/mongodb" - fi + # Only remove the mongodb service if it is not installed. + if ! ynh_package_is_installed --package="mongodb*" + then + ynh_print_info --message="Removing MongoDB service..." + mongodb_servicename=mongod + # Remove the mongodb service + yunohost service remove $mongodb_servicename + ynh_secure_remove --file="/var/lib/mongodb" + ynh_secure_remove --file="/var/log/mongodb" + fi } #================================================= From 4c9b56c94e75c75fe573125d724554873343ce6a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 24 Apr 2024 20:11:54 +0200 Subject: [PATCH 08/22] update to latest version --- conf/nginx.conf | 69 ++++++++++++++------------ conf/overleaf-chat.service | 1 + conf/overleaf-clsi.service | 1 + conf/overleaf-contacts.service | 1 + conf/overleaf-docstore.service | 1 + conf/overleaf-document-updater.service | 1 + conf/overleaf-filestore.service | 1 + conf/overleaf-history-v1.service | 1 + conf/overleaf-notifications.service | 1 + conf/overleaf-project-history.service | 1 + conf/overleaf-real-time.service | 1 + conf/overleaf-spelling.service | 1 + conf/overleaf-web.service | 3 ++ conf/settings.js | 8 +-- manifest.toml | 4 +- scripts/_common.sh | 2 +- 16 files changed, 58 insertions(+), 39 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 2d9041b..8bfc407 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,51 +1,56 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { + # block external access to prometheus /metrics + location /metrics/ { + internal; + } + + location __PATH__/ { # Set max upload size client_max_body_size 50m; - proxy_pass http://localhost:__PORT__; # The port must match the value of SHARELATEX_PORT. - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_send_timeout 10m; + proxy_pass http://127.0.0.1:__PORT__; # The port must match the value of SHARELATEX_PORT. + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 10m; + proxy_send_timeout 10m; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; -} + } -location __PATH__/socket.io/ { - proxy_pass http://localhost:3026; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 10m; - proxy_send_timeout 10m; -} + location __PATH__/socket.io/ { + proxy_pass http://127.0.0.1:3026; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 10m; + proxy_send_timeout 10m; + } location __PATH__/stylesheets/ { # Set max upload size client_max_body_size 50m; - alias __INSTALL_DIR__/live/services/web/public/stylesheets/; - expires 1y; -} + expires 1y; + } location __PATH__/minjs/ { - alias __INSTALL_DIR__/live/services/web/public/minjs/; - expires 1y; -} + + expires 1y; + } location __PATH__/img/ { - alias __INSTALL_DIR__/live/services/web/public/img/; - expires 1y; -} + + expires 1y; + } \ No newline at end of file diff --git a/conf/overleaf-chat.service b/conf/overleaf-chat.service index 3cd42ad..04881d4 100644 --- a/conf/overleaf-chat.service +++ b/conf/overleaf-chat.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/chat/app.js StandardOutput=append:/var/log/__APP__/chat.log StandardError=inherit diff --git a/conf/overleaf-clsi.service b/conf/overleaf-clsi.service index 41832a0..02f1c5b 100644 --- a/conf/overleaf-clsi.service +++ b/conf/overleaf-clsi.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/clsi/app.js StandardOutput=append:/var/log/__APP__/clsi.log StandardError=inherit diff --git a/conf/overleaf-contacts.service b/conf/overleaf-contacts.service index 5c4c01e..9fb405e 100644 --- a/conf/overleaf-contacts.service +++ b/conf/overleaf-contacts.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/contacts/app.js StandardOutput=append:/var/log/__APP__/contacts.log StandardError=inherit diff --git a/conf/overleaf-docstore.service b/conf/overleaf-docstore.service index 2142f94..5f4c4f1 100644 --- a/conf/overleaf-docstore.service +++ b/conf/overleaf-docstore.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/docstore/app.js StandardOutput=append:/var/log/__APP__/docstore.log StandardError=inherit diff --git a/conf/overleaf-document-updater.service b/conf/overleaf-document-updater.service index a1f1c40..4da29fb 100644 --- a/conf/overleaf-document-updater.service +++ b/conf/overleaf-document-updater.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/document-updater/app.js StandardOutput=append:/var/log/__APP__/document-updater.log StandardError=inherit diff --git a/conf/overleaf-filestore.service b/conf/overleaf-filestore.service index 10e3417..fc1cf80 100644 --- a/conf/overleaf-filestore.service +++ b/conf/overleaf-filestore.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/filestore/app.js StandardOutput=append:/var/log/__APP__/filestore.log StandardError=inherit diff --git a/conf/overleaf-history-v1.service b/conf/overleaf-history-v1.service index bf6e15d..7ae6fe1 100644 --- a/conf/overleaf-history-v1.service +++ b/conf/overleaf-history-v1.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" Environment="NODE_CONFIG_DIR=__INSTALL_DIR__/live/services/history-v1/config" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/history-v1/app.js diff --git a/conf/overleaf-notifications.service b/conf/overleaf-notifications.service index 5699f45..f0bfade 100644 --- a/conf/overleaf-notifications.service +++ b/conf/overleaf-notifications.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/notifications/app.js StandardOutput=append:/var/log/__APP__/notifications.log StandardError=inherit diff --git a/conf/overleaf-project-history.service b/conf/overleaf-project-history.service index 4bc10a4..5fecd35 100644 --- a/conf/overleaf-project-history.service +++ b/conf/overleaf-project-history.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="LISTEN_ADDRESS=127.0.0.1" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/project-history/app.js StandardOutput=append:/var/log/__APP__/project-history.log StandardError=inherit diff --git a/conf/overleaf-real-time.service b/conf/overleaf-real-time.service index 9f7981c..de857ae 100644 --- a/conf/overleaf-real-time.service +++ b/conf/overleaf-real-time.service @@ -7,6 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="LISTEN_ADDRESS=127.0.0.1" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/real-time/app.js StandardOutput=append:/var/log/__APP__/real-time.log diff --git a/conf/overleaf-spelling.service b/conf/overleaf-spelling.service index efb3a0c..44c543c 100644 --- a/conf/overleaf-spelling.service +++ b/conf/overleaf-spelling.service @@ -7,6 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="LISTEN_ADDRESS=127.0.0.1" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/spelling/app.js StandardOutput=append:/var/log/__APP__/spelling.log diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index 30f40bf..b6457f1 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -7,6 +7,9 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="ENABLED_SERVICES="web"" +Environment="WEB_PORT="__PORT__"" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/web/app.js StandardOutput=append:/var/log/__APP__/web.log diff --git a/conf/settings.js b/conf/settings.js index 39b3d84..f6725bb 100644 --- a/conf/settings.js +++ b/conf/settings.js @@ -258,16 +258,16 @@ const settings = { apis: { web: { - url: 'http://localhost:__PORT__', + url: 'http://127.0.0.1:__PORT__', user: httpAuthUser, pass: httpAuthPass, }, project_history: { sendProjectStructureOps: true, - url: 'http://localhost:3054', + url: 'http://127.0.0.1:3054', }, v1_history: { - url: process.env.V1_HISTORY_URL || 'http://localhost:3100/api', + url: process.env.V1_HISTORY_URL || 'http://127.0.0.1:3100/api', user: 'staging', pass: process.env.STAGING_PASSWORD, requestTimeout: parseInt( @@ -411,7 +411,7 @@ if ( if (parse(process.env.OVERLEAF_IS_SERVER_PRO) === true) { settings.bypassPercentageRollouts = true - settings.apis.references = { url: 'http://localhost:3040' } + settings.apis.references = { url: 'http://127.0.0.1:3040' } } // Compiler diff --git a/manifest.toml b/manifest.toml index 8ac7900..47be6c1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,8 +51,8 @@ ram.runtime = "3G" [resources] [resources.sources] [resources.sources.main] - url = "https://github.com/overleaf/overleaf/archive/af037ddb439505e1171f51d1a3e676a67fe98c9d.tar.gz" - sha256 = "403e9572b32addb4252de171191200510af70cdb868e90838091183e3ebec9a7" + url = "https://github.com/overleaf/overleaf/archive/2469c93da470c16649c17d39dae5bbc81185ebaa.tar.gz" + sha256 = "c0420f8815998945cae21b6e8b1c2bf9e9b0f5db171e41ee5225ae67fc75ca8e" autoupdate.strategy = "latest_github_commit" [resources.system_user] diff --git a/scripts/_common.sh b/scripts/_common.sh index d355291..890562e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=18.20.1 +nodejs_version=18.20.2 #================================================= # PERSONAL HELPERS From f7b9fc4fe02369f6efd010298f3836df7c2eccc7 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 24 Apr 2024 18:11:59 +0000 Subject: [PATCH 09/22] Auto-update READMEs --- ALL_README.md | 1 + README_zh_Hans.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 77b7509..a01b345 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -4,3 +4,4 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..6b40153 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,48 @@ + + +# YunoHost 的 Overleaf + +[![集成程度](https://dash.yunohost.org/integration/overleaf.svg)](https://dash.yunohost.org/appci/app/overleaf) ![工作状态](https://ci-apps.yunohost.org/ci/badges/overleaf.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/overleaf.maintain.svg) + +[![使用 YunoHost 安装 Overleaf](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=overleaf) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Overleaf。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +Overleaf is an open-source online real-time collaborative LaTeX editor. + + +**分发版本:** 2024.04.09~ynh1 + +## 截图 + +![Overleaf 的截图](./doc/screenshots/screenshot.png) + +## 文档与资源 + +- 官方应用网站: +- 官方用户文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/overleaf_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/overleaf_ynh/tree/testing --debug +或 +sudo yunohost app upgrade overleaf -u https://github.com/YunoHost-Apps/overleaf_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 28b577d41dfa2763dbc5e67228b1a3a0a1830ab8 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:10:24 +0200 Subject: [PATCH 10/22] Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" --- conf/overleaf-chat.service | 1 + conf/overleaf-clsi.service | 1 + conf/overleaf-contacts.service | 1 + conf/overleaf-docstore.service | 1 + conf/overleaf-document-updater.service | 1 + conf/overleaf-filestore.service | 1 + conf/overleaf-notifications.service | 1 + conf/overleaf-project-history.service | 1 + conf/overleaf-real-time.service | 1 + conf/overleaf-spelling.service | 1 + conf/overleaf-web.service | 1 + 11 files changed, 11 insertions(+) diff --git a/conf/overleaf-chat.service b/conf/overleaf-chat.service index 04881d4..bd68b2a 100644 --- a/conf/overleaf-chat.service +++ b/conf/overleaf-chat.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/chat/app.js StandardOutput=append:/var/log/__APP__/chat.log StandardError=inherit diff --git a/conf/overleaf-clsi.service b/conf/overleaf-clsi.service index 02f1c5b..972780b 100644 --- a/conf/overleaf-clsi.service +++ b/conf/overleaf-clsi.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/clsi/app.js StandardOutput=append:/var/log/__APP__/clsi.log StandardError=inherit diff --git a/conf/overleaf-contacts.service b/conf/overleaf-contacts.service index 9fb405e..b201c5e 100644 --- a/conf/overleaf-contacts.service +++ b/conf/overleaf-contacts.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/contacts/app.js StandardOutput=append:/var/log/__APP__/contacts.log StandardError=inherit diff --git a/conf/overleaf-docstore.service b/conf/overleaf-docstore.service index 5f4c4f1..ec2b019 100644 --- a/conf/overleaf-docstore.service +++ b/conf/overleaf-docstore.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/docstore/app.js StandardOutput=append:/var/log/__APP__/docstore.log StandardError=inherit diff --git a/conf/overleaf-document-updater.service b/conf/overleaf-document-updater.service index 4da29fb..a2653e9 100644 --- a/conf/overleaf-document-updater.service +++ b/conf/overleaf-document-updater.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/document-updater/app.js StandardOutput=append:/var/log/__APP__/document-updater.log StandardError=inherit diff --git a/conf/overleaf-filestore.service b/conf/overleaf-filestore.service index fc1cf80..4b56d4c 100644 --- a/conf/overleaf-filestore.service +++ b/conf/overleaf-filestore.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/filestore/app.js StandardOutput=append:/var/log/__APP__/filestore.log StandardError=inherit diff --git a/conf/overleaf-notifications.service b/conf/overleaf-notifications.service index f0bfade..65d8b0e 100644 --- a/conf/overleaf-notifications.service +++ b/conf/overleaf-notifications.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/notifications/app.js StandardOutput=append:/var/log/__APP__/notifications.log StandardError=inherit diff --git a/conf/overleaf-project-history.service b/conf/overleaf-project-history.service index 5fecd35..a5c933b 100644 --- a/conf/overleaf-project-history.service +++ b/conf/overleaf-project-history.service @@ -9,6 +9,7 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/project-history/app.js StandardOutput=append:/var/log/__APP__/project-history.log StandardError=inherit diff --git a/conf/overleaf-real-time.service b/conf/overleaf-real-time.service index de857ae..4560c7c 100644 --- a/conf/overleaf-real-time.service +++ b/conf/overleaf-real-time.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/real-time/app.js StandardOutput=append:/var/log/__APP__/real-time.log diff --git a/conf/overleaf-spelling.service b/conf/overleaf-spelling.service index 44c543c..93b936b 100644 --- a/conf/overleaf-spelling.service +++ b/conf/overleaf-spelling.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/spelling/app.js StandardOutput=append:/var/log/__APP__/spelling.log diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index b6457f1..646a046 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" Environment="ENABLED_SERVICES="web"" Environment="WEB_PORT="__PORT__"" EnvironmentFile=__INSTALL_DIR__/variables.env From 167f164663d80e1a1e25385ce89f2d0f6f6c91ac Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 27 Apr 2024 14:49:13 +0200 Subject: [PATCH 11/22] fix nginx --- conf/nginx.conf | 65 +++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8bfc407..bfd0484 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,53 +4,54 @@ internal; } - location __PATH__/ { +location __PATH__/ { # Set max upload size client_max_body_size 50m; - proxy_pass http://127.0.0.1:__PORT__; # The port must match the value of SHARELATEX_PORT. - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_read_timeout 10m; - proxy_send_timeout 10m; + proxy_pass http://localhost:__PORT__; # The port must match the value of OVERLEAF_PORT. + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 10m; + proxy_send_timeout 10m; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; - } +} - location __PATH__/socket.io/ { - proxy_pass http://127.0.0.1:3026; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 10m; - proxy_send_timeout 10m; - } +location __PATH__/socket.io/ { + proxy_pass http://localhost:3026; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 10m; + proxy_send_timeout 10m; +} location __PATH__/stylesheets/ { # Set max upload size client_max_body_size 50m; - expires 1y; - } + alias __INSTALL_DIR__/live/services/web/public/stylesheets/; + expires 1y; +} location __PATH__/minjs/ { - - expires 1y; - } + alias __INSTALL_DIR__/live/services/web/public/minjs/; + expires 1y; +} location __PATH__/img/ { - - expires 1y; - } \ No newline at end of file + alias __INSTALL_DIR__/live/services/web/public/img/; + expires 1y; +} \ No newline at end of file From 11848f6772c98ab9b26056371c1a635629b79ff3 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:24:26 +0200 Subject: [PATCH 12/22] fix services --- conf/overleaf-chat.service | 1 - conf/overleaf-clsi.service | 1 - conf/overleaf-contacts.service | 1 - conf/overleaf-docstore.service | 1 - conf/overleaf-document-updater.service | 1 - conf/overleaf-filestore.service | 1 - conf/overleaf-history-v1.service | 1 - conf/overleaf-notifications.service | 1 - conf/overleaf-project-history.service | 1 - conf/overleaf-real-time.service | 1 - conf/overleaf-spelling.service | 1 - conf/overleaf-web.service | 1 - 12 files changed, 12 deletions(-) diff --git a/conf/overleaf-chat.service b/conf/overleaf-chat.service index bd68b2a..4144221 100644 --- a/conf/overleaf-chat.service +++ b/conf/overleaf-chat.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/chat/app.js StandardOutput=append:/var/log/__APP__/chat.log diff --git a/conf/overleaf-clsi.service b/conf/overleaf-clsi.service index 972780b..c91f08a 100644 --- a/conf/overleaf-clsi.service +++ b/conf/overleaf-clsi.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/clsi/app.js StandardOutput=append:/var/log/__APP__/clsi.log diff --git a/conf/overleaf-contacts.service b/conf/overleaf-contacts.service index b201c5e..10b0c39 100644 --- a/conf/overleaf-contacts.service +++ b/conf/overleaf-contacts.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/contacts/app.js StandardOutput=append:/var/log/__APP__/contacts.log diff --git a/conf/overleaf-docstore.service b/conf/overleaf-docstore.service index ec2b019..58ca48a 100644 --- a/conf/overleaf-docstore.service +++ b/conf/overleaf-docstore.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/docstore/app.js StandardOutput=append:/var/log/__APP__/docstore.log diff --git a/conf/overleaf-document-updater.service b/conf/overleaf-document-updater.service index a2653e9..22f8e43 100644 --- a/conf/overleaf-document-updater.service +++ b/conf/overleaf-document-updater.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/document-updater/app.js StandardOutput=append:/var/log/__APP__/document-updater.log diff --git a/conf/overleaf-filestore.service b/conf/overleaf-filestore.service index 4b56d4c..ceb4cd8 100644 --- a/conf/overleaf-filestore.service +++ b/conf/overleaf-filestore.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/filestore/app.js StandardOutput=append:/var/log/__APP__/filestore.log diff --git a/conf/overleaf-history-v1.service b/conf/overleaf-history-v1.service index 7ae6fe1..bf6e15d 100644 --- a/conf/overleaf-history-v1.service +++ b/conf/overleaf-history-v1.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" Environment="NODE_CONFIG_DIR=__INSTALL_DIR__/live/services/history-v1/config" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/history-v1/app.js diff --git a/conf/overleaf-notifications.service b/conf/overleaf-notifications.service index 65d8b0e..f542fa7 100644 --- a/conf/overleaf-notifications.service +++ b/conf/overleaf-notifications.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/notifications/app.js StandardOutput=append:/var/log/__APP__/notifications.log diff --git a/conf/overleaf-project-history.service b/conf/overleaf-project-history.service index a5c933b..1a04a70 100644 --- a/conf/overleaf-project-history.service +++ b/conf/overleaf-project-history.service @@ -8,7 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/project-history/app.js StandardOutput=append:/var/log/__APP__/project-history.log diff --git a/conf/overleaf-real-time.service b/conf/overleaf-real-time.service index 4560c7c..080dced 100644 --- a/conf/overleaf-real-time.service +++ b/conf/overleaf-real-time.service @@ -7,7 +7,6 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/real-time/app.js diff --git a/conf/overleaf-spelling.service b/conf/overleaf-spelling.service index 93b936b..53b9a24 100644 --- a/conf/overleaf-spelling.service +++ b/conf/overleaf-spelling.service @@ -7,7 +7,6 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/spelling/app.js diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index 646a046..03464d0 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -7,7 +7,6 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="LISTEN_ADDRESS=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" Environment="ENABLED_SERVICES="web"" Environment="WEB_PORT="__PORT__"" From 777687ab237bcd9f150b45917049c2280f922dc6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:25:00 +0200 Subject: [PATCH 13/22] fix services --- conf/overleaf-web.service | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index 03464d0..552268b 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -8,8 +8,6 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" -Environment="ENABLED_SERVICES="web"" -Environment="WEB_PORT="__PORT__"" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/web/app.js StandardOutput=append:/var/log/__APP__/web.log From 6dc0c786aaf0af28317d3925303e49e7bb689bff Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:46:26 +0200 Subject: [PATCH 14/22] adapt nginx --- conf/nginx.conf | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index bfd0484..9572324 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,16 +9,15 @@ location __PATH__/ { # Set max upload size client_max_body_size 50m; - proxy_pass http://localhost:__PORT__; # The port must match the value of OVERLEAF_PORT. - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_read_timeout 10m; - proxy_send_timeout 10m; + proxy_pass http://localhost:__PORT__; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 10m; + proxy_send_timeout 10m; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 1a2c4bb34ae79f11616d77866f0d3f400d936af3 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:33:22 +0200 Subject: [PATCH 15/22] update to latest version --- conf/variables.env | 4 ++++ manifest.toml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/variables.env b/conf/variables.env index fbbaa97..4e59196 100644 --- a/conf/variables.env +++ b/conf/variables.env @@ -22,6 +22,10 @@ OVERLEAF_SITE_LANGUAGE="__LANGUAGE__" ENABLED_LINKED_FILE_TYPES=project_file,project_output_file +CLSI_COMPILES_PATH="__DATA_DIR__/compiles" +CLSI_OUTPUT_PATH="__DATA_DIR__/output" +CLSI_CACHE_PATH="__DATA_DIR__/cache" + OVERLEAF_ALLOW_PUBLIC_ACCESS=true OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING=true diff --git a/manifest.toml b/manifest.toml index 47be6c1..52a324f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,8 +51,8 @@ ram.runtime = "3G" [resources] [resources.sources] [resources.sources.main] - url = "https://github.com/overleaf/overleaf/archive/2469c93da470c16649c17d39dae5bbc81185ebaa.tar.gz" - sha256 = "c0420f8815998945cae21b6e8b1c2bf9e9b0f5db171e41ee5225ae67fc75ca8e" + url = "https://github.com/overleaf/overleaf/archive/568044ee48a20bdb930f9f140f17227d19cb1219.tar.gz" + sha256 = "61e2602c76f8c8a635656d99db6725c802261e383411d71095cf9710149567f6" autoupdate.strategy = "latest_github_commit" [resources.system_user] From c8f01102b8a2d99e8a23676b454d72366b1dfd4b Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:57:27 +0200 Subject: [PATCH 16/22] update env file --- conf/variables.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/variables.env b/conf/variables.env index 4e59196..8dbcc5d 100644 --- a/conf/variables.env +++ b/conf/variables.env @@ -14,7 +14,7 @@ CRYPTO_RANDOM=__CRYPTO_RANDOM__ OVERLEAF_MONGO_URL="mongodb://127.0.0.1:27017/__DB_NAME__" OVERLEAF_REDIS_HOST="localhost" - +OVERLEAF_REDIS_PORT=6379 REDIS_HOST="localhost" REDIS_PORT=6379 From 3d4e6b316e59bbeca2b1a3930c53989a83c6783c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 28 Apr 2024 15:12:15 +0200 Subject: [PATCH 17/22] =?UTF-8?q?Disable=20some=20variable=20to=20make=20s?= =?UTF-8?q?ign=5Fup/login=20work=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/variables.env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/variables.env b/conf/variables.env index 8dbcc5d..367226c 100644 --- a/conf/variables.env +++ b/conf/variables.env @@ -44,8 +44,8 @@ TEXMFVAR=__INSTALL_DIR__/tmp/texmf-var # NGINX_WORKER_CONNECTIONS=768 ## Set for TLS via nginx-proxy -OVERLEAF_BEHIND_PROXY=true -OVERLEAF_SECURE_COOKIE=false +# OVERLEAF_BEHIND_PROXY=true +# OVERLEAF_SECURE_COOKIE=false OVERLEAF_SITE_URL=https://__DOMAIN__ # OVERLEAF_NAV_TITLE=Our Overleaf Instance @@ -103,4 +103,4 @@ OT_JWT_AUTH_KEY=__JWT_KEY__ # TEX_LIVE_DOCKER_IMAGE=quay.io/OVERLEAF/texlive-full:2021.1 # ALL_TEX_LIVE_DOCKER_IMAGES=quay.io/OVERLEAF/texlive-full:2021.1,quay.io/OVERLEAF/texlive-full:2020.1 -# OVERLEAF_PROXY_LEARN=true \ No newline at end of file +# OVERLEAF_PROXY_LEARN=true From 8b8909cf20c9fc64553cd72ba2096d0464b71ea4 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:39:21 +0200 Subject: [PATCH 18/22] fix web service --- conf/overleaf-web.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index 552268b..1ea1e58 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -7,6 +7,8 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="WEB_PORT=__PORT__" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/web/app.js From e8384c22198711fa2010e215fa594546be1994f6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:13:58 +0200 Subject: [PATCH 19/22] fix services? --- conf/overleaf-chat.service | 1 + conf/overleaf-clsi.service | 1 + conf/overleaf-contacts.service | 1 + conf/overleaf-docstore.service | 1 + conf/overleaf-document-updater.service | 2 ++ conf/overleaf-filestore.service | 1 + conf/overleaf-history-v1.service | 1 + conf/overleaf-notifications.service | 1 + conf/overleaf-project-history.service | 1 + conf/overleaf-real-time.service | 1 + conf/overleaf-spelling.service | 1 + conf/overleaf-web.service | 3 ++- 12 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/overleaf-chat.service b/conf/overleaf-chat.service index 4144221..467b83e 100644 --- a/conf/overleaf-chat.service +++ b/conf/overleaf-chat.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="CHAT_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/chat/app.js StandardOutput=append:/var/log/__APP__/chat.log diff --git a/conf/overleaf-clsi.service b/conf/overleaf-clsi.service index c91f08a..5695c1c 100644 --- a/conf/overleaf-clsi.service +++ b/conf/overleaf-clsi.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="CLSI_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/clsi/app.js StandardOutput=append:/var/log/__APP__/clsi.log diff --git a/conf/overleaf-contacts.service b/conf/overleaf-contacts.service index 10b0c39..47094ef 100644 --- a/conf/overleaf-contacts.service +++ b/conf/overleaf-contacts.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="CONTACTS_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/contacts/app.js StandardOutput=append:/var/log/__APP__/contacts.log diff --git a/conf/overleaf-docstore.service b/conf/overleaf-docstore.service index 58ca48a..4156f05 100644 --- a/conf/overleaf-docstore.service +++ b/conf/overleaf-docstore.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="DOCSTORE_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/docstore/app.js StandardOutput=append:/var/log/__APP__/docstore.log diff --git a/conf/overleaf-document-updater.service b/conf/overleaf-document-updater.service index 22f8e43..b11fd43 100644 --- a/conf/overleaf-document-updater.service +++ b/conf/overleaf-document-updater.service @@ -8,6 +8,8 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="DOCUMENT_UPDATER_HOST=127.0.0.1" +Environment="DOCUPDATER_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/document-updater/app.js StandardOutput=append:/var/log/__APP__/document-updater.log diff --git a/conf/overleaf-filestore.service b/conf/overleaf-filestore.service index ceb4cd8..11d80dd 100644 --- a/conf/overleaf-filestore.service +++ b/conf/overleaf-filestore.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="FILESTORE_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/filestore/app.js StandardOutput=append:/var/log/__APP__/filestore.log diff --git a/conf/overleaf-history-v1.service b/conf/overleaf-history-v1.service index bf6e15d..5d1dacc 100644 --- a/conf/overleaf-history-v1.service +++ b/conf/overleaf-history-v1.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="HISTORY_V1_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" Environment="NODE_CONFIG_DIR=__INSTALL_DIR__/live/services/history-v1/config" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/history-v1/app.js diff --git a/conf/overleaf-notifications.service b/conf/overleaf-notifications.service index f542fa7..c1ef937 100644 --- a/conf/overleaf-notifications.service +++ b/conf/overleaf-notifications.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="NOTIFICATIONS_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/notifications/app.js StandardOutput=append:/var/log/__APP__/notifications.log diff --git a/conf/overleaf-project-history.service b/conf/overleaf-project-history.service index 1a04a70..5e37470 100644 --- a/conf/overleaf-project-history.service +++ b/conf/overleaf-project-history.service @@ -8,6 +8,7 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/variables.env +Environment="PROJECT_HISTORY_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/project-history/app.js StandardOutput=append:/var/log/__APP__/project-history.log diff --git a/conf/overleaf-real-time.service b/conf/overleaf-real-time.service index 080dced..3f64553 100644 --- a/conf/overleaf-real-time.service +++ b/conf/overleaf-real-time.service @@ -7,6 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="REALTIME_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/real-time/app.js diff --git a/conf/overleaf-spelling.service b/conf/overleaf-spelling.service index 53b9a24..a475516 100644 --- a/conf/overleaf-spelling.service +++ b/conf/overleaf-spelling.service @@ -7,6 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ +Environment="SPELLING_HOST=127.0.0.1" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env ExecStart=__YNH_NODE__ __INSTALL_DIR__/live/services/spelling/app.js diff --git a/conf/overleaf-web.service b/conf/overleaf-web.service index 1ea1e58..4880f73 100644 --- a/conf/overleaf-web.service +++ b/conf/overleaf-web.service @@ -7,7 +7,8 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="LISTEN_ADDRESS=127.0.0.1" +Environment="WEB_HOST=127.0.0.1" +Environment="WEB_API_HOST=127.0.0.1" Environment="WEB_PORT=__PORT__" Environment="MONGO_CONNECTION_STRING=mongodb://127.0.0.1:27017/__DB_NAME__" EnvironmentFile=__INSTALL_DIR__/variables.env From 1c53345c7ef464701808272bdd9d35202a2d9e14 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 2 May 2024 08:52:25 +0200 Subject: [PATCH 20/22] ynh_secure_remove on some dirs --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 5fc875d..12acb31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,6 +87,9 @@ then ynh_setup_source --dest_dir="$install_dir/build" --full_replace=1 fi +# full replace on live dir +ynh_secure_remove "$install_dir/live" + chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -158,6 +161,9 @@ pushd "$install_dir/live/services/web" ynh_secure_remove --file="$install_dir/live/services/web/node_modules/.cache" popd +#remove build dir +ynh_secure_remove "$install_dir/build" + chmod 750 "$install_dir/live" chmod -R o-rwx "$install_dir/live" chown -R $app:www-data "$install_dir/live" From 374db7ec39587b9e6199e69edcad412d8e4db3a0 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 2 May 2024 08:53:30 +0200 Subject: [PATCH 21/22] ynh_secure_remove build dir --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 4db35c1..88c32ef 100755 --- a/scripts/install +++ b/scripts/install @@ -143,6 +143,9 @@ pushd "$install_dir/live/services/web" ynh_secure_remove --file="$install_dir/live/services/web/node_modules/.cache" popd +# remove build dir +ynh_secure_remove "$install_dir/build" + chmod 750 "$install_dir/live" chmod -R o-rwx "$install_dir/live" chown -R $app:www-data "$install_dir/live" From 18a030cacac15be34aba7195a091a32aeb8205ec Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 2 May 2024 13:16:19 +0200 Subject: [PATCH 22/22] fix file manually edited --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12acb31..38c9358 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,6 +144,7 @@ cp -r "$install_dir/build/patches/" "$install_dir/live/patches/" cp -r "$install_dir/build/server-ce/config" "$install_dir/config/" ynh_secure_remove --file="$install_dir/config/settings.js" ynh_secure_remove --file="$install_dir/config/production.json" +ynh_secure_remove --file="$install_dir/live/services/history-v1/config/production.json" ynh_add_config --template="../conf/production.json" --destination="$install_dir/config/production.json" ynh_add_config --template="../conf/production.json" --destination="$install_dir/live/services/history-v1/config/production.json"