Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Migrate mobile endpoints to ente.com

Manav Rathic49d61c308cc
diff --git a/mobile/apps/auth/ios/Runner/Runner.entitlements b/mobile/apps/auth/ios/Runner/Runner.entitlements
index 0a7198161c..a683f152d3 100644
--- a/mobile/apps/auth/ios/Runner/Runner.entitlements
+++ b/mobile/apps/auth/ios/Runner/Runner.entitlements
@@ -8,6 +8,7 @@
<array>
<string>webcredentials:web.ente.io</string>
<string>webcredentials:auth.ente.io</string>
+ <string>webcredentials:auth.ente.com</string>
</array>
</dict>
</plist>
diff --git a/mobile/apps/auth/lib/core/constants.dart b/mobile/apps/auth/lib/core/constants.dart
index 43fc402033..bed441a657 100644
--- a/mobile/apps/auth/lib/core/constants.dart
+++ b/mobile/apps/auth/lib/core/constants.dart
@@ -46,4 +46,4 @@ class FFDefault {
static const bool disableCFWorker = false;
}
-const kDefaultProductionEndpoint = 'https://api.ente.io';
+const kDefaultProductionEndpoint = 'https://api.ente.com';
diff --git a/mobile/apps/auth/lib/services/billing_service.dart b/mobile/apps/auth/lib/services/billing_service.dart
index c70595f399..e702ccc8f4 100644
--- a/mobile/apps/auth/lib/services/billing_service.dart
+++ b/mobile/apps/auth/lib/services/billing_service.dart
@@ -8,10 +8,10 @@ import 'package:ente_auth/models/billing_plan.dart';
import 'package:ente_network/network.dart';
import 'package:logging/logging.dart';
-const kWebPaymentRedirectUrl = "https://payments.ente.io/frameRedirect";
+const kWebPaymentRedirectUrl = "https://payments.ente.com/frameRedirect";
const kWebPaymentBaseEndpoint = String.fromEnvironment(
"web-payment",
- defaultValue: "https://payments.ente.io",
+ defaultValue: "https://payments.ente.com",
);
const kFamilyPlanManagementUrl = String.fromEnvironment(
diff --git a/mobile/apps/auth/lib/ui/settings/social_section_widget.dart b/mobile/apps/auth/lib/ui/settings/social_section_widget.dart
index b74ac53d94..2c0f636166 100644
--- a/mobile/apps/auth/lib/ui/settings/social_section_widget.dart
+++ b/mobile/apps/auth/lib/ui/settings/social_section_widget.dart
@@ -44,7 +44,7 @@ class SocialSectionWidget extends StatelessWidget {
sectionOptionSpacing,
SocialsMenuItemWidget(
l10n.merchandise,
- "https://shop.ente.io",
+ "https://shop.ente.com",
launchInExternalApp: !Platform.isAndroid,
),
sectionOptionSpacing,
diff --git a/mobile/apps/auth/lib/ui/share/code_share.dart b/mobile/apps/auth/lib/ui/share/code_share.dart
index af2f771308..8168f12662 100644
--- a/mobile/apps/auth/lib/ui/share/code_share.dart
+++ b/mobile/apps/auth/lib/ui/share/code_share.dart
@@ -118,7 +118,7 @@ class _ShareCodeDialogState extends State<ShareCodeDialog> {
Uint8List input = utf8.encode(jsonEncode(data));
final encResult = await CryptoUtil.encryptData(input, key);
String url =
- 'https://auth.ente.io/share?data=${_uint8ListToUrlSafeBase64(encResult.encryptedData!)}&header=${_uint8ListToUrlSafeBase64(encResult.header!)}#${_uint8ListToUrlSafeBase64(key)}';
+ 'https://auth.ente.com/share?data=${_uint8ListToUrlSafeBase64(encResult.encryptedData!)}&header=${_uint8ListToUrlSafeBase64(encResult.header!)}#${_uint8ListToUrlSafeBase64(key)}';
try {
await shareText(url, context: context);
} catch (e) {
diff --git a/mobile/apps/locker/android/app/src/main/res/xml/network_security_config.xml b/mobile/apps/locker/android/app/src/main/res/xml/network_security_config.xml
index ce487867fd..1f79f46048 100644
--- a/mobile/apps/locker/android/app/src/main/res/xml/network_security_config.xml
+++ b/mobile/apps/locker/android/app/src/main/res/xml/network_security_config.xml
@@ -6,6 +6,7 @@
</base-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">ente.io</domain>
+ <domain includeSubdomains="true">ente.com</domain>
<trust-anchors>
<certificates src="system" />
</trust-anchors>
diff --git a/mobile/apps/locker/lib/core/constants.dart b/mobile/apps/locker/lib/core/constants.dart
index a90610f715..f997a1852d 100644
--- a/mobile/apps/locker/lib/core/constants.dart
+++ b/mobile/apps/locker/lib/core/constants.dart
@@ -8,7 +8,7 @@ const int android11SDKINT = 30;
// https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic
const mnemonicKeyWordCount = 24;
-const kDefaultProductionEndpoint = 'https://api.ente.io';
+const kDefaultProductionEndpoint = 'https://api.ente.com';
const String githubDiscussionsUrl =
"https://github.com/ente-io/ente/discussions";
diff --git a/mobile/apps/locker/lib/services/files/download/file_url.dart b/mobile/apps/locker/lib/services/files/download/file_url.dart
index ec93dd4867..6d2647e641 100644
--- a/mobile/apps/locker/lib/services/files/download/file_url.dart
+++ b/mobile/apps/locker/lib/services/files/download/file_url.dart
@@ -20,22 +20,22 @@ class FileUrl {
case FileUrlType.download:
return disableWorker
? "$endpoint/files/download/$fileID"
- : "https://files.ente.io/?fileID=$fileID";
+ : "https://files.ente.com/?fileID=$fileID";
case FileUrlType.publicDownload:
return disableWorker
? "$endpoint/public-collection/files/download/$fileID"
- : "https://public-albums.ente.io/download/?fileID=$fileID";
+ : "https://public-albums.ente.com/download/?fileID=$fileID";
case FileUrlType.thumbnail:
return disableWorker
? "$endpoint/files/preview/$fileID"
- : "https://thumbnails.ente.io/?fileID=$fileID";
+ : "https://thumbnails.ente.com/?fileID=$fileID";
case FileUrlType.publicThumbnail:
return disableWorker
? "$endpoint/public-collection/files/preview/$fileID"
- : "https://public-albums.ente.io/preview/?fileID=$fileID";
+ : "https://public-albums.ente.com/preview/?fileID=$fileID";
}
}
}
diff --git a/mobile/apps/photos/android/app/src/main/res/values/strings.xml b/mobile/apps/photos/android/app/src/main/res/values/strings.xml
index a3d34cbecd..3f60660443 100644
--- a/mobile/apps/photos/android/app/src/main/res/values/strings.xml
+++ b/mobile/apps/photos/android/app/src/main/res/values/strings.xml
@@ -4,6 +4,9 @@
<string name="asset_statements" translatable="false">
[{
\"include\": \"https://web.ente.io/.well-known/assetlinks.json\"
+ },
+ {
+ \"include\": \"https://photos.ente.com/.well-known/assetlinks.json\"
}]
</string>
diff --git a/mobile/apps/photos/android/app/src/main/res/xml/network_security_config.xml b/mobile/apps/photos/android/app/src/main/res/xml/network_security_config.xml
index a7a11ec732..78c33c4bbb 100644
--- a/mobile/apps/photos/android/app/src/main/res/xml/network_security_config.xml
+++ b/mobile/apps/photos/android/app/src/main/res/xml/network_security_config.xml
@@ -7,6 +7,7 @@
</base-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">ente.io</domain>
+ <domain includeSubdomains="true">ente.com</domain>
<trust-anchors>
<certificates src="system" />
</trust-anchors>
diff --git a/mobile/apps/photos/integration_test/ml_parity_shared.dart b/mobile/apps/photos/integration_test/ml_parity_shared.dart
index e1bbb9cd58..f6f6833e77 100644
--- a/mobile/apps/photos/integration_test/ml_parity_shared.dart
+++ b/mobile/apps/photos/integration_test/ml_parity_shared.dart
@@ -28,7 +28,7 @@ const _internalUserRoute =
const _localModelMirrorRelativeDir = ".cache/local_model_mirror";
const _parityReportDataKey = "ml_parity_results_json";
-const _modelBaseUrl = "https://models.ente.io/";
+const _modelBaseUrl = "https://models.ente.com/";
const _modelFiles = <String>[
"yolov5s_face_640_640_dynamic.onnx",
"mobilefacenet_opset15.onnx",
diff --git a/mobile/apps/photos/ios/Runner/Runner.entitlements b/mobile/apps/photos/ios/Runner/Runner.entitlements
index 45e73ef077..f97a9f2a2b 100644
--- a/mobile/apps/photos/ios/Runner/Runner.entitlements
+++ b/mobile/apps/photos/ios/Runner/Runner.entitlements
@@ -7,7 +7,9 @@
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:web.ente.io</string>
+ <string>webcredentials:photos.ente.com</string>
<string>webcredentials:auth.ente.io</string>
+ <string>webcredentials:auth.ente.com</string>
<string>applinks:albums.ente.io</string>
<string>applinks:albums.ente.com</string>
</array>
diff --git a/mobile/apps/photos/lib/core/configuration.dart b/mobile/apps/photos/lib/core/configuration.dart
index afce88d7a7..f07d322f3e 100644
--- a/mobile/apps/photos/lib/core/configuration.dart
+++ b/mobile/apps/photos/lib/core/configuration.dart
@@ -523,7 +523,11 @@ class Configuration {
}
String getHttpEndpoint() {
- return _preferences.getString(endPointKey) ?? endpoint;
+ final savedEndpoint = _preferences.getString(endPointKey) ?? endpoint;
+ if (savedEndpoint == kLegacyProductionEndpoint) {
+ return kDefaultProductionEndpoint;
+ }
+ return savedEndpoint;
}
// isEnteProduction checks if the current endpoint is the default production
diff --git a/mobile/apps/photos/lib/core/constants.dart b/mobile/apps/photos/lib/core/constants.dart
index b33679c128..a3332ce521 100644
--- a/mobile/apps/photos/lib/core/constants.dart
+++ b/mobile/apps/photos/lib/core/constants.dart
@@ -42,10 +42,10 @@ const supportEmail = '[email protected]';
// this is the chunk size of the un-encrypted file which is read and encrypted before uploading it as a single part.
const multipartPartSize = 20 * 1024 * 1024;
-const kDefaultProductionEndpoint = 'https://api.ente.io';
-const kUploadProxyEndpoint = 'https://uploader.ente.io';
+const kDefaultProductionEndpoint = 'https://api.ente.com';
+const kLegacyProductionEndpoint = 'https://api.ente.io';
+const kUploadProxyEndpoint = 'https://uploader.ente.com';
const kAccountsUrl = 'https://accounts.ente.io';
-const kCasUrl = 'https://cas.ente.io';
const kFamilyUrl = 'https://family.ente.io';
const int intMaxValue = 9223372036854775807;
diff --git a/mobile/apps/photos/lib/module/download/file_url.dart b/mobile/apps/photos/lib/module/download/file_url.dart
index e5faced127..3a7a898d19 100644
--- a/mobile/apps/photos/lib/module/download/file_url.dart
+++ b/mobile/apps/photos/lib/module/download/file_url.dart
@@ -22,22 +22,22 @@ class FileUrl {
case FileUrlType.download:
return disableWorker
? "$endpoint/files/download/$fileID"
- : "https://files.ente.io/?fileID=$fileID";
+ : "https://files.ente.com/?fileID=$fileID";
case FileUrlType.publicDownload:
return disableWorker
? "$endpoint/public-collection/files/download/$fileID"
- : "https://public-albums.ente.io/download/?fileID=$fileID";
+ : "https://public-albums.ente.com/download/?fileID=$fileID";
case FileUrlType.thumbnail:
return disableWorker
? "$endpoint/files/preview/$fileID"
- : "https://thumbnails.ente.io/?fileID=$fileID";
+ : "https://thumbnails.ente.com/?fileID=$fileID";
case FileUrlType.publicThumbnail:
return disableWorker
? "$endpoint/public-collection/files/preview/$fileID"
- : "https://public-albums.ente.io/preview/?fileID=$fileID";
+ : "https://public-albums.ente.com/preview/?fileID=$fileID";
}
}
}
diff --git a/mobile/apps/photos/lib/services/account/billing_service.dart b/mobile/apps/photos/lib/services/account/billing_service.dart
index 8441fce3bc..f56fd9a76f 100644
--- a/mobile/apps/photos/lib/services/account/billing_service.dart
+++ b/mobile/apps/photos/lib/services/account/billing_service.dart
@@ -16,12 +16,12 @@ import 'package:photos/utils/dialog_util.dart';
const kWebPaymentRedirectUrl = String.fromEnvironment(
"web-payment-redirect",
- defaultValue: "https://payments.ente.io/frameRedirect",
+ defaultValue: "https://payments.ente.com/frameRedirect",
);
const kWebPaymentBaseEndpoint = String.fromEnvironment(
"web-payment",
- defaultValue: "https://payments.ente.io",
+ defaultValue: "https://payments.ente.com",
);
class BillingService {
diff --git a/mobile/apps/photos/lib/services/location_service.dart b/mobile/apps/photos/lib/services/location_service.dart
index 3478156020..943a5153fd 100644
--- a/mobile/apps/photos/lib/services/location_service.dart
+++ b/mobile/apps/photos/lib/services/location_service.dart
@@ -31,7 +31,7 @@ class LocationService {
bool reloadLocationDiscoverySection = false;
static const _kCitiesKdTreeRemotePath =
- "https://assets.ente.io/world_cities.kdtree.bin";
+ "https://assets.ente.com/world_cities.kdtree.bin";
List<City> _cities = [];
List<List<int>> _kdTreeNodes = [];
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_model.dart b/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
index 118cc173c7..4a354d051b 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
@@ -13,7 +13,7 @@ abstract class MlModel {
static final Logger isolateLogger = Logger("MlModel");
Logger get logger;
- String get kModelBucketEndpoint => "https://models.ente.io/";
+ String get kModelBucketEndpoint => "https://models.ente.com/";
String get modelRemotePath;
diff --git a/mobile/apps/photos/lib/services/remote_assets_service.dart b/mobile/apps/photos/lib/services/remote_assets_service.dart
index 7a6f6546a6..08ce1402b0 100644
--- a/mobile/apps/photos/lib/services/remote_assets_service.dart
+++ b/mobile/apps/photos/lib/services/remote_assets_service.dart
@@ -567,7 +567,7 @@ class RemoteAssetsService {
bool _shouldLogProbeDiagnosticsFor(String url) {
final host = Uri.tryParse(url)?.host;
- return host == "models.ente.io";
+ return host == "models.ente.com";
}
}
diff --git a/mobile/apps/photos/lib/ui/payment/billing_questions_widget.dart b/mobile/apps/photos/lib/ui/payment/billing_questions_widget.dart
index 8c4dd63c98..04733ea6f3 100644
--- a/mobile/apps/photos/lib/ui/payment/billing_questions_widget.dart
+++ b/mobile/apps/photos/lib/ui/payment/billing_questions_widget.dart
@@ -16,7 +16,7 @@ class BillingQuestionsWidget extends StatelessWidget {
return FutureBuilder(
future: NetworkClient.instance
.getDio()
- .get("https://static.ente.io/faq.json")
+ .get("https://static.ente.com/faq.json")
.then((response) {
final faqItems = <FaqItem>[];
for (final item in response.data as List) {
diff --git a/mobile/apps/photos/lib/ui/settings/social_section_widget.dart b/mobile/apps/photos/lib/ui/settings/social_section_widget.dart
index a032e32185..ecfa6a407e 100644
--- a/mobile/apps/photos/lib/ui/settings/social_section_widget.dart
+++ b/mobile/apps/photos/lib/ui/settings/social_section_widget.dart
@@ -47,7 +47,7 @@ class SocialSectionWidget extends StatelessWidget {
sectionOptionSpacing,
SocialsMenuItemWidget(
AppLocalizations.of(context).merchandise,
- "https://shop.ente.io",
+ "https://shop.ente.com",
launchInExternalApp: !Platform.isAndroid,
),
sectionOptionSpacing,
diff --git a/mobile/apps/photos/lib/ui/settings_page.dart b/mobile/apps/photos/lib/ui/settings_page.dart
index 03eaa09253..83d531ddf5 100644
--- a/mobile/apps/photos/lib/ui/settings_page.dart
+++ b/mobile/apps/photos/lib/ui/settings_page.dart
@@ -651,7 +651,7 @@ class _SettingsBody extends StatelessWidget {
trailingIconIsMuted: true,
onTap: () async {
await launchUrlString(
- "https://shop.ente.io",
+ "https://shop.ente.com",
mode: LaunchMode.externalApplication,
);
},
diff --git a/mobile/apps/photos/scripts/app_init_perf_test.sh b/mobile/apps/photos/scripts/app_init_perf_test.sh
index d9c8469177..6058135ba4 100755
--- a/mobile/apps/photos/scripts/app_init_perf_test.sh
+++ b/mobile/apps/photos/scripts/app_init_perf_test.sh
@@ -10,7 +10,7 @@
# app will start from home page. --keep-app-running is for starting the
# app from home page instead of logging in on every run.
-export ENDPOINT="https://api.ente.io"
+export ENDPOINT="https://api.ente.com"
flutter drive \
--driver=test_driver/perf_driver.dart \
diff --git a/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh b/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh
index bc0b1a400c..850f5b3917 100755
--- a/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh
+++ b/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh
@@ -6,7 +6,7 @@
# Specify the report_key of the test in perf_driver.dart. `report_key`` of
# `traceAction`` in app_init_test.dart.
-export ENDPOINT="https://api.ente.io"
+export ENDPOINT="https://api.ente.com"
flutter drive \
--driver=test_driver/perf_driver.dart \
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/AppViewModel.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/AppViewModel.kt
index 5befdfafb1..eacbb473bc 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/AppViewModel.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/AppViewModel.kt
@@ -83,7 +83,7 @@ class AppViewModel(application: Application) : AndroidViewModel(application) {
val endpoint = endpointPreferences.endpointFlow.first()
val buildEndpoint = BuildConfig.API_ENDPOINT.trim()
if (endpoint.isNullOrBlank()) {
- val fallback = "https://api.ente.io"
+ val fallback = "https://api.ente.com"
val resolved = if (buildEndpoint.isNotBlank()) buildEndpoint else fallback
endpointPreferences.setEndpoint(resolved)
} else if (buildEndpoint.isNotBlank() && buildEndpoint != endpoint) {
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/DeveloperSettingsScreen.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/DeveloperSettingsScreen.kt
index 678e2bb6f2..ab7ea53b77 100644
--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/DeveloperSettingsScreen.kt
+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/settings/DeveloperSettingsScreen.kt
@@ -43,7 +43,7 @@ fun DeveloperSettingsScreen(
onOpenModelSettings: () -> Unit,
onSaved: () -> Unit
) {
- val currentEndpoint by currentEndpointFlow.collectAsState(initial = "https://api.ente.io")
+ val currentEndpoint by currentEndpointFlow.collectAsState(initial = "https://api.ente.com")
var endpointInput by remember { mutableStateOf("") }
var isSaving by remember { mutableStateOf(false) }
var errorMessage by remember { mutableStateOf<String?>(null) }
diff --git a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/EndpointPreferencesDataStore.kt b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/EndpointPreferencesDataStore.kt
index fa905953d0..8a139324c6 100644
--- a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/EndpointPreferencesDataStore.kt
+++ b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/EndpointPreferencesDataStore.kt
@@ -11,9 +11,10 @@ private val Context.endpointPreferences by preferencesDataStore("ensu_developer_
class EndpointPreferencesDataStore(private val context: Context) {
private val endpointKey = stringPreferencesKey("custom_endpoint")
+ private val legacyProductionEndpoint = "https://api.ente.io"
val endpointFlow: Flow<String?> = context.endpointPreferences.data.map { prefs ->
- prefs[endpointKey]
+ prefs[endpointKey]?.takeUnless { it == legacyProductionEndpoint }
}
suspend fun setEndpoint(endpoint: String?) {
diff --git a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/network/NetworkConfiguration.kt b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/network/NetworkConfiguration.kt
index a0f4c8d98c..831fda0294 100644
--- a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/network/NetworkConfiguration.kt
+++ b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/network/NetworkConfiguration.kt
@@ -24,10 +24,10 @@ data class NetworkConfiguration(
}
val default: NetworkConfiguration = NetworkConfiguration(
- apiEndpoint = "https://api.ente.io".toHttpUrl(),
+ apiEndpoint = "https://api.ente.com".toHttpUrl(),
accountsEndpoint = "https://accounts.ente.io".toHttpUrl(),
- castEndpoint = "https://api.ente.io".toHttpUrl(),
- publicAlbumsEndpoint = "https://albums.ente.io".toHttpUrl(),
+ castEndpoint = "https://api.ente.com".toHttpUrl(),
+ publicAlbumsEndpoint = "https://albums.ente.com".toHttpUrl(),
familyEndpoint = "https://family.ente.io".toHttpUrl()
)
}
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift b/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
index f62dbdcf05..0684b5c302 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
+++ b/mobile/native/darwin/Apps/Ensu/Ensu/Chat/ChatViewModel.swift
@@ -104,7 +104,7 @@ struct NetworkConfiguration {
let apiEndpoint: URL
static var `default`: NetworkConfiguration {
- NetworkConfiguration(apiEndpoint: URL(string: "https://api.ente.io")!)
+ NetworkConfiguration(apiEndpoint: URL(string: "https://api.ente.com")!)
}
}
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu/Services/EnsuDeveloperSettings.swift b/mobile/native/darwin/Apps/Ensu/Ensu/Services/EnsuDeveloperSettings.swift
index 5c2d2d8019..9af26aa29e 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu/Services/EnsuDeveloperSettings.swift
+++ b/mobile/native/darwin/Apps/Ensu/Ensu/Services/EnsuDeveloperSettings.swift
@@ -6,7 +6,7 @@ struct NetworkConfiguration {
let apiEndpoint: URL
static var `default`: NetworkConfiguration {
- NetworkConfiguration(apiEndpoint: URL(string: "https://api.ente.io")!)
+ NetworkConfiguration(apiEndpoint: URL(string: "https://api.ente.com")!)
}
static func selfHosted(baseURL: URL) -> NetworkConfiguration {
@@ -17,6 +17,7 @@ struct NetworkConfiguration {
enum EnsuDeveloperSettings {
private static let endpointKey = "ensu.customEndpoint"
+ private static let legacyProductionEndpoint = "https://api.ente.io"
static var currentEndpoint: URL? {
if let envEndpoint = endpointURL(from: ProcessInfo.processInfo.environment["ENTE_API_ENDPOINT"]) {
@@ -45,7 +46,11 @@ enum EnsuDeveloperSettings {
static func setEndpoint(_ url: URL?) {
if let url {
let normalized = normalize(url.absoluteString)
- UserDefaults.standard.set(normalized, forKey: endpointKey)
+ if normalized == legacyProductionEndpoint {
+ UserDefaults.standard.removeObject(forKey: endpointKey)
+ } else {
+ UserDefaults.standard.set(normalized, forKey: endpointKey)
+ }
} else {
UserDefaults.standard.removeObject(forKey: endpointKey)
}
@@ -54,6 +59,9 @@ enum EnsuDeveloperSettings {
private static func endpointURL(from value: String?) -> URL? {
guard let value, !value.isEmpty else { return nil }
let normalized = normalize(value)
+ if normalized == legacyProductionEndpoint {
+ return nil
+ }
return URL(string: normalized)
}
diff --git a/mobile/native/darwin/Apps/Ensu/Ensu/Settings/SettingsView.swift b/mobile/native/darwin/Apps/Ensu/Ensu/Settings/SettingsView.swift
index 3a3474261d..6866e539ca 100644
--- a/mobile/native/darwin/Apps/Ensu/Ensu/Settings/SettingsView.swift
+++ b/mobile/native/darwin/Apps/Ensu/Ensu/Settings/SettingsView.swift
@@ -257,7 +257,7 @@ struct SettingsView: View {
private var endpointInfoText: String? {
guard trimmedQuery.isEmpty else { return nil }
- let defaultEndpoint = "https://api.ente.io"
+ let defaultEndpoint = "https://api.ente.com"
let endpoint = EnsuDeveloperSettings.currentEndpointString
.trimmingCharacters(in: .whitespacesAndNewlines)
.trimmingCharacters(in: CharacterSet(charactersIn: "/"))
diff --git a/mobile/native/darwin/Apps/tv/cast/Services/CastPairingService.swift b/mobile/native/darwin/Apps/tv/cast/Services/CastPairingService.swift
index 381d2de43b..841154fe1d 100644
--- a/mobile/native/darwin/Apps/tv/cast/Services/CastPairingService.swift
+++ b/mobile/native/darwin/Apps/tv/cast/Services/CastPairingService.swift
@@ -46,7 +46,7 @@ class CastSession: ObservableObject {
// MARK: - Real Cast Pairing Service
class RealCastPairingService {
- private let baseURL = "https://api.ente.io"
+ private let baseURL = "https://api.ente.com"
private var pollingTimer: Timer?
private var lastLoggedMessages: [String: Date] = [:]
private let logThrottleInterval: TimeInterval = 5.0 // 5 seconds
diff --git a/mobile/native/darwin/Apps/tv/cast/ViewModels/SlideshowService.swift b/mobile/native/darwin/Apps/tv/cast/ViewModels/SlideshowService.swift
index 5021de2e98..dab9a00540 100644
--- a/mobile/native/darwin/Apps/tv/cast/ViewModels/SlideshowService.swift
+++ b/mobile/native/darwin/Apps/tv/cast/ViewModels/SlideshowService.swift
@@ -71,8 +71,8 @@ class RealSlideshowService: ObservableObject {
// Simplified mode: only load first file (no slideshow navigation)
private var didDisplayFirstFile: Bool = false
- private let baseURL = "https://api.ente.io"
- private let castDownloadURL = "https://cast-albums.ente.io/download"
+ private let baseURL = "https://api.ente.com"
+ private let castDownloadURL = "https://cast-albums.ente.com/download"
// Configuration Flags
private let verboseFileLogging = false // Reduces per-file spam unless true
@@ -1011,7 +1011,7 @@ class RealSlideshowService: ObservableObject {
private func downloadImage(castPayload: CastPayload, fileID: Int) async throws -> Data {
// Use preview endpoint for thumbnails suitable for TV display
- let url = URL(string: "https://cast-albums.ente.io/preview/?fileID=\(fileID)")!
+ let url = URL(string: "https://cast-albums.ente.com/preview/?fileID=\(fileID)")!
var request = URLRequest(url: url)
request.setValue(castPayload.castToken, forHTTPHeaderField: "X-Cast-Access-Token")
@@ -1409,4 +1409,3 @@ func extractLivePhotoComponents(from zipData: Data) throws -> LivePhotoComponent
throw CastError.decryptionError("Failed to extract live photo zip: \(error)")
}
}
-
diff --git a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift
index 4335ab88b8..a9aded742e 100644
--- a/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift
+++ b/mobile/native/darwin/Packages/EnteNetwork/Sources/EnteNetwork/Configuration/NetworkConfiguration.swift
@@ -37,10 +37,10 @@ public struct NetworkConfiguration {
// Default Ente configuration
public static let `default` = NetworkConfiguration(
- apiEndpoint: URL(string: "https://api.ente.io")!,
+ apiEndpoint: URL(string: "https://api.ente.com")!,
accountsEndpoint: URL(string: "https://accounts.ente.io"),
- castEndpoint: URL(string: "https://api.ente.io"), // Fix: Use same endpoint as web app
- publicAlbumsEndpoint: URL(string: "https://albums.ente.io"),
+ castEndpoint: URL(string: "https://api.ente.com"), // Fix: Use same endpoint as web app
+ publicAlbumsEndpoint: URL(string: "https://albums.ente.com"),
familyEndpoint: URL(string: "https://family.ente.io")
)
}
@@ -111,4 +111,4 @@ public class EndpointResolver {
return configuration.familyEndpoint ?? configuration.apiEndpoint
}
}
-}
\ No newline at end of file
+}
diff --git a/mobile/packages/configuration/lib/base_configuration.dart b/mobile/packages/configuration/lib/base_configuration.dart
index ef9e4132c8..2515d9d6f4 100644
--- a/mobile/packages/configuration/lib/base_configuration.dart
+++ b/mobile/packages/configuration/lib/base_configuration.dart
@@ -275,7 +275,11 @@ class BaseConfiguration {
}
String getHttpEndpoint() {
- return _preferences.getString(endPointKey) ?? endpoint;
+ final savedEndpoint = _preferences.getString(endPointKey) ?? endpoint;
+ if (savedEndpoint == kLegacyProductionEndpoint) {
+ return kDefaultProductionEndpoint;
+ }
+ return savedEndpoint;
}
// isEnteProduction checks if the current endpoint is the default production
diff --git a/mobile/packages/configuration/lib/constants.dart b/mobile/packages/configuration/lib/constants.dart
index 7b28375d9f..f0333e9bef 100644
--- a/mobile/packages/configuration/lib/constants.dart
+++ b/mobile/packages/configuration/lib/constants.dart
@@ -1,4 +1,5 @@
-const kDefaultProductionEndpoint = 'https://api.ente.io';
+const kDefaultProductionEndpoint = 'https://api.ente.com';
+const kLegacyProductionEndpoint = 'https://api.ente.io';
// 256 bit key maps to 24 words
// https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic