Giter Site home page Giter Site logo

kffl / nextcloud-webhooks Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 9.0 729 KB

Webhooks app for Nextcloud :globe_with_meridians: :zap:

Home Page: https://apps.nextcloud.com/apps/webhooks

License: GNU Affero General Public License v3.0

Makefile 9.95% PHP 84.56% CSS 0.15% JavaScript 3.92% Vue 1.42%
nextcloud webhooks

nextcloud-webhooks's People

Contributors

0xsuid avatar kffl avatar serotonie avatar xstable 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

Watchers

 avatar  avatar  avatar  avatar

nextcloud-webhooks's Issues

Error: Undefined index: scheme at /var/www/nextcloud/apps/webhooks/lib/Listeners/AbstractListener.php#55

Hi all,

as soon as I activate the app my log gets flooded (several entrys per minute) with following error messages:

[PHP] Fehler: Error: Undefined index: scheme at /var/www/nextcloud/apps/webhooks/lib/Listeners/AbstractListener.php#55 at <<closure>>

 0. /var/www/nextcloud/apps/webhooks/lib/Listeners/AbstractListener.php line 55
    OC\Log\ErrorHandler::onError()
 1. /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php line 87
    OCA\Webhooks\Listeners\AbstractListener->handle()
 2. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OC\EventDispatcher\ServiceEventListener->__invoke()
 3. /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
 4. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 88
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
 5. /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php line 100
    OC\EventDispatcher\EventDispatcher->dispatch()
 6. /var/www/nextcloud/apps/user_status/lib/Controller/HeartbeatController.php line 91
    OC\EventDispatcher\EventDispatcher->dispatchTyped()
 7. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\UserStatus\Controller\HeartbeatController->heartbeat()
 8. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
 9. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
10. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
11. /var/www/nextcloud/ocs/v1.php line 63
    OC\Route\Router->match()
12. /var/www/nextcloud/ocs/v2.php line 23
    require_once("/var/www/nextcloud/ocs/v1.php")

PUT /nextcloud/ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json
from [removed_ip_adress] by [user] at 2022-11-27T11:17:45+00:00
The setting looks (as far as I can see ok:

    The Webhooks app is enabled
    The secret used for signing POST requests is defined
    The curl command appears to be working

Active Events with corresponding Webhook URLs:

    Calendar Object Created: http://127.0.0.1:5000/my_webhook

and requests are send correctly when a new Calendar item is created

Thanks,
Marc

Add file path as filter option

The "File created" event already has the file path inside of its metadata, so it should be pretty simple, to expose the file path to the filter options dropdown, right?

Would be a much appreciated feature, so I don't have to do this on the receiver side of the webhook.

Nextcloud 26

Hi,

NC 26 has been released.
Just tested Webhooks on it and it seems to work flawlessly.

Could you please update the max version ?

Thanks :)

Nextcloud 25

Nextcloud 25 is being released on 10/18 as stable. I haven't personally tested webhooks with it yet in rc, so just an fyi.

Discord webhook support

Hi, i am trying to use your app with discord webhook, but it doesnt work, i activated user login in config.php along with my discord webhook's url but nothing happen, is discord supported ?
Thanks

Allow configuration via webinterface

Hi,

first of all, thanks for the nice app and especially for the integration into the flow system!

I have a feature request:

At the moment, you have to manually edit the config php file to set up event based notifications and the webhooks_secret parameter.

Since I use a hosted-Nextcloud instance where I have full admin access to Nextcloud but no access to the file system (and thus also not to config.php, I cannot set this parameters.

Do you think it is possible and makes sense to make this configurable in the webinterface as well?

For flow based notifications, an alternative could be to define a secret alongside the flow, so one could even use different secrets for different notification targets.

calendar event notification

Is it possible to add tracking for an upcoming calendar event. This would be a much needed feature for reminders of events on third party platforms.

Calendar Object Deleted

Hi there

Creating and updating works perfectly with Zapier, but if I delete a calendar entry, the change does not arrive at Zapier. Would it also be possible to trigger an event when a calendar item is deleted?

Greetings

Use HMAC to compute authentication header

Currently, the X-Nextcloud-Webhooks authentication header is calculated by concatenating the payload/body with a shared-secret, and computing the SHA2 hash of this data:

Once the secret is defined, all outgoing webhook notifications will contain a signature in the X-Nextcloud-Webhooks HTTP header. The signature is calculated by performing a SHA256 function on the POST request raw body concatenated with the secret defined earlier.

I propose to instead (or in addition) use a proper HMAC for this.

HMAC?

Why? Wikipedia to the rescue: HMAC → Design principles

The design of the HMAC specification was motivated by the existence of attacks on more trivial mechanisms for combining a key with a hash function. For example, one might assume the same security that HMAC provides could be achieved with MAC = H(key ∥ message). However, this method suffers from a serious flaw: with most hash functions, it is easy to append data to the message without knowing the key and obtain another valid MAC ("length-extension attack"). The alternative, appending the key using MAC = H(message ∥ key), suffers from the problem that an attacker who can find a collision in the (unkeyed) hash function has a collision in the MAC (as two messages m1 and m2 yielding the same hash will provide the same start condition to the hash function before the appended key is hashed, hence the final hash will be the same). Using MAC = H(key ∥ message ∥ key) is better, but various security papers have suggested vulnerabilities with this approach, even when two different keys are used

Another reason is that a standardized HMAC is easier to use an more safe than a custom-build authentication mechanism.

Implementation?

I am not a PHP-expert, but for example there is hash_hmac.
But I think it is a better idea to use a more standardized approach like a HMAC-JSON Web Token (with algorithm HS256 and the payload emitted in the token), which has great library support.

Migration?

I assume that just changing how the value of X-Nextcloud-Webhooks is computed will break the setup of users who compute the header in the way you currently do. An alternative approach would be to add a second header in addition to the existing one that contains the HMAC, so users can chose which header they want to verify.

Just an idea. :-)

