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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Healthcheck for protected custom Node apps

    Support
    health
    4
    6
    308
    Loading More Posts
    • 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.
    • P
      pdubs last edited by

      Hi All-

      I have a custom Node app that runs smoothly and passes the Healthcheck when the homepage is not protected.

      However, if I try to protect the whole app including the homepage, I get "Not Responding" in my dashboard. I saw that for LAMP apps there is an easy fix here by editing the .htaccess file -- but how do I fix this for a Node app?

      Sincere thanks,

      Phil

      1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        This would highly depend on the kind of node app. For LAMP there is a http server (apache) running, which serves up a folder tree. This may or may not be the case for a nodejs server, but it is part of the app code itself and there is no such universal concept of htaccess like for apache.

        Which nodejs app are you referring to?

        1 Reply Last reply Reply Quote 0
        • girish
          girish Staff last edited by

          @pdubs For custom apps, simply add a special route in your nodejs app like /cloudron_healthcheck and make it return a http status code 200. Then fixup the healthCheckPath of your app's CloudronManifest.json.

          1 Reply Last reply Reply Quote 0
          • Lonkle
            Lonkle last edited by

            I can do things like this but there's an app I'm editing right now for Cloudron that has a token capability and no place for a "whitelist" URL so I have to code one - there are a few web apps that are allowed to be "tokened" shut. It would be nice to be able to provide within the "health path" /?token=abcdefg in the Cloudron.manifest just like I would the URL when accessing it...does that work already or would those be considered invalid characters? This is for custom development, of course. It would speed up the process of porting over new changes that open source projects have while still maintaining instant security.

            1 Reply Last reply Reply Quote 0
            • girish
              girish Staff last edited by

              @Lonk mm, given the CloudronManifest.json is checked into a git repo, would it not be dangerous to put the token in the health path? But otherwise, ?token=xx should indeed work already.

              Lonkle 1 Reply Last reply Reply Quote 0
              • Lonkle
                Lonkle @girish last edited by Lonkle

                @girish Yes yes, this would only be for development purposes (since placing the token in CloudronManifest would, of course, be silly).

                This would be just to pass the healthcheck so I don't expose anything while developing on a public domain.

                Thanks for letting me know it'll work, it'll help with an app I'm porting.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB