Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added LunaSea Support #1072

Merged
merged 5 commits into from
Mar 9, 2024
Merged

Added LunaSea Support #1072

merged 5 commits into from
Mar 9, 2024

Conversation

caronc
Copy link
Owner

@caronc caronc commented Mar 3, 2024

Description:

Related issue (if applicable): #1070

  • Source: https://lunasea.app
  • Icon Support: Yes
  • Message Format: Text
  • Message Limit: 160 Characters per message

Syntax

Valid syntax is as follows:

Cloud Hosting

  • lunasea://{toFireBaseUser}
  • lunasea://{toFireBaseUser1}/{toFireBaseUser2}/{toFireBaseUserN}
  • lunasea://+{toFireBaseDevice}
  • lunasea://+{toFireBaseDevice1}/{toFireBaseDevice2}/{toFireBaseDeviceN}

You can mix and match as well:

  • lunasea://{user}:{pass}@/+{toFireBaseUser1}/{toFireBaseDevice1}/

** Private Hosting**
This works the exact same way; you can just additionally specify your connection details to your local server:

  • lunasea://{user}:{pass}@{hostname}/{toFireBaseUser}
  • lunasea://{user}:{pass}@{hostname}/{toFireBaseUser1}/{toFireBaseUser2}/{toFireBaseUserN}
  • lunasea://{user}:{pass}@{hostname}/+{toFireBaseDevice}
  • lunasea://{user}:{pass}@{hostname}//+{toFireBaseDevice1}/{toFireBaseDevice2}/{toFireBaseDeviceN}
  • lunasea://{user}:{pass}@{hostname}:{port}/{toFireBaseUser}
  • lunasea://{user}:{pass}@{hostname}:{port}/{toFireBaseUser1}/{toFireBaseUser2}/{toFireBaseUserN}
  • lunasea://{user}:{pass}@{hostname}:{port}/+{toFireBaseDevice}
  • lunasea://{user}:{pass}@{hostname}:{port}//+{toFireBaseDevice1}/{toFireBaseDevice2}/{toFireBaseDeviceN}

You can mix and match as well:

  • lunasea://{user}:{pass}@{hostname}/+{toFireBaseUser1}/{toFireBaseDevice1}/
  • lunasea://{user}:{pass}@{hostname}:{port}/+{toFireBaseUser1}/{toFireBaseDevice1}/

Use lunaseas:// for a Secure (https://) connection and lunasea:// for Insecure (http://).

lsea:// and lseas:// can also be used as an alias to lunasee:// and lunaseas:// (respectively) if you choose.

Parameter Breakdown

Variable Required Description
to *No One or more Firebase User IDs or Device IDs p you wish to send your notification to. You can use comma's to separate multiple entries if you wish.
image No Map the image associated with the notification type to the payload. By default this is set to no.
mode No The default mode to treat the URL provided as. Possible values are cloud and private. This is detected if no otherwise specified. When set to private, a hostname must be provided as part of the URL. When set to cloud, all elements are presumed to be notification end points and https://lunasea.app is used. In cloud mode, all transactions are secure (regardless if you specify lunasea:// or lsea://).

New Service Completion Status

  • apprise/plugins/NotifyLunaSea.py
  • 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
    • add new service into the %global common_description

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@1070-lunasea-support

# Send to a Device (make sure to add + at front):
apprise -t "Test Title" -b "Test Message" \
  lunasea://+FireBaseDevice1

#Send to a device (add +) and a user (optionally add @)
apprise -t "Test Title" -b "Test Message" \
  lunasea://+FireBaseDevice1/@FireBaseUserID

# Running your own private server, no problem:
apprise -t "Test Title" -b "Test Message" \
  lunasea://user:pass@myhostname/+FireBaseDevice1/@FireBaseUserID

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.28%. Comparing base (26d8e45) to head (ce5ffcd).
Report is 3 commits behind head on master.

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

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1072    +/-   ##
========================================
  Coverage   99.27%   99.28%            
========================================
  Files         136      137     +1     
  Lines       17753    17874   +121     
  Branches     3623     3649    +26     
========================================
+ Hits        17625    17746   +121     
  Misses        119      119            
  Partials        9        9            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc merged commit 108da1e into master Mar 9, 2024
12 checks passed
@caronc caronc deleted the 1070-lunasea-support branch April 6, 2024 15:04
@mdeeter
Copy link

mdeeter commented Sep 13, 2024

̶G̶e̶t̶t̶i̶n̶g̶ ̶a̶n̶ ̶e̶r̶r̶o̶r̶ ̶w̶h̶e̶n̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶u̶s̶e̶ ̶̶l̶u̶n̶a̶s̶e̶a̶̶.̶.̶.̶.̶ ̶B̶a̶d̶ ̶A̶t̶t̶a̶c̶h̶m̶e̶n̶t̶

Yup... was using wrong container for this repo....

@caronc
Copy link
Owner Author

caronc commented Sep 13, 2024

Are you using my Docker container or LinuxServer.io?

@mdeeter
Copy link

mdeeter commented Sep 13, 2024

updated... was struggling getting Lunasea to work... finally figured it out... your container definitely works better

@caronc
Copy link
Owner Author

caronc commented Sep 13, 2024

LinuxServer.io is a great solution, but attachments are disabled out of the gate. I think i may need to still investigate why simple notifications aren't working with it in this state.

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.

3 participants