Deck events?

Hey
This looks awesome! However, if it would also support webhooks for Deck events, that would be even better. It would i.e. allow for automated notifications when cards are moved to a channel somewhere, something that is lacking currently. Has this feature been thought about?

Killer feature: Support for nextcloud Flow

Thank you for creating this app!

The functionality this app provides is an often sought for request for existing apps. Allowing users to setup custom webhooks with nextcloud flow would allow seamless integration of this app with a lot of apps.

Authenticating requests

Hello kffl

I don't quite understand the "Authenticating requests" function. If I define a webhooks_secret, I should be able to open the POST at the target URL only if I authenticate with my webhooks_secret. But I can receive and read the POST on the target URL without authentication.
Maybe I understand something wrong?

Thanks for your help.

Greetings
swelcom

Nextcloud 24?

When do you propose Nextcloud 24 compatibility will be available?

End-to-end testing

Given rather unusual nature of this app (core functionality revolving around notifying an external system via HTTP POST requests), it seems that the most reasonable way to automate testing would rely on e2e approach. A draft solution would be to create a separate Node.js server used as a webhook target (performing assertions on received data) with events triggered by simulated frontend user activity automated via Cypress. Such pipeline would allow for quicker delivery of updates for newer Nextcloud versions, as they wouldn't have to be tested manually.

Internal Server Error after go to: Administration->Security

I've got Internal Server Error after go to: Administration->Security if Webhooks app has been enabled.

from log:
{"reqId":"ZA91ZOerowcy0SOwTQfH@AAAAW","level":3,"time":"2023-03-13T19:11:32+00:00","remoteAddr":"89.00.00.000","user":"admin","app":"index","method":"GET","url":"/index.php/settings/admin/security","message":"Call to undefined function OCA\Webhooks\Settings\exec() in file '/home/tsr/domains/cpdm.pl/public_html/chmura/apps/webhooks/lib/Settings/Admin.php' line 81","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"Exception","Message":"Call to undefined function OCA\Webhooks\Settings\exec() in file '/home/tsr/domains/cpdm.pl/public_html/chmura/apps/webhooks/lib/Settings/Admin.php' line 81","Code":0,"Trace":[{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Settings\Controller\AdminSettingsController"],"index"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Settings\Controller\AdminSettingsController","index",["OC\AppFramework\DependencyInjection\DIContainer"],["security","settings.AdminSettings.index"]]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/base.php","line":1047,"function":"match","class":"OC\Route\Router","type":"->","args":["/settings/admin/security"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"Error","Message":"Call to undefined function OCA\Webhooks\Settings\exec()","Code":0,"Trace":[{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/webhooks/lib/Settings/Admin.php","line":62,"function":"testCurl","class":"OCA\Webhooks\Settings\Admin","type":"::","args":[]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/settings/lib/Controller/CommonSettingsTrait.php","line":129,"function":"getForm","class":"OCA\Webhooks\Settings\Admin","type":"->","args":[]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/settings/lib/Controller/AdminSettingsController.php","line":83,"function":"formatSettings","class":"OCA\Settings\Controller\AdminSettingsController","type":"->","args":[[[["OCA\Settings\Settings\Admin\Security"]],[["OCA\Password_Policy\Settings"]],[["OCA\OAuth2\Settings\Admin"]],[["OCA\Webhooks\Settings\Admin"]]]]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/settings/lib/Controller/CommonSettingsTrait.php","line":149,"function":"getSettings","class":"OCA\Settings\Controller\AdminSettingsController","type":"->","args":["security"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/settings/lib/Controller/AdminSettingsController.php","line":68,"function":"getIndexResponse","class":"OCA\Settings\Controller\AdminSettingsController","type":"->","args":["admin","security"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\Settings\Controller\AdminSettingsController","type":"->","args":["security"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Settings\Controller\AdminSettingsController"],"index"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[["OCA\Settings\Controller\AdminSettingsController"],"index"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Settings\Controller\AdminSettingsController","index",["OC\AppFramework\DependencyInjection\DIContainer"],["security","settings.AdminSettings.index"]]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/lib/base.php","line":1047,"function":"match","class":"OC\Route\Router","type":"->","args":["/settings/admin/security"]},{"file":"/home/tsr/domains/cpdm.pl/public_html/chmura/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/home/tsr/domains/cpdm.pl/public_html/chmura/apps/webhooks/lib/Settings/Admin.php","Line":81},"CustomMessage":"--"}}

Nextcloud Updates as Event

Hello,,
is it possible to define Nextcloud updates and app updates as a webhook event? I regularly receive emails when new app or Nextcloud updates are available. Instead of emails, I would like to be able to trigger webhooks so that the monitoring system can react accordingly.

Here are examples of the mails, but in German:
grafik
grafik

Possible to attach a file to webhook call?

Is it possible to attach a file to the external webhook call?

I want to create a webhook for "new pdf-files" in a given directory. If a new file is saved into this directory, it should be send to an external API (with attached file).

Looking forward for your suggestions how to archive this.

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.