From ca52674969bd8616ff5c1bbb8061a6718a04e01b Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Sat, 3 Jun 2023 16:29:36 -0400 Subject: [PATCH] Python 3.11 test env --- .gitignore | 1 + Dockerfile.py310 | 6 +++- Dockerfile.py311 | 52 ++++++++++++++++++++++++++++ Dockerfile.py36 | 6 +++- KEYWORDS | 1 + README.md | 1 + apprise/plugins/NotifyRingCentral.py | 13 ++++++- docker-compose.yml | 7 ++++ packaging/redhat/python-apprise.spec | 8 ++--- 9 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.py311 diff --git a/.gitignore b/.gitignore index b7ccab0e..946ec320 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ __pycache__/ # Distribution / packaging .Python +.bash_* env/ .venv* build/ diff --git a/Dockerfile.py310 b/Dockerfile.py310 index b23c8da3..fff91576 100644 --- a/Dockerfile.py310 +++ b/Dockerfile.py310 @@ -44,5 +44,9 @@ COPY dev-requirements.txt / ENV PYTHONPATH /apprise ENV PYTHONPYCACHEPREFIX /apprise/__pycache__/py310 - RUN pip install -r /requirements.txt -r /dev-requirements.txt + +RUN addgroup --gid ${USER_GID:-1000} apprise +RUN adduser --system --uid ${USER_UID:-1000} --ingroup apprise --home /apprise --no-create-home --disabled-password apprise + +USER apprise diff --git a/Dockerfile.py311 b/Dockerfile.py311 new file mode 100644 index 00000000..7cf4c6d2 --- /dev/null +++ b/Dockerfile.py311 @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# BSD 3-Clause License +# +# Apprise - Push Notification Library. +# Copyright (c) 2023, Chris Caron +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +# Base +FROM python:3.11-buster +RUN apt-get update && \ + apt-get install -y libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash +RUN pip install dbus-python PyGObject + +# Apprise Setup +VOLUME ["/apprise"] +WORKDIR /apprise +COPY requirements.txt / +COPY dev-requirements.txt / +ENV PYTHONPATH /apprise +ENV PYTHONPYCACHEPREFIX /apprise/__pycache__/py311 + +RUN pip install -r /requirements.txt -r /dev-requirements.txt + +RUN addgroup --gid ${USER_GID:-1000} apprise +RUN adduser --system --uid ${USER_UID:-1000} --ingroup apprise --home /apprise --no-create-home --disabled-password apprise + +USER apprise diff --git a/Dockerfile.py36 b/Dockerfile.py36 index a96d1e08..a261f204 100644 --- a/Dockerfile.py36 +++ b/Dockerfile.py36 @@ -44,5 +44,9 @@ COPY dev-requirements.txt / ENV PYTHONPATH /apprise ENV PYTHONPYCACHEPREFIX /apprise/__pycache__/py36 - RUN pip install -r /requirements.txt -r /dev-requirements.txt + +RUN addgroup --gid ${USER_GID:-1000} apprise +RUN adduser --system --uid ${USER_UID:-1000} --ingroup apprise --home /apprise --no-create-home --disabled-password apprise + +USER apprise diff --git a/KEYWORDS b/KEYWORDS index 293c1489..f44a814b 100644 --- a/KEYWORDS +++ b/KEYWORDS @@ -61,6 +61,7 @@ Push Notifications Pushover PushSafer Reddit +RingCentral Rocket.Chat Ryver SendGrid diff --git a/README.md b/README.md index f6c69625..1941f205 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ The table below identifies the services this tool supports and some example serv | [Kavenegar](https://github.com/caronc/apprise/wiki/Notify_kavenegar) | kavenegar:// | (TCP) 443 | kavenegar://ApiKey/ToPhoneNo
kavenegar://FromPhoneNo@ApiKey/ToPhoneNo
kavenegar://ApiKey/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN | [MessageBird](https://github.com/caronc/apprise/wiki/Notify_messagebird) | msgbird:// | (TCP) 443 | msgbird://ApiKey/FromPhoneNo
msgbird://ApiKey/FromPhoneNo/ToPhoneNo
msgbird://ApiKey/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/ | [MSG91](https://github.com/caronc/apprise/wiki/Notify_msg91) | msg91:// | (TCP) 443 | msg91://AuthKey/ToPhoneNo
msg91://SenderID@AuthKey/ToPhoneNo
msg91://AuthKey/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/ +| [RingCentral](https://github.com/caronc/apprise/wiki/Notify_ringcentral) | ringc:// | (TCP) 443 | ringc://SourcePhoneNo:JWTToken@ClientID/ClientSecret
ringc://SourcePhoneNo:JWTToken@ClientID/ClientSecret/ToPhoneNo
ringc://SourcePhoneNo:JWTToken@ClientID/ClientSecret/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/ | [Signal API](https://github.com/caronc/apprise/wiki/Notify_signal) | signal:// or signals:// | (TCP) 80 or 443 | signal://hostname:port/FromPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo
signal://hostname:port/FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/ | [Sinch](https://github.com/caronc/apprise/wiki/Notify_sinch) | sinch:// | (TCP) 443 | sinch://ServicePlanId:ApiToken@FromPhoneNo
sinch://ServicePlanId:ApiToken@FromPhoneNo/ToPhoneNo
sinch://ServicePlanId:ApiToken@FromPhoneNo/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/
sinch://ServicePlanId:ApiToken@ShortCode/ToPhoneNo
sinch://ServicePlanId:ApiToken@ShortCode/ToPhoneNo1/ToPhoneNo2/ToPhoneNoN/ | [SMSEagle](https://github.com/caronc/apprise/wiki/Notify_smseagle) | smseagle:// or smseagles:// | (TCP) 80 or 443 | smseagles://hostname:port/ToPhoneNo
smseagles://hostname:port/@ToContact
smseagles://hostname:port/#ToGroup
smseagles://hostname:port/ToPhoneNo1/#ToGroup/@ToContact/ diff --git a/apprise/plugins/NotifyRingCentral.py b/apprise/plugins/NotifyRingCentral.py index ba2759e1..20fb0a93 100644 --- a/apprise/plugins/NotifyRingCentral.py +++ b/apprise/plugins/NotifyRingCentral.py @@ -134,9 +134,14 @@ class NotifyRingCentral(NotifyBase): # Define object templates templates = ( # Auth + '{schema}://{from_phone}:{password}@{client_id}/{secret}/', + '{schema}://{from_phone}:{password}@{client_id}/{secret}/{targets}', '{schema}://{password}@{client_id}/{secret}/{from_phone}', '{schema}://{password}@{client_id}/{secret}/{from_phone}/{targets}', + # JWT + '{schema}://{from_phone}:{token}@{client_id}/{secret}/', + '{schema}://{from_phone}:{token}@{client_id}/{secret}/{targets}', '{schema}://{token}@{client_id}/{secret}/{from_phone}', '{schema}://{token}@{client_id}/{secret}/{from_phone}/{targets}', ) @@ -150,6 +155,12 @@ class NotifyRingCentral(NotifyBase): 'regex': (r'^[a-z0-9._-]+$', 'i'), 'private': True, }, + 'password': { + 'name': _('Password'), + 'type': 'string', + 'required': True, + 'private': True, + }, 'client_id': { 'name': _('Client ID'), 'type': 'string', @@ -214,7 +225,7 @@ class NotifyRingCentral(NotifyBase): 'alias_of': 'token', }, 'secret': { - 'alias_of': 'client_secret', + 'alias_of': 'secret', }, 'mode': { # This is automatically detected diff --git a/docker-compose.yml b/docker-compose.yml index f2d22f05..b3756da8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,13 @@ services: volumes: - ./:/apprise + test.py311: + build: + context: . + dockerfile: Dockerfile.py311 + volumes: + - ./:/apprise + rpmbuild.el8: build: context: . diff --git a/packaging/redhat/python-apprise.spec b/packaging/redhat/python-apprise.spec index 855559c6..15566254 100644 --- a/packaging/redhat/python-apprise.spec +++ b/packaging/redhat/python-apprise.spec @@ -50,10 +50,10 @@ LaMetric, Line, MacOSX, Mailgun, Mastodon, Mattermost, Matrix, MessageBird, Microsoft Windows, Microsoft Teams, Misskey, MQTT, MSG91, MyAndroid, Nexmo, Nextcloud, NextcloudTalk, Notica, Notifico, ntfy, Office365, OneSignal, Opsgenie, PagerDuty, PagerTree, ParsePlatform, PopcornNotify, Prowl, Pushalot, -PushBullet, Pushjet, Pushover, PushSafer, Reddit, Rocket.Chat, SendGrid, -ServerChan, Signal, SimplePush, Sinch, Slack, SMSEagle, SMTP2Go, Spontit, -SparkPost, Super Toasty, Streamlabs, Stride, Syslog, Techulus Push, Telegram, -Twilio, Twitter, Twist, XBMC, Voipms, Vonage, Webex Teams} +PushBullet, Pushjet, Pushover, PushSafer, Reddit, RingCentral, Rocket.Chat, +SendGrid, ServerChan, Signal, SimplePush, Sinch, Slack, SMSEagle, SMTP2Go, +Spontit, SparkPost, Super Toasty, Streamlabs, Stride, Syslog, Techulus Push, +Telegram, Twilio, Twitter, Twist, XBMC, Voipms, Vonage, Webex Teams} Name: python-%{pypi_name} Version: 1.4.0