hexojs / hexo-deployer-rsync

Rsync deployer plugin for Hexo.
MIT License
47 stars 30 forks source link

Deploying to IPv6 host doesn't work in macOS #80

Closed a342191555 closed 1 year ago

a342191555 commented 3 years ago

Hi, I've met a problem when deploy my blog to an IPv6 host with rsync plugin in macOS. The config file like :

deploy:
- type: rsync
  host: '[::1]'
  user: root
  root: /PATH/TO/html

It seems the deployer will generate params for sync like rsync -az /PATH/FROM/LOCAL/public root@[::1]:/PATH/TO/html

I've comfirmed it DO work well in rsync(version 3.1.3, protocol version 31) in most Linux distributions, however, the version of the built-in rsync in macOS(Big Sur 11.6, current latest version) was 2.6.8(protocol version 29), which does not support the syntax of root@[::1].

There may be 2 solutions:

I can create a PR to fix this issue with the first solution if you would, while I am now using the other.

SukkaW commented 3 years ago
  • Use an alternative way to call sync: use the ssh -l user option, metioned here. The sync command will then be called like rsync -az -e 'ssh -l root' /PATH/FROM/LOCAL/public [::1]:/PATH/TO/html.

What happens if the rsync is not running under root?

a342191555 commented 3 years ago

What happens if the rsync is not running under root?

ssh -l root in rsync -ewill use user root , just like ssh root@::1. If my config file is:

deploy:
- type: rsync
  host: '[::1]'
  user: my_name
  root: /PATH/TO/html

The rsync command should be rsync -az -e 'ssh -l my_name' /PATH/FROM/LOCAL/public [::1]:/PATH/TO/html

stevenjoezhang commented 1 year ago

I'm closing this issue since it's related to the version of rsync itself. Maybe you can add the docs about installing rsync tool with homebrew to README.

a342191555 commented 1 year ago

Now I am in macOS Ventura, seems Apple has upgraded rsync to version 3.2.7 protocol version 31, this issue is now fixed by "upgrading macOS" LOL.