backup engine fixes: shared-repo unlock, non-root uid reads, lock release, local-path repo, backblaze key id

This commit is contained in:
jarek committed 2026-07-31 10:10:55 +02:00
1 parent e700b5b6aa
commit e3c07f32da
15 files changed
+375 -313

No files matched your search

@@ -11,20 +11,22 @@
* local-on-remote disabling.
*/
import * as Select from '$lib/components/ui/select';
import { getRepoTypeIcon, isLocalRepo } from '$lib/utils/backup';
import { getRepoTypeIcon, localRepoNeedsSameHost } from '$lib/utils/backup';
interface Destination {
id: number;
name: string;
repository: string;
hostPath?: string | null;
}
interface Props {
destinations: Destination[];
/** Bound to the selected destination id. 0 = nothing selected. */
value: number;
/** Set to true on a remote environment to disable local-path destinations. */
disableLocalForRemoteEnv?: boolean;
/** The target environment. A local-path destination is disabled for a
* remote env unless it declares a hostPath. Omit for a local/socket env. */
env?: { connectionType?: string | null; host?: string | null } | null;
/** CSS class for the trigger. Defaults to full width. */
triggerClass?: string;
placeholder?: string;
@@ -33,7 +35,7 @@
let {
destinations,
value = $bindable(),
disableLocalForRemoteEnv = false,
env,
triggerClass = 'h-9 w-full',
placeholder = 'Select repository...'
}: Props = $props();
@@ -60,23 +62,16 @@
<Select.Content>
{#each destinations as dest}
{@const DIcon = getRepoTypeIcon(dest.repository)}
{@const localOnRemote = disableLocalForRemoteEnv && isLocalRepo(dest.repository)}
{#if localOnRemote}
<Select.Item value={String(dest.id)} disabled>
<span class="flex items-center gap-2 opacity-50">
<DIcon class="w-4 h-4 text-muted-foreground" />
{dest.name}
<span class="text-xs text-muted-foreground">— local</span>
</span>
</Select.Item>
{:else}
<Select.Item value={String(dest.id)}>
<span class="flex items-center gap-2">
<DIcon class="w-4 h-4 text-muted-foreground" />
{dest.name}
</span>
</Select.Item>
{/if}
{@const localOnRemote = localRepoNeedsSameHost(dest, env)}
<Select.Item value={String(dest.id)}>
<span class="flex items-center gap-2">
<DIcon class="w-4 h-4 text-muted-foreground" />
{dest.name}
{#if localOnRemote}
<span class="rounded-full bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-600 dark:text-amber-400" title="A local-path repo only works if this environment's Docker daemon is on the same host as Dockhand.">needs same host</span>
{/if}
</span>
</Select.Item>
{/each}
</Select.Content>
</Select.Root>