Compare commits

...

2 Commits

Author SHA1 Message Date
darroyo 340370a43b Bump version to 1.0.47 2026-07-17 18:26:26 -04:00
darroyo 743882eb0e Allow remote-to-remote sync pairs 2026-07-17 18:26:19 -04:00
4 changed files with 20 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
BINARY=syncserver
VERSION?=1.0.46
VERSION?=1.0.47
GO?=go
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
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"github.com/syncserver/internal/syncengine"
)
var version = "1.0.46"
var version = "1.0.47"
func main() {
cfgPath := flag.String("config", "", "Path to config.yaml")
+4 -4
View File
@@ -75,8 +75,8 @@ func (h *SyncPairHandler) Create(w http.ResponseWriter, r *http.Request) {
writeError(w, http.StatusBadRequest, "direction must be push, pull, or mirror")
return
}
if req.SourceMachineID != nil && req.DestMachineID != nil {
writeError(w, http.StatusBadRequest, "both source and destination cannot be remote machines; one side must be the server (set one MachineID to null)")
if req.SourceMachineID != nil && req.DestMachineID != nil && *req.SourceMachineID == *req.DestMachineID {
writeError(w, http.StatusBadRequest, "source and destination cannot be the same machine")
return
}
if req.RsyncFlags == "" {
@@ -131,8 +131,8 @@ func (h *SyncPairHandler) Update(w http.ResponseWriter, r *http.Request) {
writeError(w, http.StatusBadRequest, "direction must be push, pull, or mirror")
return
}
if req.SourceMachineID != nil && req.DestMachineID != nil {
writeError(w, http.StatusBadRequest, "both source and destination cannot be remote machines; one side must be the server (set one MachineID to null)")
if req.SourceMachineID != nil && req.DestMachineID != nil && *req.SourceMachineID == *req.DestMachineID {
writeError(w, http.StatusBadRequest, "source and destination cannot be the same machine")
return
}
+14
View File
@@ -111,6 +111,14 @@ export default function SyncPairs() {
toast.error('Source and destination paths are required');
return;
}
if (
form.source_machine_id !== null &&
form.dest_machine_id !== null &&
form.source_machine_id === form.dest_machine_id
) {
toast.error('Source and destination cannot be the same machine');
return;
}
setLoading(true);
try {
await api(form.id ? `/api/sync-pairs/${form.id}` : '/api/sync-pairs', {
@@ -325,6 +333,9 @@ export default function SyncPairs() {
))}
</SelectContent>
</Select>
<p className="text-xs text-fg-subtle">
Where the data lives. Pick <span className="font-medium">Local server</span> if it&apos;s on this machine, otherwise the remote machine holding the data.
</p>
</div>
<div className="space-y-1.5">
<Label htmlFor="sp-dest-machine">Dest Machine</Label>
@@ -346,6 +357,9 @@ export default function SyncPairs() {
))}
</SelectContent>
</Select>
<p className="text-xs text-fg-subtle">
Where to copy the data. Can be the same machine (no-op) or any remote. Remote-to-remote is supported.
</p>
</div>
</div>
<div className="grid grid-cols-2 gap-3">