Git Product home page Git Product logo

synology-notifications's Introduction

synology-notifications

Receive notifications from Synology and forward them to the notification service of your choice

Supported notification services

  • Slack

Service settings

Settings are supplied by setting environment variables

  • API_KEY: A minimum of 32 character api key that Synology server needs to use to auth to this services api
  • LISTEN_PORT: Default 8080. The port the service will listen on

Slack settings

  • SLACK_WEBHOOK: URL for the Slack web hook
  • SLACK_ATTACHMENT_COLOR: Color to use for the attachments can use hex #36a64f

Cmd

export API_KEY='LO45UXS%amLAWJn6CwJ1koaXW&7pY9#Z'
export SLACK_WEBHOOK='https://slack.com/myWebHookUrl'
./synology-notifications
listening on port 8080

Docker

docker run -e API_KEY='LO45UXS%amLAWJn6CwJ1koaXW&7pY9#Z' -e SLACK_WEBHOOK='https://slack.com/myWebHookUrl' -p 8080:8080 ryancurrah/synology-notifications:latest
listening on port 8080

Setting up Synology

  1. Login to Diskstation
  2. Go to Control Pannel > Notification > SMS
  3. Check Enable SMS Notifications
  4. Click Add SMS Provider to create a new SMS provider which will be the synology-notifications service. (NOTE: We will not actually be using SMS)
    1. Provider Name: synology-notifications
    2. SMS URL: http://<ip address of synology-notifications service>:8080
    3. HTTP Method: POST
  5. Click Next to go to the Edit HTTP Request Header page
  6. Click Add and set the Parameter to api_key and leave Value empty
  7. Click Next to go to the Edit HTTP Request Body page
  8. Click Add and set the Parameter to phone_number and leave Value empty (NOTE: Synology requires this field to exist even though it's not used)
  9. Click Add and set the Parameter to message set the Value to Hello world (NOTE: Synology requires a sample value)
  10. Click Next to go to the Select the corrosponding category for each parameter page
  11. Set the type of the api_key Parameter to API Key
  12. Set the type of the phone_number Parameter to Phone Number
  13. Set the type of the message Parameter to Message content
  14. Click Apply
  15. Select synology-notifications from the SMS service provider dropdown
  16. In the API Key field paste the API Key you choose for the service
  17. Click Apply
  18. Test the notification service by clicking Send a test SMS message

Setting up Synology with screenshots

Step 1

Step 2

Step 3

Step 4

Step 5

synology-notifications's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ryancurrah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

synology-notifications's Issues

Does it still work? | dial tcp 13.225.85.153:443: i/o timeout

Hey guys,

I just would like to know if the docker container still works, because I get an timeout error?
2020/03/03 20:15:59 error sendming slack message: failed to post webhook: Post https://hooks.slack.com/services/xxxxxxx/xxxxxxxxxx/xxxxxxxxxxxxxxx: dial tcp 13.225.85.153:443: i/o timeout
I am able to ping the ip address just fine.

Make setup instructions a little clearer

Hello,

Really appreciate you taking the time to make this.
Slack is really a better/more modern choice for these notifications.

I was able to get it setup and working correctly.
But it seems the setup instructions you provided aren't formatted correctly.

Really it was just important that (and to anyone that may read this):
the api_key field goes under HTTP Request Header

and then under HTTP request body:

phone_number
message=hello world

Blank message in Slack

Hi. I use docker container, have issue when send test message in Slack. It sent message OK but in Slack i got blank message.

invalid api key

Hello ryancurrah,

Thanks for your work on this feature.
I have a issue, when i send test notification from synology to slack, i don't receive it on slack.
On my ubuntu vm where i run the docker i have the following error (invalid api key):
docker run -p 8080:8080 -e API_KEY='LO45UXS%amLAWJn6CwJ1koaXW&7pY9#Z' -e SLACK_WEBHOOK='https://hooks.slack.com/services/T02UNCY9H/B011ZGHRKQV/xxxxxxxxxxxxxxxxx' ryancurrah/synology-notifications:latest

Below the screenshot of my terminal:
image

My api_key is the same on synology and on the command i run.
I have also try with export API_KEY command.

Do you know how can i fix this issue ?
Thanks.

Missing preview text in Android notification

I have this set up and am receiving messages; however, I'm not seeing any preview text in my Android notification.

Here's the message in Slack itself.

Is this by design or do I potentially have something misconfigured?

Raspberry Pi

Figured I'd leave the fact it does not work on Raspberry Pi here incase anyone is looking. I get the following error:

standard_init_linux.go:211: exec user process caused "exec format error"

Thanks for the effort in the image though :)

Unable to send test message

The service is working with the curl command, but test message is not sending and I'm getting nothing in the log after listening on port 8080.

Probably a stretch, but curious about the last screenshot in the README. You have the API Key and Primary Phone Number fields blacked out. Is the API Key not LO45UXS%amLAWJn6CwJ1koaXW&7pY9#Z? Right now I'm using that in this field and in the container environment variable. And just using + 1234567890 for the Primary Phone Number. What's supposed to go in these fields? Any other ideas? Thanks

FEAT: add twilio as a service

given you readme says 'notification service service of your choice' i was wondering if you would consider adding twilio sms service?

I ask because the username field in the synology sms notification page limts the username to 32 chars and twilio account sid has a 34 char username, lol.

others are looking for this feature https://www.reddit.com/r/synology/comments/hr9tcj/twilio_sms_with_synology_nas/

this is an example curl for sending a message

EXCLAMATION_MARK='!'
curl -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json \
--data-urlencode "Body=Hi there$EXCLAMATION_MARK" \
--data-urlencode "From=+15017122661" \
--data-urlencode "To=+15558675310" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

I have no idea how to code from scratch, can help test, document etc

Slack message colour

Hi,

Thanks a lot for this fantastic project!

Would it be possible to have a configured colour instead of the hard-coded "warning"?

e.g. my only message from synology is that the backup was successful, but it is displayed in Slack with a yellow warning colour.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.