<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ERROR log to telegram or somewhere else]]></title><description><![CDATA[<p dir="auto">In case of apear certain words on logs, it send that log line with some basic data to the manager get notifications as soon as an Error happends.</p>
]]></description><link>https://forum.cloudron.io/topic/11375/error-log-to-telegram-or-somewhere-else</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 08:25:02 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/11375.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Mar 2024 14:00:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ERROR log to telegram or somewhere else on Sun, 09 Jun 2024 18:11:32 GMT]]></title><description><![CDATA[<p dir="auto">In case anyone needs it, I added support to dismiss the notification.</p>
<p dir="auto">After the if node, assuming true, add another connection, a 'Loop over items' node, with a batch size of 1.</p>
<p dir="auto">Connect the node's "loop" connection to a new function node with this code.</p>
<pre><code>// Access the input JSON data
const item = $json;

// Ensure the structure is correct and 'filteredID' exists
if (item.filteredID &amp;&amp; Array.isArray(item.filteredID) &amp;&amp; item.filteredID.length &gt; 0) {
    const notificationId = item.filteredID[0]; // Extract the first ID

    // Return the data for the HTTP Request node
    return {
        json: {
            notificationId: notificationId,
            acknowledged: true
        }
    };
} else {
    throw new Error("Invalid JSON structure or 'filteredID' not found.");
}
</code></pre>
<p dir="auto">Then, connect the function node to a new HTTP request node with the method of 'POST', URL of "<a href="https://my.cloudron.site/api/v1/notifications/" target="_blank" rel="noopener noreferrer nofollow ugc">https://my.cloudron.site/api/v1/notifications/</a>{{ $json.notificationId }}" (As an expression), same authorization header as the first HTTP request nodes, with the (JSON) body of:</p>
<pre><code>{
  "acknowledged": true
}
</code></pre>
<p dir="auto">I'm pretty sure this process can be written better, but this approach was quick and dirty. I've also adjusted the notifications to be sent via email rather than using NFTY, but that's a pretty straightforward step.</p>
<p dir="auto"><img src="/assets/uploads/files/1717956398117-0338dc53-6d5a-4d2b-9071-5849f552439b-image-resized.png" alt="0338dc53-6d5a-4d2b-9071-5849f552439b-image.png" class="img-markdown  img-fluid" /></p>
]]></description><link>https://forum.cloudron.io/post/89604</link><guid isPermaLink="true">https://forum.cloudron.io/post/89604</guid><dc:creator><![CDATA[Locutus]]></dc:creator><pubDate>Sun, 09 Jun 2024 18:11:32 GMT</pubDate></item><item><title><![CDATA[Reply to ERROR log to telegram or somewhere else on Sun, 28 Apr 2024 10:16:58 GMT]]></title><description><![CDATA[<p dir="auto">Out of curiosity I've built what <a class="plugin-mentions-user plugin-mentions-a" href="/user/luckow" aria-label="Profile: luckow">@<bdi>luckow</bdi></a> suggested, only with Cloudron API (notifications endpoint) -&gt; n8n -&gt; some magic -&gt; ntfy.sh-app and it looks like this:</p>
<p dir="auto"><img src="/assets/uploads/files/1714298120875-f036453c-4190-48d2-bae2-33c5e16133b5-image-resized.png" alt="f036453c-4190-48d2-bae2-33c5e16133b5-image.png" class="img-markdown  img-fluid" /></p>
<ul>
<li>
<p dir="auto">Action gets triggered (either automatically or manually), n8n checks the cloudron api <code>https://my.example1.com/api/v1/notifications</code> (create a readonly access token in your profile and update the Bearer token with it) with the parameters <code>acknowledged</code> = <code>false</code>, so only unread notifications are collected.</p>
</li>
<li>
<p dir="auto">The code-node does the following (<code>filteredTitles</code> because I don't care about app-updates, only actual issues, can be adjusted of course):</p>
</li>
</ul>
<pre><code>const notifications = items[0].json.notifications;
const types = notifications.map(notification =&gt; notification.type);
const titles = notifications.map(notification =&gt; notification.title);

// Filter notifications to remove those with type "appUpdated"
const filteredNotifications = notifications.filter(notification =&gt; notification.type != "appUpdated");

// Extract titles of the filtered notifications
const filteredTitles = filteredNotifications.map(notification =&gt; notification.title);

//return [{ json: { types, titles } }];
return [{ json: { filteredTitles } }];
</code></pre>
<p dir="auto">This will result in an array of current notifications, e.g.</p>
<pre><code>[
  {
    "filteredTitles": [
      "Email is not configured properly",
      "The app at cms.example.com ran out of memory."
    ]
  }
]
</code></pre>
<ul>
<li>The if-node checks if there's actual content. If it's empty, nothing will happen, if it's not, it will make a http request to your nfty instance and topic of your choice (saved credentials in n8n) and send the notifications:</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1714298335838-2ae64242-ff94-44d3-843d-fb0154436eed-image-resized.png" alt="2ae64242-ff94-44d3-843d-fb0154436eed-image.png" class="img-markdown  img-fluid" /></p>
<p dir="auto">Since I was working with readonly tokens, I had no intentions of marking the notifications as read after sending out the message. So there's room for improvement, but I thought I would throw it in here as a PoC <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=44248645c10" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Complete code (My_Cloudron_workflow.json) is here:</p>
<pre><code>{
  "name": "My Cloudron workflow",
  "nodes": [
    {
      "parameters": {},
      "id": "0dcf1d60-f8e7-4ffe-be14-64399a5c924d",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        240,
        620
      ]
    },
    {
      "parameters": {
        "url": "https://my.example1.com/api/v1/notifications",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "acknowledged",
              "value": "false"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 123"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "options": {}
      },
      "id": "073de174-b658-480e-bb3c-6be103304bd9",
      "name": "EX1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        620
      ],
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "url": "https://my.example2.com/api/v1/notifications",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "acknowledged",
              "value": "false"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 456"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "options": {}
      },
      "id": "c29eae02-51b5-417c-a103-d35b4bcb15e8",
      "name": "EX2",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        780
      ],
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "url": "https://my.example3.com/api/v1/notifications",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "acknowledged",
              "value": "false"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 789"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "options": {}
      },
      "id": "a00d01ae-fca9-41e8-b16f-3456459f414a",
      "name": "EX3",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        460
      ],
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "jsCode": "const notifications = items[0].json.notifications;\nconst types = notifications.map(notification =&gt; notification.type);\nconst titles = notifications.map(notification =&gt; notification.title);\n\n// Filter notifications to remove those with type \"appUpdated\"\nconst filteredNotifications = notifications.filter(notification =&gt; notification.type != \"appUpdated\");\n\n// Extract titles of the filtered notifications\nconst filteredTitles = filteredNotifications.map(notification =&gt; notification.title);\n\n//return [{ json: { types, titles } }];\nreturn [{ json: { filteredTitles } }];"
      },
      "id": "fb776916-d0d4-46b6-8a7d-7de5694e650c",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        620,
        460
      ]
    },
    {
      "parameters": {
        "jsCode": "const notifications = items[0].json.notifications;\nconst types = notifications.map(notification =&gt; notification.type);\nconst titles = notifications.map(notification =&gt; notification.title);\n\n// Filter notifications to remove those with type \"appUpdated\"\nconst filteredNotifications = notifications.filter(notification =&gt; notification.type != \"appUpdated\");\n\n// Extract titles of the filtered notifications\nconst filteredTitles = filteredNotifications.map(notification =&gt; notification.title);\n\n//return [{ json: { types, titles } }];\nreturn [{ json: { filteredTitles } }];"
      },
      "id": "968f2566-7983-46ef-b14a-3677a3a6fc88",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        620,
        620
      ]
    },
    {
      "parameters": {
        "jsCode": "const notifications = items[0].json.notifications;\nconst types = notifications.map(notification =&gt; notification.type);\nconst titles = notifications.map(notification =&gt; notification.title);\n\n// Filter notifications to remove those with type \"appUpdated\"\nconst filteredNotifications = notifications.filter(notification =&gt; notification.type != \"appUpdated\");\n\n// Extract titles of the filtered notifications\nconst filteredTitles = filteredNotifications.map(notification =&gt; notification.title);\n\n//return [{ json: { types, titles } }];\nreturn [{ json: { filteredTitles } }];"
      },
      "id": "5463ace4-ed1f-408a-a13c-a153fbda2ca3",
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        620,
        780
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://ntfy.nftyserver.com/cloudron-notifications",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Title",
              "value": "Current example3.com notifications"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "Title",
        "body": "={{ $json.filteredTitles.join(\"\\n\"); }}",
        "options": {}
      },
      "id": "83bc0ca8-d7e1-4fb5-8dd9-0b3360f6763e",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        460
      ],
      "credentials": {
        "httpBasicAuth": {
          "id": "5tUu1DjoNUxl0M5a",
          "name": "ntfy token"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://ntfy.nftyserver.com/cloudron-notifications",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Title",
              "value": "Current example1.com notifications"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "Title",
        "body": "={{ $json.filteredTitles.join(\"\\n\"); }}",
        "options": {}
      },
      "id": "92815612-9381-444f-86b5-7c3c3cf8a371",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        620
      ],
      "credentials": {
        "httpBasicAuth": {
          "id": "5tUu1DjoNUxl0M5a",
          "name": "ntfy token"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://ntfy.nftyserver.com/cloudron-notifications",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Title",
              "value": "Current example2.com notifications"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "Title",
        "body": "={{ $json.filteredTitles.join(\"\\n\"); }}",
        "options": {}
      },
      "id": "bc221e4f-8817-4c19-a74d-9333a4783319",
      "name": "HTTP Request2",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        940,
        780
      ],
      "credentials": {
        "httpBasicAuth": {
          "id": "5tUu1DjoNUxl0M5a",
          "name": "ntfy token"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "43482a2f-b2b0-4f0a-b970-7b11e8f6ee03",
              "leftValue": "={{ $json.filteredTitles }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "af3ebb14-32db-4afb-8c9d-84eb593eae96",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        780,
        620
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "1811bb6f-55ca-4b2d-9f6b-97c489ef4d21",
              "leftValue": "={{ $json.filteredTitles }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "e354d631-5daf-495d-a5e2-e0fb64ef212d",
      "name": "If2",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        780,
        780
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "43482a2f-b2b0-4f0a-b970-7b11e8f6ee03",
              "leftValue": "={{ $json.filteredTitles }}",
              "rightValue": "",
              "operator": {
                "type": "array",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "a3fc1a27-f94d-4651-884f-34c683b0a2da",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        780,
        460
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "EX1",
            "type": "main",
            "index": 0
          },
          {
            "node": "EX2",
            "type": "main",
            "index": 0
          },
          {
            "node": "EX3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EX1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EX2": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EX3": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b1689af0-81c6-453c-a8aa-1d7c84d7a85e",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "8903125d64295093a384f52f480a1738308c71ada8db56c53efba4894aefbff2"
  },
  "id": "I2Mq9Y8GOPIDIh8i",
  "tags": []
}
</code></pre>
<p dir="auto">I threw out a module last minute, so hopefully no oversights in there. Improvements are welcome! <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=44248645c10" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";)" alt="😉" /></p>
<p dir="auto">TL;DR: Adjust the URLs to your Cloudrons, create and add readonly tokens, add a <code>ntfy token</code> to your n8n credentials and adjust the URL to your ntfy instance.</p>
]]></description><link>https://forum.cloudron.io/post/87582</link><guid isPermaLink="true">https://forum.cloudron.io/post/87582</guid><dc:creator><![CDATA[msbt]]></dc:creator><pubDate>Sun, 28 Apr 2024 10:16:58 GMT</pubDate></item><item><title><![CDATA[Reply to ERROR log to telegram or somewhere else on Fri, 22 Mar 2024 16:04:21 GMT]]></title><description><![CDATA[<p dir="auto">Invitation to an experiment: Try to find out if this works ...<br />
Cloudron api -&gt; n8n -&gt; some magic -&gt; Telegram</p>
<p dir="auto">IMHO it should be possible to get all the information (<a href="https://docs.cloudron.io/api.html#tag/Eventlog" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/api.html#tag/Eventlog</a>)</p>
<p dir="auto">Challenge accepted?</p>
]]></description><link>https://forum.cloudron.io/post/85557</link><guid isPermaLink="true">https://forum.cloudron.io/post/85557</guid><dc:creator><![CDATA[luckow]]></dc:creator><pubDate>Fri, 22 Mar 2024 16:04:21 GMT</pubDate></item></channel></rss>