Compare commits

..

2 Commits

3 changed files with 27 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
BINARY=syncserver BINARY=syncserver
VERSION?=1.0.48 VERSION?=1.0.49
GO?=go GO?=go
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
BUILD_FLAGS=CGO_ENABLED=0 BUILD_FLAGS=CGO_ENABLED=0
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"github.com/syncserver/internal/syncengine" "github.com/syncserver/internal/syncengine"
) )
var version = "1.0.48" var version = "1.0.49"
func main() { func main() {
cfgPath := flag.String("config", "", "Path to config.yaml") cfgPath := flag.String("config", "", "Path to config.yaml")
+25 -3
View File
@@ -26,7 +26,7 @@ import {
import { EmptyState } from '@/components/ui/EmptyState'; import { EmptyState } from '@/components/ui/EmptyState';
import { Badge } from '@/components/ui/Badge'; import { Badge } from '@/components/ui/Badge';
import { Card } from '@/components/ui/Card'; import { Card } from '@/components/ui/Card';
import { Play, Trash2, Plus, GitCompare, ArrowRight, ArrowLeft, Pencil } from 'lucide-react'; import { Play, Trash2, Plus, GitCompare, ArrowRight, ArrowLeft, Pencil, AlertTriangle } from 'lucide-react';
import { toast } from 'sonner'; import { toast } from 'sonner';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
@@ -295,8 +295,8 @@ export default function SyncPairs() {
<ModalTitle>{form.id ? 'Edit Sync Pair' : 'Add Sync Pair'}</ModalTitle> <ModalTitle>{form.id ? 'Edit Sync Pair' : 'Add Sync Pair'}</ModalTitle>
<ModalDescription> <ModalDescription>
{form.id {form.id
? 'Update the configuration for this sync pair' ? 'Update this sync pair. Direction: push (src→dst), pull (dst←src), or mirror (push + --delete).'
: 'Define a new source and destination for data syncing'} : 'Define source and destination for data syncing. Pick a direction: push (src→dst), pull (dst←src), or mirror (push + --delete).'}
</ModalDescription> </ModalDescription>
</ModalHeader> </ModalHeader>
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
@@ -414,6 +414,12 @@ export default function SyncPairs() {
<SelectItem value="mirror">Mirror</SelectItem> <SelectItem value="mirror">Mirror</SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
<p className="text-xs text-fg-subtle">
<span className="font-medium">Push</span> copies source destination.{' '}
<span className="font-medium">Pull</span> reverses it (dest source).{' '}
<span className="font-medium">Mirror</span> is like push but adds{' '}
<code className="font-mono">--delete</code> (see warning).
</p>
</div> </div>
<div className="space-y-1.5"> <div className="space-y-1.5">
<Label htmlFor="sp-rsync-flags">Rsync Flags</Label> <Label htmlFor="sp-rsync-flags">Rsync Flags</Label>
@@ -427,6 +433,22 @@ export default function SyncPairs() {
/> />
</div> </div>
</div> </div>
{form.direction === 'mirror' && (
<div
role="alert"
className="flex items-start gap-2 rounded-card p-3 bg-amber-500/10 border border-amber-500/30"
>
<AlertTriangle className="h-4 w-4 text-amber-400 shrink-0 mt-0.5" />
<div className="text-xs text-amber-200 leading-relaxed">
<span className="font-semibold">Mirror will delete files.</span>{' '}
With <code className="font-mono">--delete</code>, any file in the
destination that doesn&apos;t exist in the source is permanently
removed. Double-check both paths before saving a wrong
destination (e.g. <code className="font-mono">/</code> or{' '}
<code className="font-mono">/home</code>) can wipe data.
</div>
</div>
)}
<div className="space-y-1.5"> <div className="space-y-1.5">
<Label htmlFor="sp-exclude">Exclude Patterns</Label> <Label htmlFor="sp-exclude">Exclude Patterns</Label>
<Textarea <Textarea