From aa89019236abd90a457946bb2a6110b3c17e5b3a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 18 Feb 2022 23:25:24 +0100 Subject: [PATCH 1/4] fix: Database connection strings --- src/routes/databases/[id]/_Databases/_Databases.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/databases/[id]/_Databases/_Databases.svelte b/src/routes/databases/[id]/_Databases/_Databases.svelte index e09e8d278..611936d59 100644 --- a/src/routes/databases/[id]/_Databases/_Databases.svelte +++ b/src/routes/databases/[id]/_Databases/_Databases.svelte @@ -36,7 +36,7 @@ function generateUrl() { return browser - ? `${database.type}://${database.type === 'redis' && ':'}${ + ? `${database.type}://${database.type === 'redis' ? ':' : ''}${ databaseDbUser ? databaseDbUser + ':' : '' }${databaseDbUserPassword}@${ isPublic From 6c9ef34905e6948e02c52af01369ac17ed99f687 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 18 Feb 2022 23:25:43 +0100 Subject: [PATCH 2/4] chore: version++ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0a7b34a7..b936ec3bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "2.0.14", + "version": "2.0.15", "license": "AGPL-3.0", "scripts": { "dev": "docker compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0", From 64cd5b6e4b6db64aef81ecb1443084c174650094 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 19 Feb 2022 13:57:56 +0100 Subject: [PATCH 3/4] fix: Gitlab webhooks fixed --- src/hooks.ts | 2 +- .../databases/[id]/_Databases/_Databases.svelte | 2 +- src/routes/sources/[id]/_Gitlab.svelte | 13 ++++++++----- src/routes/webhooks/gitlab/index.ts | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hooks.ts b/src/hooks.ts index 7bb2d8060..bdd1f9234 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -18,7 +18,7 @@ export const handle = handleSession( try { if (event.locals.cookies) { let gitlabToken = event.locals.cookies.gitlabToken || null; - let ghToken = event.locals.cookies.ghToken; + let ghToken = event.locals.cookies.ghToken || null; if (event.locals.cookies['kit.session']) { const { permission, teamId, userId } = await getUserDetails(event, false); const newSession = { diff --git a/src/routes/databases/[id]/_Databases/_Databases.svelte b/src/routes/databases/[id]/_Databases/_Databases.svelte index 611936d59..83c15a496 100644 --- a/src/routes/databases/[id]/_Databases/_Databases.svelte +++ b/src/routes/databases/[id]/_Databases/_Databases.svelte @@ -36,7 +36,7 @@ function generateUrl() { return browser - ? `${database.type}://${database.type === 'redis' ? ':' : ''}${ + ? `${database.type}://${ databaseDbUser ? databaseDbUser + ':' : '' }${databaseDbUserPassword}@${ isPublic diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/src/routes/sources/[id]/_Gitlab.svelte index 01de75424..0a39fcf72 100644 --- a/src/routes/sources/[id]/_Gitlab.svelte +++ b/src/routes/sources/[id]/_Gitlab.svelte @@ -121,12 +121,15 @@ Scopes required: +
- api (Access the authenticated user's API) +
- read_repository (Allows read-only access to the repository) +
- email (Allows read-only access to the user's primary email address using OpenID Connect)
-
For extra security, you can add Expire access tokens!" +
For extra security, you can set Expire access tokens! +

Webhook URL: {window.location + .origin}/webhooks/gitlab +
But if you will set a custom domain name for Coolify, use that instead." />
diff --git a/src/routes/webhooks/gitlab/index.ts b/src/routes/webhooks/gitlab/index.ts index 9f953bc88..f3d930ace 100644 --- a/src/routes/webhooks/gitlab/index.ts +++ b/src/routes/webhooks/gitlab/index.ts @@ -21,8 +21,8 @@ export const get: RequestHandler = async (event) => { const code = event.url.searchParams.get('code'); const state = event.url.searchParams.get('state'); try { + const { fqdn } = await db.listSettings(); const application = await db.getApplication({ id: state, teamId }); - const { fqdn } = application; const { appId, appSecret } = application.gitSource.gitlabApp; const { htmlUrl } = application.gitSource; From e51a8d43d9a9030ac28efa6d595bf0f4dc89785f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 19 Feb 2022 14:03:33 +0100 Subject: [PATCH 4/4] Browser --- src/routes/sources/[id]/_Gitlab.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/src/routes/sources/[id]/_Gitlab.svelte index 0a39fcf72..ba18ea5f2 100644 --- a/src/routes/sources/[id]/_Gitlab.svelte +++ b/src/routes/sources/[id]/_Gitlab.svelte @@ -5,6 +5,7 @@ import { page, session } from '$app/stores'; import { onMount } from 'svelte'; import { post } from '$lib/api'; + import { browser } from '$app/env'; const { id } = $page.params; let loading = false; @@ -127,8 +128,9 @@
- email (Allows read-only access to the user's primary email address using OpenID Connect)

For extra security, you can set Expire access tokens! -

Webhook URL: {window.location - .origin}/webhooks/gitlab +

Webhook URL: {browser + ? window.location.origin + : ''}/webhooks/gitlab
But if you will set a custom domain name for Coolify, use that instead." />