2022-03-23 00:18:30 +00:00
|
|
|
# Salty IM (Legacy)
|
2022-03-23 00:16:52 +00:00
|
|
|
|
|
|
|
A rudimentary terminal / command-line based chat system using the
|
|
|
|
[salty](https://git.mills.io/prologic/salty) command-line tool for encrypting
|
|
|
|
and decrypting messages using the [saltpack](https://saltpack.org) message
|
|
|
|
format and using [msgbus](https://git.mills.io/prologic/msgbux) as transport.
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- You need a POSIX Shell, e.g: `/bin/sh`
|
|
|
|
- You also need [jq](https://stedolan.github.io/jq/) installed
|
|
|
|
(the script uses this to parse the JSON from Discovery requests)
|
|
|
|
- [msgbus](https://git.mills.io/prologic/msgbus)
|
|
|
|
- [salty](https://git.mills.io/prologic/salty)
|
|
|
|
|
|
|
|
If you have [Go](https://golang.org) installed:
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ go install git.mills.io/prologic/msgbus/cmd/msgbus@latest
|
|
|
|
$ go install go.mills.io/salty/cmd/salty@latest
|
|
|
|
$ go install go.mills.io/salty/cmd/salty-keygen@latest
|
|
|
|
```
|
|
|
|
|
|
|
|
## Quick Start
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
export MSGBUS_URI=https://msgbus.<yourdomain>
|
|
|
|
$ ./salty-chat read &
|
|
|
|
$ ./salty-chat chat prologic@mills.io
|
|
|
|
```
|
|
|
|
|
|
|
|
> **NB:** You need to ensure you have a valid msgbus Endpoint for `salt-chat`
|
|
|
|
> to work. See [Endpoint](#Endpoint) for details.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
> SKip this section if you ran `salty-chat make-user`
|
|
|
|
|
|
|
|
### Keys
|
|
|
|
|
|
|
|
To generate your Private / Public keys:
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ salty-keygen -o $HOME/.config/salty/$USER.key
|
|
|
|
```
|
|
|
|
|
|
|
|
Setup an environment variable in your shell to point `SALTY_IDENTITY`
|
|
|
|
to `$HOME/.config/salty/$USER.key`. For example:
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
|
|
|
|
```
|
|
|
|
|
|
|
|
### Inbox
|
|
|
|
|
|
|
|
To ensure you are reading from your own Inbox by default use: `export SALTY_INBOX="username"`
|
|
|
|
|
|
|
|
### Endpoint
|
|
|
|
|
|
|
|
First you need to setup [msgbus](https://git.mills.io/prologic/msgbus)
|
|
|
|
somewhere, see that project for details on how to set this up. Or you can just
|
|
|
|
use the instance I run at https://msgbus.mills.io/ (just please don't abuse it!)
|
|
|
|
|
|
|
|
Point an environment variable called `MSGBUS_URI` to your msgbus instance.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
```#!sh
|
|
|
|
export MSGBUS_URI=https://msgbus.mills.io
|
|
|
|
```
|
|
|
|
|
|
|
|
> **NB:** You are welcome to use my (James Mills) msgbus instance above but
|
|
|
|
> please don't abuse it!
|
|
|
|
|
|
|
|
### Discovery
|
|
|
|
|
|
|
|
Create a JSON file called `<user>.json` and place it at the root of your
|
|
|
|
domain on a path like `/.well-known/salty/user.json`. The conents of which are:
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"endpoint": "https://msgbus.mills.io",
|
|
|
|
"topic": "prologic",
|
|
|
|
"key": "kex1ekt5cru4vs42wnaxppkjn5pexmt2w6uxx9z2mz0fqeuc80e0g9gsggs8ah"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
You can see an example of [prologic@mills.io](https://mills.io/.well-known/salty/prologic.json)
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Start a Chat
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ ./salty-chat chat prologic@mills.io
|
|
|
|
>
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sending a Message
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ ./salty-chat send prologic@mills.io Test
|
|
|
|
2022/03/17 01:46:14 Reading message from stdin...
|
|
|
|
```
|
|
|
|
|
|
|
|
### Receiving your Messages
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ ./salty-chat read
|
|
|
|
INFO[0000] successfully connected to wss://msgbus.mills.io/prologic
|
|
|
|
# signed by: kex1ekt5cru4vs42wnaxppkjn5pexmt2w6uxx9z2mz0fqeuc80e0g9gsggs8ah
|
|
|
|
[2022-03-17T01:23+10:00] <prologic> Test
|
|
|
|
# signed by: kex1ekt5cru4vs42wnaxppkjn5pexmt2w6uxx9z2mz0fqeuc80e0g9gsggs8ah
|
|
|
|
[2022-03-17T01:46+10:00] <prologic> Test
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
`salty-msgbus-chat` is licensed under the terms of the [WTFPL](/LICENSE) license.
|