Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: Gitlab webhooks fixed

Andras Bacsai64cd5b6e4b6d
diff --git a/src/hooks.ts b/src/hooks.ts
index 7bb2d80606..bdd1f92348 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 611936d595..83c15a496e 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 01de75424d..0a39fcf72f 100644
--- a/src/routes/sources/[id]/_Gitlab.svelte
+++ b/src/routes/sources/[id]/_Gitlab.svelte
@@ -121,12 +121,15 @@
<Explainer
customClass="w-full"
- text="<span class='font-bold text-base'>Scopes required:</span>
- <br>- api (Access the authenticated user's API)
- <br>- read_repository (Allows read-only access to the repository)
- <br>- email (Allows read-only access to the user's primary email address using OpenID Connect)
+ text="<span class='font-bold text-base text-white'>Scopes required:</span>
+ <br>- <span class='text-orange-500 font-bold'>api</span> (Access the authenticated user's API)
+ <br>- <span class='text-orange-500 font-bold'>read_repository</span> (Allows read-only access to the repository)
+ <br>- <span class='text-orange-500 font-bold'>email</span> (Allows read-only access to the user's primary email address using OpenID Connect)
<br>
- <br>For extra security, you can add Expire access tokens!"
+ <br>For extra security, you can set Expire access tokens!
+ <br><br>Webhook URL: <span class='text-orange-500 font-bold'>{window.location
+ .origin}/webhooks/gitlab</span>
+ <br>But if you will set a custom domain name for Coolify, use that instead."
/>
</form>
<form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4 pt-10">
diff --git a/src/routes/webhooks/gitlab/index.ts b/src/routes/webhooks/gitlab/index.ts
index 9f953bc88f..f3d930acec 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;