Coder Social home page Coder Social logo

alertbot's Introduction

Julian-Samuel Gebühr

I am a student of medical informatics in my masters and work in infosec. Prior to that I studied medical engineering and worked in Neuroscience. Feel free to reach out to me about anything you see here!

Basic information

alertbot's People

Contributors

ayushin avatar domrim avatar james-choncholas avatar moan0s avatar pauvos avatar spatteriight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

alertbot's Issues

Setting raw mode in a room also changes configuration in other rooms

Steps to reproduce

  • Start an instance of the bot and invite it into two rooms
  • in roomA set the mode to raw with the !raw command
  • alerts in roomB will now also show up in raw mode

Solutions for this I can think of

  • store per-room configuration at runtime if changed from default and check for every alert
  • store per-room configuration in database

Handle bot not in requested room

Oct 04 16:04:40 X-Wing matrix-nginx-proxy[1339632]: 172.18.0.1 - - [04/Oct/2022:16:04:40 +0000] "GET /_matrix/client/v3/rooms/%21ujxjgvoAxxHVXSdlev%3Aactiv
ism.international/state/m.room.encryption/ HTTP/1.1" 403 158 "-" "Python/3.9 aiohttp/3.8.1" "-"                                                            
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]: [2022-10-04 16:04:40,985] [[email protected]] Error handling request                                 
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]: Traceback (most recent call last):                                                                      
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request         
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     resp = await request_handler(request)                                                               
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle                      Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     resp = await handler(request)                                                                       Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl                 
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     return await handler(request)                                                                       Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/opt/maubot/maubot/server.py", line 119, in frontend_404_middleware                             
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     return await handler(request)                                                                       Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/opt/maubot/maubot/server.py", line 69, in handle_plugin_path                                   
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     return await app.handle(request)                                                                    Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/opt/maubot/maubot/plugin_server.py", line 57, in handle                                        
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     resp = await handler(request)                                                                       Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/data/plugins/de.hyteck.alertbot-v1.0.0.mbp/alertbot.py", line 177, in webhook_room             Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     await self.send_alert(req, room=room_id)                                                            
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/data/plugins/de.hyteck.alertbot-v1.0.0.mbp/alertbot.py", line 172, in send_alert               Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     await self.client.send_markdown(room, message)                                                      Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/opt/maubot/maubot/matrix.py", line 166, in send_markdown                                       
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     return await self.send_message(room_id, content, **kwargs)                                          Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/mautrix/client/encryption_manager.py", line 157, in send_messag
e_event                                                                                                                                                    Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     await self.get_state_event(room_id, EventType.ROOM_ENCRYPTION)                                      
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/mautrix/client/store_updater.py", line 162, in get_state_event Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     event = await super().get_state_event(room_id, event_type, state_key)                               Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/mautrix/client/api/events.py", line 149, in get_state_event    
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     content = await self.api.request(                                                                   Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 383, in request                          Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     return await self._send(method, full_url, req_content, query_params, headers or {})                 
Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:   File "/usr/lib/python3.9/site-packages/mautrix/api.py", line 258, in _send                            Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]:     raise make_request_error(                                                                           Oct 04 16:04:40 X-Wing matrix-bot-maubot[1341237]: mautrix.errors.request.MForbidden: User @alertbot:hyteck.de not in room !ujxjgvoAxxHVXSdlev:activism.int
ernational, and room previews are disabled    

500 on default glitchtip webhook

curl -X POST -d '{"alias": "GlitchTip", "text": "GlitchTip Alert", "attachments": [{"title": "TypeError: exceptions must derive from BaseException", "title_link": "https://alerts.djangoflow.net/getease-bv/issues/61126", "text": "django.core.management.commands.shell in <module>", "image_url": null, "color": "#e52b50", "fields": [{"title": "Project", "value": "Django", "short": true}, {"title": "Environment", "value": "sandbox", "short": true}], "mrkdown_in": ["text"]}], "sections": [{"activityTitle": "TypeError: exceptions must derive from BaseException", "activitySubtitle": "[View Issue DJANGO-1KR3](https://alerts.djangoflow.net/getease-bv/issues/61126)"}]}' 'https://matrix.............../_matrix/maubot/plugin/alerts/webhook/!.........:............'

500 Internal Server Error

Typo in the About of the project

Currently there is written: "A bot that recives a webhook and forwards alerts to a matrix room"
"recives" should be "receives".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.