Skip to content

Dumping sharelatex projects

Created by: dtu-compute

Right now get-pdf.sh downloads a Sharelatex project as zip by having it shared with a dumper user and then do

csrf=$(curl -sk --cookie-jar $c $url/login | perl -lne 'print $1 if /csrfToken = \"(.+?)\"/')
curl -k --cookie-jar $c --cookie $c -d "email=$email&password=$pass&_csrf=$csrf" $url/login > /dev/null
curl -k --cookie $c $url/project/$project/download/zip -o $z

It would be very useful to have a script that could

./sharelatex_dump_ project <sharelatex container name> <project number | all>

That way projects wouldn't need to be shared with a dumper user and daily backup of all projects would be possible.

Ideally it shouldn't patch the ShareLatex code to make it more robust.

How difficult would it be to make such script?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information