Compare commits

..
4 Commits
Author SHA1 Message Date
ashish b63a13caa1 Adjustment to stop script 2026-01-24 10:42:50 -06:00
ashish 9ed37905c8 Another bugfix 2023-11-22 19:36:40 -06:00
ashish a3b2e0e22c Fixed AttributeError in NtfyRouter #5
Squashed commit of the following:

commit 49daddff83a18e0eba4ab04899937f8962df2379
Author: Ashish D'Souza <[email protected]>
Date:   Wed Nov 22 18:55:58 2023 -0600

    Fixed wrong variable name
2023-11-22 18:56:31 -06:00
ashish a14ae8581a Added ntfy router #2
Squashed commit of the following:

commit 3ba0c9b4c6
Author: Ashish D'Souza <[email protected]>
Date:   Sun Nov 19 05:21:27 2023 -0600

    Another bugfix

commit 8a76bddbf1
Author: Ashish D'Souza <[email protected]>
Date:   Sun Nov 19 05:12:40 2023 -0600

    Added ntfy router to ansible scripts

commit 7b51846e1b
Author: Ashish D'Souza <[email protected]>
Date:   Sun Nov 19 05:12:14 2023 -0600

    Fixed inconsistent variable names bug

commit a96a14e261
Author: Ashish D'Souza <[email protected]>
Date:   Sun Nov 19 04:53:09 2023 -0600

    Added ntfy router to docker compose

commit d2f30faa5e
Author: Ashish D'Souza <[email protected]>
Date:   Sun Nov 19 04:52:07 2023 -0600

    Added ntfy routing
2023-11-19 06:17:01 -06:00
4 changed files with 11 additions and 12 deletions

No files matched your search

+5 -6
View File
@@ -1,10 +1,4 @@
notification:
test2:
system:
title: '(?<=\[).+(?=\])'
message:
title: '^.+(?=\s\[)'
message: '[^\n]+$'
jenkins:
system:
title: '.*'
@@ -16,6 +10,11 @@ notification:
message:
title: '^.+(?=\s\[)'
message: '[^\n]+$'
Dsatp58_alerts:
system:
title: '(?<=\s)[\w.]+'
message:
message: '[^\n]+(?=\n---------)'
call:
call_ashish:
caller:
+1 -1
View File
@@ -37,7 +37,7 @@ class RabbitMQPublisher:
def send_notification(self, system: str, user: str, priority: str, message: str) -> None:
self._publish(f'notification.{system}.{user}.{priority}', message)
def send_call() -> None:
def send_call(self, caller: str, user: str, message: str) -> None:
self._publish(f'call.{caller}.{user}', json.dumps({
'ringtone': {
'filename': 'Magic.mp3',
+4 -4
View File
@@ -45,11 +45,11 @@ class NtfyRouter:
def route_message(self, topic: str, title: str, message: str):
if topic in self._formatters['notification']:
notification_args = {notification_arg: self._formatters['notification'][topic][call_arg](topic=topic, title=title, message=message) for notification_arg in self._formatters['notification'][topic]}
self._send_notification(user='ashish', priority='high', **notification_args)
elif topic in self._call_topics:
notification_args = {notification_arg: self._formatters['notification'][topic][notification_arg](topic=topic, title=title, message=message) for notification_arg in self._formatters['notification'][topic]}
self._rabbitmq_publisher.send_notification(user='ashish', priority='high', **notification_args)
elif topic in self._formatters['call']:
call_args = {call_arg: self._formatters['call'][topic][call_arg](topic=topic, title=title, message=message) for call_arg in self._formatters['call'][topic]}
self._send_call(user='ashish', **call_args)
self._rabbitmq_publisher.send_call(**call_args)
async def start(self, rabbitmq_host: str, rabbitmq_port: int):
self._ntfy_subscriber = NtfySubscriber([topic for message_type in self._formatters for topic in self._formatters[message_type]])
+1 -1
View File
@@ -14,7 +14,7 @@
- name: Docker Compose down Broadcast
environment:
SERVER_IP: '{{ansible_default_ipv4.address}}'
community.docker.docker_compose:
community.docker.docker_compose_v2:
project_name: broadcast
project_src: '{{docker_compose_dir.path}}'
state: absent