Rename Deployment to Build
Perhaps (perhaps) this better conveys the fact that the build itself is a static entity that doesn't and cannot change after deployment.
This commit is contained in:
parent
3ad29a504c
commit
fc695eff75
|
@ -29,7 +29,7 @@
|
||||||
#
|
#
|
||||||
# 2. Sentry crash reporting etc is disabled
|
# 2. Sentry crash reporting etc is disabled
|
||||||
#
|
#
|
||||||
# See `isDevDeployment` for the exact rules for determining what counts as a
|
# See `isDevBuild` for the exact rules for determining what counts as a
|
||||||
# development build.
|
# development build.
|
||||||
|
|
||||||
# The ente API endpoint
|
# The ente API endpoint
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {
|
import {
|
||||||
getEndpoint,
|
getEndpoint,
|
||||||
getFamilyPortalURL,
|
getFamilyPortalURL,
|
||||||
isDevDeployment,
|
isDevBuild,
|
||||||
} from '@ente/shared/network/api';
|
} from '@ente/shared/network/api';
|
||||||
import { getData, LS_KEYS } from '@ente/shared/storage/localStorage';
|
import { getData, LS_KEYS } from '@ente/shared/storage/localStorage';
|
||||||
import localForage from '@ente/shared/storage/localForage';
|
import localForage from '@ente/shared/storage/localForage';
|
||||||
|
@ -326,7 +326,7 @@ export async function getDisableCFUploadProxyFlag(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const disableCFUploadProxy =
|
const disableCFUploadProxy =
|
||||||
process.env.NEXT_PUBLIC_DISABLE_CF_UPLOAD_PROXY;
|
process.env.NEXT_PUBLIC_DISABLE_CF_UPLOAD_PROXY;
|
||||||
if (isDevDeployment() && typeof disableCFUploadProxy !== 'undefined') {
|
if (isDevBuild() && typeof disableCFUploadProxy !== 'undefined') {
|
||||||
return disableCFUploadProxy === 'true';
|
return disableCFUploadProxy === 'true';
|
||||||
}
|
}
|
||||||
const featureFlags = (
|
const featureFlags = (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export const getEndpoint = () => {
|
export const getEndpoint = () => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return endpoint;
|
return endpoint;
|
||||||
}
|
}
|
||||||
return 'https://api.ente.io';
|
return 'https://api.ente.io';
|
||||||
|
@ -8,7 +8,7 @@ export const getEndpoint = () => {
|
||||||
|
|
||||||
export const getFileURL = (id: number) => {
|
export const getFileURL = (id: number) => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return `${endpoint}/files/download/${id}`;
|
return `${endpoint}/files/download/${id}`;
|
||||||
}
|
}
|
||||||
return `https://files.ente.io/?fileID=${id}`;
|
return `https://files.ente.io/?fileID=${id}`;
|
||||||
|
@ -16,7 +16,7 @@ export const getFileURL = (id: number) => {
|
||||||
|
|
||||||
export const getPublicCollectionFileURL = (id: number) => {
|
export const getPublicCollectionFileURL = (id: number) => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return `${endpoint}/public-collection/files/download/${id}`;
|
return `${endpoint}/public-collection/files/download/${id}`;
|
||||||
}
|
}
|
||||||
return `https://public-albums.ente.io/download/?fileID=${id}`;
|
return `https://public-albums.ente.io/download/?fileID=${id}`;
|
||||||
|
@ -24,7 +24,7 @@ export const getPublicCollectionFileURL = (id: number) => {
|
||||||
|
|
||||||
export const getThumbnailURL = (id: number) => {
|
export const getThumbnailURL = (id: number) => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return `${endpoint}/files/preview/${id}`;
|
return `${endpoint}/files/preview/${id}`;
|
||||||
}
|
}
|
||||||
return `https://thumbnails.ente.io/?fileID=${id}`;
|
return `https://thumbnails.ente.io/?fileID=${id}`;
|
||||||
|
@ -32,7 +32,7 @@ export const getThumbnailURL = (id: number) => {
|
||||||
|
|
||||||
export const getPublicCollectionThumbnailURL = (id: number) => {
|
export const getPublicCollectionThumbnailURL = (id: number) => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return `${endpoint}/public-collection/files/preview/${id}`;
|
return `${endpoint}/public-collection/files/preview/${id}`;
|
||||||
}
|
}
|
||||||
return `https://public-albums.ente.io/preview/?fileID=${id}`;
|
return `https://public-albums.ente.io/preview/?fileID=${id}`;
|
||||||
|
@ -40,7 +40,7 @@ export const getPublicCollectionThumbnailURL = (id: number) => {
|
||||||
|
|
||||||
export const getUploadEndpoint = () => {
|
export const getUploadEndpoint = () => {
|
||||||
const endpoint = process.env.NEXT_PUBLIC_ENTE_UPLOAD_ENDPOINT;
|
const endpoint = process.env.NEXT_PUBLIC_ENTE_UPLOAD_ENDPOINT;
|
||||||
if (isDevDeployment() && endpoint) {
|
if (isDevBuild() && endpoint) {
|
||||||
return endpoint;
|
return endpoint;
|
||||||
}
|
}
|
||||||
return `https://uploader.ente.io`;
|
return `https://uploader.ente.io`;
|
||||||
|
@ -48,7 +48,7 @@ export const getUploadEndpoint = () => {
|
||||||
|
|
||||||
export const getPaymentsURL = () => {
|
export const getPaymentsURL = () => {
|
||||||
const paymentsURL = process.env.NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT;
|
const paymentsURL = process.env.NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT;
|
||||||
if (isDevDeployment() && paymentsURL) {
|
if (isDevBuild() && paymentsURL) {
|
||||||
return paymentsURL;
|
return paymentsURL;
|
||||||
}
|
}
|
||||||
return `https://payments.ente.io`;
|
return `https://payments.ente.io`;
|
||||||
|
@ -56,7 +56,7 @@ export const getPaymentsURL = () => {
|
||||||
|
|
||||||
export const getAlbumsURL = () => {
|
export const getAlbumsURL = () => {
|
||||||
const albumsURL = process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT;
|
const albumsURL = process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT;
|
||||||
if (isDevDeployment() && albumsURL) {
|
if (isDevBuild() && albumsURL) {
|
||||||
return albumsURL;
|
return albumsURL;
|
||||||
}
|
}
|
||||||
return `https://albums.ente.io`;
|
return `https://albums.ente.io`;
|
||||||
|
@ -66,7 +66,7 @@ export const getAlbumsURL = () => {
|
||||||
// create or manage family.
|
// create or manage family.
|
||||||
export const getFamilyPortalURL = () => {
|
export const getFamilyPortalURL = () => {
|
||||||
const familyURL = process.env.NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT;
|
const familyURL = process.env.NEXT_PUBLIC_ENTE_FAMILY_PORTAL_ENDPOINT;
|
||||||
if (isDevDeployment() && familyURL) {
|
if (isDevBuild() && familyURL) {
|
||||||
return familyURL;
|
return familyURL;
|
||||||
}
|
}
|
||||||
return `https://family.ente.io`;
|
return `https://family.ente.io`;
|
||||||
|
@ -83,6 +83,6 @@ export const getFamilyPortalURL = () => {
|
||||||
* automatically assigns development when running the `next dev` command,
|
* automatically assigns development when running the `next dev` command,
|
||||||
* or production for all other commands.
|
* or production for all other commands.
|
||||||
*/
|
*/
|
||||||
export const isDevDeployment = () => {
|
export const isDevBuild = () => {
|
||||||
return process.env.NODE_ENV === 'development';
|
return process.env.NODE_ENV === 'development';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue