amyreese / znc-push

Push notification service module for ZNC
http://noswap.com/projects/znc-push
MIT License
556 stars 122 forks source link

Can't get push to work; not receiving test messages #223

Closed lpessers closed 7 years ago

lpessers commented 7 years ago

I used the latest push.cpp version and installed it with the znc-buildmod tool.

Then I configured telegram first, that didn't seem to work so I tried slack. For some reason I don't receive any push notifications when I use the send tool or when I get mentioned in my network.

I used the following commands to set things up (webhooks, etc modified with 1 digit for security reasons, same format kept)

set service telegram set secret 364561415:AAE-2auAWabb8hA9RBGSzE-4CcU7uoFWWsA set target 330058746 send test

set service slack set secret T4DP6D16G/B4DQURW68/0sNVpqxVUhbKBdQMCcKgAWHN set username ZNC BOT set target znc send test

ZNC version: ZNC 1.6.4 ZNC server OS: Ubuntu 14.04.5 LTS (GNU/Linux 2.6.32-042stab116.2 x86_64)

I get no error messages but I just don't receive any messages on both platforms.... Does anyone know how to solve this issue?

amyreese commented 7 years ago

Try doing set debug on and see what output you get when sending a test message. It's possible that Slack or Telegram changed their API, or that ZNC's SSL library doesn't work well with their services, and I don't generally use or test anything beyond the Pushover integration myself. The last option is to rebuild using the makefile with make curl=yes, which will use the libcurl network stack instead of ZNC's own sockets, which could also solve this issue.

lpessers commented 7 years ago

I just tried configuring push with pushover, but that doesn't seem to work either. The debug indicated everything was going okay:

[10:29:44] <*push> service: pushover [10:29:44] <*push> service_host: api.pushover.net [10:29:44] <*push> service_url: /1/messages.json [10:29:44] <*push> service_auth: [10:29:44] <*push> use_port: 443 [10:29:44] <*push> use_ssl: 1 [10:29:44] <*push> use_post: 1 [10:29:44] <*push> NOT using libcurl [10:29:44] <*push> Building notification to api.pushover.net/1/messages.json... [10:29:44] <*push> User-Agent: ZNC Push/dev [10:29:44] <*push> Query string: device=PhoneSE&message=test&priority=0&title=New+Message&token=ai4zt8fgn9c6iz78sucuwxtghvduxv&user=u7iurnv8ztws9inx2hh17zk5fhYsp7 [10:29:44] <*push> Request sending [10:29:44] <*push> Ok [10:29:44] <*push> Disconnected.

However, still not receiving the message on pushover

stevesbrain commented 7 years ago

Does every thing sending to the same user + key work fine? Does running the query string listed above work fine if you do it with cURL? Also, probably want to remove your secrets from the above ^

lpessers commented 7 years ago

I don't know how cURLs work exactly and how I can test them. The secrets posted above are slightly edited and are not my real 'secrets'. I'm pretty sure the users and keys are correct since I literally copied and pasted them into my IRC client.

stevesbrain commented 7 years ago

Ah, cool @lpessers - just didn't want to assume, as I know people sometimes will post such things without realising :) As for command line, I'd suggest trying the same user secret + token with cURL as documented here:

https://pushover.net/faq#library-shell

I.e., for your example, you could do:

curl -s \
  --form-string "device=PhoneSE" \
  --form-string "token=ai4zt8fgn9c6iz46sucuwxtghvduxv" \
  --form-string "user=u7iurnv8ztws5inx2hh17zk5fhnsp7" \
  --form-string "message=hello world" \
  https://api.pushover.net/1/messages.json

If that doesn't work, remove the entire "device" line and test again :)

lpessers commented 7 years ago

That worked perfectly fine, received the notification, used the same details as I used for push on my znc network. Weird why it doesn't work when it goes through push on my znc server

stevesbrain commented 7 years ago

Very weird indeed! Running the same cURL command on your ZNC that you successfully used to test locally also works?

Noticed [10:29:44] <*push> NOT using libcurl - is libcurl installed on the ZNC machine?

lpessers commented 7 years ago

No, libcurl is not installed and I have no clue how to install it to be honest

stevesbrain commented 7 years ago

Try this out:

sudo apt-get install -y libcurl3{,-gnutls,-gnutls-dev}

You'll probably want to rebuild the push module after that, put it in debug again, and try once more for us :)

lpessers commented 7 years ago

This is what I got when I tried that:

root@sv1:~# apt-get install -y libcurl{3,-dev,3-gnutls,3-gnutls-dev}
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libcurl4-gnutls-dev' instead of 'libcurl3-gnutls-dev'
Package libcurl-dev is a virtual package provided by:
  libcurl4-openssl-dev 7.35.0-1ubuntu2.10
  libcurl4-nss-dev 7.35.0-1ubuntu2.10
  libcurl4-gnutls-dev 7.35.0-1ubuntu2.10
You should explicitly select one to install.

E: Package 'libcurl-dev' has no installation candidate
lpessers commented 7 years ago

I am now able to receive notifications! I think it works! Thanks!

lpessers commented 7 years ago

One more thing, how do I get push to notify me when someone private messages me or when I'm mentioned in a channel?

stevesbrain commented 7 years ago

I believe both PM + mentions are included by default, but if not, you can manually set highlights:

/msg *push set highlight _SPECIFICWHOLEWORD *startswiththis

That'd match highlights of only "SPECIFICWHOLEWORD", and also anything that starts with "startswiththis" - for example, it'd match both "startswiththisword" and "startswiththisphrase".

For more info, see:

https://github.com/jreese/znc-push/tree/python#conditions https://github.com/jreese/znc-push/tree/python#commands

lpessers commented 7 years ago

Okay, thanks

Merlincool commented 3 years ago

I am now able to receive notifications! I think it works! Thanks!

After installation of libcurl did you rebuild push?? Because there are no chances after libcurl installation for me