From 3e8a8364dcb19418b0eafaa3a07f3b379f973e83 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 6 Apr 2022 22:01:41 +0200 Subject: [PATCH] feat: Basic white labeled version --- src/app.d.ts | 3 +-- src/app.html | 1 - src/hooks.ts | 3 +++ src/routes/__layout.svelte | 16 +++++++++++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app.d.ts b/src/app.d.ts index 0557299b9..a88bd7502 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -19,14 +19,13 @@ declare namespace App { } interface SessionData { + whiteLabeled: boolean; version?: string; userId?: string | null; teamId?: string | null; permission?: string; isAdmin?: boolean; expires?: string | null; - gitlabToken?: string | null; - ghToken?: string | null; } type DateTimeFormatOptions = { diff --git a/src/app.html b/src/app.html index 2dc97f37d..a0336e87d 100644 --- a/src/app.html +++ b/src/app.html @@ -2,7 +2,6 @@ - Coolify %svelte.head% diff --git a/src/hooks.ts b/src/hooks.ts index d6c6eca6d..c72c7fd6c 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -7,6 +7,8 @@ import { version } from '$lib/common'; import cookie from 'cookie'; import { dev } from '$app/env'; +const whiteLabeled = process.env['COOLIFY_WHITE_LABELED'] === 'true'; + export const handle = handleSession( { secret: process.env['COOLIFY_SECRET_KEY'], @@ -71,6 +73,7 @@ export const handle = handleSession( export const getSession: GetSession = function ({ locals }) { return { version, + whiteLabeled, ...locals.session.data }; }; diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index ce9cd7c0f..8d5922450 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -134,13 +134,18 @@ Coolify + {#if !$session.whiteLabeled} + + {/if} {#if $session.userId} + {#if $session.whiteLabeled} + Powered by Coolify + {/if} +