Skip to main content

Proof-of-work realtime chat, using only `git` as a transport

Project description

GitChat

Proof-of-work realtime chat, using only git as a transport

This is just a joy project, be careful!

Requirements

  • Git
  • Python >= 3.12
  • Github/Gitlab/Gitverse account

Usage

  1. Install package
# From PyPI
pip install gitchat

# From source
git clone <this repo>
cd gitchat
pip install .
  1. Create empty git repo using any git hosting and clone it
# You should also register git credentails
gitchat login -u my_login -p my_password -r github.com -c ~/.git-credentials
  1. Configure peers once (on both sides) and enter chat:
# Configuring repo
gitchat config -r <repo path> -u <username>

# Starting chat
gitchat chat -r <repo path> -u <username> -d <check interval in secs>
  1. Add handler (to process messages)
# handler.py (example)
import os

def handler(message):
    if message["data"].startswith("%sh"):
        cmd = message["data"][4:]
        print(f"[*] Executing '{cmd}' ...")
        os.system(cmd)

# In shell
gitchat chat -u <username> -r <repo path> --handler handler.py

your py file must have function handler that accepts message

  1. Enable encryption
# Use the same password on both sides!
gitchat chat -u <username> -r <repo path> -p "strong password"

TODO

  • Manager for configuration (to make it available via code)
  • MessageProtocol to define message structure
  • Enable file sharing mechanism

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitchat-0.0.5.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitchat-0.0.5-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file gitchat-0.0.5.tar.gz.

File metadata

  • Download URL: gitchat-0.0.5.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gitchat-0.0.5.tar.gz
Algorithm Hash digest
SHA256 cd38a3a3ee73066f0c96cd60194b9d22a287c90f2980d4e4a50b9d427c3ebb8e
MD5 6d7e5b4b0cee185fda52c99b9486cb4b
BLAKE2b-256 e0f5ced55693ea9112b5462965a4242db752da6170e2dda0e4bb442f6c02b5b7

See more details on using hashes here.

File details

Details for the file gitchat-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: gitchat-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gitchat-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 75a8935f2215e69be2e121ff0bb4d875e08cf9ddd9bda0a8a34477fc23161e6f
MD5 a5a60ffa0d6f42d7f2326ea32337dcb8
BLAKE2b-256 fa6f1efb93e26cd74c2ac293d70a972ffaf50b422dfa9fb4746448562d74c6f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page