Skip to content

Commit 21e45c8

Browse files
committed
fixed env vars
1 parent 9b2899e commit 21e45c8

File tree

6 files changed

+47
-44
lines changed

6 files changed

+47
-44
lines changed

apps/backend/.env

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ NEXT_PUBLIC_STACK_DASHBOARD_URL=# the URL of Stack's dashboard. For local develo
44
STACK_SERVER_SECRET=# a random, unguessable secret key generated by `pnpm generate-keys`
55

66
# seed script settings
7-
STACK_SEED_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
8-
STACK_SEED_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
9-
STACK_SEED_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
10-
STACK_SEED_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
11-
STACK_SEED_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
12-
STACK_SEED_USER_EMAIL=# default user added to the dashboard
13-
STACK_SEED_USER_PASSWORD=# default user's password, paired with STACK_SEED_USER_EMAIL
14-
STACK_SEED_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
15-
STACK_SEED_USER_GITHUB_ID=# add github oauth id to the default user
7+
STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
8+
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
9+
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
10+
STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
11+
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
12+
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=# default user added to the dashboard
13+
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=# default user's password, paired with STACK_SEED_INTERNAL_PROJECT_USER_EMAIL
14+
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
15+
STACK_SEED_INTERNAL_PROJECT_USER_GITHUB_ID=# add github oauth id to the default user
1616
STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=# default publishable client key for the internal project
1717
STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=# default secret server key for the internal project
1818
STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=# default super secret admin key for the internal project

apps/backend/.env.development

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ NEXT_PUBLIC_STACK_API_URL=http://localhost:8102
22
NEXT_PUBLIC_STACK_DASHBOARD_URL=http://localhost:8101
33
STACK_SERVER_SECRET=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
44

5-
STACK_SEED_SIGN_UP_ENABLED=true
6-
STACK_SEED_OTP_ENABLED=true
7-
STACK_SEED_ALLOW_LOCALHOST=true
8-
STACK_SEED_OAUTH_PROVIDERS=github,spotify,google,microsoft
9-
STACK_SEED_CLIENT_TEAM_CREATION=true
10-
STACK_SEED_USER_INTERNAL_ACCESS=true
5+
STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED=true
6+
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=true
7+
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=true
8+
STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS=github,spotify,google,microsoft
9+
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=true
10+
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=true
1111
STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only
1212
STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only
1313
STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=this-super-secret-admin-key-is-for-local-development-only

apps/backend/prisma/seed.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ async function seed() {
99
console.log('Seeding database...');
1010

1111
// Optional default admin user
12-
const adminEmail = process.env.STACK_SEED_USER_EMAIL;
13-
const adminPassword = process.env.STACK_SEED_USER_PASSWORD;
14-
const adminInternalAccess = process.env.STACK_SEED_USER_INTERNAL_ACCESS === 'true';
15-
const adminGithubId = process.env.STACK_SEED_USER_GITHUB_ID;
12+
const adminEmail = process.env.STACK_SEED_INTERNAL_PROJECT_USER_EMAIL;
13+
const adminPassword = process.env.STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD;
14+
const adminInternalAccess = process.env.STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS === 'true';
15+
const adminGithubId = process.env.STACK_SEED_INTERNAL_PROJECT_USER_GITHUB_ID;
1616

1717
// dashboard settings
1818
const dashboardDomain = process.env.NEXT_PUBLIC_STACK_DASHBOARD_URL;
19-
const oauthProviderIds = process.env.STACK_SEED_OAUTH_PROVIDERS?.split(',') ?? [];
20-
const otpEnabled = process.env.STACK_SEED_OTP_ENABLED === 'true';
21-
const signUpEnabled = process.env.STACK_SEED_SIGN_UP_ENABLED === 'true';
22-
const allowLocalhost = process.env.STACK_SEED_ALLOW_LOCALHOST === 'true';
23-
const clientTeamCreation = process.env.STACK_SEED_CLIENT_TEAM_CREATION === 'true';
19+
const oauthProviderIds = process.env.STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS?.split(',') ?? [];
20+
const otpEnabled = process.env.STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED === 'true';
21+
const signUpEnabled = process.env.STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED === 'true';
22+
const allowLocalhost = process.env.STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST === 'true';
23+
const clientTeamCreation = process.env.STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION === 'true';
2424

2525
let internalProject = await prisma.project.findUnique({
2626
where: {
@@ -253,7 +253,7 @@ async function seed() {
253253
}
254254
});
255255
} else if (!allowLocalhost) {
256-
throw new Error('Cannot use localhost as a trusted domain if STACK_SEED_ALLOW_LOCALHOST is not set to true');
256+
throw new Error('Cannot use localhost as a trusted domain if STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST is not set to true');
257257
}
258258
}
259259

