{ "info": { "author": "jkuettner", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "# Dirvish Telegram Bot\nThis is a simple telegram-bot for the backupsoftware [dirvish](http://www.dirvish.org/) that will notify you if a backup has failed.\n\n## Features\n- Register with the bot\n- add user to the bot (unregistered users are not able to do anything)\n- subscribe/unsubscribe to failed backup notification\n- show the current backup status\n\n## Installation\nTo install this bot you have to run one of the following commands:\n```\npip install dirvishbot\n```\nor\n```\ngit clone https://github.com/jkuettner/dirvishbot.git && cd dirvishbot && pip install .\n```\n\n## Update\nTo update simply run\n```\npip install --upgrade dirvishbot\n```\nor\n```\ngit clone https://github.com/jkuettner/dirvishbot.git && cd dirvishbot && pip install --upgrade .\n```\n\n## Configuration\n### 1. Create a new telegram bot\n- Start conversation with `@botfather`\n- Send `/newbot` and follow the instructions of `@botfather` until you got your bot token.\n\nFurther informations about how to create a new bot: https://core.telegram.org/bots#create-a-new-bot\n### 2. Create `config.json`\nYou have to create a config.json with the telegram bot token in it. To do this you could copy the `config.example.json` to `/etc/dirvishbot/config.json` and replace the example `api_token` with yours:\n```\ncp /etc/dirvishbot/config.json.example /etc/dirvishbot/config.json\n```\nThe `config.json` should look like the following:\n```\n{\n \"api_token\": \"123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n}\n\n```\n### 3. Trigger dirvishbot after the backup-process\nThe dirvishbot listens to the signal `SIGUSR1` to check the state of all backups and informs all subscribers if one of the backups has failed.\n\nWith the following line the dirvishbot will be notified:\n```\nbash -c 'kill -s SIGUSR1 $(< /var/run/dirvishbot.pid)'\n```\nYou can put this line just before `exit $rc` in `/etc/dirvish/dirvish-cronjob` to start the backup-check after dirvish has finished.\n\n\n## Run\nIf you have systemd installed the `dirvishbot.service` file will be placed to `/etc/systemd/system/dirvishbot.service` and you can start it with:\n```\nsystemctl start dirvishbot\n```\nTo check the status run\n```\nsystemctl status dirvishbot\n```\n\nIf you do not use `systemd` you can start this bot by running\n```\ndirvishbot &\n```\n\n## Usage\n### First start\nIf you start the dirvishbot for the first time you have to register your telegram-user as admin.\nTo do this you need a token that will be saved in `/etc/dirvishbit/register`:\n\n```\ncat /etc/dirvishbot/register\n```\n```\nThis is your first start of the Bot.\nPlease register your admin-user within the next hour by sending the following to this Bot:\n /register \n```\n\nAfter the first start you have one hour to register an admin-user with this bot until the token invalidates and you have to restart the bot to get a new token.\n\n**Note that the first user that will send the `/register ` to your bot will become the administrator.**\n\nTo reset the bot simple stop it, delete every line but `\"api_token\": ...` from the `config.json`-file and restart the bot.\n\n### Commands\nTo run a command, send one of the following messages to your telegram-bot from your telegram-client:\n- `/start`: Sends you a welcome message with an introduction (every user)\n- `/register `: registers the sender with this bot if `` is valid. (every user)\n- `/adduser`: generates a token for your contact that will be able to run the `/register`-command. The token invalidates after 24 hours. (only admins)\n- `/subscribe`: enable notification of failed backups (every registered user)\n- `/unsubscribe`: disable notification of failed backups (every registered user)\n- `/status `: show the current status of the (DEFAULT=1) of last backups. (every registered user).\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jkuettner/dirvishbot", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jkuettner/dirvishbot", "keywords": "dirvish telegram bot notify notification", "license": "GPL3", "maintainer": null, "maintainer_email": null, "name": "dirvishbot", "package_url": "https://pypi.org/project/dirvishbot/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dirvishbot/", "project_urls": { "Download": "https://github.com/jkuettner/dirvishbot", "Homepage": "https://github.com/jkuettner/dirvishbot" }, "release_url": "https://pypi.org/project/dirvishbot/0.0.8/", "requires_dist": null, "requires_python": null, "summary": "A simple telegram bot for dirvish", "version": "0.0.8" }, "last_serial": 2586183, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "8640939df9dec9dbd0ade06a5009c59d", "sha256": "4cb6b5fde24be25f2db3826fb92f3e16820efb371dbc77a389c1c9748ff75f5b" }, "downloads": -1, "filename": "dirvishbot-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8640939df9dec9dbd0ade06a5009c59d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19651, "upload_time": "2016-10-20T18:18:45", "url": "https://files.pythonhosted.org/packages/b3/8f/a5ed87975ce4513a81d9951d23743da6e1afc53dd5c2e55f50dc86dd753e/dirvishbot-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4b2b9b128f6bbef60f512966239611b2", "sha256": "cd21a283ea1a53f28249d808a65a512c718a9423e91a025dbcf563381d3a9edb" }, "downloads": -1, "filename": "dirvishbot-0.0.4.tar.gz", "has_sig": false, "md5_digest": "4b2b9b128f6bbef60f512966239611b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20051, "upload_time": "2016-11-06T21:26:35", "url": "https://files.pythonhosted.org/packages/81/60/d0d2f97c9160f4c02c36dc75b87b3efe8e5a22a3356006be1016600e0bbd/dirvishbot-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "9cd6b78f9700aadac6207318e3c6d5a8", "sha256": "deb0f9dda1b03b8885a57377c65a4caeb419bc9b6cf314f05c28ca99f3e92619" }, "downloads": -1, "filename": "dirvishbot-0.0.5.tar.gz", "has_sig": false, "md5_digest": "9cd6b78f9700aadac6207318e3c6d5a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20036, "upload_time": "2016-11-06T21:31:52", "url": "https://files.pythonhosted.org/packages/73/c0/8e60ef61ec70895431cfc13498784dde973563426a6b36b372e9aae5ffb0/dirvishbot-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "1377ca1f6b16a8ae609e598b63be5d57", "sha256": "400d6ed4a6796f52bf51b9c2c3559635b95e8fcf75ed005ac46b319585914165" }, "downloads": -1, "filename": "dirvishbot-0.0.6.tar.gz", "has_sig": false, "md5_digest": "1377ca1f6b16a8ae609e598b63be5d57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20078, "upload_time": "2017-01-17T20:44:01", "url": "https://files.pythonhosted.org/packages/85/ec/f46642466534b75f1307218f29f5cf9a3c49ccc3c381e93e58db1e2f1ee7/dirvishbot-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "e57300e9c1eba1ff2ccb53c3be800a00", "sha256": "d80cf6c7d186b6f28086d55172fb2e7f9150a9c76d0eaecf0d855500ccade0ce" }, "downloads": -1, "filename": "dirvishbot-0.0.7.tar.gz", "has_sig": false, "md5_digest": "e57300e9c1eba1ff2ccb53c3be800a00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20082, "upload_time": "2017-01-17T20:48:33", "url": "https://files.pythonhosted.org/packages/a0/a9/b0b2a76894f4c5b7451633fe5ecaba80ddd9c838fdefc2d93d7023a4c727/dirvishbot-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "e2e94c9e087accf20b456ac99347e7d2", "sha256": "eec14d0f4c9424b65c161030439283882f89ae5e6cfc17ca400ba7ff61d857a5" }, "downloads": -1, "filename": "dirvishbot-0.0.8.tar.gz", "has_sig": false, "md5_digest": "e2e94c9e087accf20b456ac99347e7d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20134, "upload_time": "2017-01-19T21:48:54", "url": "https://files.pythonhosted.org/packages/6b/b1/331d04be5cbe23040b23ac580e723cb9ad4e4758a8b5d485c72b7b15465f/dirvishbot-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e2e94c9e087accf20b456ac99347e7d2", "sha256": "eec14d0f4c9424b65c161030439283882f89ae5e6cfc17ca400ba7ff61d857a5" }, "downloads": -1, "filename": "dirvishbot-0.0.8.tar.gz", "has_sig": false, "md5_digest": "e2e94c9e087accf20b456ac99347e7d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20134, "upload_time": "2017-01-19T21:48:54", "url": "https://files.pythonhosted.org/packages/6b/b1/331d04be5cbe23040b23ac580e723cb9ad4e4758a8b5d485c72b7b15465f/dirvishbot-0.0.8.tar.gz" } ] }