From f7a5f5783bb594907759949f06fbba677a6925b5 Mon Sep 17 00:00:00 2001 From: Adolphe Kifungo <45813955+adkif@users.noreply.github.com> Date: Sat, 14 Oct 2023 13:20:35 +0200 Subject: [PATCH 1/3] fix: remove unnecessary log --- packages/core/src/time-tracking/timer/timer.service.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/core/src/time-tracking/timer/timer.service.ts b/packages/core/src/time-tracking/timer/timer.service.ts index 3a76cc642b2..2157949f946 100644 --- a/packages/core/src/time-tracking/timer/timer.service.ts +++ b/packages/core/src/time-tracking/timer/timer.service.ts @@ -149,10 +149,6 @@ export class TimerService { // Calculate last TimeLog duration if (lastLog) { - console.log( - '----------------------------------Timer Status----------------------------------', - lastLog.isRunning - ); status.lastLog = lastLog; status.running = lastLog.isRunning; if (status.running) { From 77e5b47d77197296059c3099a00ec260f3298b24 Mon Sep 17 00:00:00 2001 From: Ruslan Konviser Date: Sat, 14 Oct 2023 13:47:04 +0200 Subject: [PATCH 2/3] chore: more env vars for GitHub integration --- .deploy/api/Dockerfile | 12 ++++++++++++ .deploy/k8s/k8s-manifest.civo.prod.yaml | 12 ++++++++++++ .deploy/k8s/k8s-manifest.civo.stage.yaml | 12 ++++++++++++ .deploy/k8s/k8s-manifest.cw.prod.yaml | 12 ++++++++++++ .deploy/k8s/k8s-manifest.cw.stage.yaml | 12 ++++++++++++ .deploy/k8s/k8s-manifest.prod.yaml | 12 ++++++++++++ .deploy/k8s/k8s-manifest.stage.yaml | 12 ++++++++++++ .github/workflows/deploy-civo-prod.yml | 3 +++ .github/workflows/deploy-civo-stage.yml | 3 +++ .github/workflows/deploy-cw-prod.yml | 3 +++ .github/workflows/deploy-cw-stage.yml | 3 +++ .github/workflows/deploy-do-prod.yml | 3 +++ .github/workflows/deploy-do-stage.yml | 3 +++ docker-compose.demo.yml | 7 +++++++ docker-compose.yml | 6 ++++++ 15 files changed, 115 insertions(+) diff --git a/.deploy/api/Dockerfile b/.deploy/api/Dockerfile index e961d325e39..6fcdd1e8af9 100644 --- a/.deploy/api/Dockerfile +++ b/.deploy/api/Dockerfile @@ -68,8 +68,14 @@ ARG PM2_MACHINE_NAME ARG JITSU_SERVER_URL ARG JITSU_SERVER_WRITE_KEY ARG GAUZY_GITHUB_CLIENT_ID +ARG GAUZY_GITHUB_CLIENT_SECRET ARG GAUZY_GITHUB_WEBHOOK_URL ARG GAUZY_GITHUB_WEBHOOK_SECRET +ARG GAUZY_GITHUB_APP_ID +ARG GAUZY_GITHUB_APP_NAME +ARG GAUZY_GITHUB_CALLBACK_URL +ARG GAUZY_GITHUB_POST_INSTALL_URL +ARG GAUZY_GITHUB_APP_PRIVATE_KEY FROM node:18-alpine3.17 AS dependencies @@ -299,8 +305,14 @@ ENV PM2_MACHINE_NAME=${PM2_MACHINE_NAME} ENV JITSU_SERVER_URL=${JITSU_SERVER_URL} ENV JITSU_SERVER_WRITE_KEY=${JITSU_SERVER_WRITE_KEY} ENV GAUZY_GITHUB_CLIENT_ID=${GAUZY_GITHUB_CLIENT_ID} +ENV GAUZY_GITHUB_CLIENT_SECRET=${GAUZY_GITHUB_CLIENT_SECRET} ENV GAUZY_GITHUB_WEBHOOK_URL=${GAUZY_GITHUB_WEBHOOK_URL} ENV GAUZY_GITHUB_WEBHOOK_SECRET=${GAUZY_GITHUB_WEBHOOK_SECRET} +ENV GAUZY_GITHUB_APP_PRIVATE_KEY=${GAUZY_GITHUB_APP_PRIVATE_KEY} +ENV GAUZY_GITHUB_APP_ID=${GAUZY_GITHUB_APP_ID} +ENV GAUZY_GITHUB_APP_NAME=${GAUZY_GITHUB_APP_NAME} +ENV GAUZY_GITHUB_CALLBACK_URL=${GAUZY_GITHUB_CALLBACK_URL} +ENV GAUZY_GITHUB_POST_INSTALL_URL=${GAUZY_GITHUB_POST_INSTALL_URL} EXPOSE ${API_PORT} diff --git a/.deploy/k8s/k8s-manifest.civo.prod.yaml b/.deploy/k8s/k8s-manifest.civo.prod.yaml index 61baac61a30..13d19a2d73d 100644 --- a/.deploy/k8s/k8s-manifest.civo.prod.yaml +++ b/.deploy/k8s/k8s-manifest.civo.prod.yaml @@ -175,10 +175,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.deploy/k8s/k8s-manifest.civo.stage.yaml b/.deploy/k8s/k8s-manifest.civo.stage.yaml index 0f1d4710a04..55c32f7f026 100644 --- a/.deploy/k8s/k8s-manifest.civo.stage.yaml +++ b/.deploy/k8s/k8s-manifest.civo.stage.yaml @@ -169,10 +169,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.deploy/k8s/k8s-manifest.cw.prod.yaml b/.deploy/k8s/k8s-manifest.cw.prod.yaml index 1191f24fd63..85a98cc574f 100644 --- a/.deploy/k8s/k8s-manifest.cw.prod.yaml +++ b/.deploy/k8s/k8s-manifest.cw.prod.yaml @@ -201,10 +201,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.deploy/k8s/k8s-manifest.cw.stage.yaml b/.deploy/k8s/k8s-manifest.cw.stage.yaml index 721c063f092..ec6f7ce809a 100644 --- a/.deploy/k8s/k8s-manifest.cw.stage.yaml +++ b/.deploy/k8s/k8s-manifest.cw.stage.yaml @@ -195,10 +195,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.deploy/k8s/k8s-manifest.prod.yaml b/.deploy/k8s/k8s-manifest.prod.yaml index d0840bff011..7e1405eea7c 100644 --- a/.deploy/k8s/k8s-manifest.prod.yaml +++ b/.deploy/k8s/k8s-manifest.prod.yaml @@ -193,10 +193,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.deploy/k8s/k8s-manifest.stage.yaml b/.deploy/k8s/k8s-manifest.stage.yaml index 7999861c8f1..e5c34d7f2bc 100644 --- a/.deploy/k8s/k8s-manifest.stage.yaml +++ b/.deploy/k8s/k8s-manifest.stage.yaml @@ -187,10 +187,22 @@ spec: value: '$JITSU_SERVER_WRITE_KEY' - name: GAUZY_GITHUB_CLIENT_ID value: '$GAUZY_GITHUB_CLIENT_ID' + - name: GAUZY_GITHUB_CLIENT_SECRET + value: '$GAUZY_GITHUB_CLIENT_SECRET' - name: GAUZY_GITHUB_WEBHOOK_URL value: '$GAUZY_GITHUB_WEBHOOK_URL' - name: GAUZY_GITHUB_WEBHOOK_SECRET value: '$GAUZY_GITHUB_WEBHOOK_SECRET' + - name: GAUZY_GITHUB_APP_PRIVATE_KEY + value: '$GAUZY_GITHUB_APP_PRIVATE_KEY' + - name: GAUZY_GITHUB_APP_ID + value: '$GAUZY_GITHUB_APP_ID' + - name: GAUZY_GITHUB_APP_NAME + value: '$GAUZY_GITHUB_APP_NAME' + - name: GAUZY_GITHUB_CALLBACK_URL + value: '$GAUZY_GITHUB_CALLBACK_URL' + - name: GAUZY_GITHUB_POST_INSTALL_URL + value: '$GAUZY_GITHUB_POST_INSTALL_URL' ports: - containerPort: 3000 diff --git a/.github/workflows/deploy-civo-prod.yml b/.github/workflows/deploy-civo-prod.yml index 44ca74e425c..63662cc8b38 100644 --- a/.github/workflows/deploy-civo-prod.yml +++ b/.github/workflows/deploy-civo-prod.yml @@ -103,12 +103,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/.github/workflows/deploy-civo-stage.yml b/.github/workflows/deploy-civo-stage.yml index 0c35b7b37bc..56f4acce2fe 100644 --- a/.github/workflows/deploy-civo-stage.yml +++ b/.github/workflows/deploy-civo-stage.yml @@ -104,12 +104,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/.github/workflows/deploy-cw-prod.yml b/.github/workflows/deploy-cw-prod.yml index b4603edc34b..564fc6a4712 100644 --- a/.github/workflows/deploy-cw-prod.yml +++ b/.github/workflows/deploy-cw-prod.yml @@ -103,12 +103,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/.github/workflows/deploy-cw-stage.yml b/.github/workflows/deploy-cw-stage.yml index 2f102d8fc11..29b22887c5e 100644 --- a/.github/workflows/deploy-cw-stage.yml +++ b/.github/workflows/deploy-cw-stage.yml @@ -104,12 +104,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/.github/workflows/deploy-do-prod.yml b/.github/workflows/deploy-do-prod.yml index f2aea9183c7..f5b79c34406 100644 --- a/.github/workflows/deploy-do-prod.yml +++ b/.github/workflows/deploy-do-prod.yml @@ -98,12 +98,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/.github/workflows/deploy-do-stage.yml b/.github/workflows/deploy-do-stage.yml index 969ca292acb..63b334e54e3 100644 --- a/.github/workflows/deploy-do-stage.yml +++ b/.github/workflows/deploy-do-stage.yml @@ -99,12 +99,15 @@ jobs: JITSU_SERVER_URL: '${{ secrets.JITSU_SERVER_URL }}' JITSU_SERVER_WRITE_KEY: '${{ secrets.JITSU_SERVER_WRITE_KEY }}' GAUZY_GITHUB_CLIENT_ID: '${{ secrets.GAUZY_GITHUB_CLIENT_ID }}' + GAUZY_GITHUB_CLIENT_SECRET: '${{ secrets.GAUZY_GITHUB_CLIENT_SECRET }}' + GAUZY_GITHUB_APP_PRIVATE_KEY: '${{ secrets.GAUZY_GITHUB_APP_PRIVATE_KEY }}' GAUZY_GITHUB_WEBHOOK_URL: '${{ secrets.GAUZY_GITHUB_WEBHOOK_URL }}' GAUZY_GITHUB_WEBHOOK_SECRET: '${{ secrets.GAUZY_GITHUB_WEBHOOK_SECRET }}' GAUZY_GITHUB_APP_NAME: '${{ secrets.GAUZY_GITHUB_APP_NAME }}' GAUZY_GITHUB_REDIRECT_URL: '${{ secrets.GAUZY_GITHUB_REDIRECT_URL }}' GAUZY_GITHUB_POST_INSTALL_URL: '${{ secrets.GAUZY_GITHUB_POST_INSTALL_URL }}' GAUZY_GITHUB_APP_ID: '${{ secrets.GAUZY_GITHUB_APP_ID }}' + GAUZY_GITHUB_CALLBACK_URL: '${{ secrets.GAUZY_GITHUB_CALLBACK_URL }}' JITSU_BROWSER_URL: '${{ secrets.JITSU_BROWSER_URL }}' JITSU_BROWSER_WRITE_KEY: '${{ secrets.JITSU_BROWSER_WRITE_KEY }}' diff --git a/docker-compose.demo.yml b/docker-compose.demo.yml index 394d6c30e19..b9f3deeb0e9 100644 --- a/docker-compose.demo.yml +++ b/docker-compose.demo.yml @@ -221,8 +221,15 @@ services: JITSU_SERVER_URL: ${JITSU_SERVER_URL:-} JITSU_SERVER_WRITE_KEY: ${JITSU_SERVER_WRITE_KEY:-} GAUZY_GITHUB_CLIENT_ID: ${GAUZY_GITHUB_CLIENT_ID:-} + GAUZY_GITHUB_CLIENT_SECRET: ${GAUZY_GITHUB_CLIENT_SECRET:-} GAUZY_GITHUB_WEBHOOK_URL: ${GAUZY_GITHUB_WEBHOOK_URL:-} GAUZY_GITHUB_WEBHOOK_SECRET: ${GAUZY_GITHUB_WEBHOOK_SECRET:-} + GAUZY_GITHUB_APP_PRIVATE_KEY: ${GAUZY_GITHUB_APP_PRIVATE_KEY:-} + GAUZY_GITHUB_APP_ID: ${GAUZY_GITHUB_APP_ID:-} + GAUZY_GITHUB_APP_NAME: ${GAUZY_GITHUB_APP_NAME:-} + GAUZY_GITHUB_CALLBACK_URL: ${GAUZY_GITHUB_CALLBACK_URL:-} + GAUZY_GITHUB_POST_INSTALL_URL: ${GAUZY_GITHUB_POST_INSTALL_URL:-} + env_file: - .env.compose entrypoint: './entrypoint.compose.sh' diff --git a/docker-compose.yml b/docker-compose.yml index 4648bff9d14..1d968a86ccc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -228,8 +228,14 @@ services: JITSU_SERVER_URL: ${JITSU_SERVER_URL:-} JITSU_SERVER_WRITE_KEY: ${JITSU_SERVER_WRITE_KEY:-} GAUZY_GITHUB_CLIENT_ID: ${GAUZY_GITHUB_CLIENT_ID:-} + GAUZY_GITHUB_CLIENT_SECRET: ${GAUZY_GITHUB_CLIENT_SECRET:-} GAUZY_GITHUB_WEBHOOK_URL: ${GAUZY_GITHUB_WEBHOOK_URL:-} GAUZY_GITHUB_WEBHOOK_SECRET: ${GAUZY_GITHUB_WEBHOOK_SECRET:-} + GAUZY_GITHUB_APP_PRIVATE_KEY: ${GAUZY_GITHUB_APP_PRIVATE_KEY:-} + GAUZY_GITHUB_APP_ID: ${GAUZY_GITHUB_APP_ID:-} + GAUZY_GITHUB_APP_NAME: ${GAUZY_GITHUB_APP_NAME:-} + GAUZY_GITHUB_CALLBACK_URL: ${GAUZY_GITHUB_CALLBACK_URL:-} + GAUZY_GITHUB_POST_INSTALL_URL: ${GAUZY_GITHUB_POST_INSTALL_URL:-} env_file: - .env.compose From 0bbac6f60f986bbebce5614f148bb5c97d2602e6 Mon Sep 17 00:00:00 2001 From: Ruslan Konviser Date: Sat, 14 Oct 2023 14:51:04 +0200 Subject: [PATCH 3/3] fix: decode GAUZY_GITHUB_APP_PRIVATE_KEY from env var --- .../src/environments/environment.prod.ts | 85 ++++++++++++++----- .../config/src/environments/environment.ts | 10 ++- 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/packages/config/src/environments/environment.prod.ts b/packages/config/src/environments/environment.prod.ts index 09f95f2b487..c28e084a6db 100644 --- a/packages/config/src/environments/environment.prod.ts +++ b/packages/config/src/environments/environment.prod.ts @@ -24,29 +24,38 @@ export const environment: IEnvironment = { USER_PASSWORD_BCRYPT_SALT_ROUNDS: 12, JWT_SECRET: process.env.JWT_SECRET || 'secretKey', - JWT_TOKEN_EXPIRATION_TIME: parseInt(process.env.JWT_TOKEN_EXPIRATION_TIME) || 86400 * 1, // default JWT token expire time (1 day) + JWT_TOKEN_EXPIRATION_TIME: + parseInt(process.env.JWT_TOKEN_EXPIRATION_TIME) || 86400 * 1, // default JWT token expire time (1 day) - JWT_REFRESH_TOKEN_SECRET: process.env.JWT_REFRESH_TOKEN_SECRET || 'refreshSecretKey', - JWT_REFRESH_TOKEN_EXPIRATION_TIME: parseInt(process.env.JWT_REFRESH_TOKEN_EXPIRATION_TIME) || 86400 * 7, // default JWT refresh token expire time (7 days) + JWT_REFRESH_TOKEN_SECRET: + process.env.JWT_REFRESH_TOKEN_SECRET || 'refreshSecretKey', + JWT_REFRESH_TOKEN_EXPIRATION_TIME: + parseInt(process.env.JWT_REFRESH_TOKEN_EXPIRATION_TIME) || 86400 * 7, // default JWT refresh token expire time (7 days) /** * Email verification options */ - JWT_VERIFICATION_TOKEN_SECRET: process.env.JWT_VERIFICATION_TOKEN_SECRET || 'verificationSecretKey', - JWT_VERIFICATION_TOKEN_EXPIRATION_TIME: parseInt(process.env.JWT_VERIFICATION_TOKEN_EXPIRATION_TIME) || 86400 * 7, // default verification expire token time (7 days) + JWT_VERIFICATION_TOKEN_SECRET: + process.env.JWT_VERIFICATION_TOKEN_SECRET || 'verificationSecretKey', + JWT_VERIFICATION_TOKEN_EXPIRATION_TIME: + parseInt(process.env.JWT_VERIFICATION_TOKEN_EXPIRATION_TIME) || + 86400 * 7, // default verification expire token time (7 days) /** * Email Reset */ - EMAIL_RESET_EXPIRATION_TIME: parseInt(process.env.EMAIL_RESET_EXPIRATION_TIME) || 1800, // default email reset expiration time (30 minutes) + EMAIL_RESET_EXPIRATION_TIME: + parseInt(process.env.EMAIL_RESET_EXPIRATION_TIME) || 1800, // default email reset expiration time (30 minutes) /** * Password Less Authentication Configuration */ - AUTHENTICATION_CODE_EXPIRATION_TIME: parseInt(process.env.AUTHENTICATION_CODE_EXPIRATION_TIME) || 86400 * 1, // default password less authentication code expire time (1 day) + AUTHENTICATION_CODE_EXPIRATION_TIME: + parseInt(process.env.AUTHENTICATION_CODE_EXPIRATION_TIME) || 86400 * 1, // default password less authentication code expire time (1 day) /** Organization Team Join Request Configuration **/ - TEAM_JOIN_REQUEST_EXPIRATION_TIME: parseInt(process.env.TEAM_JOIN_REQUEST_EXPIRATION_TIME) || 60 * 60 * 24, // default code expire time (1 day) + TEAM_JOIN_REQUEST_EXPIRATION_TIME: + parseInt(process.env.TEAM_JOIN_REQUEST_EXPIRATION_TIME) || 60 * 60 * 24, // default code expire time (1 day) /** * Throttler (Rate Limiting) Options @@ -61,7 +70,8 @@ export const environment: IEnvironment = { serverHost: process.env.JITSU_SERVER_URL, serverWriteKey: process.env.JITSU_SERVER_WRITE_KEY, debug: process.env.JITSU_SERVER_DEBUG === 'true' ? true : false, - echoEvents: process.env.JITSU_SERVER_ECHO_EVENTS === 'true' ? true : false, + echoEvents: + process.env.JITSU_SERVER_ECHO_EVENTS === 'true' ? true : false, }, fileSystem: { @@ -107,33 +117,48 @@ export const environment: IEnvironment = { clientId: process.env.FACEBOOK_CLIENT_ID, clientSecret: process.env.FACEBOOK_CLIENT_SECRET, fbGraphVersion: process.env.FACEBOOK_GRAPH_VERSION, - oauthRedirectUri: process.env.FACEBOOK_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/facebook/callback`, + oauthRedirectUri: + process.env.FACEBOOK_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/facebook/callback`, state: '{fbstate}', }, googleConfig: { clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, - callbackUrl: process.env.GOOGLE_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/google/callback`, + callbackUrl: + process.env.GOOGLE_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/google/callback`, }, github: { /**Github OAuth Configuration */ clientId: process.env.GAUZY_GITHUB_CLIENT_ID, clientSecret: process.env.GAUZY_GITHUB_CLIENT_SECRET, - callbackUrl: process.env.GAUZY_GITHUB_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/github/callback`, + callbackUrl: + process.env.GAUZY_GITHUB_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/github/callback`, /** Github App Install Configuration */ appId: process.env.GAUZY_GITHUB_APP_ID, appName: process.env.GAUZY_GITHUB_APP_NAME, - appPrivateKey: process.env.GAUZY_GITHUB_APP_PRIVATE_KEY, + appPrivateKey: process.env.GAUZY_GITHUB_APP_PRIVATE_KEY + ? Buffer.from( + process.env.GAUZY_GITHUB_APP_PRIVATE_KEY, + 'base64' + ).toString('ascii') + : '', /** Github App Post Install Configuration */ - postInstallUrl: process.env.GAUZY_GITHUB_POST_INSTALL_URL || `${process.env.CLIENT_BASE_URL}/#/pages/integrations/github/setup/installation`, + postInstallUrl: + process.env.GAUZY_GITHUB_POST_INSTALL_URL || + `${process.env.CLIENT_BASE_URL}/#/pages/integrations/github/setup/installation`, /** Github Webhook Configuration */ webhookSecret: process.env.GAUZY_GITHUB_WEBHOOK_SECRET, - webhookUrl: process.env.GAUZY_GITHUB_WEBHOOK_URL || `${process.env.API_BASE_URL}/api/integration/github/webhook` + webhookUrl: + process.env.GAUZY_GITHUB_WEBHOOK_URL || + `${process.env.API_BASE_URL}/api/integration/github/webhook`, }, microsoftConfig: { @@ -141,19 +166,25 @@ export const environment: IEnvironment = { clientSecret: process.env.MICROSOFT_CLIENT_SECRET, resource: process.env.MICROSOFT_RESOURCE, tenant: process.env.MICROSOFT_TENANT, - callbackUrl: process.env.MICROSOFT_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/microsoft/callback`, + callbackUrl: + process.env.MICROSOFT_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/microsoft/callback`, }, linkedinConfig: { clientId: process.env.LINKEDIN_CLIENT_ID, clientSecret: process.env.LINKEDIN_CLIENT_SECRET, - callbackUrl: process.env.LINKEDIN_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/linked/callback`, + callbackUrl: + process.env.LINKEDIN_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/linked/callback`, }, twitterConfig: { clientId: process.env.TWITTER_CLIENT_ID, clientSecret: process.env.TWITTER_CLIENT_SECRET, - callbackUrl: process.env.TWITTER_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/twitter/callback`, + callbackUrl: + process.env.TWITTER_CALLBACK_URL || + `${process.env.API_BASE_URL}/api/auth/twitter/callback`, }, fiverrConfig: { @@ -179,13 +210,18 @@ export const environment: IEnvironment = { dsn: process.env.SENTRY_DSN, }, - defaultIntegratedUserPass: process.env.INTEGRATED_USER_DEFAULT_PASS || '123456', + defaultIntegratedUserPass: + process.env.INTEGRATED_USER_DEFAULT_PASS || '123456', upwork: { apiKey: process.env.UPWORK_API_KEY, apiSecret: process.env.UPWORK_API_SECRET, - callbackUrl: process.env.UPWORK_REDIRECT_URL || `${process.env.API_BASE_URL}/api/integrations/upwork/callback`, - postInstallUrl: process.env.UPWORK_POST_INSTALL_URL || `${process.env.CLIENT_BASE_URL}/#/pages/integrations/upwork`, + callbackUrl: + process.env.UPWORK_REDIRECT_URL || + `${process.env.API_BASE_URL}/api/integrations/upwork/callback`, + postInstallUrl: + process.env.UPWORK_POST_INSTALL_URL || + `${process.env.CLIENT_BASE_URL}/#/pages/integrations/upwork`, }, hubstaff: { @@ -193,12 +229,15 @@ export const environment: IEnvironment = { clientId: process.env.HUBSTAFF_CLIENT_ID, clientSecret: process.env.HUBSTAFF_CLIENT_SECRET, /** Hubstaff Integration Post Install URL */ - postInstallUrl: process.env.HUBSTAFF_POST_INSTALL_URL || `${process.env.CLIENT_BASE_URL}/#/pages/integrations/hubstaff`, + postInstallUrl: + process.env.HUBSTAFF_POST_INSTALL_URL || + `${process.env.CLIENT_BASE_URL}/#/pages/integrations/hubstaff`, }, isElectron: process.env.IS_ELECTRON === 'true' ? true : false, gauzyUserPath: process.env.GAUZY_USER_PATH, - allowSuperAdminRole: process.env.ALLOW_SUPER_ADMIN_ROLE === 'false' ? false : true, + allowSuperAdminRole: + process.env.ALLOW_SUPER_ADMIN_ROLE === 'false' ? false : true, /** * Endpoint for Gauzy AI API (optional), e.g.: http://localhost:3005/graphql diff --git a/packages/config/src/environments/environment.ts b/packages/config/src/environments/environment.ts index 22bd4127ac1..9e30b65eb6f 100644 --- a/packages/config/src/environments/environment.ts +++ b/packages/config/src/environments/environment.ts @@ -74,7 +74,8 @@ export const environment: IEnvironment = { serverHost: process.env.JITSU_SERVER_URL, serverWriteKey: process.env.JITSU_SERVER_WRITE_KEY, debug: process.env.JITSU_SERVER_DEBUG === 'true' ? true : false, - echoEvents: process.env.JITSU_SERVER_ECHO_EVENTS === 'true' ? true : false, + echoEvents: + process.env.JITSU_SERVER_ECHO_EVENTS === 'true' ? true : false, }, fileSystem: { @@ -145,7 +146,12 @@ export const environment: IEnvironment = { /** Github App Install Configuration */ appId: process.env.GAUZY_GITHUB_APP_ID, appName: process.env.GAUZY_GITHUB_APP_NAME, - appPrivateKey: process.env.GAUZY_GITHUB_APP_PRIVATE_KEY, + appPrivateKey: process.env.GAUZY_GITHUB_APP_PRIVATE_KEY + ? Buffer.from( + process.env.GAUZY_GITHUB_APP_PRIVATE_KEY, + 'base64' + ).toString('ascii') + : '', /** Github App Post Install Configuration */ postInstallUrl: