π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Unconditionally use environment overrides
Manav Rathi36e76626cd58
diff --git a/apps/photos/.env.development b/apps/photos/.env.developmentindex f037e3a167..1062636483 100644--- a/apps/photos/.env.development+++ b/apps/photos/.env.development@@ -25,9 +25,9 @@# 2. Sentry crash reports go to a separate project.## Note that even in development build, the app still connects to the production-# APIs by default. This is usually a good default, for example someone might-# want to run the client locally but still use their actual ente account. This-# can be customized by using some of the environment variables below.+# APIs by default (can be customized using the env vars below). This is usually+# a good default, for example a customer cloning this repository want to build+# and run the client from source but still use their actual Ente account.# The Ente API endpoint#diff --git a/packages/shared/network/api.ts b/packages/shared/network/api.tsindex fbce09b49f..6e72baa240 100644--- a/packages/shared/network/api.ts+++ b/packages/shared/network/api.ts@@ -1,6 +1,6 @@export const getEndpoint = () => {const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;- if (isDevBuild() && endpoint) {+ if (endpoint) {return endpoint;}return 'https://api.ente.io';@@ -8,7 +8,7 @@ export const getEndpoint = () => {export const getFileURL = (id: number) => {const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;- if (isDevBuild() && endpoint) {+ if (endpoint) {return `${endpoint}/files/download/${id}`;}return `https://files.ente.io/?fileID=${id}`;@@ -16,7 +16,7 @@ export const getFileURL = (id: number) => {export const getPublicCollectionFileURL = (id: number) => {const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;- if (isDevBuild() && endpoint) {+ if (endpoint) {return `${endpoint}/public-collection/files/download/${id}`;}return `https://public-albums.ente.io/download/?fileID=${id}`;@@ -24,7 +24,7 @@ export const getPublicCollectionFileURL = (id: number) => {export const getThumbnailURL = (id: number) => {const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;- if (isDevBuild() && endpoint) {+ if (endpoint) {return `${endpoint}/files/preview/${id}`;}return `https://thumbnails.ente.io/?fileID=${id}`;@@ -32,15 +32,15 @@ export const getThumbnailURL = (id: number) => {export const getPublicCollectionThumbnailURL = (id: number) => {const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;- if (isDevBuild() && endpoint) {+ if (endpoint) {return `${endpoint}/public-collection/files/preview/${id}`;}return `https://public-albums.ente.io/preview/?fileID=${id}`;};export const getUploadEndpoint = () => {- const endpoint = process.env.NEXT_PUBLIC_ENTE_UPLOAD_ENDPOINT;- if (isDevBuild() && endpoint) {+ const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;+ if (endpoint) {return endpoint;}return `https://uploader.ente.io`;@@ -48,7 +48,7 @@ export const getUploadEndpoint = () => {export const getPaymentsURL = () => {const paymentsURL = process.env.NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT;- if (isDevBuild() && paymentsURL) {+ if (paymentsURL) {return paymentsURL;}return `https://payments.ente.io`;@@ -56,17 +56,19 @@ export const getPaymentsURL = () => {export const getAlbumsURL = () => {const albumsURL = process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT;- if (isDevBuild() && albumsURL) {+ if (albumsURL) {return albumsURL;}return `https://albums.ente.io`;};-// getFamilyPortalURL returns the endpoint for the family dashboard which can be used to-// create or manage family.+/**+ * Return the URL for the family dashboard which can be used to create or manage+ * family plans.+ */export const getFamilyPortalURL = () => {const familyURL = process.env.NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT;- if (isDevBuild() && familyURL) {+ if (familyURL) {return familyURL;}return `https://family.ente.io`;diff --git a/scripts/deploy.sh b/scripts/deploy.shindex dd4498dbaa..9f39df2332 100755--- a/scripts/deploy.sh+++ b/scripts/deploy.sh@@ -36,9 +36,7 @@ else# development deployment.export NODE_ENV=development# Also, we connect all of them to the dev APIs.- export NEXT_PUBLIC_APP_ENV=developmentexport NEXT_PUBLIC_ENTE_ENDPOINT=https://dev-api.ente.io- export NEXT_PUBLIC_ENTE_WEB_ENDPOINT=https://dev-web.ente.ioexport NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT=https://dev-albums.ente.ioyarn export:photos