yaotpbot


Nameyaotpbot JSON
Version 0.0.9 PyPI version JSON
download
home_page
SummaryA telegram bot to generate OTPs
upload_time2023-11-28 17:51:19
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords telegram-bot otp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://badge.fury.io/py/yaotpbot.svg)](https://badge.fury.io/py/yaotpbot) [![Gitlab pipeline status](https://gitlab.com/ollaww/yaotpbot/badges/main/pipeline.svg)](https://gitlab.com/ollaww/yaotpbot) [![Python code style](https://img.shields.io/badge/code_style-black-000000.svg)](https://github.com/ambv/black)

# Yet Another OTP Bot

A Telegram Bot to generate OTPs.

[@yaotpbot](https://t.me/yaotpbot)

## Architecture

![Architecture of bot](/docs/architecture.png "High level architecture")

### Software
Yaotpbot is written in Python and use [telegram-bot-api](https://github.com/python-telegram-bot/python-telegram-bot) to interact with Telegram.

### Infrastructure
A [DynamoDB](https://aws.amazon.com/dynamodb/) table it's used to store the identifiers of the chats and all the related seeds, needed to generate OTPs. All those information **are stored encrypted** and just decrpyted at runtime, using `dynamodb-encryption-sdk` library with AES encryption.

### Deployment
CI/CD is automated with GitOps. in particular:
- The pipeline
    - Builds the artifact and publishes it on [Pypi](https://pypi.org/project/yaotpbot/);
    - Builds the container using [buildx](https://docs.docker.com.xy2401.com/buildx/working-with-buildx/) to support multiple architecture and push the images on [GitLab container registry](https://gitlab.com/ollaww/yaotpbot/container_registry).
- The [operator](https://docs.gitlab.com/ee/user/clusters/agent/install/index.html) deploys and keep synced the manifests created on a local k3s cluster.

## Installation and usage

The bot can either be used as a container ([registry](https://gitlab.com/ollaww/yaotpbot/container_registry)) or installed directly with `pip` running

```
pip3 install --upgrade yaotpbot 
```
Note that following environment variables must be set:

| Name        | Description |
|---------------------------|---|
| TELEGRAM_API_TOKEN       | Telegram Api Token of your bot needed to interact with Telegram. You always get a new one when [creating a new bot](https://core.telegram.org/bots/api). |
| DYNAMO_DB_ENDPOINT       | A custom DynamoDB endpoint when not using AWS. By default the bot looks for a table called `yaotpbot-table` using the credentials provided. |
| DYNAMO_AES_SIGN_KEY       | Key used to sign encrypted data stored on DynamoDB. Can be generated running `python scrips/keys.py` |
| DYNAMO_AES_ENCRYPTION_KEY | Key used to encrypt data stored on DynamoDB. Can be generated running `python scrips/keys.py` |
| AWS_ACCESS_KEY_ID         | AWS access key id. Used with `AWS_SECRET_ACCESS_KEY` to interact with DynamoDB. |
| AWS_SECRET_ACCESS_KEY         | AWS secret access key. Used with  `AWS_ACCESS_KEY_ID` to interact with DynamoDB. |

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "yaotpbot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "telegram-bot,otp",
    "author": "",
    "author_email": "Olla Gabriele <ollagabriele@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/93/c3/f37f8b1560f311fd6d4969f587ab02586e909fac032834d7d08b47634c0c/yaotpbot-0.0.9.tar.gz",
    "platform": null,
    "description": "[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PyPI version](https://badge.fury.io/py/yaotpbot.svg)](https://badge.fury.io/py/yaotpbot) [![Gitlab pipeline status](https://gitlab.com/ollaww/yaotpbot/badges/main/pipeline.svg)](https://gitlab.com/ollaww/yaotpbot) [![Python code style](https://img.shields.io/badge/code_style-black-000000.svg)](https://github.com/ambv/black)\n\n# Yet Another OTP Bot\n\nA Telegram Bot to generate OTPs.\n\n[@yaotpbot](https://t.me/yaotpbot)\n\n## Architecture\n\n![Architecture of bot](/docs/architecture.png \"High level architecture\")\n\n### Software\nYaotpbot is written in Python and use [telegram-bot-api](https://github.com/python-telegram-bot/python-telegram-bot) to interact with Telegram.\n\n### Infrastructure\nA [DynamoDB](https://aws.amazon.com/dynamodb/) table it's used to store the identifiers of the chats and all the related seeds, needed to generate OTPs. All those information **are stored encrypted** and just decrpyted at runtime, using `dynamodb-encryption-sdk` library with AES encryption.\n\n### Deployment\nCI/CD is automated with GitOps. in particular:\n- The pipeline\n    - Builds the artifact and publishes it on [Pypi](https://pypi.org/project/yaotpbot/);\n    - Builds the container using [buildx](https://docs.docker.com.xy2401.com/buildx/working-with-buildx/) to support multiple architecture and push the images on [GitLab container registry](https://gitlab.com/ollaww/yaotpbot/container_registry).\n- The [operator](https://docs.gitlab.com/ee/user/clusters/agent/install/index.html) deploys and keep synced the manifests created on a local k3s cluster.\n\n## Installation and usage\n\nThe bot can either be used as a container ([registry](https://gitlab.com/ollaww/yaotpbot/container_registry)) or installed directly with `pip` running\n\n```\npip3 install --upgrade yaotpbot \n```\nNote that following environment variables must be set:\n\n| Name        | Description |\n|---------------------------|---|\n| TELEGRAM_API_TOKEN       | Telegram Api Token of your bot needed to interact with Telegram. You always get a new one when [creating a new bot](https://core.telegram.org/bots/api). |\n| DYNAMO_DB_ENDPOINT       | A custom DynamoDB endpoint when not using AWS. By default the bot looks for a table called `yaotpbot-table` using the credentials provided. |\n| DYNAMO_AES_SIGN_KEY       | Key used to sign encrypted data stored on DynamoDB. Can be generated running `python scrips/keys.py` |\n| DYNAMO_AES_ENCRYPTION_KEY | Key used to encrypt data stored on DynamoDB. Can be generated running `python scrips/keys.py` |\n| AWS_ACCESS_KEY_ID         | AWS access key id. Used with `AWS_SECRET_ACCESS_KEY` to interact with DynamoDB. |\n| AWS_SECRET_ACCESS_KEY         | AWS secret access key. Used with  `AWS_ACCESS_KEY_ID` to interact with DynamoDB. |\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A telegram bot to generate OTPs",
    "version": "0.0.9",
    "project_urls": null,
    "split_keywords": [
        "telegram-bot",
        "otp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd18cd7842bc866986f5fa153f6a9c1309f6a0619058c39d6cb6c143b1cf52e5",
                "md5": "a932a992f6b3a3c0601cd18e5a413fcf",
                "sha256": "ab5f446826938ba5c115c2f639164a7086bbe099e5f92595f9d0b06ecbde65dc"
            },
            "downloads": -1,
            "filename": "yaotpbot-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a932a992f6b3a3c0601cd18e5a413fcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13956,
            "upload_time": "2023-11-28T17:51:17",
            "upload_time_iso_8601": "2023-11-28T17:51:17.013850Z",
            "url": "https://files.pythonhosted.org/packages/cd/18/cd7842bc866986f5fa153f6a9c1309f6a0619058c39d6cb6c143b1cf52e5/yaotpbot-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93c3f37f8b1560f311fd6d4969f587ab02586e909fac032834d7d08b47634c0c",
                "md5": "e03fe57fb024ec1798bca7d5919a695b",
                "sha256": "0fe84ff4abc3d7cb0d4d1c02e545928ff8fbe7e52fff66e4fbbfc0b070be06bf"
            },
            "downloads": -1,
            "filename": "yaotpbot-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "e03fe57fb024ec1798bca7d5919a695b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 52182,
            "upload_time": "2023-11-28T17:51:19",
            "upload_time_iso_8601": "2023-11-28T17:51:19.110475Z",
            "url": "https://files.pythonhosted.org/packages/93/c3/f37f8b1560f311fd6d4969f587ab02586e909fac032834d7d08b47634c0c/yaotpbot-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-28 17:51:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "yaotpbot"
}
        
Elapsed time: 0.14818s