Skip to content

Render pages to static html

Created by: dtu-compute

It would be very useful to have a secondary webserver not hosted at DO, where a static copy of all the pages and enotes also exist. The purpose for it is to be a fall back plan for the professors, in case something happens to the DO host. That way they know the latest version in static format always is located at e.g. PlanB.example.com/0xxxx. They know the url in advance and therefore doesn't even need to contact me to use it.

The PlanB webserver would just be an Apache with an htaccess file and that's it.

On PlanB the easiest would be to wget 01005.compute.dtu.dk but that gives

<html><head><title>Cas</title>
<script>
window.location.href='https://01005.compute.dtu.dk/home/index?ticket=';
</script>
</head>
<body> 
Click <a href='https://01005.compute.dtu.dk/home/index?ticket='>here</a>
to access the service you requested.                     
</body>
</html>

and for some reason wget -r won't follow the link.

The disadvantage of this solution, if it got to work is it wouldn't be able to dump pages using the begin:only to require a user to be logged in.

Questions

  • Out of curiosity. Why does Rails generate the above html for each page?
  • When doing a recursive wget on https://01005.compute.dtu.dk/home/index?ticket=. Why is auth.dtu.dk involved at this point, when the user is not logged in?
  • How difficult would it be to change the Rails app to render the pages to static html in e.g. /vol/website-rendered/0xxxx/ and either use them for the actual website or just rsync them to the PlanB host?
  • How difficult would it be to make a rake task to that takes an markdown file (or valid url) as input and renders it to html and when can be rsync'ed to PlanB?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information