webhook - lightweight incoming webhook server to run shell commands
-
@fbartels thanks for packaging this.
I'm looking into using it and noticed this at the end of the DESCRIPTION.mdThe cloudron cli utility should be used to add custom hooks and place scripts to trigger in ยด/app/data/ยด.
This is only for the initial deployment, right ?
Afterwards it can be managed via terminal I presume. -
@fbartels small difficulty after installation
App installed fine and default hooks working fine.
I add one hook as a test in hooks.json, just to check hook creation.
Straight copy of the webook config except cwd dir set to /app/dataOct 09 05:49:42 [webhook] 2021/10/09 02:49:42 [713620] error parsing body payload due to unsupported content type header: Oct 09 05:49:42 [webhook] 2021/10/09 02:49:42 [713620] test hook triggered successfully Oct 09 05:49:42 [webhook] 2021/10/09 02:49:42 [713620] error in exec: "/app/data/test.sh": permission denied
test.sh
is owned by root -
@robi errr .... good thought !
I was led down the road by instructions from SMS provider (telnyx)
I will check out if it is posisble.
But initially not sure, webhook needs to be received and then acted on by some php scripts.
But maybe it's all doable.
Will check it out. -
@timconsidine said in webhook - lightweight incoming webhook server to run shell commands:
test.sh is owned by root
It may be owned by root, but by the output of webhook it seems to exec permissions are missing.
@timconsidine said in webhook - lightweight incoming webhook server to run shell commands:
This is only for the initial deployment, right ?
Yes, today the management could be done just as well through the file manager and the terminal. Back when I wrote that readme I think the file manager did not yet exist.
-
-
@timconsidine no problem, webhook is a simple, no fuss tool, thats what I like about it.
It just has "too less" gui, thats why I never pursued putting it into the appcenter.
-
@fbartels I'm totally OK with no GUI
I don't think it has any real role in this kind of app.
I can't really envisage a case where an app user is deploying the app but is not comfortable with the terminal.
The webhooks have got to be consumed, and that's likely to mean some kind of scripting or coding. -
@fbartels said in webhook - lightweight incoming webhook server to run shell commands:
It may be owned by root, but by the output of webhook it seems to exec permissions are missing.
You are indeed correct. logs show :
Oct 09 21:56:16 [webhook] 2021/10/09 18:56:16 [706dfd] test hook triggered successfully Oct 09 21:56:16 [webhook] 2021/10/09 18:56:16 [706dfd] executing /app/data/test.sh (/app/data/test.sh) with arguments ["/app/data/test.sh"] and environment [] using /app/data as cwd Oct 09 21:56:16 [webhook] 2021/10/09 18:56:16 [706dfd] command output: pong Oct 09 21:56:16 /app/data/test.sh: 4: cannot create out/test.txt: Permission denied
This is a simple test where the working directory is
/app/data
and the directory and subfolders ownership is set towww-data
:#!/bin/sh echo "pong" echo "test" > out/test.txt
Pong succeeds but echo to a file does not.
Been staring at this and I can't see the problem, so forgive asking for any enlightenment.
www-data
doesn't seem to be able to access directory owned bywww-data
. Andsu - www-data
responds with this account is not available. -
@timconsidine grrrr it seems that
/app/data
needs to be owned bycloudron
Then it works.In case that helps anyone else
-
@robi said in webhook - lightweight incoming webhook server to run shell commands:
why not use N8N instead? much more featureful and UI.
I ran up a quick n8n webhook
Easier than I thought and works well.
The only thing I really understand what to do with webhook payload in a n8n workflow is put it in a database or Baserow (which I have on cloudron) or now also SeaTable (which I have on Caprover).Not sure n8n is up to the scripting of how the payload needs to be parsed and manipulated and disposed of. But maybe the
function
node is adequate.Need to think it through and make a plan.
At least I have 2 options now, n8n and @fbartels' webhook app.
Thanks again.