π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Move public app origins to ente.com
Manav Rathi6d90abc5fd92
diff --git a/docs/docs/photos/faq/sharing-and-collaboration.md b/docs/docs/photos/faq/sharing-and-collaboration.mdindex 178d793afc..ff5260c8a2 100644--- a/docs/docs/photos/faq/sharing-and-collaboration.md+++ b/docs/docs/photos/faq/sharing-and-collaboration.md@@ -592,11 +592,11 @@ Open the album in Ente (web or mobile app), create a public link, open link sett**Manual method:**-Create a public link for your album, then add an iframe to your HTML with the URL, replacing `albums.ente.io` with `embed.ente.io`:+Create a public link for your album, then add an iframe to your HTML with the URL, replacing `albums.ente.com` with `embed.ente.com`:```html<iframe- src="https://embed.ente.io/?t=...#..."+ src="https://embed.ente.com/?t=...#..."width="800"height="600"frameborder="0"@@ -609,14 +609,14 @@ For complete details, see the [Embed albums guide](/photos/features/sharing-and-### Do embedded albums work with custom domains? {#embed-custom-domains}-Yes, but you need to use `embed.ente.io` instead of your custom domain in the iframe src.+Yes, but you need to use `embed.ente.com` instead of your custom domain in the iframe src.-If you're using the easy method (copy embed HTML button), the app automatically handles this for you - it will use `embed.ente.io` regardless of your custom domain setting.+If you're using the easy method (copy embed HTML button), the app automatically handles this for you - it will use `embed.ente.com` regardless of your custom domain setting.If you're creating the embed code manually and have a custom domain configured:-- Replace your custom domain with `embed.ente.io` in the iframe src-- For example: `https://embed.ente.io/?t=...` (not `https://pics.example.org/?t=...`)+- Replace your custom domain with `embed.ente.com` in the iframe src+- For example: `https://embed.ente.com/?t=...` (not `https://pics.example.org/?t=...`)The embed will still work perfectly - it's just served from the embed subdomain instead of your custom domain.diff --git a/docs/docs/photos/features/sharing-and-collaboration/embed.md b/docs/docs/photos/features/sharing-and-collaboration/embed.mdindex f7163e3ad1..9ce7e7b99f 100644--- a/docs/docs/photos/features/sharing-and-collaboration/embed.md+++ b/docs/docs/photos/features/sharing-and-collaboration/embed.md@@ -48,15 +48,15 @@ First, you need to create a public link for the album you want to embed:1. Open the album in Ente (web or mobile app)2. Open the album's sharing settings3. Create a public link-4. Copy the link (it will look like `https://albums.ente.io/?t=...#...`)+4. Copy the link (it will look like `https://albums.ente.com/?t=...#...`)#### Step 2 - Add iframe to your website-Add an iframe to your HTML with the public link as the source, replacing `albums.ente.io` with `embed.ente.io`:+Add an iframe to your HTML with the public link as the source, replacing `albums.ente.com` with `embed.ente.com`:```html<iframe- src="https://embed.ente.io/?t=...#..."+ src="https://embed.ente.com/?t=...#..."width="800"height="600"frameborder="0"@@ -67,7 +67,11 @@ Add an iframe to your HTML with the public link as the source, replacing `albums> [!NOTE]>-> If you're using a custom domain for your public links, then replace your custom domain with `embed.ente.io`. The easy method will automatically do this for you.+> If you're using a custom domain for your public links, then replace your custom domain with `embed.ente.com`. The easy method will automatically do this for you.++> [!NOTE]+>+> `https://embed.ente.io` is soft-deprecated. Existing embeds will keep working, but new embed links use `https://embed.ente.com`. You can update an old embed link by changing `embed.ente.io` to `embed.ente.com`.### Embedding in WordPress (Block Editor)@@ -94,7 +98,7 @@ You can customize the appearance by adjusting the iframe attributes:style="position: relative; padding-bottom: 75%; height: 0; overflow: hidden;"><iframe- src="https://embed.ente.io/?t=...#..."+ src="https://embed.ente.com/?t=...#..."style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"frameborder="0"allowfullscreendiff --git a/mobile/apps/photos/android/app/src/main/AndroidManifest.xml b/mobile/apps/photos/android/app/src/main/AndroidManifest.xmlindex 6d351e66fa..41733576f1 100644--- a/mobile/apps/photos/android/app/src/main/AndroidManifest.xml+++ b/mobile/apps/photos/android/app/src/main/AndroidManifest.xml@@ -66,6 +66,9 @@<dataandroid:scheme="https"android:host="albums.ente.io"/>+ <data+ android:scheme="https"+ android:host="albums.ente.com"/></intent-filter><!-- file provider to share files having a file:// URI -->diff --git a/mobile/apps/photos/ios/Runner/Info.plist b/mobile/apps/photos/ios/Runner/Info.plistindex 935667cbe6..c4970ba21d 100644--- a/mobile/apps/photos/ios/Runner/Info.plist+++ b/mobile/apps/photos/ios/Runner/Info.plist@@ -62,7 +62,7 @@</dict><dict><key>CFBundleURLName</key>- <string>albums.ente.io</string>+ <string>public-albums</string><key>CFBundleURLSchemes</key><array><string>https</string>diff --git a/mobile/apps/photos/ios/Runner/Runner.entitlements b/mobile/apps/photos/ios/Runner/Runner.entitlementsindex 9d0b344294..45e73ef077 100644--- a/mobile/apps/photos/ios/Runner/Runner.entitlements+++ b/mobile/apps/photos/ios/Runner/Runner.entitlements@@ -9,6 +9,7 @@<string>webcredentials:web.ente.io</string><string>webcredentials:auth.ente.io</string><string>applinks:albums.ente.io</string>+ <string>applinks:albums.ente.com</string></array><key>com.apple.security.application-groups</key><array>diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dartindex 79126cdd72..bf82510de8 100644--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart@@ -668,8 +668,10 @@ class _HomeWidgetState extends State<HomeWidget> {final appLinks = AppLinks();// Handle public album deep links:- // - iOS: Universal Links (https://albums.ente.io/...)- // - Android: Custom scheme (ente://albums.ente.io/...) from web join feature+ // - iOS: Universal Links (https://albums.ente.io/... or+ // https://albums.ente.com/...)+ // - Android: Custom scheme (ente://albums.ente.io/... or+ // ente://albums.ente.com/...)try {final initialUri = await appLinks.getInitialLink();if (initialUri != null) {@@ -710,7 +712,8 @@ class _HomeWidgetState extends State<HomeWidget> {}bool _isPublicAlbumUrl(String url) {- return url.contains("albums.ente.io");+ final host = Uri.tryParse(url)?.host;+ return host == "albums.ente.io" || host == "albums.ente.com";}@overridediff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dartindex 19e8167d6f..0caf268cac 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart@@ -1041,7 +1041,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {MaterialPageRoute(builder: (context) => WebPage(widget.title ?? "",- "https://albums.ente.io/?t=$authToken#$albumKey",+ "https://albums.ente.com/?t=$authToken#$albumKey",),),);diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.goindex 8f7bad938f..4bb2f3c95b 100644--- a/server/cmd/museum/main.go+++ b/server/cmd/museum/main.go@@ -102,13 +102,14 @@ func main() {panic(err)}- viper.SetDefault("apps.public-albums", "https://albums.ente.io")- viper.SetDefault("apps.embed-albums", "https://embed.ente.io")+ viper.SetDefault("apps.public-albums", "https://albums.ente.com")+ viper.SetDefault("apps.embed-albums", "https://embed.ente.com")viper.SetDefault("apps.custom-domain.cname", "my.ente.io")- viper.SetDefault("apps.public-locker", "https://share.ente.io")+ viper.SetDefault("apps.public-locker", "https://share.ente.com")viper.SetDefault("apps.public-paste", "https://paste.ente.com")+ viper.SetDefault("apps.public-memories", "https://memories.ente.com")viper.SetDefault("apps.accounts", "https://accounts.ente.io")- viper.SetDefault("apps.cast", "https://cast.ente.io")+ viper.SetDefault("apps.cast", "https://cast.ente.com")viper.SetDefault("apps.family", "https://family.ente.io")setupLogger(environment)diff --git a/server/pkg/middleware/collection_link.go b/server/pkg/middleware/collection_link.goindex 277c3e6278..8bbe38bfaf 100644--- a/server/pkg/middleware/collection_link.go+++ b/server/pkg/middleware/collection_link.go@@ -288,10 +288,14 @@ func (m *CollectionLinkMiddleware) validatePassword(c *gin.Context, reqPath strifunc (m *CollectionLinkMiddleware) validateOrigin(c *gin.Context, ownerID int64) error {origin := c.Request.Header.Get("Origin")+ embedAlbumsOrigin := viper.GetString("apps.embed-albums")if origin == "" ||origin == viper.GetString("apps.public-albums") ||- origin == viper.GetString("apps.embed-albums") ||+ origin == embedAlbumsOrigin ||+ // Keep old embedded iframes working after moving the default embed app+ // origin to embed.ente.com. Custom embed origins should not inherit this.+ (embedAlbumsOrigin == "https://embed.ente.com" && origin == "https://embed.ente.io") ||origin == viper.GetString("apps.public-locker") ||strings.HasPrefix(strings.ToLower(origin), "http://localhost:") {return nildiff --git a/web/apps/albums/src/public-album/access/services/join-public-album-redirect.ts b/web/apps/albums/src/public-album/access/services/join-public-album-redirect.tsindex 7f0896caa0..f4689424e6 100644--- a/web/apps/albums/src/public-album/access/services/join-public-album-redirect.ts+++ b/web/apps/albums/src/public-album/access/services/join-public-album-redirect.ts@@ -1,5 +1,5 @@import type { PublicAlbumsCredentials } from "ente-base/http";-import { albumsAppOrigin, photosAppOrigin } from "ente-base/origins";+import { photosAppOrigin } from "ente-base/origins";import type { Collection } from "ente-media/collection";import type { RefObject } from "react";@@ -104,8 +104,9 @@ export const joinPublicAlbumViaRedirect = ({};if (navigator.userAgent.includes("Android")) {- const albumsHost = new URL(albumsAppOrigin()).host;- const deepLinkURL = `ente://${albumsHost}/?action=join&t=${encodeURIComponent(accessToken)}#${currentHash}`;+ // Older Android clients only recognize albums.ente.io in ente://+ // public-album join links. Newer ones also support albums.ente.com.+ const deepLinkURL = `ente://albums.ente.io/?action=join&t=${encodeURIComponent(accessToken)}#${currentHash}`;tryDeepLinkWithFallback(deepLinkURL, fallbackToWeb);} else {diff --git a/web/packages/base/origins.ts b/web/packages/base/origins.tsindex 0177c90eeb..f46677afee 100644--- a/web/packages/base/origins.ts+++ b/web/packages/base/origins.ts@@ -91,12 +91,12 @@ export const isCustomAlbumsAppOrigin =/*** Return the origin that serves public albums.*- * Defaults to our production instance, "https://albums.ente.io", but can be+ * Defaults to our production instance, "https://albums.ente.com", but can be* overridden by setting the `NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT` environment* variable.*/export const albumsAppOrigin = () =>- process.env.NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT ?? "https://albums.ente.io";+ process.env.NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT ?? "https://albums.ente.com";/*** Return true if this build is Ente's official public albums deployment.