hackoregon / civic-devops

Master collection point for issues, procedures, and code to manage the HackOregon Civic platform
MIT License
11 stars 4 forks source link

What to do about the (site).civicpdx.org sites? #192

Closed MikeTheCanuck closed 6 years ago

MikeTheCanuck commented 6 years ago

All of the 2017 React sites have been published as routes under the http://2017.civicpdx.org domain:

However, we still also have the S3 bucket-published sites (and their corresponding DNS records):

Recommendation

  1. remove the buckets
  2. reconfigure the DNS "A" records to redirect to their corresponding http://2017.civicpdx.org/(site) URLs
MikeTheCanuck commented 6 years ago

On further consideration, it isn't possible to direct requests from http://budget.civicpdx.org to http://2017.civicpdx.org/budget using just DNS - DNS (domain name) services are only able to redirect from http://budget.civicpdx.org to http://2017.civicpdx.org.

To accomplish the complete redirect we're after would require hosting some application code that directs from the original requested URL to the full target URL.

For example, we could place an index.html in the root of the legacy bucket for budget.civicpdx.org, and the contents of that index.html file would be <meta http-equiv="refresh" content="0; url=http://2017.civicpdx.org/budget/" /> (cf. stackoverflow)

MikeTheCanuck commented 6 years ago

Turns out it's even easier to enable a redirect from an S3 static-website-hosting setup to another URL - just enable "redirect requests" in the bucket Properties like so:

screen shot 2018-07-04 at 16 52 50

Don't even need to have any files in the S3 bucket, so let's empty those suckers!

Thus I've emptied the buckets that were hosting those sites, deleted the staging buckets that weren't even being used anymore, and tar.gz'd the contents of all those buckets to the s3://civic-devops/backups/deleted-buckets location.

Buckets archived and emptied

Buckets archived and deleted