Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support OMEMO #2

Open
jelmer opened this issue Oct 28, 2018 · 8 comments
Open

support OMEMO #2

jelmer opened this issue Oct 28, 2018 · 8 comments

Comments

@jelmer
Copy link
Owner

jelmer commented Oct 28, 2018

It would be great to support OMEMO. This depends on support in slixmpp: https://lab.louiz.org/poezio/slixmpp/merge_requests/1

@ichthyx
Copy link
Contributor

ichthyx commented Jul 1, 2023

Hello,
added omemo support here https://github.com/ichthyx/prometheus-xmpp-alerts
I'll do a pr when I have time

@Neustradamus
Copy link

@ichthyx: Any news on it? :)

@ichthyx
Copy link
Contributor

ichthyx commented Feb 28, 2024

It's on my todo list but for now I lack of time sorry.
If you in a hurry, you can get a working version in some branch, but code was not perfect.

@ichthyx
Copy link
Contributor

ichthyx commented Sep 14, 2024

@jelmer is master supposed to work?

I have a bunch of error like

    help=argparse.HIDDEN)
         ^^^^^^^^^^^^^^^
AttributeError: module 'argparse' has no attribute 'HIDDEN'
UnboundLocalError: cannot access local variable 'text' where it is not associated with a value

in render_alert

and recipients bugs user@domain become 'u'

btw here an example with the new omemo plugin from Syndace

https://github.com/ichthyx/prometheus-xmpp-alerts/tree/omemo

jelmer added a commit that referenced this issue Sep 14, 2024
Fix argument parsing and add tests. See #2
@jelmer
Copy link
Owner Author

jelmer commented Sep 14, 2024

Yeah, not sure how that regressed. I've fixed it up and added some tests for the argument parsing.

@jelmer
Copy link
Owner Author

jelmer commented Sep 14, 2024

btw here an example with the new omemo plugin from [Syndace] (https://github.com/Syndace/slixmpp-omemo)

https://github.com/ichthyx/prometheus-xmpp-alerts/tree/omemo

Neat!

@ichthyx
Copy link
Contributor

ichthyx commented Sep 19, 2024

@jelmer with latest master if curl http://127.0.0.1:9199/test

Traceback (most recent call last):
  File "/home/user/DEV/xmppprom/venv/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/DEV/xmppprom/venv/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/DEV/xmppprom/prometheus-xmpp-alerts/prometheus_xmpp/__main__.py", line 249, in serve_test
    text, html = await render_alert(
                 ^^^^^^^^^^^^^^^^^^^
  File "/home/user/DEV/xmppprom/prometheus-xmpp-alerts/prometheus_xmpp/__main__.py", line 283, in render_alert
    return text, html
                 ^^^^
UnboundLocalError: cannot access local variable 'html' where it is not associated with a value

config is

# HTML message template as jinja2:
# html_template: |
#  <strong>{{ status.upper() }}</strong>: <i>{{ labels.alertname }}</i>
#  {% if labels.host or labels.instance %} at {{ labels.host or labels.instance }}{% endif %}
#  {% if annotations.message %}<br/>{{ annotations.message.replace("\n", "<br/>") }}{% endif %}
#  {% if annotations.description %}<br/>{{ annotations.description }}{% endif %}
#  <br/><a href="{{ generatorURL }}">Alert link</a>

# Text message template as jinja2; defaults to html_template with tags stripped.
text_template: |
 {{ status.upper() }}: *{{ labels.alertname }}* at {{ labels.host or labels.instance }}:\
 {{ annotations.message }}. {{ generatorURL }}

@jelmer
Copy link
Owner Author

jelmer commented Sep 27, 2024

(for those following just this issue, that last bug is now fixed in master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants