Marv's Blog

Blog setup

I have been looking into setting up a blog for a long time, but never really imagined having any content for it. Inspired by Simon Willison, I decided to use this as a sort of public knowledge base, documenting what I know and learn and possibly helping others out with it as well.

Setting this up, I had a few clear requirements in mind on how this should work out:

Everything was fairly straightforward, the first Kagi search results recommended Eleventy for static site generation, which I went with.

Fossil has built-in support for versioned documentation, meaning you can serve any checked-in HTML (or fossil-wiki) files from the /doc path. So when building the blog, I am committing the generated static files to the www directory which will then allow fossil to serve them from blog.lt-mr.de/doc/trunk/www.

This has the obvious downside of having this "polluted" base URL, instead of having a clean slate after .de. Having a pretty URL was and is not part of my requirements though, so I am accepting it as it is.

While setting this up, I wondered if this will mean that I have to commit each time I want to look at a newly written blog post, as trunk in the URL represents the branch the files are pulled from. Luckily, this is a non-issue: in my local fossil ui, I can look at the currently changed files under /doc/ckout/www, ckout representing the changes in my current checkout.

Deployment of the fossil server is as easy as it gets for me: I am already running a VPS with a Docker reverse proxy. Setting up a Dockerfile to build the image:

FROM alpine:edge

ENV USERNAME=fossil

RUN addgroup -Sg 400 g$USERNAME \
  && adduser -Su 400 -G g$USERNAME $USERNAME \
  && apk update \
  && apk upgrade \
  && apk add fossil

VOLUME ["/fossils"]

WORKDIR "/fossils"

EXPOSE 8181

ENTRYPOINT ["/usr/bin/fossil"]

CMD ["server","--nojail","--https","--port","8181","/fossils/blog.fossil"]

I added that image to my deployment (I may write about the details some other day) and pointing the DNS to it.

If everything works as intended, you should be reading this blog right now.