mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
fixed env vars
Some checks failed
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Some checks failed
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
This commit is contained in:
parent
9b2899e5f2
commit
21e45c89b2
@ -4,15 +4,15 @@ NEXT_PUBLIC_STACK_DASHBOARD_URL=# the URL of Stack's dashboard. For local develo
|
||||
STACK_SERVER_SECRET=# a random, unguessable secret key generated by `pnpm generate-keys`
|
||||
|
||||
# seed script settings
|
||||
STACK_SEED_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
|
||||
STACK_SEED_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
|
||||
STACK_SEED_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
|
||||
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_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
|
||||
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"
|
||||
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=# default user added to the dashboard
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=# default user's password, paired with STACK_SEED_INTERNAL_PROJECT_USER_EMAIL
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
|
||||
STACK_SEED_INTERNAL_PROJECT_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
|
||||
|
||||
@ -2,12 +2,12 @@ NEXT_PUBLIC_STACK_API_URL=http://localhost:8102
|
||||
NEXT_PUBLIC_STACK_DASHBOARD_URL=http://localhost:8101
|
||||
STACK_SERVER_SECRET=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
|
||||
|
||||
STACK_SEED_SIGN_UP_ENABLED=true
|
||||
STACK_SEED_OTP_ENABLED=true
|
||||
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
|
||||
STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED=true
|
||||
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=true
|
||||
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=true
|
||||
STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS=github,spotify,google,microsoft
|
||||
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=true
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=true
|
||||
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
|
||||
|
||||
@ -9,18 +9,18 @@ async function seed() {
|
||||
console.log('Seeding database...');
|
||||
|
||||
// Optional default admin user
|
||||
const adminEmail = process.env.STACK_SEED_USER_EMAIL;
|
||||
const adminPassword = process.env.STACK_SEED_USER_PASSWORD;
|
||||
const adminInternalAccess = process.env.STACK_SEED_USER_INTERNAL_ACCESS === 'true';
|
||||
const adminGithubId = process.env.STACK_SEED_USER_GITHUB_ID;
|
||||
const adminEmail = process.env.STACK_SEED_INTERNAL_PROJECT_USER_EMAIL;
|
||||
const adminPassword = process.env.STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD;
|
||||
const adminInternalAccess = process.env.STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS === 'true';
|
||||
const adminGithubId = process.env.STACK_SEED_INTERNAL_PROJECT_USER_GITHUB_ID;
|
||||
|
||||
// dashboard settings
|
||||
const dashboardDomain = process.env.NEXT_PUBLIC_STACK_DASHBOARD_URL;
|
||||
const oauthProviderIds = process.env.STACK_SEED_OAUTH_PROVIDERS?.split(',') ?? [];
|
||||
const otpEnabled = process.env.STACK_SEED_OTP_ENABLED === 'true';
|
||||
const signUpEnabled = process.env.STACK_SEED_SIGN_UP_ENABLED === 'true';
|
||||
const allowLocalhost = process.env.STACK_SEED_ALLOW_LOCALHOST === 'true';
|
||||
const clientTeamCreation = process.env.STACK_SEED_CLIENT_TEAM_CREATION === 'true';
|
||||
const oauthProviderIds = process.env.STACK_SEED_INTERNAL_PROJECT_OAUTH_PROVIDERS?.split(',') ?? [];
|
||||
const otpEnabled = process.env.STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED === 'true';
|
||||
const signUpEnabled = process.env.STACK_SEED_INTERNAL_PROJECT_SIGN_UP_ENABLED === 'true';
|
||||
const allowLocalhost = process.env.STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST === 'true';
|
||||
const clientTeamCreation = process.env.STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION === 'true';
|
||||
|
||||
let internalProject = await prisma.project.findUnique({
|
||||
where: {
|
||||
@ -253,7 +253,7 @@ async function seed() {
|
||||
}
|
||||
});
|
||||
} else if (!allowLocalhost) {
|
||||
throw new Error('Cannot use localhost as a trusted domain if STACK_SEED_ALLOW_LOCALHOST is not set to true');
|
||||
throw new Error('Cannot use localhost as a trusted domain if STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST is not set to true');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
NEXT_PUBLIC_STACK_API_URL=# https://your-backend-domain.com
|
||||
NEXT_PUBLIC_STACK_DASHBOARD_URL=# https://your-dashboard-domain.com, this will be added as a trusted domain by the seed script
|
||||
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.
|
||||
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.
|
||||
|
||||
STACK_DATABASE_CONNECTION_STRING=# postgres connection string with pooler
|
||||
STACK_DIRECT_DATABASE_CONNECTION_STRING=# postgres direct connection string
|
||||
@ -11,15 +11,15 @@ STACK_SECRET_SERVER_KEY=# a secure random string
|
||||
STACK_SERVER_SECRET=# a 32 bytes base64url encoded random string, used for JWT encryption. can be generated with `pnpm generate-keys`
|
||||
|
||||
# seed script settings
|
||||
STACK_SEED_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
|
||||
STACK_SEED_OAUTH_PROVIDERS=# list of oauth providers to add to the dashboard when seeding, separated by comma, for example "github,google,facebook"
|
||||
STACK_SEED_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
|
||||
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_SIGN_UP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_INTERNAL_PROJECT_OTP_ENABLED=# true to add OTP auth to the dashboard when seeding
|
||||
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=# true to allow running dashboard on the localhost, set this to true only in development
|
||||
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"
|
||||
STACK_SEED_INTERNAL_PROJECT_CLIENT_TEAM_CREATION=# true to allow the users of the internal project to create teams
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=# default user added to the dashboard
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=# default user's password, paired with STACK_SEED_INTERNAL_PROJECT_USER_EMAIL
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=# if the default user has access to the internal dashboard project
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_GITHUB_ID=# add github oauth id to the default user
|
||||
|
||||
# Set these if you want to use any email functionality
|
||||
STACK_EMAIL_HOST=
|
||||
|
||||
@ -4,15 +4,13 @@ NEXT_PUBLIC_STACK_DASHBOARD_URL=http://localhost:8101
|
||||
STACK_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
|
||||
STACK_DIRECT_DATABASE_CONNECTION_STRING=postgres://postgres:password@host.docker.internal:5432/stackframe
|
||||
|
||||
NEXT_PUBLIC_STACK_PROJECT_ID=internal
|
||||
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_SERVER_SECRET=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
|
||||
|
||||
STACK_SEED_ALLOW_LOCALHOST=true
|
||||
STACK_SEED_USER_EMAIL=admin@email.com
|
||||
STACK_SEED_USER_PASSWORD=password
|
||||
STACK_SEED_USER_INTERNAL_ACCESS=false
|
||||
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=23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
|
||||
STACK_SEED_INTERNAL_PROJECT_ALLOW_LOCALHOST=true
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_EMAIL=admin@email.com
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_PASSWORD=password
|
||||
STACK_SEED_INTERNAL_PROJECT_USER_INTERNAL_ACCESS=false
|
||||
|
||||
STACK_RUN_MIGRATIONS=true
|
||||
STACK_RUN_SEED_SCRIPT=true
|
||||
|
||||
@ -2,6 +2,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
export NEXT_PUBLIC_STACK_PROJECT_ID=internal
|
||||
export NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY=${STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY}
|
||||
export STACK_SECRET_SERVER_KEY=${STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY}
|
||||
export STACK_SUPER_SECRET_ADMIN_KEY=${STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY}
|
||||
|
||||
if [ "$STACK_RUN_MIGRATIONS" = "true" ]; then
|
||||
echo "Running migrations..."
|
||||
prisma migrate deploy --schema=./apps/backend/prisma/schema.prisma
|
||||
|
||||
Loading…
Reference in New Issue
Block a user