Skip to content

Integration of Apprise notification services as a configurable option#14

Open
brott8 wants to merge 3 commits intofirasdib:mainfrom
brott8:main
Open

Integration of Apprise notification services as a configurable option#14
brott8 wants to merge 3 commits intofirasdib:mainfrom
brott8:main

Conversation

@brott8
Copy link
Copy Markdown

@brott8 brott8 commented Jul 21, 2024

  • Integration of Apprise notification services for Snapraid process results.
  • Handling split parity in sanity checks

…on for Snapraid process results.

- Update of touch regex to account for "a" in versions of Snapraid

- Handling split parity in sanity checks
Comment thread snapper.py Outdated
snapraid_status, flags=re.MULTILINE)
zero_subsecond_count = re.search(
r'^You have (?P<touch_files>\d+) files with (?:a )?zero sub-second timestamp', snapraid_status,
r'^You have (?P<touch_files>\d+) files with( a)? zero sub-second timestamp', snapraid_status,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change this back

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I must have had an old version that I merged against. I'll amend.

Comment thread snapper.py Outdated

file_regex = re.compile(r'^(content|(?:\d+-)?parity) +(.+/\w+.(?:content|(?:\d+-)?parity)) *$',
#Split parity handling
file_regex = re.compile(r'^(content|parity) +(.+/\w+.(?:content|parity)) *$',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above - I'll amend this. Split parity is obviously already handled in your regex.

Comment thread snapper.py Outdated
Comment on lines +714 to +715
apprise_report = create_apprise_report(report_data)
send_apprise('SnapRAID Job Completed Successfully', apprise_report)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these be guarded to ensure the feature is enabled?

Copy link
Copy Markdown
Author

@brott8 brott8 Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I followed your send_mail implementation. This relies on the enabled flag within the routine to guard. It won't execute if not enabled:

    is_enabled, apprise_bin, config_loc = itemgetter(
        'enabled', 'binary', 'config')(config['notifications']['apprise'])

    if not is_enabled:
        return

The main downside of this approach is that the template execution runs every time regardless. I can suggest bringing the enabled flag into the main routine for both email and apprise, following your discord implementation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants