mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore: update configs (#3190)
This commit is contained in:
parent
a63e79c8b4
commit
518579efce
4 changed files with 10 additions and 6 deletions
|
@ -5,6 +5,8 @@ tasks:
|
||||||
|
|
||||||
- name: Logto dev
|
- name: Logto dev
|
||||||
init: |
|
init: |
|
||||||
|
nvm i 18
|
||||||
|
nvm use 18
|
||||||
pnpm i
|
pnpm i
|
||||||
pnpm prepack
|
pnpm prepack
|
||||||
cd packages/core
|
cd packages/core
|
||||||
|
@ -15,6 +17,7 @@ tasks:
|
||||||
gp ports await 5432
|
gp ports await 5432
|
||||||
sleep 3
|
sleep 3
|
||||||
export ENDPOINT=$(gp url 3001)
|
export ENDPOINT=$(gp url 3001)
|
||||||
|
export ADMIN_ENDPOINT=$(gp url 3002)
|
||||||
pnpm cli db seed
|
pnpm cli db seed
|
||||||
pnpm start:dev
|
pnpm start:dev
|
||||||
env:
|
env:
|
||||||
|
@ -26,6 +29,10 @@ ports:
|
||||||
description: The Logto core service
|
description: The Logto core service
|
||||||
port: 3001
|
port: 3001
|
||||||
visibility: public
|
visibility: public
|
||||||
|
- name: Admin Console
|
||||||
|
description: The Admin Console for Logto core service
|
||||||
|
port: 3002
|
||||||
|
visibility: public
|
||||||
- name: Postgres
|
- name: Postgres
|
||||||
port: 5432
|
port: 5432
|
||||||
visibility: public
|
visibility: public
|
||||||
|
|
|
@ -22,7 +22,7 @@ RUN pnpm i
|
||||||
ENV CONSOLE_PUBLIC_URL=/
|
ENV CONSOLE_PUBLIC_URL=/
|
||||||
ENV IS_CLOUD=1
|
ENV IS_CLOUD=1
|
||||||
# Temporarily use it for Admin Console build, will try to use runtime technique later
|
# 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 prepack
|
||||||
RUN pnpm -r --filter @logto/console --filter @logto/cloud build
|
RUN pnpm -r --filter @logto/console --filter @logto/cloud build
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
const getEnv = (key: string) => process.env[key];
|
const getEnv = (key: string) => process.env[key];
|
||||||
|
|
||||||
class GlobalValues {
|
class GlobalValues {
|
||||||
public readonly logtoEndpoint = new URL(
|
public readonly logtoEndpoint = new URL(getEnv('ADMIN_ENDPOINT') ?? 'http://localhost:3002');
|
||||||
getEnv('ADMIN_TENANT_ENDPOINT') ?? 'http://localhost:3002'
|
|
||||||
);
|
|
||||||
|
|
||||||
public readonly dbUrl = getEnv('DB_URL');
|
public readonly dbUrl = getEnv('DB_URL');
|
||||||
public readonly isProduction = getEnv('NODE_ENV') === 'production';
|
public readonly isProduction = getEnv('NODE_ENV') === 'production';
|
||||||
|
|
|
@ -7,8 +7,7 @@ import { isCloud } from './cloud';
|
||||||
const isProduction = process.env.NODE_ENV === 'production';
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
export const adminTenantEndpoint =
|
export const adminTenantEndpoint =
|
||||||
process.env.ADMIN_TENANT_ENDPOINT ??
|
process.env.ADMIN_ENDPOINT ?? (isProduction ? window.location.origin : 'http://localhost:3002');
|
||||||
(isProduction ? window.location.origin : 'http://localhost:3002');
|
|
||||||
|
|
||||||
export const getUserTenantId = () => {
|
export const getUserTenantId = () => {
|
||||||
if (isCloud) {
|
if (isCloud) {
|
||||||
|
|
Loading…
Reference in a new issue