Skip to content
A simple image sharing server written in Go.
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 Fix previous commit Jun 4, 2019
config Add support for thumbnail to improve low-bandwidth performance Jun 8, 2019
endpoints Change default paging to be multiple of 3 Jun 9, 2019
thumbnail Fix encoding of thumbnails Jun 8, 2019
types Add pagination support Jun 4, 2019
vendor Add support for thumbnail to improve low-bandwidth performance Jun 8, 2019
web
Dockerfile Add Readme.md May 27, 2019
Gopkg.lock Add support for thumbnail to improve low-bandwidth performance Jun 8, 2019
Gopkg.toml Add support for thumbnail to improve low-bandwidth performance Jun 8, 2019
Makefile Make prune forced Jun 8, 2019
README.md Add web interface configurations and descriptions Jun 4, 2019
k8s-backend.yaml Add web interface configurations and descriptions Jun 4, 2019
main.go Initial iteration of code. May 27, 2019
run_local.sh Add support for thumbnail to improve low-bandwidth performance Jun 8, 2019

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