Skip to content

armgit / ente

Public Imported from GitHub
0

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

Doesn't work outside of the next process

Manav Rathi2f372cdbe1d3
diff --git a/web/package.json b/web/package.json
index 474005f358..7398ae9ad7 100644
--- a/web/package.json
+++ b/web/package.json
@@ -8,12 +8,11 @@
],
"scripts": {
"build": "yarn build:photos",
- "build-prep": "packages/build-config/build-prep.sh",
- "build:accounts": "yarn build-prep && yarn workspace accounts next build",
- "build:auth": "yarn build-prep && yarn workspace auth next build",
- "build:cast": "yarn build-prep && yarn workspace cast next build",
- "build:payments": "yarn build-prep && yarn workspace payments build",
- "build:photos": "yarn build-prep && yarn workspace photos next build",
+ "build:accounts": "yarn workspace accounts next build",
+ "build:auth": "yarn workspace auth next build",
+ "build:cast": "yarn workspace cast next build",
+ "build:payments": "yarn workspace payments build",
+ "build:photos": "yarn workspace photos next build",
"dev": "yarn dev:photos",
"dev:accounts": "yarn workspace accounts next dev -p 3001",
"dev:albums": "yarn workspace photos next dev -p 3002",
diff --git a/web/packages/base/next.config.base.js b/web/packages/base/next.config.base.js
index a7637a32a8..909c9d8217 100644
--- a/web/packages/base/next.config.base.js
+++ b/web/packages/base/next.config.base.js
@@ -76,6 +76,26 @@ const desktopAppVersion = isDesktop
.version
: undefined;
+// Fail the build if the user is setting any of the legacy environment variables
+// which have now been replaced with museum configuration. This is meant to help
+// self hosters find the new setting instead of being caught unawares.
+
+if (process.env.NEXT_PUBLIC_ENTE_ACCOUNTS_URL) {
+ console.log(
+ "The NEXT_PUBLIC_ENTE_ACCOUNTS_URL environment variable is not supported.",
+ );
+ console.log("Use apps.accounts in the museum configuration instead.");
+ process.exit(1);
+}
+
+if (process.env.NEXT_PUBLIC_ENTE_FAMILY_URL) {
+ console.log(
+ "The NEXT_PUBLIC_ENTE_FAMILY_URL environment variable is not supported.",
+ );
+ console.log("Use apps.family in the museum configuration instead.");
+ process.exit(1);
+}
+
/**
* Configuration for the Next.js build
*
diff --git a/web/packages/build-config/build-prep.sh b/web/packages/build-config/build-prep.sh
deleted file mode 100755
index 03a3021ab7..0000000000
--- a/web/packages/build-config/build-prep.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# Fail the build if the user is setting any of the legacy environment variables
-# which have now been replaced with museum configuration. This is meant to help
-# self hosters find the new setting instead of being caught unawares.
-
-if test -n "$NEXT_PUBLIC_ENTE_ACCOUNTS_URL"
-then
- echo "The NEXT_PUBLIC_ENTE_ACCOUNTS_URL environment variable is not supported."
- echo "Use apps.accounts in the museum configuration instead."
- exit 1
-fi
-
-if test -n "$NEXT_PUBLIC_ENTE_FAMILY_URL"
-then
- echo "The NEXT_PUBLIC_ENTE_FAMILY_URL environment variable is not supported."
- echo "Use apps.family in the museum configuration instead."
- exit 1
-fi