Sharing: Add Shared Albums to Home Screen #1194

Open
opened 2026-02-20 00:08:08 -05:00 by deekerman · 4 comments
Owner

Originally created by @bcardiff on GitHub (Oct 25, 2021).

I wanted to share an album with family and friends. I plan to add photos to that album in weeks and months to come. So I wanted to simplify how they can keep the shared album link during that period. Installing the shared album as a PWA seems like a good way to achieve that.

I would have expected that the shared album page could be added as a PWA that will open the album directly. But that is not happening.

When adding the page to Home Screen (The regular iOS PWA install), the root url is used and hence the guest will see the login screen.

Would it make sense to customize the "start_url" of the manifest in the shared album page? Other properties that could have sensible values for the shared album I can think of are title and image, to show the album title and album cover.

From what I can see in the code the manifest in the shared views are fixed here github.com/photoprism/photoprism@caf7920672/assets/templates/share.tmpl (L27) and the manifest has a single route defined in github.com/photoprism/photoprism@8e5a97ed4a/internal/server/routes.go (L22-L28).

Regarding the implementation, would it make sense to add a route /s/:secret/manifest.json and use that instead of the root site manifest?

Originally created by @bcardiff on GitHub (Oct 25, 2021). I wanted to share an album with family and friends. I plan to add photos to that album in weeks and months to come. So I wanted to simplify how they can keep the shared album link during that period. Installing the shared album as a PWA seems like a good way to achieve that. I would have expected that the shared album page could be added as a PWA that will open the album directly. But that is not happening. When adding the page to Home Screen (The regular iOS PWA install), the root url is used and hence the guest will see the login screen. Would it make sense to customize the "start_url" of the manifest in the shared album page? Other properties that could have sensible values for the shared album I can think of are title and image, to show the album title and album cover. From what I can see in the code the manifest in the shared views are fixed here https://github.com/photoprism/photoprism/blob/caf792067274694f890d10660fcceb4f41fc92f6/assets/templates/share.tmpl#L27 and the manifest has a single route defined in https://github.com/photoprism/photoprism/blob/8e5a97ed4a267b48b14fcfed2bb3542aebd5ffe3/internal/server/routes.go#L22-L28. Regarding the implementation, would it make sense to add a route `/s/:secret/manifest.json` and use that instead of the root site manifest?
Author
Owner

@lastzero commented on GitHub (Oct 27, 2021):

AFAIK there's a convention that the manifest.json must be in the root path like the PWA worker. Also browsers have special caching rules for the manifest.json, so that simple anti cache HTTP headers won't work.

Shouldn't be an issue to just install it on the home screen like a regular Web site / app, maybe with a few changes if it's not working right now. I suspect it's an authentication issue as the album URL doesn't contain the secret token. You would have to use the original share URL containing the secret token. Otherwise everyone could open the album.

@lastzero commented on GitHub (Oct 27, 2021): AFAIK there's a convention that the `manifest.json` must be in the root path like the PWA worker. Also browsers have special caching rules for the `manifest.json`, so that simple anti cache HTTP headers won't work. Shouldn't be an issue to just install it on the home screen like a regular Web site / app, maybe with a few changes if it's not working right now. I suspect it's an authentication issue as the album URL doesn't contain the secret token. You would have to use the original share URL containing the secret token. Otherwise everyone could open the album.
Author
Owner

@alchemyconsulting commented on GitHub (Jan 2, 2022):

Yup I get this complaint from pretty much everyone I share an album with. Would be great to get a fix or workaround for this :)

@alchemyconsulting commented on GitHub (Jan 2, 2022): Yup I get this complaint from pretty much everyone I share an album with. Would be great to get a fix or workaround for this :)
Author
Owner

@bcardiff commented on GitHub (Jan 23, 2022):

My current workaround was to drop a some files in a folder like /a/simple-name/index.html with it's own manifest and icons. In my setup I use caddy. I instruct to serve /a/* from local files instead of upstream and it does the trick.

The index.html is a cover image with a link to view photos via the secret link, but the manifest points to the secret link directly. The cover page/image is viewed once.

Sometimes when accessing the album it redirects to the login screen, not sure why. But it's a matter of clicking again in the link from the home page and it works.

I can share the setup details if wanted.

I tried to overwrite via caddy the response, but I couldn't. Using caddy for the first time, configuring it via docker, compiling a custom docker image because replace-response extension and dealing with compression with upstream was just a bit to much 🙈 . So, I use a simpler approach.

@bcardiff commented on GitHub (Jan 23, 2022): My current workaround was to drop a some files in a folder like `/a/simple-name/index.html` with it's own manifest and icons. In my setup I use caddy. I instruct to serve /a/* from local files instead of upstream and it does the trick. The index.html is a cover image with a link to view photos via the secret link, but the manifest points to the secret link directly. The cover page/image is viewed once. Sometimes when accessing the album it redirects to the login screen, not sure why. But it's a matter of clicking again in the link from the home page and it works. I can share the setup details if wanted. I tried to overwrite via caddy the response, but I couldn't. Using caddy for the first time, configuring it via docker, compiling a custom docker image because replace-response extension and dealing with compression with upstream was just a bit to much 🙈 . So, I use a simpler approach.
Author
Owner

@alanmcginnis commented on GitHub (Jun 21, 2023):

Thank you for the feedback. I have been creating shortcuts on iOS that open the original share link URL. I have then been sharing those shortcuts with my family. This is a specific use case but an easy workaround for the Apple ecosystem. Android may have something similar.

They can then add the shortcut to the home screen.

@alanmcginnis commented on GitHub (Jun 21, 2023): Thank you for the feedback. I have been creating shortcuts on iOS that open the original share link URL. I have then been sharing those shortcuts with my family. This is a specific use case but an easy workaround for the Apple ecosystem. Android may have something similar. They can then add the shortcut to the home screen.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#1194
No description provided.