Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Wishlist
  3. webhook - lightweight incoming webhook server to run shell commands

webhook - lightweight incoming webhook server to run shell commands

Scheduled Pinned Locked Moved App Wishlist
15 Posts 4 Posters 2.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robiR Offline
      robiR Offline
      robi
      wrote on last edited by
      #6

      why not use N8N instead? much more featureful and UI.

      Conscious tech

      timconsidineT 2 Replies Last reply
      1
      • robiR robi

        why not use N8N instead? much more featureful and UI.

        timconsidineT Offline
        timconsidineT Offline
        timconsidine
        App Dev
        wrote on last edited by
        #7

        @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.

        1 Reply Last reply
        0
        • timconsidineT timconsidine

          @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/data

          Oct 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

          fbartelsF Offline
          fbartelsF Offline
          fbartels
          App Dev
          wrote on last edited by
          #8

          @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.

          timconsidineT 2 Replies Last reply
          0
          • fbartelsF fbartels

            @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.

            timconsidineT Offline
            timconsidineT Offline
            timconsidine
            App Dev
            wrote on last edited by
            #9

            @fbartels many thanks
            I will look at directory permissions etc.
            I rebuilt the app with Cloudron base 3.0 in Dockerfile, just in case it did something about permissions, but no change.
            The app is nice - thanks for making it 👍

            fbartelsF 1 Reply Last reply
            0
            • timconsidineT timconsidine

              @fbartels many thanks
              I will look at directory permissions etc.
              I rebuilt the app with Cloudron base 3.0 in Dockerfile, just in case it did something about permissions, but no change.
              The app is nice - thanks for making it 👍

              fbartelsF Offline
              fbartelsF Offline
              fbartels
              App Dev
              wrote on last edited by
              #10

              @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.

              timconsidineT 1 Reply Last reply
              0
              • fbartelsF fbartels

                @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.

                timconsidineT Offline
                timconsidineT Offline
                timconsidine
                App Dev
                wrote on last edited by
                #11

                @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.

                1 Reply Last reply
                1
                • robiR Offline
                  robiR Offline
                  robi
                  wrote on last edited by
                  #12

                  For Cloudron it seems we'd do well with packaging such CLI tools into an app that has a simple lightweight GUI for informational or 3rd party password access instructions.

                  Many GoLang programs fit this model wrapped in a nice UX.

                  Conscious tech

                  1 Reply Last reply
                  0
                  • fbartelsF fbartels

                    @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.

                    timconsidineT Offline
                    timconsidineT Offline
                    timconsidine
                    App Dev
                    wrote on last edited by timconsidine
                    #13

                    @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 to www-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 by www-data. And su - www-data responds with this account is not available.

                    timconsidineT 1 Reply Last reply
                    0
                    • timconsidineT timconsidine

                      @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 to www-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 by www-data. And su - www-data responds with this account is not available.

                      timconsidineT Offline
                      timconsidineT Offline
                      timconsidine
                      App Dev
                      wrote on last edited by
                      #14

                      @timconsidine grrrr it seems that /app/data needs to be owned by cloudron
                      Then it works.

                      In case that helps anyone else

                      1 Reply Last reply
                      0
                      • robiR robi

                        why not use N8N instead? much more featureful and UI.

                        timconsidineT Offline
                        timconsidineT Offline
                        timconsidine
                        App Dev
                        wrote on last edited by timconsidine
                        #15

                        @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.

                        1 Reply Last reply
                        1
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Bookmarks
                          • Search