Immich Magic Proxy
A fork of Immich Public Proxy (4.1.1) that adds invitations, comments and new-photo emails. Each share is either public (anyone with its Immich link can view it, as upstream) or sign-in only (only people you invite).
- Public or sign-in only. Any Immich shared link opened through the proxy is added to
/adminautomatically, as public. Untick "Public link works" there to make it sign-in only. Shares you add in/adminyourself are public unless you untick the box when adding them. Shares added before this setting existed stay sign-in only. A key Immich doesn't know is refused, and Immich is asked about it at most once every 10 minutes. - Magic links. You add the people allowed to see a share. Each person gets a personal link. For a sign-in only share, without a valid link every page, photo, video, download and API route answers with a "private photos" page or a 404, and never touches Immich.
- Bookmarkable. Opening the link signs that browser in with an
HttpOnlycookie that lasts 400 days (the browser maximum) and renews itself daily while in use. Sessions live in the database, so restarts don't sign anyone out. Recipients can bookmark an album, or/mefor all their albums. - New-photo emails. Each recipient chooses daily, weekly, monthly or never (you set their starting choice). The proxy checks every album for new photos and sends one summary email per period, with a sign-in link per album. Photos that were already there when someone got access are never reported as new.
- Comments. Recipients can comment on any photo from the lightbox (comment button, or the info sidebar). They can delete their own; you can moderate all of them from the admin page. Comments are only ever shown to recipients given that share, never to other visitors of a public share.
- Hearts. Recipients can heart a photo from the lightbox (heart button, beside the comments button). The count is everyone's; each recipient hearts a photo at most once and can take it back. Like comments, hearts are for recipients given that share only.
- Activity.
/adminshows how often each album's gallery was opened (and how many of those opens were by visitors who weren't signed in), its hearts, and how often each recipient opened their albums. A recipient's page lists each signed-in browser with when it was last used and its views, and can sign out any one of them. Counting started with this release; earlier visits aren't included. - Lost links. A visitor with no session can ask for a new link by email. The reply is the same whether or not the address was invited, and requests are rate-limited.
- Password-protected shares. Store the share password when adding the album, and recipients are never asked for it.
Setup
To run it in an LXC container (Proxmox, Incus, LXD) instead of Docker, see lxc/README.md.
- Set the environment (see
docker-compose.yml) and start it withdocker compose up -d --build. Mount a volume at/data: it holds the SQLite database of recipients, sessions and comments. Back it up. - Open
/adminand sign in withADMIN_PASSWORD. - Under Albums, paste an Immich shared link (
https://immich.example.com/share/...or/s/<slug>), or just open it through the proxy. Choose whether its public link works. - Under Recipients, add each person, tick their albums, and either email the invitation or copy the link.
From a recipient's page you can send a new link, revoke every link and session they have, disable them, or delete them.
| Variable | |
|---|---|
IMMICH_URL |
Immich's internal URL, as upstream |
PUBLIC_BASE_URL |
This proxy's public URL. Needed for links in emails, and https:// makes cookies Secure |
ADMIN_PASSWORD |
Turns on /admin. Without it there is no admin console |
SMTP_URL or SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / SMTP_SECURE |
Outgoing mail. Without it, no emails are sent; you copy links by hand |
MAIL_FROM |
Sender address, e.g. Our photos <photos@example.com> |
SITE_NAME |
Name used in email subjects. Default Shared photos |
DIGEST_HOUR |
Hour (0-23) that notification emails go out. Default 8 |
TZ |
Timezone for DIGEST_HOUR. Default UTC |
NOTIFY_INTERVAL_MINUTES |
How often albums are checked for new photos. Default 60 |
DATA_DIR |
Database directory. /data in the image, ./data otherwise |
TRUST_PROXY |
Express trust proxy setting. Default trusts private-network proxies |
Differences from upstream
- Responses are cached
privateonly, with no CORS header, so a CDN can't hand a photo to someone without a session. If you setipp.responseHeadersyourself, keepCache-Controlprivate. - The gallery page is
private, no-cache;ipp.gallery.cacheTimeandipp.showHomePageare no longer used./goes to the recipient's albums. ipp.gallery.singleImagedefaults totrue, so a one-photo share opens in the gallery where it can be commented on.ipp.uploadUrldefaults to off. The separate upload service (upload-app/) does not check magic-link sessions, so don't route it unless you accept that anyone with a share key can upload.- An Immich share link still works directly on Immich itself; this proxy only controls access through the proxy. Keep Immich private, as upstream recommends.
- Removing a share in
/admindoesn't block its link: if Immich still accepts it, opening it adds the share back as public. To block a share, make it sign-in only, or delete the link in Immich.
The rest of this README is upstream's.
Immich Public Proxy
Share your Immich photos and albums in a safe way without exposing your Immich instance to the public.
This does not need an API key, or any privileged access to Immich. Setup takes less than a minute, and you never need to touch it again as all of your sharing stays managed within Immich.
See a Live demo gallery serving straight out of my own Immich instance.
About this project
Immich is a wonderful bit of software, but since it holds all your private photos it's best to keep it fully locked down. This presents a problem when you want to share a photo or a gallery with someone.
Immich Public Proxy provides a barrier of security between the public and Immich, and only allows through requests which you have publicly shared. It is stateless, needs no API key, and knows nothing about your Immich instance beyond what you have shared.
Read more in the Introduction, including
why not just expose Immich's /share/ path.
Visitors can optionally add their own photos and videos to a share, for example guests at a wedding. See Let visitors send photos back.
Quick start
- Download the docker-compose.yml file.
- Set
IMMICH_URLto the local (not public) URL of your Immich server, andPUBLIC_BASE_URLto the public URL of IPP. - Run
docker-compose up -dand check thathttps://photos.example.com/share/healthcheckresponds. - In Immich's Server Settings, set the "External domain" to your IPP URL. Every link Immich generates from now on points at the proxy.
If you use Cloudflare, set your /share/video/* path to Bypass Cache or videos may not play.
Full instructions, including Kubernetes: Installation.
Documentation
Everything is at docs.ipp.nz:
- Installation and Sharing from Immich
- Configuration: downloads, gallery layout, lightbox, metadata privacy, error responses
- Guides: let visitors send photos back, single domain with Immich, redirect your root domain to a share, securing Immich with mTLS
- Troubleshooting
Feature requests
You can add feature requests here.
IPP has read-only access to Immich and stores nothing: anything that needs an API key, modifies Immich, or would require storing a share key won't be considered. Visitor uploads are the one write path, and they live in their own optional container. See CONTRIBUTING.md for the full list.
Thanks
The gallery lightbox, with its zoom, swipe and keyboard navigation, is PhotoSwipe by Dmytro Semenov. It is a superb piece of work, MIT licensed, and IPP would be a much poorer viewer without it. If you find it useful, consider sponsoring the project.
