Lightweight, self-hosted photo sharing for families on low-resource VPS.
This repository contains the Go backend and SSR frontend. See .docs/ for design notes and task backlog.
- Zero-waste storage: uploads are resized and converted to WebP (default) or AVIF (optional)
- Magic link sharing with view/time limits
- Simple admin UI (no SPA)
- Mobile-first UX
- HTMX + Alpine.js for light interactivity
- Go (
net/http,chi) - SQLite (pure Go, no CGO)
- HTML templates + Tailwind CSS
FamilyShare uses a lightweight image pipeline designed for low-resource servers:
- WebP (default): encoded with
github.com/chai2010/webpat 80% quality. - AVIF (optional): encoded with
github.com/gen2brain/avif(CGO-free, WASM fallback) using quality 60 and speed 6.
To enable AVIF output, set IMAGE_FORMAT=avif in your environment (see .env.example). If unset, the pipeline defaults to WebP.
- Copy
.env.exampleto.envand edit values. - Generate an admin password hash:
make hash-password PASSWORD=YourSecurePassword123Or:
go run scripts/hash_password.go YourSecurePassword123- Set the hash:
export ADMIN_PASSWORD_HASH='$2a$12$...'- Build and run:
go build -o familyshare ./cmd/app
./familyshareAdmin UI: http://localhost:8080/admin/login
See Quick Start section above.
Quick Deploy (recommended):
# On your VPS, from the project root
git clone https://github.com/YOUR_USERNAME/family-share.git
cd family-share
cp .env.example .env
# Edit .env and set at minimum: ADMIN_PASSWORD_HASH, DATA_DIR, DOMAIN, ACME_EMAIL
nano .env
./scripts/deploy.sh [production|staging]Notes (be meticulous):
- The deploy script automates pull, build, backup, Docker Compose bring-up and health checks. It validates that
DOMAINandACME_EMAILare present in your project.envand will prompt before making changes. - You do not normally need to edit
deploy/Caddyfile; the deploy script and the included Caddyfile are sufficient for standard VPS use. If you have special TLS or proxy needs, editdeploy/Caddyfile(advanced). - Ensure DNS for
DOMAINpoints to your VPS before running the script so Caddy can provision certificates.
Detailed Guide: See VPS Deployment Guide for complete instructions including:
- VPS preparation
- Domain configuration via
.env - SSL setup with Caddy (automatic via Caddy + ACME)
- Backup strategies
- Troubleshooting
See .docs/configuration.md for all environment variables and defaults.
See .docs/usage-guide.md for admin workflows (albums, uploads, share links).
See .docs/deployment/docker-compose.md and .docs/deployment/reverse-proxy.md.
See .docs/troubleshooting.md.
Q: Are original photos stored? A: No. Photos are resized and converted to WebP to save space.
Q: Can I use AVIF instead of WebP?
A: Yes. Set IMAGE_FORMAT=avif to encode uploads as AVIF. WebP remains the default.
Q: Do viewers need an account? A: No. Access is via share links only.
Migrations are embedded in the binary under sql/schema/* and applied at startup by internal/db.
Manual apply (debug only):
sqlite3 ./data/familyshare.db < sql/schema/0001_init_schema.sql