Skip to content
A simple image sharing server written in Go.
Go JavaScript HTML Dockerfile Shell CSS Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
auth
config
endpoints
thumbnail
types
vendor
web
Dockerfile
Gopkg.lock
Gopkg.toml
Makefile
README.md
k8s-backend.yaml
main.go
run_local.sh

README.md

Yronwood

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.

Yronwood

Usage

See Dockerfile for how it is built and ran; and k8s-backend.yaml for how I have configured it in my cluster.

See 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.

See types/types.go for the API schema. All non-GET requests have JSON request payloads, while GET requests use query string params.

Web Interface

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.

Credits

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:

  • typhon for HTTP service and request schematics
  • slog for logging
  • terrors for 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.

You can’t perform that action at this time.