detect undefined env vars

This commit is contained in:
Chris Grimmett 2024-02-27 09:57:40 -08:00
parent 54991cd386
commit 09ffd5588c
3 changed files with 12 additions and 7 deletions

View File

@ -1,8 +1,10 @@
Monorepo. pnpm required for workspaces. git monorepo.
packages/strapi requires Yarn. pnpm required for workspaces.
Development uses dockerfile with dotenv. Yarn required for packages/strapi
Development uses docker compose with dotenv.
Production uses dokku. Production uses dokku.

View File

@ -1,5 +1,8 @@
// export const strapiUrl = (process.env.NODE_ENV === 'production') ? 'https://portal.futureporn.net' : 'https://chisel.sbtp:1337' if (!process.env.NEXT_PUBLIC_SITE_URL) throw new Error('NEXT_PUBLIC_SITE_URL was missing in env');
// export const siteUrl = (process.env.NODE_ENV === 'production') ? 'https://futureporn.net' : 'http://localhost:3000' if (!process.env.NEXT_PUBLIC_STRAPI_URL) throw new Error('NEXT_PUBLIC_STRAPI_URL was missing in env');
if (!process.env.NEXT_PUBLIC_UPPY_COMPANION_URL) throw new Error('NEXT_PUBLIC_UPPY_COMPANION_URL undefined in env');
export const companionUrl = process.env.NEXT_PUBLIC_UPPY_COMPANION_URL
export const siteUrl = ''+process.env.NEXT_PUBLIC_SITE_URL export const siteUrl = ''+process.env.NEXT_PUBLIC_SITE_URL
export const strapiUrl = ''+process.env.NEXT_PUBLIC_STRAPI_URL export const strapiUrl = ''+process.env.NEXT_PUBLIC_STRAPI_URL
export const patreonSupporterBenefitId: string = '4760169' export const patreonSupporterBenefitId: string = '4760169'
@ -17,4 +20,4 @@ export const authorName = 'CJ_Clippy'
export const authorEmail = 'cj@futureporn.net' export const authorEmail = 'cj@futureporn.net'
export const authorLink = 'https://futureporn.net' export const authorLink = 'https://futureporn.net'
export const giteaUrl = 'https://gitea.futureporn.net' export const giteaUrl = 'https://gitea.futureporn.net'
export const projektMelodyEpoch = new Date('2020-02-07T23:21:48.000Z') export const projektMelodyEpoch = new Date('2020-02-07T23:21:48.000Z')

View File

@ -5,8 +5,8 @@ import Uppy from '@uppy/core';
import AwsS3 from '@uppy/aws-s3'; import AwsS3 from '@uppy/aws-s3';
import RemoteSources from '@uppy/remote-sources'; import RemoteSources from '@uppy/remote-sources';
import { useAuth } from './components/auth'; import { useAuth } from './components/auth';
import { companionUrl } from '@/lib/constants';
const companionUrl = process.env.NEXT_PUBLIC_UPPY_COMPANION_URL!
export const UppyContext = createContext(new Uppy()); export const UppyContext = createContext(new Uppy());