| name | last commit | updated |
|---|---|---|
| cmd/ | Fix v1 follow-ups (!3) | 12 days ago |
| docs/ | Add timeline page (!6) | 12 days ago |
| internal/ | Add timeline page (!6) | 12 days ago |
| .dockerignore | gallery v1 (!2) | 12 days ago |
| .gitignore | Ignore .env (!5) | 12 days ago |
| Dockerfile | Fix v1 follow-ups (!3) | 12 days ago |
| LICENSE | Add v1 design spec and plan (!1) | 13 days ago |
| README.org | Fix v1 follow-ups (!3) | 12 days ago |
| compose.yml | gallery v1 (!2) | 12 days ago |
| go.mod | gallery v1 (!2) | 12 days ago |
| go.sum | gallery v1 (!2) | 12 days ago |
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.