Skip to content

Commit 023501e

Browse files
committed
chore (deployment): updated env vars
1 parent c7ee679 commit 023501e

80 files changed

Lines changed: 170 additions & 168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/.env.selfhost.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
NEXT_PUBLIC_APP_SERVER_URL=http://localhost:5000
77

88
# The mode to run the application in
9-
NEXT_PUBLIC_ENVIRONMENT=SELFHOST
9+
NEXT_PUBLIC_ENVIRONMENT=selfhost
1010

1111
# This should be a long, random, secret string. It must match SELF_HOST_AUTH_SECRET in server/.env.selfhost
1212
SELF_HOST_AUTH_TOKEN=<generate_a_strong_secret_here>

src/client/.env.selfhost.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Environment variables for the client in SELFHOST mode.
1+
# Environment variables for the client in selfhost mode.
22
# This file is loaded at runtime by the client container.
33

44
# Set the environment to self-host mode
5-
NEXT_PUBLIC_ENVIRONMENT=SELFHOST
5+
NEXT_PUBLIC_ENVIRONMENT=selfhost
66

77
# The URL for the backend server, accessible from the user's browser.
88
NEXT_PUBLIC_APP_SERVER_URL=http://localhost:5000
@@ -14,7 +14,7 @@ INTERNAL_APP_SERVER_URL=http://server:80
1414
# This MUST match the `SELF_HOST_AUTH_SECRET` in the server's .env.selfhost file.
1515
SELF_HOST_AUTH_TOKEN=<use_the_same_strong_secret_as_in_the_root_env>
1616

17-
# Auth0 variables are not used in SELFHOST mode, but are kept here
17+
# Auth0 variables are not used in selfhost mode, but are kept here
1818
# to avoid breaking any code that might reference them before a check.
1919
# The build process requires them to be present in some form.
2020
AUTH0_SECRET=""

src/client/.env.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# For env vars related to the Google project and Auth0 setup, comment in the discussion titled 'Request Environment Variables (.env) Here' (https://github.com/existence-master/Sentient/discussions/13) Make sure to keep the values in this file empty while committing to the repository
22

3-
# For self-hosting, set NEXT_PUBLIC_ENVIRONMENT to SELFHOST and provide a secure token.
4-
NEXT_PUBLIC_ENVIRONMENT="AUTH0" # Can be "AUTH0" or "SELFHOST"
5-
SELF_HOST_AUTH_TOKEN="" # Must match SELF_HOST_AUTH_SECRET on the server if using SELFHOST mode
3+
# For self-hosting, set NEXT_PUBLIC_ENVIRONMENT to selfhost and provide a secure token.
4+
NEXT_PUBLIC_ENVIRONMENT="AUTH0" # Can be "AUTH0" or "selfhost"
5+
SELF_HOST_AUTH_TOKEN="" # Must match SELF_HOST_AUTH_SECRET on the server if using selfhost mode
66

77
NEXT_PUBLIC_APP_SERVER_URL=
88
AUTH0_SECRET=

src/client/app/api/auth/token/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { auth0 } from "@lib/auth0"
44
/**
55
* API route to securely get a token for authenticating with backend services.
66
* - In Auth0 mode, it gets the user's access token from their session.
7-
* - In SELFHOST mode, it returns the static self-host token.
7+
* - In selfhost mode, it returns the static self-host token.
88
*/
99
export async function GET() {
10-
if (process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST") {
10+
if (process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost") {
1111
const token = process.env.SELF_HOST_AUTH_TOKEN
1212
if (!token) {
1313
return NextResponse.json(

src/client/app/api/chat/message/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server"
22
import { withAuth } from "@lib/api-utils"
33

44
const appServerUrl =
5-
process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST"
5+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
66
? process.env.INTERNAL_APP_SERVER_URL
77
: process.env.NEXT_PUBLIC_APP_SERVER_URL
88

src/client/app/api/integrations/connected/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NextResponse } from "next/server"
33
import { withAuth } from "@lib/api-utils"
44

55
const appServerUrl =
6-
process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST"
6+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
77
? process.env.INTERNAL_APP_SERVER_URL
88
: process.env.NEXT_PUBLIC_APP_SERVER_URL
99

src/client/app/api/journal/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server"
22
import { withAuth } from "@lib/api-utils"
33

44
const APP_SERVER_URL =
5-
process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST"
5+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
66
? process.env.INTERNAL_APP_SERVER_URL
77
: process.env.NEXT_PUBLIC_APP_SERVER_URL
88

src/client/app/api/notifications/delete/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server"
22
import { withAuth } from "@lib/api-utils"
33

44
const appServerUrl =
5-
process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST"
5+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
66
? process.env.INTERNAL_APP_SERVER_URL
77
: process.env.NEXT_PUBLIC_APP_SERVER_URL
88

src/client/app/api/notifications/route.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import { NextResponse } from "next/server"
33
import { withAuth } from "@lib/api-utils"
44

5-
const appServerUrl = process.env.NEXT_PUBLIC_ENVIRONMENT === 'SELFHOST'
6-
? process.env.INTERNAL_APP_SERVER_URL
7-
: process.env.NEXT_PUBLIC_APP_SERVER_URL;
5+
const appServerUrl =
6+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
7+
? process.env.INTERNAL_APP_SERVER_URL
8+
: process.env.NEXT_PUBLIC_APP_SERVER_URL
89

910
export const GET = withAuth(async function GET(request, { authHeader }) {
1011
try {

src/client/app/api/onboarding/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server"
22
import { withAuth } from "@lib/api-utils"
33

44
const appServerUrl =
5-
process.env.NEXT_PUBLIC_ENVIRONMENT === "SELFHOST"
5+
process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost"
66
? process.env.INTERNAL_APP_SERVER_URL
77
: process.env.NEXT_PUBLIC_APP_SERVER_URL
88

0 commit comments

Comments
 (0)