Skip to content
/ ya2ber Public

👥 CLI chat to just chat. No ads, no statistics collection, no special terms, no unknown third-party services, no spies, no tricky interfaces... no bullshit.

Notifications You must be signed in to change notification settings

zhibirc/ya2ber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ya2ber

maintenance node-version npm-version

CLI chat to just chat. No ads, no statistics collection, no special terms, no unknown third-party services, no spies, no tricky interfaces... no bullshit.


Etymology

ya2ber is just derived from yabber, which is the synonym for jabber, which is the synonym for usual talk.

Features

  • Authentication based on login and password.
  • Shows how many visitors are in the chat. Currently, this info is shown in PS1 prompt.
  • Chat members are notified when someone left.
  • There are 3 message categories/types - system (including ones from server), authentication purposed and just chat messages.
  • Client and server use JSON as data format for transmitting data to each other. See how.
  • Entering of password is hidden (like many other CLI applications do, including sudo) and isn't stored in history.
  • Authentication errors are well recognized because of verbose error messages.
  • Client doesn't contain any validation logic for user credentials, this a server's responsibility.
  • Server stores such specific user data: registration date, last activity date and last used IP address.*
  • Server doesn't store any message history. Instead, client could store history locally as an option.
  • Prevention of typosquatting in usernames.
  • Rework UI for using blessed curses-like library
  • libsignal library is used for communication encryption

* actually, server stores last login date rather than last activity date for now

CLI options

JSON message schema

Example of client's message:

{
    "message": "Hello, username!",
    "type": "message",
    "command": "/username"
}

Example of server's message:

{
    "message": "username left the chat",
    "type": "system",
    "online": 5
}

Development

Setup

Installation

git clone git@github.com:zhibirc/ya2ber.git

cd ya2ber

# it'll automatically install dependencies in all nested application folders
npm install

Pre-commit

We use pre-commit for running code checks locally, just before committing, to ensure that all basic code requirements and policies were respected. Installation is pretty simple (one-time action):

# install pre-commit using Python's pip
pip install pre-commit
# OR
# install pre-commit using using Homebrew
brew install pre-commit

# install the Git hook scripts
pre-commit install

Now pre-commit will run automatically on git commit! Configuration for pre-commit hooks is stored in .pre-commit-config.yaml file.

pre-commit notes

  • If you want to skip all the pre-commit checks (not recommended!), you can add the -n parameter as follows:
git commit -m "commit message" -n
  • Alternatively if you only want to skip some specific check, you can use SKIP=<hook_id> before the command:
SKIP=codespell git commit -m "commit message"

Storing secrets

Generally, it may be necessary to use some sensitive data, usually stored in environment variables, in application. For example, AWS keys. If so, it's important to remember that any sensitive data shouldn't be leaked to the public, including GitHub repository.

To accomplish this, create .env.local file (don't use .env file in this case) in the appropriate directory (client/ or server/), and put environment variables intended to be private there. This file is ignored by Git and excluded from Docker context on image build.

Automation scripts

We use GNU Make for automate operations related to source code and application deployment.

Available Make project-level commands

Get help/guide for all available commands.

make
make help

About

👥 CLI chat to just chat. No ads, no statistics collection, no special terms, no unknown third-party services, no spies, no tricky interfaces... no bullshit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published