dum-dum-irc


Namedum-dum-irc JSON
Version 0.4.2 PyPI version JSON
download
home_pageNone
SummaryA non-standard internet relay chat program.
upload_time2024-06-17 16:50:23
maintainerNone
docs_urlNone
authorthegamecracks
requires_python>=3.11
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # dum-dum-irc

[![](https://img.shields.io/pypi/v/dum-dum-irc?style=flat-square)](https://pypi.org/project/dum-dum-irc/)
[![](https://img.shields.io/github/actions/workflow/status/thegamecracks/dum-dum-irc/pyright-lint.yml?style=flat-square&label=pyright)](https://microsoft.github.io/pyright/#/)
[![](https://img.shields.io/github/actions/workflow/status/thegamecracks/dum-dum-irc/python-test.yml?style=flat-square&logo=pytest&label=tests)](https://docs.pytest.org/en/stable/)

A handcrafted implementation of an internet relay chat without following
any conventions or RFC standards.

![](https://raw.githubusercontent.com/thegamecracks/dum-dum-irc/main/docs/images/demo.png)

### [Changelog] | [Contributing Guide]

[Changelog]: https://github.com/thegamecracks/dum-dum-irc/blob/main/CHANGELOG.md
[Contributing Guide]: https://github.com/thegamecracks/dum-dum-irc/blob/main/CONTRIBUTING.md

## Usage

With Python 3.11+ installed, you can get the current stable version on PyPI:

```sh
pip install dum-dum-irc
```

Or if you have Git, you can install the latest in-development version:

```sh
pip install git+https://github.com/thegamecracks/dum-dum-irc
```

Once installed, you can use the `dumdum` and `dumdum-server` commands.
Running `dumdum` starts a graphical client which you can use to join
Dumdum servers, while `dumdum-server` is used to host servers of your own.
Both support the `-h/--help` option if you want to see more details:

```sh
usage: dumdum [-h] [-v] {appdirs} ...

Start the client interface for connecting to dumdum servers.

positional arguments:
  {appdirs}

options:
  -h, --help     show this help message and exit
  -v, --verbose  Increase logging verbosity
```

```sh
usage: dumdum-server [-h] [-v] [-c CHANNELS [CHANNELS ...]] [--host HOST] [--port PORT] [--cert CERT]

Host a dumdum server.

To use TLS encryption, you must provide a certificate and private key.
This can be specified as either:
1. A single file containing both the private key and certificate:
     --cert hello.pem
2. A pair of certificate and private key files, separated with a colon:
     --cert hello.crt:hello.key

options:
  -h, --help            show this help message and exit
  -v, --verbose         Increase logging verbosity
  -c CHANNELS [CHANNELS ...], --channels CHANNELS [CHANNELS ...]
                        A list of channels
  --host HOST           The address to host on, or all interfaces when not supplied
  --port PORT           The port number to host on (default: 6667)
  --cert CERT           The SSL certificate and private key to use
```

## Implementation

Dumdum consists of two parts:

1. The Sans-IO protocol, defined in [dumdum.protocol]
2. The asyncio wrapper, defined in [dumdum.client] and [dumdum.server]

The [Sans-IO] protocol is responsible for handling the generation and
consumption of byte streams, along with producing events from received
messages, while the asyncio wrapper is responsible for the actual network
communication between the server and its clients.

[Sans-IO]: https://sans-io.readthedocs.io/

[dumdum.protocol]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/protocol
[dumdum.client]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/client
[dumdum.server]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/server

## Protocol

Clients are able to send the following messages:

1. HELLO: `0x00 | 1-byte version`
2. AUTHENTICATE: `0x02 | varchar nickname (32)`
3. SEND_MESSAGE: `0x03 | varchar channel name (32) | varchar content (1024)`
4. LIST_CHANNELS: `0x04`
5. LIST_MESSAGES: `0x05 | 8-byte before snowflake or 0 | 8-byte after snowflake or 0`

Servers are able to send the following messages:

1. HELLO: `0x00 | 0 or 1 using SSL`
2. INCOMPATIBLE_VERSION: `0x01 | 1-byte version`
3. ACKNOWLEDGE_AUTHENTICATION: `0x02 | 0 or 1 success`
4. SEND_MESSAGE: `0x03 | 8-byte snowflake | varchar channel name (32) | varchar nickname (32) | varchar content (1024)`
5. LIST_CHANNELS: `0x04 | 2-byte length | varchar channel name (32) | ...`
6. LIST_MESSAGES: `0x05 | 3-byte length | same fields after SEND_MESSAGE | ...`

Clients must send a HELLO command and wait for the server to respond with HELLO.
Afterwards the client must send an AUTHENTICATE command and wait for a successful
ACKNOWLEDGE_AUTHENTICATION before they can begin chat communications.

When the client disconnects and reconnects, they MUST re-send hello
and re-authenticate with the server.

If the server supports SSL, they can set `using SSL` in HELLO to indicate
that the client should upgrade the connection to SSL.
At this point, the protocol should not receive any data until after the
SSL handshake is complete.

As this protocol has been intentionally designed to be simple (no timeouts
or keep alives), I/O wrappers do not need a significant amount of work to
implement it.

## TLS Encryption

`dumdum-server` can use SSL certificates to encrypt connections.
For example, if you want to use a self-signed certificate and private key,
you can install OpenSSL and run the following command:

```sh
openssl req -new -x509 -days 365 -noenc -out dumdum.crt -keyout dumdum.key
```

After filling out (or skipping) the certificate signing request prompts,
you can then run the server with the resulting `dumdum.crt` and `dumdum.key`
files:

```sh
dumdum-server --cert dumdum.crt:dumdum.key
```

As for the `dumdum` client, SSL can be enabled by the user before connecting
to a server. If the server uses a self-signed certificate, the user will need
to download the server's certificate (.crt) and select it.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dum-dum-irc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "thegamecracks",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/38/21/391388f6e5de4a0c3a0440deb41dfee6d059f2d33c87fc783c7e1f3fb754/dum_dum_irc-0.4.2.tar.gz",
    "platform": null,
    "description": "# dum-dum-irc\n\n[![](https://img.shields.io/pypi/v/dum-dum-irc?style=flat-square)](https://pypi.org/project/dum-dum-irc/)\n[![](https://img.shields.io/github/actions/workflow/status/thegamecracks/dum-dum-irc/pyright-lint.yml?style=flat-square&label=pyright)](https://microsoft.github.io/pyright/#/)\n[![](https://img.shields.io/github/actions/workflow/status/thegamecracks/dum-dum-irc/python-test.yml?style=flat-square&logo=pytest&label=tests)](https://docs.pytest.org/en/stable/)\n\nA handcrafted implementation of an internet relay chat without following\nany conventions or RFC standards.\n\n![](https://raw.githubusercontent.com/thegamecracks/dum-dum-irc/main/docs/images/demo.png)\n\n### [Changelog] | [Contributing Guide]\n\n[Changelog]: https://github.com/thegamecracks/dum-dum-irc/blob/main/CHANGELOG.md\n[Contributing Guide]: https://github.com/thegamecracks/dum-dum-irc/blob/main/CONTRIBUTING.md\n\n## Usage\n\nWith Python 3.11+ installed, you can get the current stable version on PyPI:\n\n```sh\npip install dum-dum-irc\n```\n\nOr if you have Git, you can install the latest in-development version:\n\n```sh\npip install git+https://github.com/thegamecracks/dum-dum-irc\n```\n\nOnce installed, you can use the `dumdum` and `dumdum-server` commands.\nRunning `dumdum` starts a graphical client which you can use to join\nDumdum servers, while `dumdum-server` is used to host servers of your own.\nBoth support the `-h/--help` option if you want to see more details:\n\n```sh\nusage: dumdum [-h] [-v] {appdirs} ...\n\nStart the client interface for connecting to dumdum servers.\n\npositional arguments:\n  {appdirs}\n\noptions:\n  -h, --help     show this help message and exit\n  -v, --verbose  Increase logging verbosity\n```\n\n```sh\nusage: dumdum-server [-h] [-v] [-c CHANNELS [CHANNELS ...]] [--host HOST] [--port PORT] [--cert CERT]\n\nHost a dumdum server.\n\nTo use TLS encryption, you must provide a certificate and private key.\nThis can be specified as either:\n1. A single file containing both the private key and certificate:\n     --cert hello.pem\n2. A pair of certificate and private key files, separated with a colon:\n     --cert hello.crt:hello.key\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --verbose         Increase logging verbosity\n  -c CHANNELS [CHANNELS ...], --channels CHANNELS [CHANNELS ...]\n                        A list of channels\n  --host HOST           The address to host on, or all interfaces when not supplied\n  --port PORT           The port number to host on (default: 6667)\n  --cert CERT           The SSL certificate and private key to use\n```\n\n## Implementation\n\nDumdum consists of two parts:\n\n1. The Sans-IO protocol, defined in [dumdum.protocol]\n2. The asyncio wrapper, defined in [dumdum.client] and [dumdum.server]\n\nThe [Sans-IO] protocol is responsible for handling the generation and\nconsumption of byte streams, along with producing events from received\nmessages, while the asyncio wrapper is responsible for the actual network\ncommunication between the server and its clients.\n\n[Sans-IO]: https://sans-io.readthedocs.io/\n\n[dumdum.protocol]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/protocol\n[dumdum.client]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/client\n[dumdum.server]: https://github.com/thegamecracks/dum-dum-irc/tree/main/src/dumdum/server\n\n## Protocol\n\nClients are able to send the following messages:\n\n1. HELLO: `0x00 | 1-byte version`\n2. AUTHENTICATE: `0x02 | varchar nickname (32)`\n3. SEND_MESSAGE: `0x03 | varchar channel name (32) | varchar content (1024)`\n4. LIST_CHANNELS: `0x04`\n5. LIST_MESSAGES: `0x05 | 8-byte before snowflake or 0 | 8-byte after snowflake or 0`\n\nServers are able to send the following messages:\n\n1. HELLO: `0x00 | 0 or 1 using SSL`\n2. INCOMPATIBLE_VERSION: `0x01 | 1-byte version`\n3. ACKNOWLEDGE_AUTHENTICATION: `0x02 | 0 or 1 success`\n4. SEND_MESSAGE: `0x03 | 8-byte snowflake | varchar channel name (32) | varchar nickname (32) | varchar content (1024)`\n5. LIST_CHANNELS: `0x04 | 2-byte length | varchar channel name (32) | ...`\n6. LIST_MESSAGES: `0x05 | 3-byte length | same fields after SEND_MESSAGE | ...`\n\nClients must send a HELLO command and wait for the server to respond with HELLO.\nAfterwards the client must send an AUTHENTICATE command and wait for a successful\nACKNOWLEDGE_AUTHENTICATION before they can begin chat communications.\n\nWhen the client disconnects and reconnects, they MUST re-send hello\nand re-authenticate with the server.\n\nIf the server supports SSL, they can set `using SSL` in HELLO to indicate\nthat the client should upgrade the connection to SSL.\nAt this point, the protocol should not receive any data until after the\nSSL handshake is complete.\n\nAs this protocol has been intentionally designed to be simple (no timeouts\nor keep alives), I/O wrappers do not need a significant amount of work to\nimplement it.\n\n## TLS Encryption\n\n`dumdum-server` can use SSL certificates to encrypt connections.\nFor example, if you want to use a self-signed certificate and private key,\nyou can install OpenSSL and run the following command:\n\n```sh\nopenssl req -new -x509 -days 365 -noenc -out dumdum.crt -keyout dumdum.key\n```\n\nAfter filling out (or skipping) the certificate signing request prompts,\nyou can then run the server with the resulting `dumdum.crt` and `dumdum.key`\nfiles:\n\n```sh\ndumdum-server --cert dumdum.crt:dumdum.key\n```\n\nAs for the `dumdum` client, SSL can be enabled by the user before connecting\nto a server. If the server uses a self-signed certificate, the user will need\nto download the server's certificate (.crt) and select it.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A non-standard internet relay chat program.",
    "version": "0.4.2",
    "project_urls": {
        "Homepage": "https://github.com/thegamecracks/dum-dum-irc",
        "Issue Tracker": "https://github.com/thegamecracks/dum-dum-irc/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03524973ce2a9a843b6792e205e479e1dd2534bbd9130b585dbc4abaca691757",
                "md5": "a501b58c7b4a3f3a63ed52e13987050b",
                "sha256": "a142f4014c015eacb72fcf35cab20dd9e631d3cbe75590c6d8c6e79b7c044ddc"
            },
            "downloads": -1,
            "filename": "dum_dum_irc-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a501b58c7b4a3f3a63ed52e13987050b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 39930,
            "upload_time": "2024-06-17T16:50:22",
            "upload_time_iso_8601": "2024-06-17T16:50:22.453283Z",
            "url": "https://files.pythonhosted.org/packages/03/52/4973ce2a9a843b6792e205e479e1dd2534bbd9130b585dbc4abaca691757/dum_dum_irc-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3821391388f6e5de4a0c3a0440deb41dfee6d059f2d33c87fc783c7e1f3fb754",
                "md5": "6c05243de8a9775c71848eb337755f66",
                "sha256": "61ff325844a0f3e3fa5f28ea5112b69f13d31fe477969ad41a878d1f082b1509"
            },
            "downloads": -1,
            "filename": "dum_dum_irc-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6c05243de8a9775c71848eb337755f66",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 94776,
            "upload_time": "2024-06-17T16:50:23",
            "upload_time_iso_8601": "2024-06-17T16:50:23.909084Z",
            "url": "https://files.pythonhosted.org/packages/38/21/391388f6e5de4a0c3a0440deb41dfee6d059f2d33c87fc783c7e1f3fb754/dum_dum_irc-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-17 16:50:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thegamecracks",
    "github_project": "dum-dum-irc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dum-dum-irc"
}
        
Elapsed time: 0.28171s