Add ntfy authentication to NEWS.

This commit is contained in:
Dan Helfman 2023-02-25 14:23:42 -08:00
parent 783a6d3b45
commit 8a9d5d93f5
3 changed files with 10 additions and 7 deletions

3
NEWS
View File

@ -1,3 +1,6 @@
1.7.8.dev0
* #621: Add optional authentication to the ntfy monitoring hook.
1.7.7
* #642: Add MySQL database hook "add_drop_database" configuration option to control whether dumped
MySQL databases get dropped right before restore.

View File

@ -62,14 +62,14 @@ def ping_monitor(hook_config, config_filename, state, monitoring_log_level, dry_
auth = None
if (username and password) is not None:
auth = requests.auth.HTTPBasicAuth(username, password)
logger.info(f'{config_filename}: Using basic auth with user {username} for Ntfy')
logger.info(f'{config_filename}: Using basic auth with user {username} for ntfy')
elif username is not None:
logger.warn(
f'{config_filename}: Password missing for Ntfy authentication, defaulting to no auth'
logger.warning(
f'{config_filename}: Password missing for ntfy authentication, defaulting to no auth'
)
elif password is not None:
logger.warn(
f'{config_filename}: Username missing for Ntfy authentication, defaulting to no auth'
logger.warning(
f'{config_filename}: Username missing for ntfy authentication, defaulting to no auth'
)
if not dry_run:
@ -79,7 +79,7 @@ def ping_monitor(hook_config, config_filename, state, monitoring_log_level, dry_
if not response.ok:
response.raise_for_status()
except requests.exceptions.RequestException as error:
logger.warning(f'{config_filename}: Ntfy error: {error}')
logger.warning(f'{config_filename}: ntfy error: {error}')
def destroy_monitor(

View File

@ -1,6 +1,6 @@
from setuptools import find_packages, setup
VERSION = '1.7.7'
VERSION = '1.7.8.dev0'
setup(