aboutsummaryrefslogtreecommitdiff
path: root/app/initialize_variables.py
diff options
context:
space:
mode:
authorParker M <contact@pkrm.dev>2023-09-23 19:11:52 -0500
committerParker M <contact@pkrm.dev>2023-09-23 19:11:52 -0500
commitac8fb456373693d3574dcfc3f2f056fb2e0e1117 (patch)
tree374448fb3ea67525004dece6f57a37b0051770b6 /app/initialize_variables.py
parentfdbb478c19aa22e8852334f56d278f41907a7183 (diff)
Add UptimeKuma Notifcations
Diffstat (limited to 'app/initialize_variables.py')
-rw-r--r--app/initialize_variables.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/initialize_variables.py b/app/initialize_variables.py
index 5450036..9dfda1a 100644
--- a/app/initialize_variables.py
+++ b/app/initialize_variables.py
@@ -4,9 +4,10 @@ import requests
supported_sms_services = ['telnyx', 'twilio']
-sms_service = str(os.environ['SMS_SERVICE']).lower()
radarr_host_url = str(os.environ['RADARR_HOST_URL'])
radarr_api_key = str(os.environ['RADARR_API_KEY'])
+enable_kuma_notifications = str(os.environ['ENABLE_KUMA_NOTIFICATIONS']).lower()
+sms_service = str(os.environ['SMS_SERVICE']).lower()
headers = {
'Content-Type': 'application/json',
@@ -26,6 +27,11 @@ try:
api_number = str(file['api_number'])
val_nums = str(file['valid_senders'])
root_folder_path = str(file['root_folder_path'])
+
+ if enable_kuma_notifications == 'true':
+ notif_receivers_nums = str(file['notif_receivers'])
+ authorization_header_token = str(file['authorization_header_token'])
+
if sms_service not in supported_sms_services:
print(f'{sms_service} is not a supported SMS service. Please choose from the supported list: {supported_sms_services}')
exit()
@@ -58,9 +64,14 @@ if value_not_set:
f.write("quality_profile_id:\n")
f.write("home_domain: null\n")
- f.write("api_number:\n")
- f.write("valid_senders:\n")
+ f.write("api_number: ''\n")
+ f.write("valid_senders: ''\n")
f.write("root_folder_path:\n")
+
+ if enable_kuma_notifications == 'true':
+ f.write("notif_receivers: ''\n")
+ f.write("authorization_header_token: uptimekumaauthtoken\n")
+
if sms_service not in supported_sms_services:
print(f'{sms_service} is not a supported SMS service. Please choose from the supported list: {supported_sms_services}')
exit()