diff --git a/.gitpod.yml b/.gitpod.yml index 06891a0ed..ecff11683 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,6 +5,8 @@ tasks: - name: Logto dev init: | + nvm i 18 + nvm use 18 pnpm i pnpm prepack cd packages/core @@ -15,6 +17,7 @@ tasks: gp ports await 5432 sleep 3 export ENDPOINT=$(gp url 3001) + export ADMIN_ENDPOINT=$(gp url 3002) pnpm cli db seed pnpm start:dev env: @@ -26,6 +29,10 @@ ports: description: The Logto core service port: 3001 visibility: public + - name: Admin Console + description: The Admin Console for Logto core service + port: 3002 + visibility: public - name: Postgres port: 5432 visibility: public diff --git a/Dockerfile.cloud b/Dockerfile.cloud index 2027342da..866281c2e 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -22,7 +22,7 @@ RUN pnpm i ENV CONSOLE_PUBLIC_URL=/ ENV IS_CLOUD=1 # Temporarily use it for Admin Console build, will try to use runtime technique later -ENV ADMIN_TENANT_ENDPOINT=https://admin.app.logto.dev/ +ENV ADMIN_ENDPOINT=https://admin.app.logto.dev/ RUN pnpm prepack RUN pnpm -r --filter @logto/console --filter @logto/cloud build diff --git a/packages/cloud/src/env-set/index.ts b/packages/cloud/src/env-set/index.ts index 13bdcee1e..8ded60476 100644 --- a/packages/cloud/src/env-set/index.ts +++ b/packages/cloud/src/env-set/index.ts @@ -1,9 +1,7 @@ const getEnv = (key: string) => process.env[key]; class GlobalValues { - public readonly logtoEndpoint = new URL( - getEnv('ADMIN_TENANT_ENDPOINT') ?? 'http://localhost:3002' - ); + public readonly logtoEndpoint = new URL(getEnv('ADMIN_ENDPOINT') ?? 'http://localhost:3002'); public readonly dbUrl = getEnv('DB_URL'); public readonly isProduction = getEnv('NODE_ENV') === 'production'; diff --git a/packages/console/src/consts/tenants.ts b/packages/console/src/consts/tenants.ts index 935034f6c..894047963 100644 --- a/packages/console/src/consts/tenants.ts +++ b/packages/console/src/consts/tenants.ts @@ -7,8 +7,7 @@ import { isCloud } from './cloud'; const isProduction = process.env.NODE_ENV === 'production'; export const adminTenantEndpoint = - process.env.ADMIN_TENANT_ENDPOINT ?? - (isProduction ? window.location.origin : 'http://localhost:3002'); + process.env.ADMIN_ENDPOINT ?? (isProduction ? window.location.origin : 'http://localhost:3002'); export const getUserTenantId = () => { if (isCloud) {