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. Support
  3. Notification settings - App is online?

Notification settings - App is online?

Scheduled Pinned Locked Moved Solved Support
notifications
6 Posts 3 Posters 339 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.
  • E Offline
    E Offline
    ekevu123
    wrote on last edited by joseph
    #1

    I have just discovered the notification settings, where I can get an e-mail in some cases.

    screenshot.png

    However, what does "App is online" mean in this case? The others are clear.

    1 Reply Last reply
    1
    • J Online
      J Online
      joseph
      Staff
      wrote on last edited by
      #2

      I think when an app went down and it came back up again. Maybe this should phrased better? "App came back online" ?

      1 Reply Last reply
      0
      • J joseph marked this topic as a question on
      • SansGuidonS Offline
        SansGuidonS Offline
        SansGuidon
        wrote on last edited by
        #3

        I wonder in which case the app is going back online? My experience has been that either we had to restart an app, either an app crashed, but then we have to manually trigger a restart.
        Did I miss other use cases? I'm still scripting a restart of crashed apps every 10 min like for WordPress, Shaarli, which seem to be taken down regularly by indexing bots, I know it was planned to automatically restart apps on demand in Cloudron settings, but I doubt it is already implemented and hence I also wonder in which case the "App is online" notification would be really helpful. Maybe for shared Cloudron instances managed by several users/admins?

        About me / Now

        1 Reply Last reply
        0
        • J Online
          J Online
          joseph
          Staff
          wrote on last edited by
          #4

          It's merely based on healthchecks. If an app starts responding to healthchecks, it is marked as 'online' . healthcehck in this context is the URL specificed in the manifest - https://docs.cloudron.io/packaging/manifest/#healthcheckpath

          1 Reply Last reply
          0
          • SansGuidonS Offline
            SansGuidonS Offline
            SansGuidon
            wrote on last edited by
            #5

            @joseph : for now I'm using a cron job (code below) and Cloudron API to check every 10 min which app is down and restart it, is it possible to mimic some basic autoRestart as part of Cloudron platform instead?
            That would be nice to free ourselves from maintaining scripts like below even if I truly love scripting and fixing problems myself 😆

            #!/bin/bash
            API_TOKEN="<REDACTED>"
            CLOUDRON_URL=${CLOUDRON_WEBADMIN_ORIGIN}
            APPS="<APP_ID> <APPNAME.MYDOMAINE.TLD>
            <ANOTHER_APP_ID> <APPNAME.MYDOMAINE.TLD>"
            echo "$APPS" | while read id url; do
              status1=$(curl --max-time 15 -s -o /dev/null -w "%{http_code}" "https://$url")
              status2=$(curl --max-time 15 -s -o /dev/null -w "%{http_code}" "https://$url")
              if [ "$status1" -ne 200 ] && [ "$status2" -ne 200 ]; then
                curl --max-time 5 -s -X POST "$CLOUDRON_URL/api/v1/apps/$id/restart" -H "Authorization: Bearer $API_TOKEN" \
                && echo "$url restarted ✅" \
                && php /app/data/scripts/send_email.php <EMAIL>  "Cloudron Healtcheck" "Service at $url was automatically restarted!"
              fi
            done
            

            About me / Now

            J 1 Reply Last reply
            4
            • SansGuidonS SansGuidon

              @joseph : for now I'm using a cron job (code below) and Cloudron API to check every 10 min which app is down and restart it, is it possible to mimic some basic autoRestart as part of Cloudron platform instead?
              That would be nice to free ourselves from maintaining scripts like below even if I truly love scripting and fixing problems myself 😆

              #!/bin/bash
              API_TOKEN="<REDACTED>"
              CLOUDRON_URL=${CLOUDRON_WEBADMIN_ORIGIN}
              APPS="<APP_ID> <APPNAME.MYDOMAINE.TLD>
              <ANOTHER_APP_ID> <APPNAME.MYDOMAINE.TLD>"
              echo "$APPS" | while read id url; do
                status1=$(curl --max-time 15 -s -o /dev/null -w "%{http_code}" "https://$url")
                status2=$(curl --max-time 15 -s -o /dev/null -w "%{http_code}" "https://$url")
                if [ "$status1" -ne 200 ] && [ "$status2" -ne 200 ]; then
                  curl --max-time 5 -s -X POST "$CLOUDRON_URL/api/v1/apps/$id/restart" -H "Authorization: Bearer $API_TOKEN" \
                  && echo "$url restarted ✅" \
                  && php /app/data/scripts/send_email.php <EMAIL>  "Cloudron Healtcheck" "Service at $url was automatically restarted!"
                fi
              done
              
              J Online
              J Online
              joseph
              Staff
              wrote on last edited by
              #6

              @SansGuidon I think your approach is the best as of right now. We will have to add automatic restart built into Cloudron at some point.

              1 Reply Last reply
              3
              • J joseph has marked this topic as solved on
              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