caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
638 stars 56 forks source link

Attachments support URLs #164

Closed caronc closed 8 months ago

caronc commented 8 months ago

Description:

Related issue (if applicable): refs #

Apprise API can now support providing URLs as attachments now; for example:

# The below will actually fetch the attachment so that it can be attached to
# the notification(s)
curl -X POST \
    -F 'urls=mailto://user:pass@gmail.com' \
    -F attachment=https://i.redd.it/my2t4d2fx0u31.jpg \
    http://localhost:8000/notify

Here is the same example but using the keys:

# Attachments do not require that you provide a body, but you're still welcome to do so.
curl -X POST \
    -F attachment=https://i.redd.it/my2t4d2fx0u31.jpg \
    http://localhost:8000/notify/apprise

# Attach more than one file is allowed too:
curl -X POST \
    -F attachment=https://hostname/path/to.one.attachment.jpg \
    -F attachment=https://hostname:3000/path/to/another.pdf \
    http://localhost:8000/notify/apprise

This PR also improves logging and drastically improves code coverage.

Checklist

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (68fd580) 95.03% compared to head (7cec7df) 99.36%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #164 +/- ## ========================================== + Coverage 95.03% 99.36% +4.32% ========================================== Files 7 7 Lines 725 785 +60 ========================================== + Hits 689 780 +91 + Misses 36 5 -31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.