diff --git a/src/lib/components/ServiceLinks.svelte b/src/lib/components/ServiceLinks.svelte index a3b4ce2cd..980505119 100644 --- a/src/lib/components/ServiceLinks.svelte +++ b/src/lib/components/ServiceLinks.svelte @@ -6,6 +6,7 @@ import N8n from './svg/services/N8n.svelte'; import NocoDb from './svg/services/NocoDB.svelte'; import PlausibleAnalytics from './svg/services/PlausibleAnalytics.svelte'; + import Umami from './svg/services/Umami.svelte'; import UptimeKuma from './svg/services/UptimeKuma.svelte'; import VaultWarden from './svg/services/VaultWarden.svelte'; import VsCodeServer from './svg/services/VSCodeServer.svelte'; @@ -52,4 +53,8 @@ +{:else if service.type === 'umami'} + + + {/if} diff --git a/src/lib/components/svg/services/Umami.svelte b/src/lib/components/svg/services/Umami.svelte new file mode 100644 index 000000000..ac0df85af --- /dev/null +++ b/src/lib/components/svg/services/Umami.svelte @@ -0,0 +1,85 @@ + + + + Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + diff --git a/src/routes/applications/[id]/__layout.svelte b/src/routes/applications/[id]/__layout.svelte index 2a09bfd1d..bf634edde 100644 --- a/src/routes/applications/[id]/__layout.svelte +++ b/src/routes/applications/[id]/__layout.svelte @@ -401,10 +401,10 @@ class:bg-coolgray-500={$page.url.pathname === `/applications/${id}/logs`} > diff --git a/src/routes/services/[id]/umami/start.json.ts b/src/routes/services/[id]/umami/start.json.ts index eb29e65a8..6a51e5cde 100644 --- a/src/routes/services/[id]/umami/start.json.ts +++ b/src/routes/services/[id]/umami/start.json.ts @@ -3,10 +3,11 @@ import * as db from '$lib/database'; import { promises as fs } from 'fs'; import yaml from 'js-yaml'; import type { RequestHandler } from '@sveltejs/kit'; -import { ErrorHandler, getFreePort, getServiceImage } from '$lib/database'; +import { ErrorHandler, getServiceImage } from '$lib/database'; import { makeLabelForServices } from '$lib/buildPacks/common'; import type { ComposeFile } from '$lib/types/composeFile'; -import type { Service, DestinationDocker, ServiceSecret, Prisma } from '@prisma/client'; +import type { Service, DestinationDocker, Prisma } from '@prisma/client'; +import bcrypt from 'bcryptjs'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); @@ -61,7 +62,7 @@ export const post: RequestHandler = async (event) => { config.umami.environmentVariables[secret.name] = secret.value; }); } - console.log(umamiAdminPassword); + const initDbSQL = ` drop table if exists event; drop table if exists pageview; @@ -136,7 +137,10 @@ export const post: RequestHandler = async (event) => { create index event_website_id_idx on event(website_id); create index event_session_id_idx on event(session_id); - insert into account (username, password, is_admin) values ('admin', '$2b$10$BUli0c.muyCW1ErNJc3jL.vFRFtFJWrT8/GcR4A.sUdCznaXiqFXa', true);`; + insert into account (username, password, is_admin) values ('admin', '${bcrypt.hashSync( + umamiAdminPassword, + 10 + )}', true);`; await fs.writeFile(`${workdir}/schema.postgresql.sql`, initDbSQL); const Dockerfile = ` FROM ${config.postgresql.image} diff --git a/src/routes/services/index.svelte b/src/routes/services/index.svelte index c5f6dea5f..fd784d049 100644 --- a/src/routes/services/index.svelte +++ b/src/routes/services/index.svelte @@ -15,6 +15,7 @@ import MeiliSearch from '$lib/components/svg/services/MeiliSearch.svelte'; import { session } from '$app/stores'; import { getDomain } from '$lib/components/common'; + import Umami from '$lib/components/svg/services/Umami.svelte'; export let services; async function newService() { @@ -86,6 +87,8 @@ {:else if service.type === 'meilisearch'} + {:else if service.type === 'umami'} + {/if}
{service.name} @@ -133,6 +136,8 @@ {:else if service.type === 'meilisearch'} + {:else if service.type === 'umami'} + {/if}
{service.name}