92b1f42730
also, tested on ipv6.. doesn't work
30 lines
1.4 KiB
Markdown
30 lines
1.4 KiB
Markdown
For git-annex to be able to clone its repo to another host, it'd be good to
|
|
have some way of pairing devices.
|
|
|
|
It could work like this:
|
|
|
|
1. Prompt for the hostname, or do avahi local machine discovery, or use
|
|
ZeroMQ with IP multicast, or use haskell's `network-multicast`. That
|
|
last option seems to work best!
|
|
2. Let user pick host to pair with. Somehow authenticate that this is
|
|
the host they expected to pair with, and not an imposter. Probably
|
|
have the users enter a shared secret and use it to HMAC the ssh public
|
|
keys.
|
|
3. Exchange a hostname or IP address with the pair. Ideally,
|
|
use `.local`, as it'll work as long as both are on the same subnet.
|
|
If mDNS is not available, regular DNS or IP addresses might have
|
|
to be used, but will result in a more fragile pairing. Or perhaps
|
|
the assistant could broadcast itself queries for current IP addresses,
|
|
if connecting to a paired host fails.
|
|
4. Enable the two hosts to ssh to one-another and run git-annex shell.
|
|
(Set up per-host ssh keys.)
|
|
5. Pull over a clone of the repository.
|
|
6. Start [[syncing]].
|
|
|
|
## TODO
|
|
|
|
* pairing over IPV6 only networks does not work. Haskell's
|
|
`network-multicast` library complains "inet_addr: Malformed address: ff02::1"
|
|
.. seems it just doesn't support IPv6. The pairing code in git-annex
|
|
does support ipv6, apart from this, it's just broadcasting the messages
|
|
that fails. (Pairing over mixed networks is fine.)
|