hyprspace icon indicating copy to clipboard operation
hyprspace copied to clipboard

CLI tools for easier interface/peer creation

Open Winterhuman opened this issue 4 years ago • 4 comments

Hi, I've been following this project for a while out of interest (mainly since this is the only project like this which allows VPN's behind double-NAT's with dynamic IP's with no other servers needed) and I have a suggestion. Is it possible to create CLI tools to streamline the process? For example...

PEER A: sudo hyrspace info ...peer-id: PEER-A-ID

sudo hyprspace create example.conf ...Generating random discovery key. ...Created peer 10.1.1.1 for peer-id PEER-A-ID. ...Enter the peer-id of another peer: [PEER-B-ID] ...Created peer 10.1.1.2 for peer-id PEER-B-ID. ...Enter the peer-id of another peer (Press enter to skip): ...Successfully created example.conf at ~/.hyprspace/example.conf

[Copy example.conf to other peer]

PEER B: sudo hyprspace import ~/example.conf ...Reading peer list. ...Created peer 10.1.1.1 for peer-id PEER-A-ID. ...Created peer 10.1.1.2 for peer-id PEER-B-ID. ...Config successfully imported.

sudo hyprspace init hs0 [Both machines]

The stuff above just demonstrates functionality, you'd probably have a better idea for how a CLI would work, sorry in advance if this is a lot to ask.

Winterhuman avatar Jun 21 '21 19:06 Winterhuman

@LynHyper no I think this is a great idea! It's definitely not too much! Since you can have multiple interfaces within Hyprspace we'd need some way of telling Hyprspace which interface to add the peer to. But I think some cli way of doing this would be a good addition for usability. What do you think about something like,

hyprspace peer add hs0 QmHictlsttxux.....

Or maybe it's worth it to mimic something like that rclone config interface to allow people to walk through a setup/modification of an interface.

alecbcs avatar Jun 24 '21 00:06 alecbcs

Good point about per-interface stuff, hadn't though about that, I think borrowing from 'rclone config' would be a great direction!

PS. I've added some discussion posts to further explore this.

Winterhuman avatar Jun 24 '21 16:06 Winterhuman

Okay so let's properly start working on an implementation because I like some of these ideas. @LynHyper I'm thinking of breaking down the feature set you mentioned in the discussion post into a few additions.

  1. A command line interface for creating/importing a peer.
  2. A full cli configuration wizard? to allow you to setup and add peers on an init.
  3. Functionality to save peers into groups and possibly sync between peers in an already connected group.

Let me know what you think/if I'm missing anything?

alecbcs avatar Aug 23 '21 02:08 alecbcs

A configuration wizard would definitely be the way to go; I think there are too many CLI commands in my original discussion to be reasonable to fully implement so it makes sense why you'd want to go for an add-only method to simplify things.

I think you'll also need to have a way to create/import groups too; otherwise you'd need to modify the config manually to add groups and at that point you might as well add the peers to the config manually while you're there.

The original discussion sort of converts hyprspace into a public room system, where people can "login" as if it was a chat room (hence --allow-all), do you think this is inappropriate for how you want hyprspace to work?

Winterhuman avatar Aug 23 '21 10:08 Winterhuman