Skip to content

Commit

Permalink
Merge pull request #1419 from logto-io/gao-add-gitpod-config
Browse files Browse the repository at this point in the history
chore: add GitPod config
  • Loading branch information
gao-sun authored Jul 5, 2022
2 parents be004fa + 9d3c2e7 commit 4993f38
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
tasks:
- name: Start Logto
init: |
docker-compose pull
command: |
ENDPOINT=$(gp url 3001) docker compose -p logto up
env:
TAG: prerelease

ports:
- name: Logto
description: The Logto core service
port: 3001
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<a href="https://github.com/logto-io/logto/releases">
<img src="https://img.shields.io/github/v/release/logto-io/logto?color=7958FF" alt="release" />
</a>
<a href="https://gitpod.io/#https://github.com/logto-io/logto">
<img src="https://img.shields.io/badge/gitpod-available-blue" alt="gitpod">
</a>
<a href="https://app.codecov.io/gh/logto-io/logto">
<img src="https://img.shields.io/codecov/c/github/logto-io/logto?label=core%20coverage" alt="core coverage" />
</a>
Expand Down
16 changes: 12 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ version: "3.9"
services:
app:
depends_on:
- postgres
postgres:
condition: service_healthy
image: ghcr.io/logto-io/logto:${TAG-latest}
ports:
- 3001:3001
environment:
ALL_YES: 1
NO_INQUIRY: 0
DB_URL_DEFAULT: postgres://postgres:p0stgr3s@postgres:5432
- ALL_YES=1
- NO_INQUIRY=0
- TRUST_PROXY_HEADER=1
- DB_URL_DEFAULT=postgres://postgres:p0stgr3s@postgres:5432
- ENDPOINT
postgres:
image: postgres:14-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: p0stgr3s
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
3 changes: 2 additions & 1 deletion packages/core/src/env-set/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { appendPath } from '@/utils/url';

import createPoolByEnv from './create-pool-by-env';
import loadOidcValues from './oidc';
import { isTrue } from './parameters';

export enum MountedApps {
Api = 'api',
Expand Down Expand Up @@ -32,7 +33,7 @@ const loadEnvValues = async () => {
localhostUrl,
endpoint,
developmentUserId: getEnv('DEVELOPMENT_USER_ID'),
trustProxyHeader: getEnv('TRUST_PROXY_HEADER') === 'true',
trustProxyHeader: isTrue(getEnv('TRUST_PROXY_HEADER')),
oidc: await loadOidcValues(appendPath(endpoint, '/oidc').toString()),
adminConsoleUrl: appendPath(endpoint, '/console'),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/env-set/parameters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getEnv } from '@silverhand/essentials';

const isTrue = (value: string) => ['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value);
export const isTrue = (value: string) => ['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value);

const parameters = new Set(process.argv.slice(2));
export const noInquiry = parameters.has('--no-inquiry') || isTrue(getEnv('NO_INQUIRY'));
Expand Down

0 comments on commit 4993f38

Please sign in to comment.