Skip to content

lokasku/pr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ΠP

Polyrhoé (PRH or pr), from the Greek πολύς (many) and ῥοή (flow), is a protocol operating over TCP/IP for multiplexing simultaneous shell connections to multiple remote hosts.

Refer to the iroh branch for PR using Iroh instead of TCP/IP. I recommend using the Iroh implementation for a more modern and efficient experience.

Roadmap

Due to complications in a previous collaborative project for YH4F 2025 and the time constraints of my final exams, I had to start a completely new project within a tight timeframe of about ten days. The following roadmap outlines its current structure and objectives.

  • Client operational
  • Server operational
  • Fully encrypted communications with DH and AES-GCM
  • Multiplexing of multiple connections
  • User-friendly client interface
  • Multithreading for the different connections
  • Support for multiple client connections
  • Modern CLI
  • Documentation
  • Tags support
    • Add tags to connections
    • Command dispatch by tag
  • Iroh implementation
  • Authentication support
    • Password-based authentication
    • Whitelist of trusted IP addresses
  • Macro support
    • Per-machine variable substitution in commands (e.g. {{ip}})
    • Define macros with variables
    • Execute macros on multiple machines
  • Diffing support
  • Daemon mode for the server
    • as a systemd service
    • Errors and logs management
  • Command history

Dependencies

You need to have rustc and cargo installed on your system. If you're using Nix, you can directly enter

nix develop

Else, you can install them by following the instructions on the official Rust website.

Once you have dependencies installed, clone the project :

git clone https://github.com/lokasku/pr.git wherever/you/want
cd wherever/you/want/pr

Usage

Client

To start the client, run the following command at the root of the repository :

cargo run --release --package pr-client

Then, an interactive interface will be displayed, allowing you to :

  • A or a : Add a connection to a remote host
  • L or l : List all established connections
  • R or r : Remove a connection
  • S or s : Switch to a connection
  • M or m : Modify a connection
    • N or n : Change the name of a connection
    • A or a : Add tags to a connection
    • R or R : Remove tags from a connection
    • B or b : Go back to the menu
  • D or d : Dispatch a command given tags
    • Enter the tags to dispatch the command to, separated by commas (e.g. tag1,tag2)
    • Enter the command to execute on the selected connections
  • Q or q : Exit the client

When you switch to a connection, enter the % to come back the main menu. The connection will remain active in the background, allowing you to switch back to it at any time.

Server

To start the server, run :

cargo run --release --package pr-server -- -p 1789

By default, the server will listen on port 1736 but you can specify a different port using the -p option.

However, in order to connect to a remote machine, the open port must be configured on the router so that it can be accessed remotely. You can still use the server locally for testing purposes.

Example of local usage

First, start the server in one terminal :

cargo run --release --package pr-server

Then, in another terminal, start the client :

cargo run --release --package pr-client

Finally, add a connection with A or a and enter localhost as the address and 1736 as the port. You can then switch to this connection and execute commands on it. You are free to add as many connections as you want.

Documentation

For detailed technical documentation, including protocol specifications please refer to the docs/ directory.

Thanks

I extend my sincere thanks to CoCoSol for his valuable support during the final phase of practical testing.

License

PR is licensed under the MPL-2.0 (Mozilla Public License 2.0). See the LICENSE file for mode details.

About

ΠΟΛΥΡΟΗ (Polyrhoē)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •