From a5f1b4b6756f857ad198c52c9b3cb6d177dee61b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 9 Apr 2022 13:25:46 +0200 Subject: [PATCH] fix: Enable https for Ghost --- src/lib/database/services.ts | 2 +- src/routes/services/[id]/ghost/start.json.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/database/services.ts b/src/lib/database/services.ts index b4d355946..0aec569b6 100644 --- a/src/lib/database/services.ts +++ b/src/lib/database/services.ts @@ -165,7 +165,7 @@ export async function configureServiceType({ id, type }) { } }); } else if (type === 'ghost') { - const defaultEmail = `${cuid()}@coolify.io`; + const defaultEmail = `${cuid()}@example.com`; const defaultPassword = encrypt(generatePassword()); const mariadbUser = cuid(); const mariadbPassword = encrypt(generatePassword()); diff --git a/src/routes/services/[id]/ghost/start.json.ts b/src/routes/services/[id]/ghost/start.json.ts index 9e0b4ba11..41c5e95d4 100644 --- a/src/routes/services/[id]/ghost/start.json.ts +++ b/src/routes/services/[id]/ghost/start.json.ts @@ -44,12 +44,15 @@ export const post: RequestHandler = async (event) => { const { workdir } = await createDirectories({ repository: type, buildId: id }); const image = getServiceImage(type); const domain = getDomain(fqdn); + const isHttps = fqdn.startsWith('https://'); const config = { ghost: { image: `${image}:${version}`, volume: `${id}-ghost:/bitnami/ghost`, environmentVariables: { + url: fqdn, GHOST_HOST: domain, + GHOST_ENABLE_HTTPS: isHttps ? 'yes' : 'no', GHOST_EMAIL: defaultEmail, GHOST_PASSWORD: defaultPassword, GHOST_DATABASE_HOST: `${id}-mariadb`,