[PR #1266] [MERGED] feat(web/server) public album sharing #8972

Closed
opened 2026-02-05 13:56:18 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1266
Author: @alextran1502
Created: 1/7/2023
Status: Merged
Merged: 1/9/2023
Merged by: @alextran1502

Base: mainHead: feat/public-sharing


📝 Commits (10+)

  • 387630f Added tables, migration and api endpoint
  • 29b3d9c Added mock testing
  • 338838e Modified id column to use generated hex instead of uuid
  • 1a6d736 Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing
  • 002d627 Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing
  • 3f8046a Added create shared link endpoit/service/core
  • bb74766 Get all shared links with album and asset information
  • 89b1bca Get all links
  • e374a3f Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing
  • f540dfe Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing

📊 Changes

103 files changed (+4925 additions, -375 deletions)

View changed files

📝 mobile/openapi/.openapi-generator/FILES (+18 -0)
📝 mobile/openapi/README.md (+12 -0)
📝 mobile/openapi/doc/AlbumApi.md (+48 -0)
📝 mobile/openapi/doc/AssetApi.md (+48 -0)
mobile/openapi/doc/CreateAlbumShareLinkDto.md (+18 -0)
mobile/openapi/doc/DownloadFilesDto.md (+15 -0)
mobile/openapi/doc/EditSharedLinkDto.md (+18 -0)
mobile/openapi/doc/ShareApi.md (+217 -0)
mobile/openapi/doc/SharedLinkResponseDto.md (+24 -0)
mobile/openapi/doc/SharedLinkType.md (+14 -0)
📝 mobile/openapi/lib/api.dart (+6 -0)
📝 mobile/openapi/lib/api/album_api.dart (+47 -0)
📝 mobile/openapi/lib/api/asset_api.dart (+47 -0)
mobile/openapi/lib/api/share_api.dart (+251 -0)
📝 mobile/openapi/lib/api_client.dart (+10 -0)
📝 mobile/openapi/lib/api_helper.dart (+3 -0)
mobile/openapi/lib/model/create_album_share_link_dto.dart (+162 -0)
mobile/openapi/lib/model/download_files_dto.dart (+113 -0)
mobile/openapi/lib/model/edit_shared_link_dto.dart (+171 -0)
mobile/openapi/lib/model/shared_link_response_dto.dart (+207 -0)

...and 80 more files

📄 Description

Overview

This PR add the public sharing functionality for album, resolve #265. Public sharing for individual files will be added in the subsequent PR to reduce the number of files that needs to be reviewed.
image

Some highlight mechanisms

  • User can create multiple shared links from an album with different expiration time

  • Shared link can be set to allow upload from the public user

  • Shared link can have an optional description
    image

  • User can manage/revoke shared links
    image

Security mechanism

  • The shared link id is a combination of 35 bytes (70 characters long) ccca2fe1ffce4e054714f1f84764f73902769830e76cda4b6121bbaa9158d5ebfe6de6
  • Each shared link comes with a key of 25 bytes (50 characters long) that is used to perform view/download/upload operation in the shared album. 35dd0bf3dd5593be9568e1d065291fca54d765a7b38d1046d8
  • Each endpoint that is allowed public usage will check for the shared link allowable actions such as upload, or add to an album.
  • Only endpoints with the decorator @Authenticated({ isShared: true }) will only evaluate the key params, otherwise, would reject the requests.

Database relationship

image

  • This database design allows an album can have multiple shared links and an asset can be in multiple shared links

TODO

  • Add edit share link mechanism.
  • Download individual asset from the public sharing view.
  • Add copy link button to the shared link management page

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1266 **Author:** [@alextran1502](https://github.com/alextran1502) **Created:** 1/7/2023 **Status:** ✅ Merged **Merged:** 1/9/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `feat/public-sharing` --- ### 📝 Commits (10+) - [`387630f`](https://github.com/immich-app/immich/commit/387630f1b22e89cc4a83a3fda7010ad7f0e224ae) Added tables, migration and api endpoint - [`29b3d9c`](https://github.com/immich-app/immich/commit/29b3d9c067978bff612f69d9f46004fe8c9a2974) Added mock testing - [`338838e`](https://github.com/immich-app/immich/commit/338838ed9e6eb3923dfef82ed0dda7da0770110c) Modified id column to use generated hex instead of uuid - [`1a6d736`](https://github.com/immich-app/immich/commit/1a6d736ba05570ac586edbe7adc2d84eb4d01fc5) Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing - [`002d627`](https://github.com/immich-app/immich/commit/002d627ce0649d0d892d7acc89756d19c6cbb9eb) Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing - [`3f8046a`](https://github.com/immich-app/immich/commit/3f8046aa4944e4ae478eb6ffda49b92b9121c0fd) Added create shared link endpoit/service/core - [`bb74766`](https://github.com/immich-app/immich/commit/bb747666efc44541188ce0ce1be585e7ad63cff6) Get all shared links with album and asset information - [`89b1bca`](https://github.com/immich-app/immich/commit/89b1bca1d2480d294ed77d4771821550edc64c02) Get all links - [`e374a3f`](https://github.com/immich-app/immich/commit/e374a3f3a145ae3a8e0c77757e753556f78d0b53) Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing - [`f540dfe`](https://github.com/immich-app/immich/commit/f540dfe101fee3513f1a219a4419d839751d3354) Merge branch 'main' of github.com:immich-app/immich into feat/public-sharing ### 📊 Changes **103 files changed** (+4925 additions, -375 deletions) <details> <summary>View changed files</summary> 📝 `mobile/openapi/.openapi-generator/FILES` (+18 -0) 📝 `mobile/openapi/README.md` (+12 -0) 📝 `mobile/openapi/doc/AlbumApi.md` (+48 -0) 📝 `mobile/openapi/doc/AssetApi.md` (+48 -0) ➕ `mobile/openapi/doc/CreateAlbumShareLinkDto.md` (+18 -0) ➕ `mobile/openapi/doc/DownloadFilesDto.md` (+15 -0) ➕ `mobile/openapi/doc/EditSharedLinkDto.md` (+18 -0) ➕ `mobile/openapi/doc/ShareApi.md` (+217 -0) ➕ `mobile/openapi/doc/SharedLinkResponseDto.md` (+24 -0) ➕ `mobile/openapi/doc/SharedLinkType.md` (+14 -0) 📝 `mobile/openapi/lib/api.dart` (+6 -0) 📝 `mobile/openapi/lib/api/album_api.dart` (+47 -0) 📝 `mobile/openapi/lib/api/asset_api.dart` (+47 -0) ➕ `mobile/openapi/lib/api/share_api.dart` (+251 -0) 📝 `mobile/openapi/lib/api_client.dart` (+10 -0) 📝 `mobile/openapi/lib/api_helper.dart` (+3 -0) ➕ `mobile/openapi/lib/model/create_album_share_link_dto.dart` (+162 -0) ➕ `mobile/openapi/lib/model/download_files_dto.dart` (+113 -0) ➕ `mobile/openapi/lib/model/edit_shared_link_dto.dart` (+171 -0) ➕ `mobile/openapi/lib/model/shared_link_response_dto.dart` (+207 -0) _...and 80 more files_ </details> ### 📄 Description ## Overview This PR add the public sharing functionality for album, resolve #265. Public sharing for individual files will be added in the subsequent PR to reduce the number of files that needs to be reviewed. ![image](https://user-images.githubusercontent.com/27055614/211132888-dc619426-2ce4-4e9f-bc48-6ab07839182e.png) Some highlight mechanisms - User can create multiple shared links from an album with different expiration time - Shared link can be set to allow upload from the public user - Shared link can have an optional description ![image](https://user-images.githubusercontent.com/27055614/211132872-c4530608-5ec1-424b-b652-29d2dd41adb8.png) - User can manage/revoke shared links ![image](https://user-images.githubusercontent.com/27055614/211132881-8fc3d930-a1dc-4f5e-8b1e-1d20352f6baa.png) ## Security mechanism * The shared link id is a combination of 35 bytes (70 characters long) `ccca2fe1ffce4e054714f1f84764f73902769830e76cda4b6121bbaa9158d5ebfe6de6` * Each shared link comes with a key of 25 bytes (50 characters long) that is used to perform view/download/upload operation in the shared album. `35dd0bf3dd5593be9568e1d065291fca54d765a7b38d1046d8` * Each endpoint that is allowed public usage will check for the shared link allowable actions such as upload, or add to an album. * Only endpoints with the decorator `@Authenticated({ isShared: true })` will only evaluate the `key` params, otherwise, would reject the requests. ## Database relationship ![image](https://user-images.githubusercontent.com/27055614/211133090-b43013dc-c616-4e4c-949e-c5cd93b0e8d8.png) * This database design allows an album can have multiple shared links and an asset can be in multiple shared links ## TODO - [x] Add edit share link mechanism. - [x] Download individual asset from the public sharing view. - [x] Add copy link button to the shared link management page --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:56:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8972