-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧑💻 Improve env variables type safety and management
Closes #679
- Loading branch information
1 parent
a23a8c4
commit 437528e
Showing
15 changed files
with
1,435 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration) | ||
ENCRYPTION_SECRET=H+KbL/OFrqbEuDy/1zX8bsPG+spXri3S | ||
|
||
DATABASE_URL=postgresql://postgres:typebot@localhost:5432/typebot | ||
|
||
NEXTAUTH_URL=http://localhost:3000 | ||
NEXT_PUBLIC_VIEWER_URL=http://localhost:3001 | ||
|
||
GITHUB_CLIENT_ID=534b549dd17709a743a2 | ||
GITHUB_CLIENT_SECRET=7adb03507504fb1a54422f6c3c697277cfd000a9 | ||
|
||
S3_ACCESS_KEY=minio | ||
S3_SECRET_KEY=minio123 | ||
S3_BUCKET=typebot | ||
S3_PORT=9000 | ||
S3_ENDPOINT=localhost | ||
S3_SSL=false | ||
|
||
# For more configuration options check out: https://docs.typebot.io/self-hosting/configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration) | ||
ENCRYPTION_SECRET=do+UspMmB/rewbX2K/rskFmtgGSSZ8Ta | ||
|
||
DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot | ||
|
||
NEXTAUTH_URL= | ||
NEXT_PUBLIC_VIEWER_URL= | ||
|
||
ADMIN_EMAIL= | ||
# For more configuration options check out: https://docs.typebot.io/self-hosting/configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { withSentryConfig } from '@sentry/nextjs' | ||
import { join, dirname } from 'path' | ||
import '@typebot.io/env/dist/env.mjs' | ||
import { configureRuntimeEnv } from 'next-runtime-env/build/configure.js' | ||
import { fileURLToPath } from 'url' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
|
||
const __dirname = dirname(__filename) | ||
|
||
configureRuntimeEnv() | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
output: 'standalone', | ||
transpilePackages: [ | ||
'@typebot.io/lib', | ||
'@typebot.io/schemas', | ||
'@typebot.io/emails', | ||
'@typebot.io/env', | ||
], | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en', 'fr', 'pt', 'de'], | ||
}, | ||
experimental: { | ||
outputFileTracingRoot: join(__dirname, '../../'), | ||
}, | ||
headers: async () => { | ||
return [ | ||
{ | ||
source: '/(.*)?', | ||
headers: [ | ||
{ | ||
key: 'X-Frame-Options', | ||
value: 'SAMEORIGIN', | ||
}, | ||
], | ||
}, | ||
] | ||
}, | ||
} | ||
|
||
const sentryWebpackPluginOptions = { | ||
silent: true, | ||
release: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA + '-builder', | ||
} | ||
|
||
export default process.env.NEXT_PUBLIC_SENTRY_DSN | ||
? withSentryConfig( | ||
{ | ||
...nextConfig, | ||
sentry: { | ||
hideSourceMaps: true, | ||
widenClientFileUpload: true, | ||
}, | ||
}, | ||
sentryWebpackPluginOptions | ||
) | ||
: nextConfig |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"label": "Guides", | ||
"position": 3 | ||
} |
Oops, something went wrong.