Skip to content

Commit 13279df

Browse files
committed
fixed accelerate and docker
1 parent fa6184c commit 13279df

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

apps/backend/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
"with-env": "dotenv -c development --",
99
"with-env:prod": "dotenv -c --",
1010
"dev": "concurrently -n \"dev,codegen,prisma-studio\" -k \"next dev --port 8102\" \"pnpm run codegen:watch\" \"pnpm run prisma-studio\"",
11-
"build": "pnpm run codegen:prod && next build",
11+
"build": "pnpm run codegen && next build",
1212
"docker-build": "pnpm run codegen && next build --experimental-build-mode compile",
1313
"self-host-seed-script": "tsup --config prisma/tsup.config.ts",
1414
"analyze-bundle": "ANALYZE_BUNDLE=1 pnpm run build",
1515
"start": "next start --port 8102",
1616
"codegen-prisma": "pnpm run prisma generate",
1717
"codegen-prisma:watch": "pnpm run prisma generate --watch",
18-
"codegen": "pnpm run codegen-prisma && pnpm run generate-docs",
19-
"codegen:prod": "pnpm run prisma generate --no-engine && pnpm run generate-docs",
18+
"codegen": "pnpm run with-env bash -c 'if [ \"$STACK_ACCELERATE_ENABLED\" = \"true\" ]; then pnpm run prisma generate --no-engine && pnpm run generate-docs; else pnpm run codegen-prisma && pnpm run generate-docs; fi'",
2019
"codegen:watch": "concurrently -n \"prisma,docs\" -k \"pnpm run codegen-prisma:watch\" \"pnpm run watch-docs\"",
2120
"psql-inner": "psql $STACK_DATABASE_CONNECTION_STRING",
2221
"psql": "pnpm run with-env pnpm run psql-inner",

apps/backend/prisma/seed.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,28 @@ async function seed() {
128128
console.log(`Updated signUpEnabled for internal project: ${signUpEnabled}`);
129129
}
130130

131+
const keySet = {
132+
publishableClientKey: process.env.STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY is not set'),
133+
secretServerKey: process.env.STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY is not set'),
134+
superSecretAdminKey: process.env.STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY is not set'),
135+
};
136+
131137
await prisma.apiKeySet.upsert({
132138
where: { projectId_id: { projectId: 'internal', id: apiKeyId } },
133-
update: {},
139+
update: {
140+
...keySet,
141+
},
134142
create: {
135143
id: apiKeyId,
136144
projectId: 'internal',
137145
description: "Internal API key set",
138-
// These keys must match the values used in the Stack dashboard env to be able to login via the UI.
139-
publishableClientKey: process.env.STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY is not set'),
140-
secretServerKey: process.env.STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY is not set'),
141-
superSecretAdminKey: process.env.STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY || throwErr('STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY is not set'),
142146
expiresAt: new Date('2099-12-31T23:59:59Z'),
147+
...keySet,
143148
}
144149
});
145150

151+
console.log('Updated internal API key set');
152+
146153
// Create optional default admin user if credentials are provided.
147154
// This user will be able to login to the dashboard with both email/password and magic link.
148155
if ((adminEmail && adminPassword) || adminGithubId) {

docker/server/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
NEXT_PUBLIC_STACK_API_URL=http://localhost:8102
22
NEXT_PUBLIC_STACK_DASHBOARD_URL=http://localhost:8101
33

4-
STACK_DATABASE_CONNECTION_STRING=postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@host.docker.internal:5432/stackframe
5-
STACK_DIRECT_DATABASE_CONNECTION_STRING=postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@host.docker.internal:5432/stackframe
4+
STACK_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
5+
STACK_DIRECT_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
66

77
STACK_SERVER_SECRET=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
88

0 commit comments

Comments
 (0)