2024-04-29 04:35:58 +12:00
# Reticulum WebChat
A simple web based [LXMF ](https://github.com/markqvist/lxmf ) client for [Reticulum ](https://github.com/markqvist/Reticulum ).
## Features
- Supports sending to and receiving messages from [Sideband ](https://github.com/markqvist/Sideband/ ) and [Nomadnet ](https://github.com/markqvist/nomadnet ).
- Supports receiving images sent from Sideband.
- Supports receiving file attachments sent from Sideband.
## How does it work?
2024-04-29 16:41:57 +12:00
- A python script ([web.py ](./web.py )) runs a Reticulum instance and a WebSocket server.
2024-04-29 04:35:58 +12:00
- The web page sends and receives lxmf packets encoded in json via the WebSocket.
- Web Browser -> WebSocket -> Python Reticulum -> (configured interfaces) -> (destination)
2024-04-29 04:37:41 +12:00
## How to use it?
You will need to clone the repo, and run `web.py` .
```
git clone https://github.com/liamcottle/reticulum-webchat
cd reticulum-webchat
2024-04-29 14:59:45 +12:00
pip install -r requirements.txt
2024-04-29 04:37:41 +12:00
python web.py
```
2024-04-29 04:35:58 +12:00
2024-04-29 14:54:13 +12:00
> NOTE: You should now be able to access the web interface at http://localhost:8000
2024-04-29 16:45:06 +12:00
For a full list of command line options, you can run;
```
python web.py --help
```
```
usage: web.py [-h] [--host [HOST]] [--port [PORT]] [--identity-file IDENTITY_FILE] [--identity-base64 IDENTITY_BASE64]
ReticulumWebChat
options:
-h, --help show this help message and exit
--host [HOST] The address the web server should listen on.
--port [PORT] The port the web server should listen on.
--identity-file IDENTITY_FILE
Path to a Reticulum Identity file to use as your LXMF address.
--identity-base64 IDENTITY_BASE64
A base64 encoded Reticulum Identity to use as your LXMF address.
```
2024-04-29 16:10:10 +12:00
## Using an existing Reticulum Identity
2024-04-29 16:32:17 +12:00
By default, a random identity is generated every time you run the script.
2024-04-29 16:10:10 +12:00
2024-04-29 16:32:17 +12:00
This is handy for quickly testing out the web ui, however you may want to use an existing identity when chatting with others.
2024-04-29 16:10:10 +12:00
2024-04-29 16:32:17 +12:00
To generate a new identity, you can use the [rnid ](https://reticulum.network/manual/using.html#the-rnid-utility ) utility provided by Reticulum.
2024-04-29 16:10:10 +12:00
```
2024-04-29 16:32:17 +12:00
rnid --generate ./new_identity
```
2024-04-29 16:46:05 +12:00
You can then use following to run the web ui with your new identity file;
2024-04-29 16:32:17 +12:00
```
python web.py --identity-file ./new_identity
```
Alternatively, you can provide a base64 encoded private key, like so;
```
python web.py --identity-base64 "GCN6mMhVemdNIK/fw97C1zvU17qjQPFTXRBotVckeGmoOwQIF8VOjXwNNem3CUOJZCQQpJuc/4U94VSsC39Phw=="
2024-04-29 16:10:10 +12:00
```
> NOTE: this is a randomly generated identity for example purposes. Do not use it, it has been leaked!
2024-04-29 04:44:42 +12:00
## TODO
- [ ] allow passing in a custom Reticulum config file via cli args
2024-04-29 16:47:59 +12:00
- [ ] allow generating identity in python if rnid util is not available
- [ ] make sure web ui can run in offline environment, so host tailwind/vue locally
2024-04-29 14:54:13 +12:00
- [ ] conversations/contacts list ui with unread indicators
2024-04-30 04:16:06 +12:00
- [ ] support saving conversation history across page reloads, maybe an sqlite database
2024-04-29 04:49:37 +12:00
- [ ] send images from web ui
- [ ] send file attachments from web ui