Allow remote-to-remote sync pairs

This commit is contained in:
2026-07-17 18:26:19 -04:00
parent 0437a7b248
commit 743882eb0e
2 changed files with 18 additions and 4 deletions
+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
}