mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Dev container for codespaces (#610)
This commit is contained in:
parent
3940e581ce
commit
8e71f18f4f
@ -9,7 +9,8 @@
|
||||
"ghcr.io/devcontainers-contrib/features/pnpm:2": {
|
||||
"version": "9"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/git:1": {}
|
||||
"ghcr.io/devcontainers/features/git:1": {},
|
||||
"github-cli": "latest"
|
||||
},
|
||||
"hostRequirements": {
|
||||
"cpus": 2,
|
||||
@ -31,8 +32,9 @@
|
||||
8180, 8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189,
|
||||
8190, 8191, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199
|
||||
],
|
||||
"postCreateCommand": "pnpm install && pnpm build:packages && pnpm codegen && pnpm run start-deps && pnpm run stop-deps",
|
||||
"postStartCommand": "pnpm install && clear && echo 'To start the development server with dependencies, run: pnpm restart-deps && pnpm dev' && echo 'To run the tests, run: pnpm test [<path-filter>]'",
|
||||
"postCreateCommand": "chmod +x .devcontainer/set-env.sh && pnpm install && pnpm build:packages && pnpm codegen && pnpm run start-deps && pnpm run stop-deps",
|
||||
"postStartCommand": "pnpm install && clear",
|
||||
"postAttachCommand": ". .devcontainer/set-env.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
|
||||
10
.devcontainer/set-env.sh
Executable file
10
.devcontainer/set-env.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -n "$CODESPACE_NAME" ]; then
|
||||
export NEXT_PUBLIC_STACK_API_URL="https://${CODESPACE_NAME}-8102.app.github.dev"
|
||||
export STACK_MOCK_OAUTH_REDIRECT_URIS="https://${CODESPACE_NAME}-8102.app.github.dev/api/v1/auth/oauth/callback/{id}"
|
||||
export NEXT_PUBLIC_STACK_DASHBOARD_URL="https://${CODESPACE_NAME}-8101.app.github.dev"
|
||||
gh codespace ports visibility 8102:public -c $CODESPACE_NAME && gh codespace ports visibility 8114:public -c $CODESPACE_NAME
|
||||
fi
|
||||
|
||||
echo 'To start the development server with dependencies, run: pnpm restart-deps && pnpm dev'
|
||||
@ -18,9 +18,12 @@ const providerIds = [
|
||||
const clients = providerIds.map((id) => ({
|
||||
client_id: id,
|
||||
client_secret: 'MOCK-SERVER-SECRET',
|
||||
redirect_uris: [8102, 32102].map(port =>
|
||||
`http://localhost:${port}/api/v1/auth/oauth/callback/${id}`
|
||||
),
|
||||
redirect_uris: [
|
||||
...([8102, 32102].map(port =>
|
||||
`http://localhost:${port}/api/v1/auth/oauth/callback/${id}`
|
||||
)),
|
||||
...(process.env.STACK_MOCK_OAUTH_REDIRECT_URIS ? [process.env.STACK_MOCK_OAUTH_REDIRECT_URIS.replace("{id}", id)] : [])
|
||||
]
|
||||
}));
|
||||
|
||||
const configuration = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user