Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sharelatex to overleaf in AuthenticationController.js.diff #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sparkcyf
Copy link
Contributor

@sparkcyf sparkcyf commented Apr 15, 2024

according to https://github.com/overleaf/overleaf/wiki/Release-Notes-5.x.x#configuration-changes , the environment variable like "SHARELATEX_" have been renamed to "OVERLEAF_" on sharelatex image >=5.0.1

@yzx9
Copy link
Collaborator

yzx9 commented Apr 15, 2024

Great work! However, we're still at version 4.2.0, haha. We'll proceed with merging this after we upgrade to version 5.0.1.

@yzx9 yzx9 added the enhancement New feature or request label Apr 15, 2024
@smhaller
Copy link
Owner

smhaller commented Apr 16, 2024

The most important change in the release upgrade from version 4.x.x to 5.x.x is the upgrade of mongodb (version 4 to 5). I think we have to test before we propose an upgrade on existing instances (I assume there will be no major issues but still).
The second change is the renaming from sharelatex to overleaf.

More important we have to adjust all configuration files - which is missing in your pull request. Additionally, the Dockerfile has to be updated to version 5.0.1 and then we have to check the ldap authentication as well.

We should have a look at the changes which davrot did (master...davrot:ldap-overleaf-sl:master) to run version 5 (see also Issue #50 ).

@sparkcyf
Copy link
Contributor Author

sparkcyf commented Apr 16, 2024

Understood. A few days ago, I attempted to upgrade our organization's Overleaf instance, which manages about 20,000 projects and is configured with LDAP and OAuth2, from version 4.2 to 5. Upgrading MongoDB was quite straightforward: before updating the MongoDB Docker image, you simply need to execute a command like db.adminCommand({ setFeatureCompatibilityVersion: "4.4" }) in the MongoDB shell.

For example, we upgraded MongoDB from 4.0 (used by ShareLaTeX 3.x) to 5.0 by following these steps (all MongoDB migrations were executed using the sharelatex:4.2.0 Docker image, and we referenced the Overleaf wiki):

  1. Change the MongoDB image to mongo:4.2 in lib/default.rc of the toolkit, then execute db.adminCommand({ setFeatureCompatibilityVersion: "4.0" }) in the MongoDB shell.
  2. Change the MongoDB image to mongo:4.4 in lib/default.rc of the toolkit, then execute db.adminCommand({ setFeatureCompatibilityVersion: "4.2" }) in the MongoDB shell.
  3. Change the MongoDB image to mongo:5.0 in lib/default.rc of the toolkit, then execute db.adminCommand({ setFeatureCompatibilityVersion: "4.4" }) in the MongoDB shell.
    Finally, change the Docker image to sharelatex:5.0.1. The instance has been functioning well since then.

I hope this helps!

@sparkcyf
Copy link
Contributor Author

sparkcyf commented Apr 16, 2024

More important we have to adjust all configuration files - which is missing in your pull request. Additionally, the Dockerfile has to be updated to version 5.0.1 and then we have to check the ldap authentication as well.

According to my upgrade log, it seems that the only additional requirement beyond the standard upgrade process is updating the TeX Live version from 2023 to 2024. I suspect that Overleaf might use TeX Live 2024 in their next v5 release. Apart from this, no other configuration changes are necessary. All features provided by ldap-overleaf-sl continue to function as expected after the upgrade.

Our mofications: https://mirrors.sustech.edu.cn/git/sustech-cra/overleaf-ldap-oauth2/-/commit/36e334be18cc6b04cd31323d06d677a10ed94d95

@gizmo1-11
Copy link
Contributor

I started an installation from the scratch using the current ldap-overleaf-sl (for 4.2.0)
to build an image base on sharelatex 5.0.1.
The LDAP-authentication worls.
My question: Why fail the tlmgr in the Dockerfile ? I substituted with apt install texlive-full

bash scripts/extract_files.sh 5.0.1
bash scripts/apply_diffs.sh // fails

bash scripts/extract_files.sh 4.2.0
bash scripts/apply_diffs.sh // works

.env
....
....

Dockerfile:

  • FROM sharelatex/sharelatex:4.2.0
  • FROM sharelatex/sharelatex:5.0.1
  • apt-get -y install .... python-pygments
  • apt-get -y install .... python3-pygments
  • tlmgr ....
  • RUN apt-get -y install texlive-full

AuthenticationController.js ( in the patched version)

  • ... env.SHARELATEX_SITE_URL ...
  • ... env.OVERLEAF_SITE_URL ...

make

docker-compose.yml
// substitute container-PATH from /var/lib/sharelatex to /var/lib/overleaf

  • ... /var/lib/sharelatex
  • ... /var/lib/overleaf

// substitute attributes which start with SHARELATEX to OVERLEAF

  • SHARELATEX_ ....
  • OVERLEAF_ ....

@sparkcyf
Copy link
Contributor Author

sparkcyf commented Apr 19, 2024

I started an installation from the scratch using the current ldap-overleaf-sl (for 4.2.0) to build an image base on sharelatex 5.0.1. The LDAP-authentication worls. My question: Why fail the tlmgr in the Dockerfile ? I substituted with apt install texlive-full

bash scripts/extract_files.sh 5.0.1 bash scripts/apply_diffs.sh // fails

bash scripts/extract_files.sh 4.2.0 bash scripts/apply_diffs.sh // works

.env .... ....

Dockerfile:

  • FROM sharelatex/sharelatex:4.2.0

  • FROM sharelatex/sharelatex:5.0.1

  • apt-get -y install .... python-pygments

  • apt-get -y install .... python3-pygments

  • tlmgr ....

  • RUN apt-get -y install texlive-full

AuthenticationController.js ( in the patched version)

  • ... env.SHARELATEX_SITE_URL ...

  • ... env.OVERLEAF_SITE_URL ...

make

docker-compose.yml // substitute container-PATH from /var/lib/sharelatex to /var/lib/overleaf

  • ... /var/lib/sharelatex

  • ... /var/lib/overleaf

// substitute attributes which start with SHARELATEX to OVERLEAF

  • SHARELATEX_ ....

  • OVERLEAF_ ....

I guess the issue may caused by the version incompatible between the current texlive and the texlive from the ubuntu package manager (apt), as https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=texlive-full indicates that the texlive-full package in the ubuntu 22.04 is Texlive 2021, but the texlive version in the docker image is 2023. It might be a better choice to upgrade the texlive by following the instructions on https://www.tug.org/texlive/upgrade.html .

@smhaller smhaller mentioned this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants