Commit 30dfdd3f authored by Manuel Leithner's avatar Manuel Leithner
Browse files

Added licensing information, installation instructions and usage example

parent ddceab3e
This diff is collapsed.
# bruh # bruh
An OMEMO-enabled XMPP bot that tails a log file and sends new lines to a given contact in encrypted form. An OMEMO-enabled XMPP bot that tails a log file and sends new lines to a given contact in encrypted form.
\ No newline at end of file
Heavily based on the [slixmpp-omemo](https://lab.louiz.org/poezio/slixmpp-omemo) example. In fact, for the most part this code is just an extension of it.
Licensed under the GPLv3, see LICENSE.
## Installation
Clone this repository, ideally set up a virtualenv for it, and install the requirements:
```bash
git clone https://git.nwt.fhstp.ac.at/is211810/bruh.git
virtualenv -p python3.8 bruh
cd bruh
source bin/activate
pip install -r requirements.txt
```
## Usage
If you are using a virtualenv, make sure to activate it first by typing `source bin/activate` in this folder!
```
python bruh.py [-h] [-q] [-d] [-j JID] [-p PASSWORD] [-f FILE_NAME] [-t WATCH_DEST_JID] [--data-dir DATA_DIR]
An OMEMO-enabled XMPP bot that tails a log file and sends new lines to a given contact in encrypted form.
It also serves as an echo bot.
optional arguments:
-h, --help show this help message and exit
-q, --quiet set logging to ERROR
-d, --debug set logging to DEBUG
-j JID, --jid JID JID to use
-p PASSWORD, --password PASSWORD
password to use
-f FILE_NAME, --file FILE_NAME
Log file to watch
-t WATCH_DEST_JID, --to WATCH_DEST_JID
JID of the user to send new lines to
--data-dir DATA_DIR data directory
```
If the `--jid` or `--password` parameter is missing, they will be requested interactively.
To tail a log file, provide the `--file` and `--to` parameters.
If these two parameters are not provided, the bot reverts to a simple echo bot (equivalent to the upstream version it is based on).
### Usage example
`python bruh.py --jid bruh@example.com --file /var/log/syslog --to manuel@m.redacted.is`
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Slixmpp OMEMO plugin Bruh log tailer
Copyright (C) 2010 Nathanael C. Fritz Based on the echo client example of slixmpp-omemo.
Copyright (C) 2019 Maxime “pep” Buquet <pep@bouah.net>
This file is part of slixmpp-omemo.
See the file LICENSE for copying permission. See the file LICENSE for copying permission.
""" """
...@@ -38,11 +36,9 @@ LEVEL_ERROR = 1 ...@@ -38,11 +36,9 @@ LEVEL_ERROR = 1
class Bruh(ClientXMPP): class Bruh(ClientXMPP):
""" """
A simple Slixmpp bot that will echo encrypted messages it receives, along An OMEMO-enabled XMPP bot that tails a log file and sends new lines
with a short thank you message. to a given contact in encrypted form.
It also serves as an echo bot.
For details on how to build a client with slixmpp, look at examples in the
slixmpp repository.
""" """
eme_ns = 'eu.siacs.conversations.axolotl' eme_ns = 'eu.siacs.conversations.axolotl'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment