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