feat: add maintenance pages to Grove
Description
This PR contains the changes needed to implement Grove maintenance pages as per this discovery. Please go through the Discovery first to get insight on the changes below.
Features implementened:
- Maintenance mode can be enabled/disabled
- A 404 page to show when an instance is being provisioned
- Custom error pages
Supporting information
- https://grove.opencraft.com/discoveries/0008-maintenance-pages/
- tutor-contrib-grove!8 (merged)
- https://tasks.opencraft.com/browse/SE-5479
Testing instructions
When running any of the commands below, make sure you have the keith/maintenance-pages
branch checked out on both grove-stage-digitalocean
and grove
.
404 Pages
I created a provisioning-page.html
in the head of grove-stage-digitalocean
repo. The only difference between it and the default 404 page is the page title.
In provisioning-page.html
it's Grove Staging
In 404.html
it's Provisioning...
Check that when hitting a 404 URL, that provisioning-page.html
is rendered. Eg. By going to the cluster ip directly http://165.227.251.188
5xx Pages
I created some dummy URLs to raise errors from the frontend. https://github.com/openedx/edx-platform/commit/1940cdabae40cfdf083f8911ee684cfa6b1e82f0
When rendering an error page for an instance either
- the LMS/CMS handles the error in which case the site's theme will be used
- Caddy handles the error in which case the error page loaded will be shown.
You can view the 504 error page by going to https://keith-relic.staging.do.opencraft.hosting/504 (it'll take a while).
- Edit the
server-error.html
file in the digital ocean config page. Your changes will show up immediately.-
Maintenance mode
I've set up a bucket containing the file that will be rendered (maintenance-mode.html
). Any modifications you make to this file will reflect immediately.
To test this, you'll need to have Grove set up locally. I've added the private.yml
file to vault under newcomers/farhaanbukhsh/grove-stage-digitalocean-private.yml
. Place the file in the root directory of grove-stage-digitalocean/private.yml
and add your username and password to GITLAB_USERNAME
and GITLAB_PASSWORD
.
Once you've added the file, checkout the keith/maintenance-mode
branch on grove-stage-digitalocean
and grove
.
Visit https://keith-relic.staging.do.opencraft.hosting. You should see a normal edx site.
Run the following from the control
directory,
./tutor keith-relic maintenance-mode --enable
Maintenance mode will now be enabled. Reload the site and you should get the content of maintenance-mode.html
in the bucket.
./tutor keith-relic maintenance-mode --disable
will reset maintenance mode and restore the site.
Documentation
- Read the documentation and see if it makes sense.
Checklist
If any of the items below is not applicable, do not remove them, but put a check in it.
-
All providers include the new feature/change -
All affected providers can provision new clusters -
Unit tests are added/updated -
Documentation is added/updated -
The TOOLS_CONTAINER_IMAGE_VERSION
in ci_vars.yml is updated -
The grove-template repository is updated
Additional context
Add any other context about the merge request here.