docker/server/.env

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NEXT_PUBLIC_STACK_API_URL=# https://your-backend-domain.com
22
NEXT_PUBLIC_STACK_DASHBOARD_URL=# https://your-dashboard-domain.com, this will be added as a trusted domain by the seed script
3-
STACK_SEED_ALLOW_LOCALHOST=# if true, the internal dashboard project will allow localhost as a trusted domain. Do not set this to true in production.
3+
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=# if true, the internal dashboard project will allow localhost as a trusted domain. Do not set this to true in production.
44

55
STACK_DATABASE_CONNECTION_STRING=# postgres connection string with pooler
66
STACK_DIRECT_DATABASE_CONNECTION_STRING=# postgres direct connection string
@@ -11,15 +11,15 @@ STACK_SECRET_SERVER_KEY=# a secure random string
1111
STACK_SERVER_SECRET=# a 32 bytes base64url encoded random string, used for JWT encryption. can be generated with `pnpm generate-keys`
1212

1313
# seed script settings
14-
STACK_SEED_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
15-
STACK_SEED_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
16-
STACK_SEED_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
17-
STACK_SEED_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
18-
STACK_SEED_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
19-
STACK_SEED_USER_EMAIL=# default user added to the dashboard
20-
STACK_SEED_USER_PASSWORD=# default user's password, paired with STACK_SEED_USER_EMAIL
21-
STACK_SEED_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
22-
STACK_SEED_USER_GITHUB_ID=# add github oauth id to the default user
14+
STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
15+
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
16+
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
17+
STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
18+
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
19+
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=# default user added to the dashboard
20+
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=# default user's password, paired with STACK_SEED_INTERNAL_PROJECT_USER_EMAIL
21+
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
22+
STACK_SEED_INTERNAL_PROJECT_USER_GITHUB_ID=# add github oauth id to the default user
2323

2424
# Set these if you want to use any email functionality
2525
STACK_EMAIL_HOST=

docker/server/.env.example

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ NEXT_PUBLIC_STACK_DASHBOARD_URL=http://localhost:8101
44
STACK_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
55
STACK_DIRECT_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
66

7-
NEXT_PUBLIC_STACK_PROJECT_ID=internal
8-
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only
9-
STACK_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only
10-
STACK_SERVER_SECRET=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
11-
12-
STACK_SEED_ALLOW_LOCALHOST=true
13-
STACK_SEED_USER_EMAIL=admin@email.com
14-
STACK_SEED_USER_PASSWORD=password
15-
STACK_SEED_USER_INTERNAL_ACCESS=false
7+
STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only
8+
STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only
9+
STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
10+
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=true
11+
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=admin@email.com
12+
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=password
13+
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=false
1614

1715
STACK_RUN_MIGRATIONS=true
1816
STACK_RUN_SEED_SCRIPT=true

docker/server/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -e
44

5+
export NEXT_PUBLIC_STACK_PROJECT_ID=internal
6+
export NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=${STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY}
7+
export STACK_SECRET_SERVER_KEY=${STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY}
8+
export STACK_SUPER_SECRET_ADMIN_KEY=${STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY}
9+
510
if [ "$STACK_RUN_MIGRATIONS" = "true" ]; then
611
echo "Running migrations..."
712
prisma migrate deploy --schema=./apps/backend/prisma/schema.prisma

0 commit comments

Comments
 (0)