Compare commits

...

2 Commits

Author SHA1 Message Date
sriram veeraghanta
9ce27009b2 Merge branch 'preview' of github.com:makeplane/plane into chore/runtime-env 2024-07-29 16:07:06 +05:30
Aaryan Khandelwal
ce1d8e8dd5 chore: runtime env 2024-07-24 16:44:54 +05:30
3 changed files with 21 additions and 6 deletions

12
web/app/env-setup.tsx Normal file
View File

@@ -0,0 +1,12 @@
"use server";
import { unstable_noStore as noStore } from "next/cache";
export default async function getEnvVariables() {
noStore();
return {
plausible: process.env.PLAUSIBLE_DOMAIN,
adminBase: process.env.NEXT_PUBLIC_ADMIN_BASE_URL,
};
}

View File

@@ -8,6 +8,7 @@ import "@/styles/react-day-picker.css";
// helpers
import { API_BASE_URL } from "@/helpers/common.helper";
// local
import getEnvVariables from "./env-setup";
import { AppProvider } from "./provider";
export const metadata: Metadata = {
@@ -27,9 +28,12 @@ export const metadata: Metadata = {
},
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const isSessionRecorderEnabled = parseInt(process.env.NEXT_PUBLIC_ENABLE_SESSION_RECORDER || "0");
const envVars = await getEnvVariables();
console.log("envVars", envVars);
return (
<html lang="en">
<head>

View File

@@ -7,7 +7,7 @@ const nextConfig = {
trailingSlash: true,
reactStrictMode: false,
swcMinify: true,
output: "standalone",
// output: "standalone",
async headers() {
return [
{
@@ -56,7 +56,7 @@ const nextConfig = {
];
},
async rewrites() {
const posthogHost = process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://app.posthog.com"
const posthogHost = process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://app.posthog.com";
const rewrites = [
{
source: "/ingest/static/:path*",
@@ -74,7 +74,7 @@ const nextConfig = {
rewrites.push({
source: "/god-mode",
destination: `${GOD_MODE_BASE_URL}/`,
})
});
rewrites.push({
source: "/god-mode/:path*",
destination: `${GOD_MODE_BASE_URL}/:path*`,
@@ -113,8 +113,7 @@ const sentryConfig = {
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
};
if (parseInt(process.env.SENTRY_MONITORING_ENABLED || "0", 10)) {
module.exports = withSentryConfig(nextConfig, sentryConfig);