Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:
- Normal
- Scheduled_Maintenance
- Unscheduled_Downtime
- Federal_Shutdown
notification:
description: 'Notification to Slack?'
required: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ Continuous Deployment via [GitHub Actions](https://github.com/GSA/catalog.data.g

## Put site into maintenance mode

To block access to the catalog apps (`catalog-web`, `catalog-admin`), set the environment variables (`CATALOG_WEB_MODE`, `CATALOG_ADMIN_MODE`) in the `catalog-proxy` app. Use 'MAINTENANCE' for scheduled downtime, 'DOWN' for unscheduled downtime. Any other value will resume normal operation.
To block access to the catalog apps (`catalog-web`, `catalog-admin`), set the environment variables (`CATALOG_WEB_MODE`, `CATALOG_ADMIN_MODE`) in the `catalog-proxy` app. Use 'MAINTENANCE' for scheduled downtime, 'DOWN' for unscheduled downtime, 'FEDERAL-SHUTDOWN' for the special occasion. Any other value will resume normal operation. Any change on `CATALOG_WEB_MODE` need to be followed by a CloudFront cache clear.
6 changes: 6 additions & 0 deletions proxy/nginx-maintenance.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if ($operation_mode = 'MAINTENANCE') {
if ($operation_mode = 'DOWN') {
set $takedown "2";
}
if ($operation_mode = 'FEDERAL-SHUTDOWN') {
set $takedown "3";
}
# Allow access to the following paths
if ($uri = "/api/action/status_show") {
set $takedown "0";
Expand All @@ -32,6 +35,9 @@ location @maintenance {
if ($takedown = "2") {
rewrite ^(.*)$ /sitedown.html break;
}
if ($takedown = "3") {
rewrite ^(.*)$ /federal-government-shutdown.html break;
}
rewrite ^(.*)$ /500.html break;
}
location = /maintenance.html {
Expand Down
22 changes: 22 additions & 0 deletions proxy/public/federal-government-shutdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding-top: 100px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
img { display: block; width: 200px;}
</style>


<article>
<img src=https://s3-us-gov-west-1.amazonaws.com/cg-0817d6e3-93c4-4de8-8b32-da6919464e61/logo.svg alt="data.gov logo">
<h1>Site not available</h1>
<div>
<p>
The Federal Government is currently shut down. As a result, this site is unavailable until further notice. Please visit <a href="https://usa.gov">https://usa.gov</a> for more information.
</p>
</div>
</article>
3 changes: 3 additions & 0 deletions tools/set_maintenance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ case "$2" in
"Unscheduled_Downtime")
maintenance_mode="DOWN"
;;
"Federal_Shutdown")
maintenance_mode="FEDERAL-SHUTDOWN"
;;
*)
maintenance_mode="NORMAL"
;;
Expand Down
Loading