diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e681434a..8431cf28 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,8 +6,8 @@ ## New Service Completion Status * [ ] apprise/plugins/Notify.py -* [ ] setup.py - - add new service into the `KEYWORDS` file located in the root directory +* [ ] KEYWORDS + - add new service into this file (alphabetically). * [ ] README.md - add entry for new service to table (as a quick reference) * [ ] packaging/redhat/python-apprise.spec @@ -37,7 +37,7 @@ source bin/activate # Install the branch pip install git+https://github.com/caronc/apprise.git@ -# Be sure you're running your Signal API Server and query it like so +# Test out the changes with the following command: apprise -t "Test Title" -b "Test Message" \ diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 61f916b8..a98a2595 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -24,3 +24,6 @@ The contributors have been listed in chronological order: * Andreas Motl * Mar 2020 - Fix XMPP Support + +* Joey Espinosa <@particledecay> + * Apr 3rd 2022 - Added Ntfy Support diff --git a/apprise/plugins/NotifyAppriseAPI.py b/apprise/plugins/NotifyAppriseAPI.py index b981f97a..4dbabf7a 100644 --- a/apprise/plugins/NotifyAppriseAPI.py +++ b/apprise/plugins/NotifyAppriseAPI.py @@ -339,18 +339,10 @@ class NotifyAppriseAPI(NotifyBase): return results # Add our headers that the user can potentially over-ride if they wish - # to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Apprise API header tokens are being " - " removed; use the plus (+) symbol instead.") - - # Tidy our header entries by unquoting them + # to to our returned result set and tidy entries by unquoting them results['headers'] = \ {NotifyAppriseAPI.unquote(x): NotifyAppriseAPI.unquote(y) - for x, y in results['headers'].items()} + for x, y in results['qsd+'].items()} # Support the passing of tags in the URL if 'tags' in results['qsd'] and len(results['qsd']['tags']): diff --git a/apprise/plugins/NotifyBoxcar.py b/apprise/plugins/NotifyBoxcar.py index 04b43b19..1d04c31f 100644 --- a/apprise/plugins/NotifyBoxcar.py +++ b/apprise/plugins/NotifyBoxcar.py @@ -357,13 +357,8 @@ class NotifyBoxcar(NotifyBase): # by default entries = NotifyBoxcar.split_path(results['fullpath']) - try: - # Now fetch the remaining tokens - results['secret'] = entries.pop(0) - - except IndexError: - # secret wasn't specified - results['secret'] = None + # Now fetch the remaining tokens + results['secret'] = entries.pop(0) if entries else None # Our recipients make up the remaining entries of our array results['targets'] = entries diff --git a/apprise/plugins/NotifyEmail.py b/apprise/plugins/NotifyEmail.py index bc08780e..d8705ad2 100644 --- a/apprise/plugins/NotifyEmail.py +++ b/apprise/plugins/NotifyEmail.py @@ -901,13 +901,6 @@ class NotifyEmail(NotifyBase): # Extract from name to associate with from address results['from_name'] = NotifyEmail.unquote(results['qsd']['name']) - if 'timeout' in results['qsd'] and len(results['qsd']['timeout']): - # Deprecated in favor of cto= flag - NotifyBase.logger.deprecate( - "timeout= argument is deprecated; use cto= instead.") - results['qsd']['cto'] = results['qsd']['timeout'] - del results['qsd']['timeout'] - # Store SMTP Host if specified if 'smtp' in results['qsd'] and len(results['qsd']['smtp']): # Extract the smtp server diff --git a/apprise/plugins/NotifyEnigma2.py b/apprise/plugins/NotifyEnigma2.py index 7161fff2..60897589 100644 --- a/apprise/plugins/NotifyEnigma2.py +++ b/apprise/plugins/NotifyEnigma2.py @@ -337,18 +337,10 @@ class NotifyEnigma2(NotifyBase): return results # Add our headers that the user can potentially over-ride if they wish - # to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Enigma header tokens are being " - " removed; use the plus (+) symbol instead.") - - # Tidy our header entries by unquoting them + # to to our returned result set and tidy entries by unquoting them results['headers'] = { NotifyEnigma2.unquote(x): NotifyEnigma2.unquote(y) - for x, y in results['headers'].items()} + for x, y in results['qsd+'].items()} # Save timeout value (if specified) if 'timeout' in results['qsd'] and len(results['qsd']['timeout']): diff --git a/apprise/plugins/NotifyForm.py b/apprise/plugins/NotifyForm.py index 32ae2c06..c7de3517 100644 --- a/apprise/plugins/NotifyForm.py +++ b/apprise/plugins/NotifyForm.py @@ -374,17 +374,9 @@ class NotifyForm(NotifyBase): for x, y in results['qsd:'].items()} # Add our headers that the user can potentially over-ride if they wish - # to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Form header tokens are being " - " removed; use the plus (+) symbol instead.") - - # Tidy our header entries by unquoting them + # to to our returned result set and tidy entries by unquoting them results['headers'] = {NotifyForm.unquote(x): NotifyForm.unquote(y) - for x, y in results['headers'].items()} + for x, y in results['qsd+'].items()} # Set method if not otherwise set if 'method' in results['qsd'] and len(results['qsd']['method']): diff --git a/apprise/plugins/NotifyJSON.py b/apprise/plugins/NotifyJSON.py index c14bbd36..8ec7df5b 100644 --- a/apprise/plugins/NotifyJSON.py +++ b/apprise/plugins/NotifyJSON.py @@ -361,17 +361,9 @@ class NotifyJSON(NotifyBase): for x, y in results['qsd:'].items()} # Add our headers that the user can potentially over-ride if they wish - # to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based JSON header tokens are being " - " removed; use the plus (+) symbol instead.") - - # Tidy our header entries by unquoting them + # to to our returned result set and tidy entries by unquoting them results['headers'] = {NotifyJSON.unquote(x): NotifyJSON.unquote(y) - for x, y in results['headers'].items()} + for x, y in results['qsd+'].items()} # Set method if not otherwise set if 'method' in results['qsd'] and len(results['qsd']['method']): diff --git a/apprise/plugins/NotifyNextcloud.py b/apprise/plugins/NotifyNextcloud.py index 30000f0d..6db7f274 100644 --- a/apprise/plugins/NotifyNextcloud.py +++ b/apprise/plugins/NotifyNextcloud.py @@ -331,13 +331,10 @@ class NotifyNextcloud(NotifyBase): results['version'] = \ NotifyNextcloud.unquote(results['qsd']['version']) - # Add our headers that the user can potentially over-ride if they - # wish to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Nextcloud header tokens are being " - " removed; use the plus (+) symbol instead.") + # Add our headers that the user can potentially over-ride if they wish + # to to our returned result set and tidy entries by unquoting them + results['headers'] = { + NotifyNextcloud.unquote(x): NotifyNextcloud.unquote(y) + for x, y in results['qsd+'].items()} return results diff --git a/apprise/plugins/NotifyNextcloudTalk.py b/apprise/plugins/NotifyNextcloudTalk.py index 1b05eb2b..a1853795 100644 --- a/apprise/plugins/NotifyNextcloudTalk.py +++ b/apprise/plugins/NotifyNextcloudTalk.py @@ -269,13 +269,10 @@ class NotifyNextcloudTalk(NotifyBase): results['targets'] = \ NotifyNextcloudTalk.split_path(results['fullpath']) - # Add our headers that the user can potentially over-ride if they - # wish to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Nextcloud Talk header tokens are being " - " removed; use the plus (+) symbol instead.") + # Add our headers that the user can potentially over-ride if they wish + # to to our returned result set and tidy entries by unquoting them + results['headers'] = { + NotifyNextcloudTalk.unquote(x): NotifyNextcloudTalk.unquote(y) + for x, y in results['qsd+'].items()} return results diff --git a/apprise/plugins/NotifyNotica.py b/apprise/plugins/NotifyNotica.py index 2a031e38..1fba8baf 100644 --- a/apprise/plugins/NotifyNotica.py +++ b/apprise/plugins/NotifyNotica.py @@ -364,13 +364,11 @@ class NotifyNotica(NotifyBase): '/' if not entries else '/{}/'.format('/'.join(entries)) # Add our headers that the user can potentially over-ride if they - # wish to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based Notica header tokens are being " - " removed; use the plus (+) symbol instead.") + # wish to to our returned result set and tidy entries by unquoting + # them + results['headers'] = { + NotifyNotica.unquote(x): NotifyNotica.unquote(y) + for x, y in results['qsd+'].items()} return results diff --git a/apprise/plugins/NotifyNtfy.py b/apprise/plugins/NotifyNtfy.py index c4698bb6..61c8f5dc 100644 --- a/apprise/plugins/NotifyNtfy.py +++ b/apprise/plugins/NotifyNtfy.py @@ -1,24 +1,31 @@ -# MIT License - -# Copyright (c) 2022 Joey Espinosa <@particledecay> - +# -*- coding: utf-8 -*- +# +# Copyright (C) 2022 Chris Caron +# All rights reserved. +# +# This code is licensed under the MIT License. +# # Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal +# of this software and associated documentation files(the "Software"), to deal # in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell # copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - +# furnished to do so, subject to the following conditions : +# # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. - +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# Great sources +# - https://github.com/matrix-org/matrix-python-sdk +# - https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.rst # # Examples: # ntfys://my-topic diff --git a/apprise/plugins/NotifyStreamlabs.py b/apprise/plugins/NotifyStreamlabs.py index 5941537d..27aea289 100644 --- a/apprise/plugins/NotifyStreamlabs.py +++ b/apprise/plugins/NotifyStreamlabs.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2021 +# Copyright (C) 2021 Chris Caron # All rights reserved. # # This code is licensed under the MIT License. diff --git a/apprise/plugins/NotifyXML.py b/apprise/plugins/NotifyXML.py index 4bda74f5..1e57b27f 100644 --- a/apprise/plugins/NotifyXML.py +++ b/apprise/plugins/NotifyXML.py @@ -414,17 +414,9 @@ class NotifyXML(NotifyBase): for x, y in results['qsd:'].items()} # Add our headers that the user can potentially over-ride if they wish - # to to our returned result set - results['headers'] = results['qsd+'] - if results['qsd-']: - results['headers'].update(results['qsd-']) - NotifyBase.logger.deprecate( - "minus (-) based XML header tokens are being " - "removed; use the plus (+) symbol instead.") - - # Tidy our header entries by unquoting them + # to to our returned result set and tidy entries by unquoting them results['headers'] = {NotifyXML.unquote(x): NotifyXML.unquote(y) - for x, y in results['headers'].items()} + for x, y in results['qsd+'].items()} # Set method if not otherwise set if 'method' in results['qsd'] and len(results['qsd']['method']): diff --git a/apprise/plugins/NotifyXMPP/SliXmppAdapter.py b/apprise/plugins/NotifyXMPP/SliXmppAdapter.py index 9450e70d..6c2fc1c7 100644 --- a/apprise/plugins/NotifyXMPP/SliXmppAdapter.py +++ b/apprise/plugins/NotifyXMPP/SliXmppAdapter.py @@ -1,4 +1,27 @@ # -*- coding: utf-8 -*- +# +# Copyright (C) 2022 Chris Caron +# All rights reserved. +# +# This code is licensed under the MIT License. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files(the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions : +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. import ssl from os.path import isfile diff --git a/test/test_plugin_apprise_api.py b/test/test_plugin_apprise_api.py index 2a250161..5203f933 100644 --- a/test/test_plugin_apprise_api.py +++ b/test/test_plugin_apprise_api.py @@ -132,7 +132,7 @@ apprise_url_tests = ( # Our expected url(privacy=True) startswith() response: 'privacy_url': 'apprises://user:****@localhost:8080/m...5/', }), - ('apprises://localhost:8080/path?-HeaderKey=HeaderValue', { + ('apprises://localhost:8080/path?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyAppriseAPI, }), ('apprise://localhost/%s' % ('a' * 32), { diff --git a/test/test_plugin_custom_form.py b/test/test_plugin_custom_form.py index 520ee2a1..104f2d5e 100644 --- a/test/test_plugin_custom_form.py +++ b/test/test_plugin_custom_form.py @@ -112,7 +112,7 @@ apprise_url_tests = ( # Our expected url(privacy=True) startswith() response: 'privacy_url': 'forms://user:****@localhost:8080', }), - ('form://localhost:8080/path?-HeaderKey=HeaderValue', { + ('form://localhost:8080/path?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyForm, }), ('form://user:pass@localhost:8081', { diff --git a/test/test_plugin_custom_json.py b/test/test_plugin_custom_json.py index 4fedfc47..d3e172a9 100644 --- a/test/test_plugin_custom_json.py +++ b/test/test_plugin_custom_json.py @@ -100,7 +100,7 @@ apprise_url_tests = ( # Our expected url(privacy=True) startswith() response: 'privacy_url': 'jsons://user:****@localhost:8080', }), - ('json://localhost:8080/path?-HeaderKey=HeaderValue', { + ('json://localhost:8080/path?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyJSON, }), ('json://user:pass@localhost:8081', { diff --git a/test/test_plugin_custom_xml.py b/test/test_plugin_custom_xml.py index db449e67..76ab8dd9 100644 --- a/test/test_plugin_custom_xml.py +++ b/test/test_plugin_custom_xml.py @@ -125,7 +125,7 @@ apprise_url_tests = ( ('xmls://user:pass@localhost:8080', { 'instance': plugins.NotifyXML, }), - ('xml://localhost:8080/path?-HeaderKey=HeaderValue', { + ('xml://localhost:8080/path?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyXML, }), ('xml://user:pass@localhost:8081', { diff --git a/test/test_plugin_email.py b/test/test_plugin_email.py index 3efa1c9f..391735bc 100644 --- a/test/test_plugin_email.py +++ b/test/test_plugin_email.py @@ -113,18 +113,6 @@ TEST_URLS = ( ('mailtos://user:pass@nuxref.com:567/l2g@nuxref.com', { 'instance': plugins.NotifyEmail, }), - ( - 'mailtos://user:pass@example.com?smtp=smtp.example.com&timeout=5' - '&name=l2g&from=noreply@example.com', { - 'instance': plugins.NotifyEmail, - }, - ), - ('mailto://user:pass@example.com?timeout=invalid.entry', { - 'instance': plugins.NotifyEmail, - }), - ('mailto://user:pass@example.com?timeout=invalid.entry', { - 'instance': plugins.NotifyEmail, - }), ( 'mailto://user:pass@example.com:2525?user=l2g@example.com' '&pass=l2g@apprise!is!Awesome', { diff --git a/test/test_plugin_enigma2.py b/test/test_plugin_enigma2.py index f08e61b4..76ba42d1 100644 --- a/test/test_plugin_enigma2.py +++ b/test/test_plugin_enigma2.py @@ -144,7 +144,7 @@ apprise_url_tests = ( 'result': True }, }), - ('enigma2://localhost:8080/path?-HeaderKey=HeaderValue', { + ('enigma2://localhost:8080/path?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyEnigma2, 'requests_response_text': { 'result': True diff --git a/test/test_plugin_nextcloud.py b/test/test_plugin_nextcloud.py index 10e52cd7..c578f5c1 100644 --- a/test/test_plugin_nextcloud.py +++ b/test/test_plugin_nextcloud.py @@ -96,7 +96,7 @@ apprise_url_tests = ( ('nclouds://user:pass@localhost:8080/admin/', { 'instance': plugins.NotifyNextcloud, }), - ('ncloud://localhost:8080/admin?-HeaderKey=HeaderValue', { + ('ncloud://localhost:8080/admin?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyNextcloud, }), ('ncloud://user:pass@localhost:8081/admin', { diff --git a/test/test_plugin_nextcloudtalk.py b/test/test_plugin_nextcloudtalk.py index 1e92f003..104422e0 100644 --- a/test/test_plugin_nextcloudtalk.py +++ b/test/test_plugin_nextcloudtalk.py @@ -85,7 +85,7 @@ apprise_url_tests = ( 'instance': plugins.NotifyNextcloudTalk, 'requests_response_code': requests.codes.created, }), - ('nctalk://user:pass@localhost:8080/roomid?-HeaderKey=HeaderValue', { + ('nctalk://user:pass@localhost:8080/roomid?+HeaderKey=HeaderValue', { 'instance': plugins.NotifyNextcloudTalk, 'requests_response_code': requests.codes.created, }), diff --git a/test/test_plugin_notica.py b/test/test_plugin_notica.py index ad308736..37e5f4f7 100644 --- a/test/test_plugin_notica.py +++ b/test/test_plugin_notica.py @@ -110,10 +110,6 @@ apprise_url_tests = ( ('notica://localhost:8080//%s/?+HeaderKey=HeaderValue' % ('7' * 6), { 'instance': plugins.NotifyNotica, }), - # Test Depricated Header overrides - ('notica://localhost:8080//%s/?-HeaderKey=HeaderValue' % ('7' * 6), { - 'instance': plugins.NotifyNotica, - }), ('notica://%s' % ('c' * 6), { 'instance': plugins.NotifyNotica, # force a failure