subhamX / overleaf_sync_with_git

🤖 A GitHub action to take backups from OverLeaf which is an Online LaTeX Editor.
Apache License 2.0
22 stars 9 forks source link

Self-hosted Overleaf Sync Problem #10

Closed Country-If closed 3 weeks ago

Country-If commented 3 months ago

I deployed an overleaf server using overleaf/toolkit. I failed to sync after only adding the environment variable OVERLEAF_HOST and the corresponding secret. I found out my cookie name is overleaf.sid, not overleaf_session2. Therefore, I forked a new branch and updated the Cookie name in src/entrypoint.sh. In this way, I successfully synchronized.

What I want to say is that it is not that simple for a self-hosted overleaf to sync.

subhamX commented 3 weeks ago

An easy fix should be to change: https://github.com/subhamX/overleaf_sync_with_git/blob/master/src/entrypoint.sh#L24 to "Cookie: overleaf_session2=$COOKIE;overleaf.sid=$COOKIE" \. What do you think?

Country-If commented 3 weeks ago

It can help. However, I found that the key of the Cookie varies from different deployments, such as overleaf_session2, overleaf.sid, and sharelatex.sid. What I am trying to say is that there may be another different key of the Cookie. Thus, I think it would be more general to users set the key of their Cookies to Secrets.

subhamX commented 3 weeks ago

Oh, I didn't consider other platforms.

I think your recommendation makes sense. So, let's by default set overleaf_session2, overleaf.sid, and sharelatex.sid (and anything else if you know). It doesn't hurt to do that. And the user can configure the key(s) themselves if they want.

Country-If commented 3 weeks ago

I think the default set with user-defined configuration approach is awesome. However, I'm not sure how to modify the YAML file. I would appreciate it if the author could assist by making the necessary modifications.