Bump version to 1.0.19
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
BINARY=syncserver
|
BINARY=syncserver
|
||||||
VERSION?=1.0.18
|
VERSION?=1.0.19
|
||||||
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
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/syncserver/internal/syncengine"
|
"github.com/syncserver/internal/syncengine"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.0.18"
|
var version = "1.0.19"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cfgPath := flag.String("config", "", "Path to config.yaml")
|
cfgPath := flag.String("config", "", "Path to config.yaml")
|
||||||
|
|||||||
@@ -157,29 +157,6 @@ func (r *RsyncRunner) buildArgs(pair *SyncPairConfig) []string {
|
|||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RsyncRunner) buildRemoteArgs(pair *SyncPairConfig) []string {
|
|
||||||
var args []string
|
|
||||||
|
|
||||||
flags := strings.Fields(pair.RsyncFlags)
|
|
||||||
args = append(args, flags...)
|
|
||||||
|
|
||||||
for _, pattern := range pair.ExcludePatterns {
|
|
||||||
args = append(args, "--exclude="+pattern)
|
|
||||||
}
|
|
||||||
|
|
||||||
if pair.Direction == "mirror" {
|
|
||||||
args = append(args, "--delete")
|
|
||||||
}
|
|
||||||
|
|
||||||
if pair.Direction == "pull" {
|
|
||||||
args = append(args, pair.Dest, pair.Source)
|
|
||||||
} else {
|
|
||||||
args = append(args, pair.Source, pair.Dest)
|
|
||||||
}
|
|
||||||
|
|
||||||
return args
|
|
||||||
}
|
|
||||||
|
|
||||||
type RemoteMachine struct {
|
type RemoteMachine struct {
|
||||||
Host string
|
Host string
|
||||||
Port int
|
Port int
|
||||||
@@ -205,19 +182,13 @@ func (r *RsyncRunner) RunRemote(ctx context.Context, pair *SyncPairConfig, remot
|
|||||||
}
|
}
|
||||||
|
|
||||||
sshArgs := []string{
|
sshArgs := []string{
|
||||||
"ssh",
|
|
||||||
"-i", remote.PrivKey,
|
"-i", remote.PrivKey,
|
||||||
"-o", "StrictHostKeyChecking=accept-new",
|
"-o", "StrictHostKeyChecking=accept-new",
|
||||||
"-o", "UserKnownHostsFile=" + strings.TrimRight(r.sshDir, "/") + "/known_hosts",
|
"-o", "UserKnownHostsFile=" + strings.TrimRight(r.sshDir, "/") + "/known_hosts",
|
||||||
"-p", fmt.Sprintf("%d", remote.Port),
|
"-p", fmt.Sprintf("%d", remote.Port),
|
||||||
fmt.Sprintf("%s@%s", remote.SSHUser, remote.Host),
|
fmt.Sprintf("%s@%s", remote.SSHUser, remote.Host),
|
||||||
}
|
}
|
||||||
if remote.DestPrivKey != "" {
|
sshArgs = append(sshArgs, remoteCmd)
|
||||||
sshArgs = append(sshArgs, "bash", "-c", remoteCmd)
|
|
||||||
} else {
|
|
||||||
sshArgs = append(sshArgs, "rsync")
|
|
||||||
sshArgs = append(sshArgs, args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := exec.CommandContext(ctx, "ssh", sshArgs...)
|
cmd := exec.CommandContext(ctx, "ssh", sshArgs...)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user