hosting updates

I've been moving my online stuff to new places.

Static websites

Things that only need static hosting (like this blog), are now served by bunny.net.

I wanted to switch to an EU based provider, and prefer paying a fair price, rather than depending fully on US based free options.

Before I was using Cloudflare Pages and before that AWS S3 with Cloudflare.

To upload stuff, I wrote my own package to handle syncing the build output folders to the online storage, and purging CDN caches. It's available on jsr.io.

Serverless functions

If I can, I like writing serverless functions, to gather data from multiple APIs or generate json feeds etc.

Deno is really nice for that, given that I'm quite comfortable with typescript, and you can also easily run things using deno deploy. But it still has issues with deno workspaces, and once again, I disliked the thought of being dependent on the free option.

Bunny.net recently started offering running serverless functions. So I started to switch to that. It can only handle a single script file thought, so I take the script entrypoint and bundle it into a single file, using the bundle function from @deno/emit.

So for now "serious" scripts can be run with bunny.net, and for other quick stuff I use deno deploy.

opsCanvas

I also have some apps and scripts in the opsCanvas monorepo, that generate images for me. Since this involves wasm files and a workspace, deno deploy stopped working for me there. And bunny.net's single file doesn't work with the wasm files.

So a couple months ago I decided to try running that stuff on a small server. Initially on Vultr and now Hetzner. It's run using pm2, so that when I push changes to github, the changes are pushed to the server, and apps get restarted. If an app crashes, it should also get automatically restarted. It's then served through caddy, since that seemed easier to setup than nginx.

On servers

Before I was too afraid to run servers. I was worried about getting hacked, the cost, and having to to server administration etc.

The final push was Deno Deploy still not supporting workspaces, even after a couple months.

I then saw a couple tutorials for doing basic hosting and it seemed quite doable to get a basic setup running. Having a couple years of experience with using cli tools and terminals, also helped my confidence there.

The servers can be rented for relatively cheap, so worst case I loose a little, and maybe have to set up a new server. After doing that 3 times, I feel like I'm kinda confident in doing that for myself :D (and I have written instructions for myself, that I mostly can just copy paste into the terminal )