Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
refactor: add gravatar enabled setting
Kyle Mendelle2c88aff0ab3
diff --git a/.github/workflows/build-1.0-preview-image.yml b/.github/workflows/build-1.0-preview-image.ymlindex d8ccaea7f..83ae78440 100644--- a/.github/workflows/build-1.0-preview-image.yml+++ b/.github/workflows/build-1.0-preview-image.yml@@ -34,11 +34,9 @@ jobs:uses: pnpm/action-setup@v4- name: Setup Node.js- uses: actions/setup-node@v4+ uses: actions/setup-node@v5with:node-version: 24- cache: pnpm- cache-dependency-path: pnpm-lock.yaml- name: Install frontend dependenciesrun: pnpm -C frontend install --frozen-lockfilediff --git a/.github/workflows/build-next.yml b/.github/workflows/build-next.ymlindex 307b315bb..a149e4eed 100644--- a/.github/workflows/build-next.yml+++ b/.github/workflows/build-next.yml@@ -25,11 +25,9 @@ jobs:uses: pnpm/action-setup@v4- name: Setup Node.js- uses: actions/setup-node@v4+ uses: actions/setup-node@v5with:node-version: 24- cache: 'pnpm'- cache-dependency-path: pnpm-lock.yaml- name: Setup Gouses: actions/setup-go@v5diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.ymlindex 4c7c8a135..13d59a508 100644--- a/.github/workflows/e2e-tests.yml+++ b/.github/workflows/e2e-tests.yml@@ -74,11 +74,10 @@ jobs:- name: Setup pnpmuses: pnpm/action-setup@v4- - uses: actions/setup-node@v4+ - name: Setup Node.js+ uses: actions/setup-node@v5with:node-version: 24- cache: 'pnpm'- cache-dependency-path: pnpm-lock.yaml- name: Cache Playwright Browsersuses: actions/cache@v3diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 00edd2ca0..55f2a32b1 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -28,11 +28,9 @@ jobs:uses: pnpm/action-setup@v4- name: Setup Node.js- uses: actions/setup-node@v4+ uses: actions/setup-node@v5with:node-version: 24- cache: pnpm- cache-dependency-path: pnpm-lock.yaml- name: Install frontend depsrun: pnpm -C frontend install --frozen-lockfilediff --git a/.github/workflows/svelte-check.yml b/.github/workflows/svelte-check.ymlindex 4b4f723ba..fe38e7060 100644--- a/.github/workflows/svelte-check.yml+++ b/.github/workflows/svelte-check.yml@@ -42,11 +42,9 @@ jobs:uses: pnpm/action-setup@v4- name: Setup Node.js- uses: actions/setup-node@v4+ uses: actions/setup-node@v5with:node-version: 24- cache: 'pnpm'- cache-dependency-path: pnpm-lock.yaml- name: Install dependenciesrun: pnpm --filter arcane-frontend install --frozen-lockfilediff --git a/backend/internal/dto/settings_dto.go b/backend/internal/dto/settings_dto.goindex 28f9430cc..9ea00e3ad 100644--- a/backend/internal/dto/settings_dto.go+++ b/backend/internal/dto/settings_dto.go@@ -20,6 +20,7 @@ type UpdateSettingsDto struct {PollingInterval *string `json:"pollingInterval,omitempty"`PruneMode *string `json:"dockerPruneMode,omitempty" binding:"omitempty,oneof=all dangling"`BaseServerURL *string `json:"baseServerUrl,omitempty"`+ EnableGravatar *string `json:"enableGravatar,omitempty"`// Authentication settingsAuthLocalEnabled *string `json:"authLocalEnabled,omitempty"`diff --git a/backend/internal/models/settings.go b/backend/internal/models/settings.goindex 2fe3c823d..cec5cf256 100644--- a/backend/internal/models/settings.go+++ b/backend/internal/models/settings.go@@ -51,6 +51,7 @@ type Settings struct {PollingInterval SettingVariable `key:"pollingInterval"`PruneMode SettingVariable `key:"dockerPruneMode"`BaseServerURL SettingVariable `key:"baseServerUrl"`+ EnableGravatar SettingVariable `key:"enableGravatar"`// AuthenticationAuthLocalEnabled SettingVariable `key:"authLocalEnabled,public"`diff --git a/backend/internal/services/settings_service.go b/backend/internal/services/settings_service.goindex 9c403ecf2..7d1180958 100644--- a/backend/internal/services/settings_service.go+++ b/backend/internal/services/settings_service.go@@ -60,6 +60,7 @@ func (s *SettingsService) getDefaultSettings() *models.Settings {PollingInterval: models.SettingVariable{Value: "300"},PruneMode: models.SettingVariable{Value: "dangling"},BaseServerURL: models.SettingVariable{Value: ""},+ EnableGravatar: models.SettingVariable{Value: "true"},// Authentication settingsAuthLocalEnabled: models.SettingVariable{Value: "true"},diff --git a/frontend/src/lib/components/sidebar/sidebar-itemgroup.svelte b/frontend/src/lib/components/sidebar/sidebar-itemgroup.svelteindex 0af851d96..031807810 100644--- a/frontend/src/lib/components/sidebar/sidebar-itemgroup.svelte+++ b/frontend/src/lib/components/sidebar/sidebar-itemgroup.svelte@@ -22,17 +22,14 @@}[];} = $props();- // Helper function to check if a URL is activefunction isActiveItem(url: string): boolean {return page.url.pathname === url || (page.url.pathname.startsWith(url) && url !== '/');}- // Helper function to check if any child items are activefunction hasActiveChild(items?: { url: string }[]): boolean {return items?.some((child) => isActiveItem(child.url)) ?? false;}- // Transform items to include isActive stateconst enhancedItems = $derived(items.map((item) => {const isItemActive = isActiveItem(item.url);diff --git a/frontend/src/lib/components/sidebar/sidebar-user.svelte b/frontend/src/lib/components/sidebar/sidebar-user.svelteindex bc5bdfd1f..fdf6370c5 100644--- a/frontend/src/lib/components/sidebar/sidebar-user.svelte+++ b/frontend/src/lib/components/sidebar/sidebar-user.svelte@@ -5,18 +5,17 @@import * as Button from '$lib/components/ui/button/index.js';import { useSidebar } from '$lib/components/ui/sidebar/index.js';import type { User } from '$lib/types/user.type';- import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';import LogOutIcon from '@lucide/svelte/icons/log-out';import Sun from '@lucide/svelte/icons/sun';import Moon from '@lucide/svelte/icons/moon';import { mode, toggleMode } from 'mode-watcher';import { cn } from '$lib/utils';+ import settingsStore from '$lib/stores/config-store';let { user, isCollapsed }: { user: User; isCollapsed: boolean } = $props();const sidebar = useSidebar();- // Generate Gravatar URL using SHA-256- async function getGravatarUrl(email: string, size = 40): Promise<string> {+ async function getGravatarUrl(email: string | undefined, size = 40): Promise<string> {if (!email) return '';const encoder = new TextEncoder();@@ -25,119 +24,196 @@const hashArray = Array.from(new Uint8Array(hashBuffer));const hash = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');- // Use Gravatar's SHA-256 endpointreturn `https://www.gravatar.com/avatar/${hash}?s=${size}`;}-- let gravatarUrl = $state('');- $effect(() => {- if (user?.email) {- getGravatarUrl(user.email).then((url) => {- gravatarUrl = url;- });- } else {- gravatarUrl = '';- }- });</script><Sidebar.Menu><Sidebar.MenuItem>- <DropdownMenu.Root>- <DropdownMenu.Trigger>- {#snippet child({ props })}- <Sidebar.MenuButton- size="lg"- class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"- {...props}- >- {#if user && user.displayName}+ {#if isCollapsed}+ <DropdownMenu.Root>+ <DropdownMenu.Trigger>+ {#snippet child({ props })}+ <Sidebar.MenuButton+ size="lg"+ class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"+ {...props}+ >+ {#if user && user.displayName}+ <Avatar.Root class="size-8 rounded-lg">+ {#if $settingsStore.enableGravatar}+ {#await getGravatarUrl(user?.email)}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {:then url}+ <Avatar.Image src={url || '/img/profile.jpg'} alt={user.displayName} />+ {:catch _}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/await}+ {:else}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/if}+ <Avatar.Fallback+ class="from-primary/20 to-primary/10 text-primary border-primary/20 rounded-lg border bg-gradient-to-br"+ >+ {user.displayName?.charAt(0).toUpperCase()}+ </Avatar.Fallback>+ </Avatar.Root>+ {#if !isCollapsed}+ <div class="grid flex-1 pl-0 text-left text-sm leading-tight">+ <span class="truncate font-medium">{user.displayName}</span>+ <span class="truncate text-xs">{user.email}</span>+ </div>+ {/if}+ {/if}+ </Sidebar.MenuButton>+ {/snippet}+ </DropdownMenu.Trigger>+ <DropdownMenu.Content+ class="w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg"+ side={sidebar.isMobile ? 'bottom' : 'right'}+ align="end"+ sideOffset={12}+ >+ <DropdownMenu.Label class="p-0 font-normal">+ <div class="flex items-center gap-2 py-1.5 text-left text-sm"><Avatar.Root class="size-8 rounded-lg">- <Avatar.Image src={gravatarUrl} alt={user.displayName} />+ {#if $settingsStore.enableGravatar}+ {#await getGravatarUrl(user?.email)}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {:then url}+ <Avatar.Image src={url || '/img/profile.jpg'} alt={user.displayName} />+ {:catch _}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/await}+ {:else}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/if}<Avatar.Fallbackclass="from-primary/20 to-primary/10 text-primary border-primary/20 rounded-lg border bg-gradient-to-br">{user.displayName?.charAt(0).toUpperCase()}</Avatar.Fallback></Avatar.Root>- {#if !isCollapsed}- <div class="grid flex-1 text-left text-sm leading-tight">- <span class="truncate font-medium">{user.displayName}</span>- <span class="truncate text-xs">{user.email}</span>- </div>- <ChevronsUpDownIcon class="ml-auto size-4" />+ <div class="grid flex-1 text-left text-sm leading-tight">+ <span class="truncate font-medium">{user.displayName}</span>+ <span class="truncate text-xs">{user.email}</span>+ </div>+ </div>+ </DropdownMenu.Label>+ <DropdownMenu.Separator />+ <DropdownMenu.Group>+ <Button.Root+ variant="ghost"+ class={cn(+ 'text-muted-foreground hover:from-muted/80 hover:to-muted/60 hover:text-foreground mb-1 flex w-full items-center rounded-xl text-sm font-medium transition-all duration-200 hover:bg-gradient-to-br',+ 'hover:scale-[1.02] hover:shadow-md active:scale-[0.98]',+ isCollapsed ? 'h-11 justify-center px-2 py-3' : 'h-11 justify-start gap-3 px-3 py-2.5'+ )}+ title={isCollapsed ? 'Toggle theme' : undefined}+ onclick={toggleMode}+ >+ <div class="group-hover:bg-muted-foreground/10 rounded-lg bg-transparent p-1 transition-colors duration-200">+ {#if mode.current === 'dark'}+ <Sun size={16} class="transition-transform duration-200" />+ {:else}+ <Moon size={16} class="transition-transform duration-200" />+ {/if}+ </div>+ {#if isCollapsed}+ <span class="font-medium">Toggle theme</span>{/if}- {/if}- </Sidebar.MenuButton>- {/snippet}- </DropdownMenu.Trigger>- <DropdownMenu.Content- class="w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg"- side={sidebar.isMobile ? 'bottom' : 'right'}- align="end"- sideOffset={4}- >- <DropdownMenu.Label class="p-0 font-normal">- <div class="flex items-center gap-2 px-1 py-1.5 text-left text-sm">+ </Button.Root>+ </DropdownMenu.Group>+ <DropdownMenu.Separator />+ <form action="/auth/logout" method="POST">+ <Button.Root+ variant="ghost"+ class={cn(+ 'text-muted-foreground flex w-full items-center rounded-xl text-sm font-medium transition-all duration-200',+ 'hover:from-destructive/10 hover:to-destructive/5 hover:text-destructive hover:scale-[1.02] hover:bg-gradient-to-br hover:shadow-md active:scale-[0.98]',+ isCollapsed ? 'h-11 justify-center px-2 py-3' : 'h-11 justify-start gap-3 px-3 py-2.5'+ )}+ title={isCollapsed ? 'Logout' : undefined}+ type="submit"+ >+ <div class="group-hover:bg-destructive/10 rounded-lg bg-transparent p-1 transition-colors duration-200">+ <LogOutIcon size={16} class="transition-transform duration-200" />+ </div>+ {#if isCollapsed}+ <span class="font-medium">Logout</span>+ {/if}+ </Button.Root>+ </form>+ </DropdownMenu.Content>+ </DropdownMenu.Root>+ {:else}+ <div class="flex w-full items-center gap-2">+ <Sidebar.MenuButton+ size="lg"+ class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground flex-1"+ >+ {#if user && user.displayName}<Avatar.Root class="size-8 rounded-lg">- <Avatar.Image src={gravatarUrl} alt={user.displayName} />+ {#if $settingsStore.enableGravatar}+ {#await getGravatarUrl(user?.email)}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {:then url}+ <Avatar.Image src={url || '/img/profile.jpg'} alt={user.displayName} />+ {:catch _}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/await}+ {:else}+ <Avatar.Image src="/img/profile.jpg" alt={user.displayName} />+ {/if}<Avatar.Fallbackclass="from-primary/20 to-primary/10 text-primary border-primary/20 rounded-lg border bg-gradient-to-br">{user.displayName?.charAt(0).toUpperCase()}</Avatar.Fallback></Avatar.Root>- <div class="grid flex-1 text-left text-sm leading-tight">- <span class="truncate font-medium">{user.displayName}</span>- <span class="truncate text-xs">{user.email}</span>- </div>- </div>- </DropdownMenu.Label>- <DropdownMenu.Separator />- <DropdownMenu.Group>- <Button.Root- variant="ghost"- class={cn(- 'text-muted-foreground hover:from-muted/80 hover:to-muted/60 hover:text-foreground mb-1 flex w-full items-center rounded-xl text-sm font-medium transition-all duration-200 hover:bg-gradient-to-br',- 'hover:scale-[1.02] hover:shadow-md active:scale-[0.98]',- isCollapsed ? 'h-11 justify-center px-2 py-3' : 'h-11 justify-start gap-3 px-3 py-2.5'- )}- title={isCollapsed ? 'Toggle theme' : undefined}- onclick={toggleMode}- >- <div class="group-hover:bg-muted-foreground/10 rounded-lg bg-transparent p-1 transition-colors duration-200">- {#if mode.current === 'dark'}- <Sun size={16} class="transition-transform duration-200" />- {:else}- <Moon size={16} class="transition-transform duration-200" />- {/if}- </div>{#if !isCollapsed}- <span class="font-medium">Toggle theme</span>+ <div class="grid flex-1 text-left text-sm leading-tight">+ <span class="truncate font-medium">{user.displayName}</span>+ <span class="truncate text-xs">{user.email}</span>+ </div>{/if}- </Button.Root>- </DropdownMenu.Group>- <DropdownMenu.Separator />+ {/if}+ </Sidebar.MenuButton>++ <Button.Root+ variant="ghost"+ class={cn(+ 'text-muted-foreground hover:from-muted/80 hover:to-muted/60 hover:text-foreground rounded-xl transition-all duration-200 hover:bg-gradient-to-br',+ 'h-11 px-2 py-3 hover:scale-[1.02] hover:shadow-md active:scale-[0.98]'+ )}+ title="Toggle theme"+ onclick={toggleMode}+ >+ <div class="group-hover:bg-muted-foreground/10 rounded-lg bg-transparent p-1 transition-colors duration-200">+ {#if mode.current === 'dark'}+ <Sun size={16} class="transition-transform duration-200" />+ {:else}+ <Moon size={16} class="transition-transform duration-200" />+ {/if}+ </div>+ </Button.Root>+<form action="/auth/logout" method="POST"><Button.Rootvariant="ghost"class={cn(- 'text-muted-foreground flex w-full items-center rounded-xl text-sm font-medium transition-all duration-200',- 'hover:from-destructive/10 hover:to-destructive/5 hover:text-destructive hover:scale-[1.02] hover:bg-gradient-to-br hover:shadow-md active:scale-[0.98]',- isCollapsed ? 'h-11 justify-center px-2 py-3' : 'h-11 justify-start gap-3 px-3 py-2.5'+ 'text-muted-foreground rounded-xl text-sm font-medium transition-all duration-200',+ 'hover:from-destructive/10 hover:to-destructive/5 hover:text-destructive h-11 px-2 py-3 hover:scale-[1.02] hover:bg-gradient-to-br hover:shadow-md active:scale-[0.98]')}- title={isCollapsed ? 'Logout' : undefined}+ title="Logout"type="submit"><div class="group-hover:bg-destructive/10 rounded-lg bg-transparent p-1 transition-colors duration-200"><LogOutIcon size={16} class="transition-transform duration-200" /></div>- {#if !isCollapsed}- <span class="font-medium">Logout</span>- {/if}</Button.Root></form>- </DropdownMenu.Content>- </DropdownMenu.Root>+ </div>+ {/if}</Sidebar.MenuItem></Sidebar.Menu>diff --git a/frontend/src/lib/components/sidebar/sidebar.svelte b/frontend/src/lib/components/sidebar/sidebar.svelteindex fd35ccab1..fc79f3e7e 100644--- a/frontend/src/lib/components/sidebar/sidebar.svelte+++ b/frontend/src/lib/components/sidebar/sidebar.svelte@@ -28,7 +28,6 @@const sidebar = useSidebar();- // Fallback to global user store so the user block appears immediately after loginlet storeUser: User | null = $state(null);$effect(() => {const unsub = userStore.subscribe((u) => (storeUser = u));@@ -36,8 +35,6 @@});const effectiveUser = $derived(user ?? storeUser);- console.log('USEROBJECT: ', user);-const isCollapsed = $derived(sidebar.state === 'collapsed');</script>diff --git a/frontend/src/lib/types/settings.type.ts b/frontend/src/lib/types/settings.type.tsindex bad1d5572..ca948df79 100644--- a/frontend/src/lib/types/settings.type.ts+++ b/frontend/src/lib/types/settings.type.ts@@ -13,6 +13,7 @@ export type Settings = {pollingInterval: number;dockerPruneMode: 'all' | 'dangling';baseServerUrl: string;+ enableGravatar: boolean;authLocalEnabled: boolean;authOidcEnabled: boolean;diff --git a/frontend/src/routes/compose/new/+page.svelte b/frontend/src/routes/compose/new/+page.svelteindex 0dd794a29..3636c7820 100644--- a/frontend/src/routes/compose/new/+page.svelte+++ b/frontend/src/routes/compose/new/+page.svelte@@ -146,7 +146,7 @@</Button><div class="bg-border h-4 w-px"></div><div class="flex items-center gap-2">- <h1 class="text-lg leading-none font-semibold">Create New Project</h1>+ <h1 class="text-lg font-semibold leading-none">Create New Project</h1></div></div>@@ -179,7 +179,7 @@type="button"variant="ghost"size="sm"- class="h-auto w-full justify-start p-2 text-left font-mono text-xs break-all whitespace-normal"+ class="h-auto w-full justify-start whitespace-normal break-all p-2 text-left font-mono text-xs"onclick={() => useExample(command)}><CopyIcon class="mr-2 size-3 shrink-0" />diff --git a/frontend/src/routes/settings/forms/general-settings-form.svelte b/frontend/src/routes/settings/forms/general-settings-form.svelteindex 33c3e9d39..317705d64 100644--- a/frontend/src/routes/settings/forms/general-settings-form.svelte+++ b/frontend/src/routes/settings/forms/general-settings-form.svelte@@ -6,6 +6,7 @@import FormInput from '$lib/components/form/form-input.svelte';import type { Settings } from '$lib/types/settings.type';import { toast } from 'svelte-sonner';+ import SwitchWithLabel from '$lib/components/form/labeled-switch.svelte';let {settings,@@ -19,7 +20,8 @@const formSchema = z.object({stacksDirectory: z.string().min(1, 'Projects directory is required'),- baseServerUrl: z.string().min(1, 'Base server URL is required')+ baseServerUrl: z.string().min(1, 'Base server URL is required'),+ enableGravatar: z.boolean()});let { inputs: formInputs, ...form } = $derived(createForm<typeof formSchema>(formSchema, settings));@@ -38,8 +40,13 @@<form onsubmit={preventDefault(onSubmit)} class="space-y-6"><div class="w-full p-6"><FieldSet.Root>- <FieldSet.Content class="flex flex-col gap-8">- <div class="min-w-0 space-y-4">+ <FieldSet.Content class="grid grid-cols-1 gap-6 md:grid-cols-2">+ <div class="bg-background/40 min-w-0 space-y-4 rounded-lg border p-5 shadow-sm">+ <div class="space-y-1">+ <h3 class="text-base font-medium">Project Paths</h3>+ <p class="text-muted-foreground text-sm">Configure where Arcane looks for your Compose files.</p>+ </div>+<FormInputlabel="Projects Directory"placeholder="data/projects"@@ -51,7 +58,21 @@label="Base Server URL"placeholder="localhost"bind:input={$formInputs.baseServerUrl}- helpText="Base URL for accessing Arcane (used for webhooks and notifications)"+ helpText="The Base URL for your docker host. Used when opening containers from the service links"+ />+ </div>++ <div class="bg-background/40 min-w-0 space-y-4 rounded-lg border p-5 shadow-sm">+ <div class="space-y-1">+ <h3 class="text-base font-medium">User Avatars</h3>+ <p class="text-muted-foreground text-sm">Control Gravatar usage for profile images.</p>+ </div>++ <SwitchWithLabel+ id="enableGravatar"+ label="Enable Gravatar"+ description="Whether to use Gravatar-based avatars for user accounts"+ bind:checked={$formInputs.enableGravatar.value}/></div></FieldSet.Content>diff --git a/frontend/static/img/profile.jpg b/frontend/static/img/profile.jpgnew file mode 100644index 000000000..c91545ac3Binary files /dev/null and b/frontend/static/img/profile.jpg differdiff --git a/frontend/vite.config.ts b/frontend/vite.config.tsindex 0a3a257d3..e3131daca 100644--- a/frontend/vite.config.ts+++ b/frontend/vite.config.ts@@ -3,6 +3,9 @@ import { sveltekit } from '@sveltejs/kit/vite';import { defineConfig } from 'vite';export default defineConfig({+ optimizeDeps: {+ exclude: ['@lucide/svelte']+ },plugins: [tailwindcss(), sveltekit()],server: {host: process.env.HOST,