2020-10-19

A static digression

 After finally passing on various web site creation tools I figured I would do the simple thing:  post a static web site.

AWS allows you to use an S3 storage bucket as a static web site.  Sweet! What could be simpler?  I have a tool that allows me to map an S3 bucket into a Windows folder, so all I would have to do is update the folder to publish changes.  Even better, you can put Cloudfront in front of it which ensures HTTPS as well as HTTP requests are handled.

Sounds good ... but

  1. The instructions (at least at that time) left out the key fact that your bucket has to have the same name as your domain.
  2. My file uploader wasn't setting the metadata correctly.  That was fixable.
  3. It's a bit confusing to pick the right kind of certificate for HTTPS (wildcard or root only).
  4. "index.html" is only returned by default for the root bucket; so, for instance, https://www.above-the-garage.com/piano doesn't work - you have to specify https://www.above-the-garage.com/piano/index.html ; this broke some existing links out in the wild.
  5. DNS

Now let's see if I can explain this.

In the beginning, web sites tended to have "www." in front, like this:


"www." specified the protocol - world wide web.  You could have file transfer ("ftp.") or actually any prefix you wanted.

About a year ago Google announced they would stop displaying the "www." part.  Sounded good.  I made sure the following variations would link to my site:


Unfortunately, one of those doesn't work!  It's #2.  And the reason is the certificate doesn't match.

And it turns out it can't match.

Here is an email from April 2019 from Pair Domains, my DNS provider, that explains things:

We are contacting you because there is a problem with DNS records for your

There is currently a CNAME record for @. DNS rules prohibit other records
from sharing the same host name with a CNAME record. With a record for @,
this means that MX records would not work and there could be e-mail
delivery problems for the domain.

We recently changed our DNS software, and the new software is more strict
about DNS rules. Before, CNAME records and MX records could coexist, but
not everyone would be able to actually deliver the e-mail. The new
software does not allow this, so if there is a CNAME for @, e-mail won't
work on the domain.

Well, I also use above-the-garage.com for email, and I want that to work, so I had to drop the CNAME which allowed www.above-the-garage.com to point to above-the-garage.com; and my cert was for above-the-garage.com (without the www.).

So what to do ... change DNS providers?  No, it looks like they are implementing the standard.  Aha!  Make the cert for the www version; and redirect any hits to the homepage to the https://www.above-the-garage.com name; the cert matches, and everything is great.  Except, sadly, case #2 above, where browsers see the https: label, and really want the cert to match the exact domain name.  It doesn't, so the redirect doesn't happen, and people get an error after it times out.  In general, this is probably not a big deal; but in the long run, people and browsers might enforce going to https://above-the-garage.com . Maybe I can put a second cert on there and all is well.  

The most important thing is what happens when you just type in "above-the-garage.com" to your browser address bar:  works in Chrome and Edge!

So, static web site mostly works.  w00t.

[Update 2024-05-06] What could go wrong with a static web site served out of an S3 bucket?  

Answer:

Oh, and since the bucket name had to match the web site name ... my bucket name was effectively public.

So rather than worry about that potential nightmare (AWS says they are working on a fix - that's good) I quickly copied everything out of the bucket into a small AWS Graviton instance and fired up nginx.  One and a half hours later I was moved over.  I still have the same DNS problem.  Ugh!]

[Update 2024-05-07 DNS issue fixed!  Did I really need CloudFront in front of my never visited web site?  NO!  Dropping CloudFront from the mix removed all the CNAME records and I can use A records and MX records together.  w00t!]

2020-09-26

A further digression

As I surveyed the accumulated blogging from the past many years, I remembered now why I really didn't like Squarespace; it was too hard to delete old posts!  

I think a blog like mine that has a lot of stream-of-consciousness in-the-moment material probably needs pruning, rather like forest overgrowth. There are 1,100 or so blog posts here! Many link to sites that don't exist anymore, and without that context, the post itself doesn't make any sense. 

I have (somewhere) a list of all my blog URLs; with Squarespace I could click on one to see the blog entry, decide if it had even a little bit of value, and delete it if not. Except it took way too many key presses to do the deletion.  Like I had to start in a different mode, search for the page, then delete it.  Too hard for something so unimportant! With Blogger it's just a couple of key presses, which is about the level of effort that seems appropriate for sweeping up some detritus. 

I don't know, now, if I have the gumption to go through 1,100 posts, but I probably will do it in small batches. Probably half of my posts should be deleted, even with the very low bar I've set.

2020-09-12

Talk about a digression

Today is September 12, 2020, and the western part of the state of Washington is shrouded in smoke that has blown north from California and Oregon.

Even with the global pandemic, it was possible to go outside in our yard or walk around the neighborhood (with proper physical distancing).  Not today!


(Source)

So, stuck inside, I brought this blog up-to-date.

I started blogging at my personal site Above the Garage in ... 1997?  The earliest archive of the site on the Way Back Machine is in 1998 and it looked like this:


There was a subdirectory of articles called "Random Blts"

My first edits were with Hot Dog because HTML was hard.  Except after producing a few articles with Hot Dog I saw that HTML was actually pretty easy.  Later I used Word and exported as HTML - this was before Word bloated the shit out of HTML.  I switched to Blogger in 2004.  Blogger had a little browser-extension button you could use to grab some text from a site you were visiting and use as a starting point for a post.  I did that a lot.

Facebook became a thing - I joined in 2007-ish.  At first it was very twitter-like - short posts.  Later you could mail pictures to it from your phone.  Eventually it consumed all of my posting time.  But I was still interested in blogging and I searched in vain for a new way to do it.  In 2012-06-12 I posted that I was moving to a MediaWiki blog.

Talk about your digressions!  I built a MediaWiki site and started writing articles with a hypertext structure to them.  Apparently I like linking, as I can see in this post.  In 1983/1984 I worked at a company called DayFlo; this was in the early days of the IBM PC and DayFlo's claim to fame was a hypertext editor.  It was built on a database and generally speaking links had to work.  The genius breakthrough of the modern Web is that links don't have to work.  If they don't have to work, you don't need a central database to make sure they work.  Thus the modern distributed web.

(Yet another aside - Roy Fielding and I had the same Ph.D. thesis advisor in college!)

I enjoyed the MediaWiki approach to blogging until I realized how much work it was to manage a MediaWiki site.  I had thought, how bad can it be?  Wikipedia uses it!  Never challenge worse, my wife says.  It was a matter of applying constant bug patches and dealing with weirdness with MySql which was a lot of sideways effort to the mission at hand.

So I looked for a WYSIWYG editor that could also embed audio and video clips, which was quite awkward back-in-the-day, requiring evil Flash plugins.  Squarespace fit the bill.  I imported the site from Blogger (basically abandoning everything that happened in the meantime on MediaWiki) and started onward from there.

Except ... for all that hassle and upgrades from Squarespace 5 to 7 ... I barely blogged at all.  Because of Facebook.  I posted some "Notes" on Facebook that in the past would have been blog entries.

Now Facebook is a cesspool, so I think I'm motivated to return to blogging.  I can't even remember all the blogging sites I have tried over the years that have come and gone.  (Here's one:  https://drstephencw.wordpress.com/ ) But blogger, in spite of Google's penchant for destroying great products, is still here!  And I was able to import the old blog archive and it worked!  Amazing!

I just now, today, while stuck in the smoky house, ported over the 17 articles I had written in Facebook (they have dates ranging from late 2012 to 2013 and I used their original dates).  I'll probably port over my Facebook notes too.*

And then we'll see.