diff --git a/Makefile b/Makefile index 4baa1d3..5b5dab2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BINARY=syncserver -VERSION?=1.0.19 +VERSION?=1.0.20 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 diff --git a/cmd/server/main.go b/cmd/server/main.go index b0d49a9..afa5af3 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -20,7 +20,7 @@ import ( "github.com/syncserver/internal/syncengine" ) -var version = "1.0.19" +var version = "1.0.20" func main() { cfgPath := flag.String("config", "", "Path to config.yaml") diff --git a/internal/syncengine/rsync_runner.go b/internal/syncengine/rsync_runner.go index a8d87f7..e71fafe 100644 --- a/internal/syncengine/rsync_runner.go +++ b/internal/syncengine/rsync_runner.go @@ -172,8 +172,8 @@ func (r *RsyncRunner) RunRemote(ctx context.Context, pair *SyncPairConfig, remot if remote.DestPrivKey != "" { encodedKey := base64.StdEncoding.EncodeToString([]byte(remote.DestPrivKey)) innerSSH := fmt.Sprintf(`ssh -i /tmp/syncserver-dest-key -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null`) - rsyncPart := fmt.Sprintf("rsync %s -e %q %s %s", - strings.Join(args, " "), innerSSH, pair.Source, pair.Dest) + rsyncPart := fmt.Sprintf("rsync %s -e %q", + strings.Join(args, " "), innerSSH) remoteCmd = fmt.Sprintf( `echo '%s' | base64 -d > /tmp/syncserver-dest-key && chmod 600 /tmp/syncserver-dest-key && %s; STATUS=$?; rm -f /tmp/syncserver-dest-key; exit $STATUS`, encodedKey, rsyncPart)