From 9b2899e5f22ece025417689b820ab86ebe99cc03 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Sat, 7 Dec 2024 10:36:52 -0800 Subject: [PATCH] Update seed script variable names --- apps/backend/.env | 3 +++ apps/backend/.env.development | 8 +++----- apps/backend/prisma/seed.ts | 6 +++--- package.json | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/backend/.env b/apps/backend/.env index afa227839..a31ce6b12 100644 --- a/apps/backend/.env +++ b/apps/backend/.env @@ -13,6 +13,9 @@ STACK_SEED_USER_EMAIL=# default user added to the dashboard STACK_SEED_USER_PASSWORD=# default user's password, paired with STACK_SEED_USER_EMAIL STACK_SEED_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project STACK_SEED_USER_GITHUB_ID=# add github oauth id to the default user +STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=# default publishable client key for the internal project +STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=# default secret server key for the internal project +STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=# default super secret admin key for the internal project # OAuth mock provider settings STACK_OAUTH_MOCK_URL=# enter the URL of the mock OAuth provider here. For local development, use `http://localhost:8114`. diff --git a/apps/backend/.env.development b/apps/backend/.env.development index b0f63854d..36279b37f 100644 --- a/apps/backend/.env.development +++ b/apps/backend/.env.development @@ -8,11 +8,9 @@ STACK_SEED_ALLOW_LOCALHOST=true STACK_SEED_OAUTH_PROVIDERS=github,spotify,google,microsoft STACK_SEED_CLIENT_TEAM_CREATION=true STACK_SEED_USER_INTERNAL_ACCESS=true - -NEXT_PUBLIC_STACK_PROJECT_ID=project-id-from-stack-dashboard -NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only -STACK_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only -STACK_SUPER_SECRET_ADMIN_KEY=this-super-secret-admin-key-is-for-local-development-only +STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only +STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only +STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=this-super-secret-admin-key-is-for-local-development-only STACK_OAUTH_MOCK_URL=http://localhost:8114 diff --git a/apps/backend/prisma/seed.ts b/apps/backend/prisma/seed.ts index 28d67ce15..6146643a6 100644 --- a/apps/backend/prisma/seed.ts +++ b/apps/backend/prisma/seed.ts @@ -42,9 +42,9 @@ async function seed() { create: [{ description: "Internal API key set", // These keys must match the values used in the Stack dashboard env to be able to login via the UI. - publishableClientKey: process.env.NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY || throwErr('NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY is not set'), - secretServerKey: process.env.STACK_SECRET_SERVER_KEY || throwErr('STACK_SECRET_SERVER_KEY is not set'), - superSecretAdminKey: process.env.STACK_SUPER_SECRET_ADMIN_KEY || throwErr('STACK_SUPER_SECRET_ADMIN_KEY is not set'), + publishableClientKey: process.env.STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY is not set'), + secretServerKey: process.env.STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY is not set'), + superSecretAdminKey: process.env.STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY is not set'), expiresAt: new Date('2099-12-31T23:59:59Z'), }], }, diff --git a/package.json b/package.json index 72f9c2181..bd28f280b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "clean": "only-allow pnpm && turbo run clean && rimraf --glob **/.next && rimraf --glob **/.turbo && rimraf .turbo && rimraf --glob **/node_modules", "codegen": "only-allow pnpm && turbo run codegen", "deps-compose": "docker compose -f dependencies.compose.yaml", - "stop-deps": "pnpm run deps-compose kill && pnpm run deps-compose down -v", + "stop-deps": "POSTGRES_DELAY_MS=0 pnpm run deps-compose kill && POSTGRES_DELAY_MS=0 pnpm run deps-compose down -v", "init-db": "pnpm run prisma db push && pnpm run prisma db seed", "start-deps:no-delay": "pnpm run deps-compose up --detach && sleep 5 && pnpm run init-db && echo \"\\nDependencies started in the background as Docker containers. 'pnpm run stop-deps' to stop them\"n", "start-deps": "POSTGRES_DELAY_MS=${POSTGRES_DELAY_MS:-20} pnpm run start-deps:no-delay",