Skip to content

Commit 6fa2fa4

Browse files
committed
exempt /status from maintenance redirect
1 parent 6ffaf15 commit 6fa2fa4

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

app/main/routes.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def index():
2020
return render_template("index.html")
2121

2222

23+
@bp.route("/status", methods=["GET"])
24+
def status():
25+
return "OK"
26+
27+
2328
@bp.route("/maintenance-mode", methods=["GET"])
2429
def maintenance_mode_page():
2530
if not current_app.config["MAINTENANCE_MODE"]:
@@ -86,5 +91,9 @@ def csrf_error(error):
8691
@bp.before_request
8792
def maintenance_mode_middleware():
8893
maintenance_url = url_for("main.maintenance_mode_page")
89-
if current_app.config["MAINTENANCE_MODE"] and request.path != maintenance_url:
94+
exempt_urls = [
95+
maintenance_url,
96+
url_for("main.status"),
97+
]
98+
if current_app.config["MAINTENANCE_MODE"] and request.path not in exempt_urls:
9099
return redirect(maintenance_url)

app/templates/main/maintenance-mode.html

+26-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@
88
<div class="govuk-grid-row">
99
<div class="govuk-grid-column-two-thirds">
1010
<h1 class="govuk-heading-l">This service is currently down for maintenance</h1>
11-
<p class="govuk-body">'If you were part way through the service, you will have to start again when the service becomes available.</p>
11+
<p class="govuk-body">If you were part way through the service, you will have to start again when the service becomes available.</p>
12+
13+
<p class="govuk-body">Contact the Civil Legal Advice Helpline if you need urgent information or advice.</p>
14+
<p class="govuk-body">Telephone:<br />
15+
<strong class="govuk-!-font-weight-bold">0345 345 4345</strong>
16+
</p>
17+
18+
<p class="govuk-body">Textphone:<br />
19+
<strong class="govuk-!-font-weight-bold">0845 609 6677</strong>
20+
</p>
21+
22+
<div class="govuk-inset-text">
23+
<p class="govuk-body">
24+
Calls will cost approximately 9p per minute from landline. Calls from mobiles may cost more.
25+
</p>
26+
<p class="govuk-body">
27+
If you are worried about the cost, you can request a call-back within 24 hours by either calling the helpline or texting ‘legal aid’ and your name to <strong class="govuk-!-font-weight-bold">80010</strong>.
28+
</p>
29+
</div>
30+
<p class="govuk-body">Opening times:<br />
31+
<strong class="govuk-!-font-weight-bold">
32+
Monday to Friday: 9am to 5pm<br />
33+
Saturday: 9am to 12.30pm
34+
</strong>
35+
</p>
36+
1237
</div>
1338
</div>
1439
{% endblock %}

helm_deploy/laa-access-civil-legal-aid/templates/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ spec:
4444
protocol: TCP
4545
livenessProbe:
4646
httpGet:
47-
path: /
47+
path: /status
4848
port: http
4949
readinessProbe:
5050
httpGet:
51-
path: /
51+
path: /status
5252
port: http

helm_deploy/laa-access-civil-legal-aid/templates/ingress.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ metadata:
1313
labels:
1414
{{- include "laa-access-civil-legal-aid.labels" . | nindent 4 }}
1515
annotations:
16+
nginx.ingress.kubernetes.io/custom-http-errors: "413,502,504"
1617
{{- if .Values.ingress.cluster.name }}
1718
external-dns.alpha.kubernetes.io/set-identifier: "{{ $fullName }}-{{ .Release.Namespace }}-{{- .Values.ingress.cluster.name -}}"
1819
external-dns.alpha.kubernetes.io/aws-weight: "{{- .Values.ingress.cluster.weight -}}"

0 commit comments

Comments
 (0)