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

update OVERLEAF_COOKIE input format #4

Closed emhl closed 1 year ago

emhl commented 1 year ago

when the session cookie runs out i always need to go back to this repository to check the syntax for the OVERLEAF_COOKIE secret. just pasting in the cookie would be much easier.

btw i've seen that you haven't created another tag so all the features added after the initial commit aren't acessible without forking the project

subhamX commented 1 year ago

Do note that if you run the workflow say, every day, then this expiration shouldn't happen. (At least that's how things were earlier). Overleaf used to extend the same cookie expiration time. Let me confirm it in 7 days.

when the session cookie runs out i always need to go back to this repository to check the syntax for the OVERLEAF_COOKIE secret. just pasting in the cookie would be much easier.

Even I was thinking about it the last time. Now the issue is everyone must be using master branch and the old cookie format. Let me try to make the change and also keep it backwards compatible.

btw i've seen that you haven't created another tag so all the features added after the initial commit aren't acessible without forking the project

Hmm. Let me make another release soon.

emhl commented 1 year ago

Do note that if you run the workflow say, every day, then this expiration shouldn't happen. (At least that's how things were earlier). Overleaf used to extend the same cookie expiration time. Let me confirm it in 7 days.

i had set the cookie almost exactly a month ago and i used the workflow ~15 times per day

Even I was thinking about it the last time. Now the issue is everyone must be using master branch and the old cookie format. >Let me try to make the change and also keep it backwards compatible.

i use the v1.0.0-alpha tag (and didn't know zou could use the master as well). well if most build directly from the latest commit their workflows would break for sure if this got merged :D

emhl commented 1 year ago

Let me confirm it in 7 days.

Has your cookie expired yet?

btw i have added backwards compatibility in the last commit

subhamX commented 1 year ago

Ah. I just saw the workflow. It looks like I have a lot of unnecessary CRON actions, and my private actions quota is over. :( The workflow did run fine for 3 days though.

Sorry for the trouble. Let me start the workflow again.

emhl commented 1 year ago

any updates?

emhl commented 1 year ago

@subhamX my workflow hasn't crashed since last time

subhamX commented 1 year ago

@subhamX my workflow hasn't crashed since last time

@emhl; Ah. That's so cool. My apologies for the delayed response. I was in the middle of transitioning to a new job, and didn't have the bandwidth to work on my side projects.

My workflow again got crashed (as there are some other internal services using the limited free resources in PRO account), and when I tried to run it again (after 18-19 days) the cookie was expired.

I suspect if we run the workflow on regular interval it keeps the cookie active. Also, maybe we shouldn't create any new session or not use the same session whose cookie is being used.

Do share what's the status of your workflow right now, and any hypothesis to this problem?

Let me start a new workflow on a public repo this time. :)

subhamX commented 1 year ago

Testing this action on this public repository.

Insights

  1. If you're using some session credentials in this github action, and you're logged in the browser using the same credentials, then please ensure that you don't LOGOUT from the browser. If you logout from the browser, then the credentials gets expired/revoked. So I would recommend that after you copy overleaf_session2 cookie and put it in the GitHub actions secret, please delete the cookie from the browser. And then start a new browser session (by logging in again) if required.
  2. I can confirm that starting a new overleaf session doesn't revoke the previously generated credentials. So, theoretically you can still work on www.overleaf.com, and keep this action running without an additional hassle.
  3. ~TODO: Shall post an update on how long does the credential remain valid. Many companies ask their users to (force) login again after 30 days (for example). Let's see what's the number for overleaf...~ This interval is definitely more than 2 months, as the workflow worked for more than 2 months without any intervention.
emhl commented 1 year ago

Do share what's the status of your workflow right now, and any hypothesis to this problem?

the action has been continuously working since Oct 4 without the need to update the token, there probably isn't a maximum time any token can be used, if it gets used continuously.

the "This cookie is to be only valid for a limited time and needs to be replaced after a while." line should be removed and/or replaced by a more detailed explanation what could cause the token to be reset

subhamX commented 1 year ago

@emhl;

the "This cookie is to be only valid for a limited time and needs to be replaced after a while." line should be removed and/or replaced by a more detailed explanation what could cause the token to be reset

I agree. Hoping to have better insights from this latest run. :) Shall post an update as soon as the workflow breaks because of revoked credentials.

subhamX commented 1 year ago

It has been more than 2 months, and the workflow is working flawlessly. :)

subhamX commented 1 year ago

Thank you @emhl for contributing to this repo. 🤗

I think I need to be more active on the platform. Kinda missing open source. 😊.

emhl commented 1 year ago

It has been more than 2 months, and the workflow is working flawlessly. :)

my workflow hasn't crashed since October either.

Thank you @emhl for contributing to this repo. :hugs:

I think I need to be more active on the platform. Kinda missing open source. :blush:.

Thanks alot for creating this awesome workflow :D