yaotpbot


Nameyaotpbot JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/ollaw/yaotpbot
SummaryA telegram bot to generate OTPs
upload_time2024-08-04 16:09:51
maintainerNone
docs_urlNone
authorOlla Gabriele
requires_python<4.0,>=3.10
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)  [![Python code style](https://img.shields.io/badge/code_style-black-000000.svg)](https://github.com/ambv/black)




# Yet Another OTP Bot

[@yaotpbot](https://t.me/yaotpbot) : A Telegram Bot to generate OTPs.

**Disclaimer: This project is intended as a toy project and should not be used for serious or production purposes. The author does not recommend using this for any critical applications.**



## Architecture

```mermaid
flowchart LR;

T[Telegram Server]

D[Dynamo DB]

subgraph K[Kubernetes Cluster]
    direction TB
    Y[Yaotpbot]
    GO[Gitlab Operator]
    GO -->|Deploy and sync| Y
end

subgraph G[GitLab]
    direction TB
    R[Repository]
    RE[Container Registry]
    R -->|CI| RE

end

K -.->|Poll update| T
D <---> |Store and retrieve| K
K -.-> |Watch and sync| G
```


### 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). |
| LOCALSTACK_ENDPOINT       | A localstack endpoint to use when not using AWS. By default the bot looks for a table called `yaotpbot-table` and use `sts` to verify the connection. |
| 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": "https://github.com/ollaw/yaotpbot",
    "name": "yaotpbot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "telegram-bot, otp",
    "author": "Olla Gabriele",
    "author_email": "dev@ollaw.xyz",
    "download_url": "https://files.pythonhosted.org/packages/c7/7b/79034857d91820db8ace70f7cf74b3b3d29b81b94c7da3f45d9569b28815/yaotpbot-0.1.0.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)  [![Python code style](https://img.shields.io/badge/code_style-black-000000.svg)](https://github.com/ambv/black)\n\n\n\n\n# Yet Another OTP Bot\n\n[@yaotpbot](https://t.me/yaotpbot) : A Telegram Bot to generate OTPs.\n\n**Disclaimer: This project is intended as a toy project and should not be used for serious or production purposes. The author does not recommend using this for any critical applications.**\n\n\n\n## Architecture\n\n```mermaid\nflowchart LR;\n\nT[Telegram Server]\n\nD[Dynamo DB]\n\nsubgraph K[Kubernetes Cluster]\n    direction TB\n    Y[Yaotpbot]\n    GO[Gitlab Operator]\n    GO -->|Deploy and sync| Y\nend\n\nsubgraph G[GitLab]\n    direction TB\n    R[Repository]\n    RE[Container Registry]\n    R -->|CI| RE\n\nend\n\nK -.->|Poll update| T\nD <---> |Store and retrieve| K\nK -.-> |Watch and sync| G\n```\n\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| LOCALSTACK_ENDPOINT       | A localstack endpoint to use when not using AWS. By default the bot looks for a table called `yaotpbot-table` and use `sts` to verify the connection. |\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\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A telegram bot to generate OTPs",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/ollaw/yaotpbot/blob/main/README.md",
        "Homepage": "https://github.com/ollaw/yaotpbot",
        "Repository": "https://github.com/ollaw/yaotpbot"
    },
    "split_keywords": [
        "telegram-bot",
        " otp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bed0731c124eb1bd96eb6af2a10b0c8a02d2a285ef4d8d82fa733ddb203b6ccd",
                "md5": "b7b07c24190b5f00d1da17344c19ff92",
                "sha256": "9609d1d23d365d2e8506e3424d2beb19ddb358a7622a009e8e65946fad9272ec"
            },
            "downloads": -1,
            "filename": "yaotpbot-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b7b07c24190b5f00d1da17344c19ff92",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13942,
            "upload_time": "2024-08-04T16:09:49",
            "upload_time_iso_8601": "2024-08-04T16:09:49.968004Z",
            "url": "https://files.pythonhosted.org/packages/be/d0/731c124eb1bd96eb6af2a10b0c8a02d2a285ef4d8d82fa733ddb203b6ccd/yaotpbot-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c77b79034857d91820db8ace70f7cf74b3b3d29b81b94c7da3f45d9569b28815",
                "md5": "099932299849002857d7bbd7f23125f3",
                "sha256": "19a6be8dd1801016cefa8cd6d6c7df489676fdb8823fb4c92ed4f8b18ed22b7b"
            },
            "downloads": -1,
            "filename": "yaotpbot-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "099932299849002857d7bbd7f23125f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 10118,
            "upload_time": "2024-08-04T16:09:51",
            "upload_time_iso_8601": "2024-08-04T16:09:51.323627Z",
            "url": "https://files.pythonhosted.org/packages/c7/7b/79034857d91820db8ace70f7cf74b3b3d29b81b94c7da3f45d9569b28815/yaotpbot-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-04 16:09:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ollaw",
    "github_project": "yaotpbot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "yaotpbot"
}
        
Elapsed time: 4.35344s