diff --git a/README.md b/README.md index 1137403..a18e79c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ 🚧 Work in Progress! 🚧 -SSH chat server written in Rust 🦀 for real-time communication, providing encrypted messaging over SSH. +An implementation of an SSH server for real-time communication that +serves a chat room instead of a shell and provides encrypted messaging over +SSH. ### Acknowledgements @@ -34,12 +36,14 @@ This project was greatly influenced by [shazow/ssh-chat](https://github.com/shaz ### Quick start ```console -SSH Chat: Real-time communication over SSH +chatd is an implementation of an SSH server for real-time communication that +serves a chat room instead of a shell and provides encrypted messaging over +SSH. Usage: chatd [OPTIONS] Options: - --port Port to listen on [default: 2222] + --port Port to listen on [default: 22] -i, --identity Private key to identify server with. Defaults to a temporary ed25519 key --oplist Optional file of public keys who are operators --whitelist Optional file of public keys who are allowed to connect @@ -49,3 +53,55 @@ Options: -h, --help Print help -V, --version Print version ``` + +### Environment Variables + +Due to the lack of persistent storage for user configurations in chatd (which is intentional), users need to reapply their settings each time they connect. This can be quite inconvenient, don't you think? + +Using environment variables can solve this problem. + +#### `CHATD_THEME` + +This variable lets you set the theme for your session. Instead of manually configuring it by running `/theme hacker`, you can do it like this: + +```bash +$ ssh -o SetEnv "CHATD_THEME=hacker" username@host +``` + +#### `CHATD_TIMESTAMP` + +This variable enables the logging of a datetime or time prefix next to each received message. Instead of running `/timestamp datetime` manually, you can set it like this before connecting: + +```bash +$ ssh -o SetEnv "CHATD_TIMESTAMP=datetime" username@host +``` + +If you find setting extra options to `ssh` command tiresome, you can use a configuration file supported by your ssh client. For the OpenSSH client, there is `.ssh/config` file. If you don't have one, feel free to create and provide r-w access `chmod 600 .ssh/config`. + +Now add the following lines to the config file: + +```bash +Host host + SendEnv CHATD_* +``` + +Now, add the environment variables to your shell profile. Then, you can simply run: + +```bash +$ ssh username@host +``` + +### Autocomplete + +`chatd`'s autocomplete is designed to be intuitive and convenient for terminal users, recognizing whether you're completing a command, its subcommand, or their arguments. + +For example: + + + + + + +
[user] /opl[user] /oplist
[user] /oplist l[user] /oplist load
[user] /oplist load m[user] /oplist load merge
[user] /oplist add al[user] /oplist add alice
+ +So, don't hesitate to press Tab whenever you want to save some typing 😉