Skip to content

Commit

Permalink
Merge pull request #118 from alphagov/disable_chat
Browse files Browse the repository at this point in the history
Add a disable_chat bool to disable the GOV.UK chat service
  • Loading branch information
rtrinque authored Sep 18, 2024
2 parents 816dc4b + 5ba5727 commit 3f1acc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions www/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ locals {
minimum_tls_version = "1.2"
ssl_ciphers = "ECDHE-RSA-AES256-GCM-SHA384"
basic_authentication = null
disable_chat = false

s3_static_assets_port = 443
s3_static_assets_hostname = null
Expand Down
7 changes: 7 additions & 0 deletions www/www.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,13 @@ sub vcl_recv {
unset req.http.Cookie;
}

%{ if disable_chat == true ~}
# Chat app is disabled
if (req.url ~ "^/chat/") {
error 503 "Service unavailable";
}
%{ endif ~}

# Strip cookies for requests to /chat/* that lack a session cookie,
# otherwise pass through
if (req.url ~ "^/chat/") {
Expand Down

0 comments on commit 3f1acc9

Please sign in to comment.