welcome to the goofiest pet photo gallery on the internet. this website is hosted on aws because why not? it’s free (except the domain). here’s how it works:
- s3 bucket: all the pet pics live here. it’s public, so everyone can see your furry friends.
- cloudfront: makes everything fast and secure with https. also caches stuff so your site doesn’t crash when your cat goes viral.
- route 53: handles the domain (in my case
krolok.net
).krolok.pics
used to be the domain, but it’s going away on 04.02.2025. rip.
fun fact: "krolok" is a strange pronunciation of królik, which is polish for "rabbit". 🐇
- get pet pics: put them in an
images
directory, with subdirectories named after each pet. yes, your hamster needs its own folder. - buy a domain: use route 53 or whatever. just make sure it’s cute.
- set up s3:
- create a bucket with public access. make it the same name as your domain/subdomain.
- slap this bucket policy on it:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::bucket-name/*" }, { "Effect": "Allow", "Principal": "*", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::bucket-name" } ] }
- enable static website hosting.
- enable CORS, example:
[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]
- get a cert: for https, because no one likes insecure websites.
- set up cloudfront:
- create a distribution with your cert.
- enable http -> https upgrade.
- set cache policy to
UseOriginCacheControlHeaders-QueryStrings
. - set origin request policy to
UserAgentRefererHeaders
. - if youre rich you can enable waf for ddos protection.
- point your domain:
- if using route 53: create an A record alias to the cloudfront domain.
- otherwise: use a CNAME record.
- configure the site:
- edit
index.html
constants to match your use case.
- edit
- done! now your pets are internet famous. 🎉
it’s an ultra-compressed version of some kevin macleod(?) song. idk which one. it’s royalty-free, so no one’s coming after you.
i don’t care what you do with this code. host your pet pics, host your memes, host your grandma’s recipes.