Deep messenger is simple console chat application that uses TOR network to create connections between clients and exchange messages. Clients are connected peer-to-peer.
Application can be started in one of two modes, client mode and mailbox mode. In client mode application will start ncurses
UI which will allow you to chat with other clients. Each client can choose one instance of application running in mailbox mode to act as it's mailbox while the client is offline. This will allow client to pull messages from the mailbox when it comes back online.
Modes and other settings are set using command line switches, for the whole list use --help
or -h
switch.
Usage: deep-messenger [options]
-h, --help Show this help message
-m, --mailbox Run mailbox service
-d, --dir <dir> Set config directory path
-p, --port <port> Listen for incomming connections on this port
-P, --mailbox-port <port> This is the port mailboxes should listen on
-t, --tor <file> Path to tor binary (default: /bin/tor)
-u, --manual Run messenger in manual mode (for debugging)
-g, --keygen <uses> Generate new mailbox access key
-k, --keys Show list of all available mailbox access keys
-r, --keydel <key> Delete given mailbox access key
-v, --version Show application version
When you run messenger in client mode additional configuration can be performed using in app commands that can be executed in console tab. To get the whole list use help
command.
List of all available commands:
help Prints this help message
sync <onion> Fetch new messages from given client
friends List all friends
friendadd <onion> Send friend request to add a new friend
friendrm <onion> Remove given friend
info Print your account info
nickname <nick> Change your nickname to <nick>
mbreg <onion> <key> Register to given mailbox server
mbrm Delete account on your current mailbox server
mbrmlocal Remove mailbox account locally
mbcontacts Upload contact list to mailbox server
mbsync Fetch new messages from mailbox server
tor Start tor client (manual mode)
version Prints app and protocol version
This app is not production ready, you are free to use it as you wish, but I don't recommend to use it for anything important. It is fairly untested and probably has a lot of bugs that are still to be fixed in the future.
Also, since this app is my gratuation project I had to finish it quickly, so codebase is prone to change in the future.
After some testing peer-to-peer messages seem to work fine, mailboxes on the other side, should work, but as you can see on the todo list below mailbox messages are not fully implemented. Since there is no way to remove messages from the mailbox they will accumulate in the mailbox. This issue will be fixed in the future.
Currently I am still considering is it worth it to try fixing current codebase, in the future I will probably split messenger library from the UI. I also need to rewrite some parts of the app and probably fix many issues I encounter along the way.
Deep Messenger can be built using gnu make (gcc) by running make command.
make
However, to build Deep Messsenger you must first install following dependencies.
Name Debian package
----------------------------------------------------
libevent => libevent-dev
sqlite3 => libsqlite3-dev
ncurses => libncurses-dev (libncursesw6 - wide character support)
openssl => libssl-dev (libcrypto)
On Debian GNU/Linux you can run the following set of commands to install dependencies, build and run the app.
# Install dependencies
su -
apt update
apt install -y build-essential libevent-dev libsqlite3-dev libssl-dev git libncurses-dev tor
exit
# Get code and build
git clone https://github.com/rdobovic/deep-messenger.git
cd deep-messenger
make
# Run the messenger
build/deep-messenger
- Create required UI components (maybe some more, but we'll see)
- Write process start/stop handler
- Implement basic
SOCKS5
client used for communication with TOR client - Create main protocol handler
- Create class (structure) for each message type
- Write simple generic queue implementation
- Design some kind of notification mechanism (hooks)
- Write official project documentation
- Connect backend and frontend together
- Test the whole application (Kinda done)
- TRANSACTION REQUEST (0x01)
- TRANSACTION RESPONSE (0x02)
- FRIEND REQUEST (0x81)
- ACK ONION (0x82)
- ACK SIGNATURE (0x83)
- MESSAGE CONTAINER (0x84)
- MAILBOX REGISTER (0x85)
- MAILBOX GRANTED (0x86)
- MAILBOX FETCH (0x87)
- MAILBOX SET CONTACTS (0x88)
- MAILBOX DEL ACCOUNT (0x89)
- MAILBOX DEL MESSAGES (0x8A)
- CLIENT FETCH (0x8B)
- MESSAGE LIST (0x8C)
Tests are not actual unit tests, they are just files with separate main functions used to test each part of the application. Tests are not guaranteed to work, you will probably need to change something in the test files to make them work for you. This tests will be reimplemented using unit testing library in the future.
To see the list of all available tests run
make test.ls
To compile and run one of the given tests type
make test.run.test_name