Yronwood is a simple API server written in Go for hosting and sharing public, unlisted, and private images from a backend file system. It uses no database, and the file system is the only source of truth for attributes.
It is designed to run as a microservice container in Kubernetes, but can also run stand-alone. Although it would be quite awkward to configure in a stand-alone state.
It serves as a drop-in replacement for my old Lychee-based PHP image gallery. This ~9MB container is much leaner and faster than the old PHP/MySQL-based solution.
config/config.go for how it is configured via environmental variables. In a Kubernetes cluster, an ingress (NGINX in my case) terminates TLS and runs in front of its pod.
types/types.go for the API schema. All non-GET requests have JSON request payloads, while GET requests use query string params.
A simple web interface for showing and uploading the images is available as a separate containerized web service in
/web/yronwood, with configurations enclosed. It runs as a separate web service in Kubernetes in my setup.
I build Go services at Monzo, so this project has extensively relied on some of Monzo's open-source projects I use day-to-day:
typhonfor HTTP service and request schematics
terrorsfor internal error schematics
Separation of build and runtime containers for Go applications can be a bit of a pain for simple setups. My Dockerfile is borrowed from this written by C Hemidy.