Compare commits
4
Commits
8a76bddbf1
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b63a13caa1 | ||
|
|
9ed37905c8 | ||
|
|
a3b2e0e22c | ||
|
|
a14ae8581a |
No files matched your search
@@ -1,10 +1,4 @@
|
|||||||
notification:
|
notification:
|
||||||
test2:
|
|
||||||
system:
|
|
||||||
title: '(?<=\[).+(?=\])'
|
|
||||||
message:
|
|
||||||
title: '^.+(?=\s\[)'
|
|
||||||
message: '[^\n]+$'
|
|
||||||
jenkins:
|
jenkins:
|
||||||
system:
|
system:
|
||||||
title: '.*'
|
title: '.*'
|
||||||
@@ -16,6 +10,11 @@ notification:
|
|||||||
message:
|
message:
|
||||||
title: '^.+(?=\s\[)'
|
title: '^.+(?=\s\[)'
|
||||||
message: '[^\n]+$'
|
message: '[^\n]+$'
|
||||||
|
Dsatp58_alerts:
|
||||||
|
system:
|
||||||
|
title: '(?<=\s)[\w.]+'
|
||||||
|
message:
|
||||||
|
message: '[^\n]+(?=\n---------)'
|
||||||
call:
|
call:
|
||||||
call_ashish:
|
call_ashish:
|
||||||
caller:
|
caller:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class RabbitMQPublisher:
|
|||||||
def send_notification(self, system: str, user: str, priority: str, message: str) -> None:
|
def send_notification(self, system: str, user: str, priority: str, message: str) -> None:
|
||||||
self._publish(f'notification.{system}.{user}.{priority}', message)
|
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({
|
self._publish(f'call.{caller}.{user}', json.dumps({
|
||||||
'ringtone': {
|
'ringtone': {
|
||||||
'filename': 'Magic.mp3',
|
'filename': 'Magic.mp3',
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ class NtfyRouter:
|
|||||||
|
|
||||||
def route_message(self, topic: str, title: str, message: str):
|
def route_message(self, topic: str, title: str, message: str):
|
||||||
if topic in self._formatters['notification']:
|
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]}
|
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._send_notification(user='ashish', priority='high', **notification_args)
|
self._rabbitmq_publisher.send_notification(user='ashish', priority='high', **notification_args)
|
||||||
elif topic in self._call_topics:
|
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]}
|
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):
|
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]])
|
self._ntfy_subscriber = NtfySubscriber([topic for message_type in self._formatters for topic in self._formatters[message_type]])
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
- name: Docker Compose down Broadcast
|
- name: Docker Compose down Broadcast
|
||||||
environment:
|
environment:
|
||||||
SERVER_IP: '{{ansible_default_ipv4.address}}'
|
SERVER_IP: '{{ansible_default_ipv4.address}}'
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose_v2:
|
||||||
project_name: broadcast
|
project_name: broadcast
|
||||||
project_src: '{{docker_compose_dir.path}}'
|
project_src: '{{docker_compose_dir.path}}'
|
||||||
state: absent
|
state: absent
|
||||||
|
|||||||
Reference in new issue
Block a user