gallery

Self-hosted photo gallery. Albums are folders; resized copies are generated on request with ImageMagick and cached on disk.

Requirements

Go 1.27, ImageMagick 7 (magick), exiftool.

Photos

photos/
  about.org           optional; rendered as the Info page
  tokyo/
    album.org         optional
    DSCF0412.jpg
    ...

album.org keywords, all optional:

Keyword Meaning Default
#+title album title folder name
#+date YYYY, YYYY-MM or YYYY-MM-DD newest photo
#+cover file name of the cover photo first photo
#+order integer; ordered albums come first unset
#+sort taken or name taken

Text below the keywords is shown as the album description.

Run

go build -o gallery ./cmd/gallery
./gallery -photos ./photos -cache ./cache -addr :8080
Flag Env Default
-photos GALLERY_PHOTOS required
-cache GALLERY_CACHE required
-addr GALLERY_ADDR :8080
-theme GALLERY_THEME embedded
-templates GALLERY_TEMPLATES embedded
-title GALLERY_TITLE gallery

-theme replaces internal/web/assets/theme.css. -templates points at a directory with the same file names as internal/web/templates.

See the design spec.

Deploy

git clone https://gitbay.org/cmc/gallery.git ~/docker/gallery
cd ~/docker/gallery
GALLERY_PHOTOS_DIR=/path/to/photos docker compose up -d --build

The container listens on 127.0.0.1:8003; put a reverse proxy in front of it. Photos are mounted read-only; derivatives and meta.json live in ./cache. The container runs as UID/GID 1000, so ./cache must be writable by that user and the photos readable by it.

About

Org 55.4%Go 40%HTML 1.9%CSS 1.6%JavaScript 1%

1 contributorcmc

Clone

SSH
git clone ssh://git@gitbay.org/cmc/gallery.git
HTTPS
git clone https://gitbay.org/cmc/gallery.git