diff --git a/cmd/config/config.go b/cmd/config/config.go index 38c9a38..3bf2304 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -120,6 +120,15 @@ type TLSConnect struct { Key string `yaml:"key"` } +type SSHStdinserverConnect struct { + Type string `yaml:"type"` + Host string `yaml:"host"` + User string `yaml:"user"` + Port uint16 `yaml:"port"` + IdentityFile string `yaml:"identity_file"` + Options []string `yaml:"options"` +} + type ServeEnum struct { Ret interface{} } @@ -138,6 +147,11 @@ type TLSServe struct { Key string `yaml:"key"` } +type StdinserverServer struct { + Type string `yaml:"type"` + ClientIdentity string `yaml:"client_identity"` +} + type PruningEnum struct { Ret interface{} } @@ -242,6 +256,7 @@ func (t *ConnectEnum) UnmarshalYAML(u func(interface{}, bool) error) (err error) t.Ret, err = enumUnmarshal(u, map[string]interface{}{ "tcp": &TCPConnect{}, "tls": &TLSConnect{}, + "ssh+stdinserver": &SSHStdinserverConnect{}, }) return } @@ -250,6 +265,7 @@ func (t *ServeEnum) UnmarshalYAML(u func(interface{}, bool) error) (err error) { t.Ret, err = enumUnmarshal(u, map[string]interface{}{ "tcp": &TCPServe{}, "tls": &TLSServe{}, + "stdinserver": &StdinserverServer{}, }) return } diff --git a/cmd/config/samples/pull_ssh.yml b/cmd/config/samples/pull_ssh.yml new file mode 100644 index 0000000..6a7b6a0 --- /dev/null +++ b/cmd/config/samples/pull_ssh.yml @@ -0,0 +1,41 @@ +jobs: + +- name: pull_servers + type: pull + replication: + connect: + type: ssh+stdinserver + host: app-srv.example.com + user: root + port: 22 + identity_file: /etc/zrepl/ssh/identity + options: # optional, default [], `-o` arguments passed to ssh + - "Compression=on" + root_dataset: "pool2/backup_servers" + pruning: + keep_sender: + - type: not_replicated + - type: last_n + count: 10 + - type: grid + grid: 1x1h(keep=all) | 24x1h | 14x1d + keep_bookmarks: all + keep_receiver: + - type: grid + grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d + keep_bookmarks: all + +global: + logging: + - type: "stdout" + time: true + level: "warn" + format: "human" + monitoring: + - type: "prometheus" + listen: ":9091" + control: + sockpath: /var/run/zrepl/control + serve: + stdinserver: + sockdir: /var/run/zrepl/stdinserver \ No newline at end of file diff --git a/cmd/config/samples/source_ssh.yml b/cmd/config/samples/source_ssh.yml new file mode 100644 index 0000000..2b2ac9c --- /dev/null +++ b/cmd/config/samples/source_ssh.yml @@ -0,0 +1,37 @@ +jobs: +- name: pull_source + type: source + replication: + serve: + type: stdinserver + client_identity: "client1" + filesystems: { + "<": true, + "secret": false + } + snapshotting: + snapshot_prefix: zrepl_ + interval: 10m + pruning: + keep: + - type: not_replicated + - type: last_n + count: 10 + - type: grid + grid: 1x1h(keep=all) | 24x1h | 14x1d + keep_bookmarks: all + +global: + logging: + - type: "stdout" + time: true + level: "warn" + format: "human" + monitoring: + - type: "prometheus" + listen: ":9091" + control: + sockpath: /var/run/zrepl/control + serve: + stdinserver: + sockdir: /var/run/zrepl/stdinserver \ No newline at end of file