Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

ministryofjustice/cjsm

Repository files navigation

CJSM Microsite - cjsm.justice.gov.uk

This is a website with information about CJSM, for users and organisation admins, including training materials for Webmail users. For more about CJSM, see CJSM Wiki and CJSM Technical Architecture

It is a static site, hosted on GitHub Pages. It is publicly accessible at: https://cjsm.justice.gov.uk/. The site has always been public, and contains nothing sensitive.

Making changes

For friendly instructions for editing this site in GitHub, see: Editing the microsite

Changes merged to the main branch get automatically deployed.

To review changes as they will look in a browser, if you have the files on your local disk you can point your browser at the file themselves. (Alternatively we could set-up a fork of this repo, with a 'test' branch that is deployed to GitHub Pages at say dev.cjsm.justice.gov.uk, that could be used for reviewing changes.)

History and decisions

Hosting

This repo is served by GitHub Pages, at https://ministryofjustice.github.io/cjsm

Other ways were considered for hosting:

  • S3 in Cloud Platform. This would be fine, but we'd have to setup and maintain the CI/CD deployment. Slightly more complex than GitHub Pages, which is pretty seamless and understood widely.

www redirect

Until 2022, both cjsm.justice.gov.uk and www.cjsm.justice.gov.uk served this site. GitHub Pages only serves on one domain, so for simplicity we'll just pick one and redirect from the other. Google Search regards the former as canonical, it was decided to redirect from www.cjsm.justice.gov.uk to cjsm.justice.gov.uk.

The redirect is achieved with a Cloud Platform ingress annotation. This provides an 30X redirect, and CP keeps the TLS cert updated.

Other ways to redirect that were considered:

  • S3 Static Site that serves a single HTML file that instructs the browser to redirect. However existing links and bookmarks to paths other than the root path would result in 404
  • a S3 Static Site Hosting rule, to redirect to cjsm.justice.gov.uk. However it couldn't be used in this case because it redirected the user to the bucket of that name, rather than 30X redirect to that hostname.

Redirect hosting

The redirect is hosted on Cloud Platform in namespace cjsm-prod, with cjsm-dev as the dev mirror.

The k8s resources are defined in deploy. These are deployed manually:

kubectl apply -f dev/cert.yaml
kubectl apply -f dev/ingress-redirect.yaml
kubectl apply -f prod/cert.yaml
kubectl apply -f prod/ingress-redirect.yaml

DNS set-up

cjsm.justice.gov.uk Hosted Zone (in DSD AWS account)

  • cjsm.justice.gov.uk NS -> default for this hosted zone
  • cjsm.justice.gov.uk SOA -> default for this hosted zone
  • cjsm.justice.gov.uk A -> GitHub Pages servers that host the site
  • www.cjsm.justice.gov.uk NS -> delegated to Hosted Zone in Cloud Platform - see www redirect
  • www.dev.cjsm.justice.gov.uk NS -> delegated to Hosted Zone in Cloud Platform - to test the redirect

(Since DSD account is deprecated, we should probably move this Hosted Zone into Cloud Platform too)

www.cjsm.justice.gov.uk hosted zone (in Cloud Platform account, cjsm-prod namespace)

www.dev.cjsm.justice.gov.uk hosted zone (in Cloud Platform account, cjsm-dev namespace)

  • www.dev.cjsm.justice.gov.uk A -> ingress that redirects to dev.cjsm.justice.gov.uk - that destination doesn't exist - it was just for developing the redirect, but it could be useful to have a dev site in the future

Old backups

There are old snapshots of this site, from 2015-2022/1 in S3 buckets in DSD account:

  • cjsm.dsd.io - 2013/12 - PHP
  • www.cjsm.justice.gov.uk - 2014/2
  • cjsm.staging.dsd.io - 2021/6
  • cjsm.justice.gov.uk - 2022/1

These could be cleared out at some point.