How to test
mkdir -p /vol/enotes
git clone https://github.com/dtu-compute/docker-get-pdf
cd docker-get-pdf
docker-compose build
docker-compose up -d
docker inspect --format '{{ .NetworkSettings.IPAddress }}' getpdf_get-pdf_1
ssh -i id_rsa ssh root@172.17.0.x get-pdf /get_pdf.sh "http://enote.compute.dtu.dk:14000" test@dtu.dk test@dtu.dk 01005 579b4ec056432e5b00742d93
and then you will have two pdf's in /vol/enotes/01005/
.
In production
The get-pdf
container will be part of the Docker testnet
or whatever we end up calling it, so get-pdf
will be a valid hostname. The update button will therefore execute something similar to
ssh -i id_rsa ssh root@get-pdf /get_pdf.sh "$docker-hostname-of-the-courses-sharelatex" getpdf@getpdf.getpdf $secret_pw $course_number $project_number
In the enote setup will we need a global yaml file containing these and others variables and constants, that are unique to our setup and therefore won't do on Github.
Dumping Projects for Backup
docker exec -it get-pdf curl localhost:8080/api/zip/5a9c73c665b6e56700f84e21
or
docker exec -it get-pdf curl localhost:8080/api/zip
For all projects. It puts the zip files in sharelatex-data/backups
:
dtu-enote (devel) $ ls ../../vol/sharelatex-data/backups/
min-enotes2.zip
(In this example, project 5a9c73c665b6e56700f84e21
is "min-enotes2"
).