README.org
65 lines · 2242 bytes
1#+title: gallery
2
3Self-hosted photo gallery. Albums are folders; resized copies are generated on
4request with ImageMagick and cached on disk.
5
6* Requirements
7
8Go 1.27, ImageMagick 7 (=magick=), exiftool.
9
10* Photos
11
12#+begin_example
13photos/
14 about.org optional; rendered as the Info page
15 tokyo/
16 album.org optional
17 DSCF0412.jpg
18 ...
19#+end_example
20
21=album.org= keywords, all optional:
22
23| Keyword | Meaning | Default |
24|------------+-------------------------------------------+--------------------|
25| =#+title= | album title | folder name |
26| =#+date= | =YYYY=, =YYYY-MM= or =YYYY-MM-DD= | newest photo |
27| =#+cover= | file name of the cover photo | first photo |
28| =#+order= | integer; ordered albums come first | unset |
29| =#+sort= | =taken= or =name= | =taken= |
30
31Text below the keywords is shown as the album description.
32
33* Run
34
35#+begin_src sh
36go build -o gallery ./cmd/gallery
37./gallery -photos ./photos -cache ./cache -addr :8080
38#+end_src
39
40| Flag | Env | Default |
41|--------------+---------------------+-----------|
42| =-photos= | =GALLERY_PHOTOS= | required |
43| =-cache= | =GALLERY_CACHE= | required |
44| =-addr= | =GALLERY_ADDR= | =:8080= |
45| =-theme= | =GALLERY_THEME= | embedded |
46| =-templates= | =GALLERY_TEMPLATES= | embedded |
47| =-title= | =GALLERY_TITLE= | =gallery= |
48
49=-theme= replaces [[file:internal/web/assets/theme.css]]. =-templates= points
50at a directory with the same file names as [[file:internal/web/templates]].
51
52See [[file:docs/specs/2026-09-25-gallery-design.org][the design spec]].
53
54* Deploy
55
56#+begin_src sh
57git clone https://gitbay.org/cmc/gallery.git ~/docker/gallery
58cd ~/docker/gallery
59GALLERY_PHOTOS_DIR=/path/to/photos docker compose up -d --build
60#+end_src
61
62The container listens on =127.0.0.1:8003=; put a reverse proxy in front of it.
63Photos are mounted read-only; derivatives and =meta.json= live in =./cache=.
64The container runs as UID/GID 1000, so =./cache= must be writable by that user
65and the photos readable by it.