6
1
mirror of https://git.mills.io/saltyim/saltyim.git synced 2024-06-28 17:51:04 +00:00
prologic-saltyim/README.md

136 lines
3.7 KiB
Markdown
Raw Normal View History

2022-03-19 05:43:43 +00:00
# Salty IM
## Quick Start
```#!sh
2022-03-19 13:05:36 +00:00
$ go install go.mills.io/saltyim/cmd/salty-chat@latest
$ salty-chat make-user user@domain
2022-03-19 05:48:42 +00:00
$ salty-chat chat prologic@mills.io
2022-03-19 05:43:43 +00:00
```
**NOTE:**
> As of 19th March 2022 15:42 AEST some of the below documentation is now
> out-of-date and will be updated soon as well as the landing page
> [salty.im](https://salty.im)
----
2022-03-16 12:45:16 +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.
2022-03-16 15:48:04 +00:00
## Requirements
- You need a POSIX Shell, e.g: `/bin/sh`
2022-03-17 02:14:48 +00:00
- You also need [jq](https://stedolan.github.io/jq/) installed
(the script uses this to parse the JSON from Discovery requests)
2022-03-16 15:48:04 +00:00
- [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
2022-03-16 15:54:20 +00:00
$ go install go.mills.io/salty/cmd/salty@latest
$ go install go.mills.io/salty/cmd/salty-keygen@latest
2022-03-16 15:48:04 +00:00
```
2022-03-16 21:32:53 +00:00
## Quick Start
```#!sh
2022-03-17 02:14:48 +00:00
export MSGBUS_URI=https://msgbus.<yourdomain>
2022-03-17 02:41:08 +00:00
$ ./salty-chat read &
$ ./salty-chat chat prologic@mills.io
2022-03-16 21:32:53 +00:00
```
2022-03-17 02:14:48 +00:00
> **NB:** You need to ensure you have a valid msgbus Endpoint for `salt-chat`
> to work. See [Endpoint](#Endpoint) for details.
2022-03-16 12:45:16 +00:00
## Setup
2022-03-16 21:32:53 +00:00
> SKip this section if you ran `salty-chat make-user`
2022-03-16 15:54:20 +00:00
### Keys
To generate your Private / Public keys:
```#!sh
2022-03-16 21:32:53 +00:00
$ salty-keygen -o $HOME/.config/salty/$USER.key
2022-03-16 15:54:20 +00:00
```
Setup an environment variable in your shell to point `SALTY_IDENTITY`
2022-03-16 21:32:53 +00:00
to `$HOME/.config/salty/$USER.key`. For example:
2022-03-16 15:54:20 +00:00
```#!sh
2022-03-16 21:32:53 +00:00
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
2022-03-16 15:54:20 +00:00
```
2022-03-16 15:48:04 +00:00
### Endpoint
2022-03-16 12:45:16 +00:00
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!)
2022-03-17 02:14:48 +00:00
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!
2022-03-16 15:48:04 +00:00
### Discovery
2022-03-16 12:45:16 +00:00
2022-03-16 15:48:04 +00:00
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"
}
2022-03-16 12:45:16 +00:00
```
2022-03-16 15:48:04 +00:00
You can see an example of [prologic@mills.io](https://mills.io/.well-known/salty/prologic.json)
## Usage
2022-03-17 02:41:08 +00:00
### Start a Chat
```#!sh
$ ./salty-chat chat prologic@mills.io
>
```
### Sending a Message
2022-03-16 15:48:04 +00:00
2022-03-16 12:45:16 +00:00
```#!sh
2022-03-16 21:32:53 +00:00
$ ./salty-chat send prologic@mills.io Test
2022-03-16 15:48:04 +00:00
2022/03/17 01:46:14 Reading message from stdin...
2022-03-16 12:45:16 +00:00
```
2022-03-16 15:48:04 +00:00
### Receiving your Messages
2022-03-16 12:45:16 +00:00
2022-03-16 15:48:04 +00:00
```#!sh
2022-03-16 21:32:53 +00:00
$ ./salty-chat read
2022-03-16 15:48:04 +00:00
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
2022-03-16 12:45:16 +00:00
```
### Infrastructure Setup:
- As mentioned earlier you will need a static site generator or webserver to serve your `.well-known` json file. This can be setup in numerous ways, but we will be providing bootstrapping instructions in the [infrastructure](/infrastructure) folder.
- You'll also need to use a msgbus to make this work as it brokers the encrypted payload between users on SaltyIm. This will also live in [infrastructure](/infrastructure)
2022-03-16 12:45:16 +00:00
## License
`salty-msgbus-chat` is licensed under the terms of the [WTFPL](/LICENSE) license.