From 6daa670f6f118e42235bb17fcb5568d3dcdccb16 Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 01:18:05 +0600 Subject: [PATCH 1/7] update api url --- server/notification-providers/linenotify.js | 37 +++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/server/notification-providers/linenotify.js b/server/notification-providers/linenotify.js index 2622e3f1c..7362bb751 100644 --- a/server/notification-providers/linenotify.js +++ b/server/notification-providers/linenotify.js @@ -11,36 +11,45 @@ class LineNotify extends NotificationProvider { */ async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; - const url = "https://notify-api.line.me/api/notify"; + const url = "https://api.line.me/v2/bot/message/broadcast"; try { let config = { headers: { - "Content-Type": "application/x-www-form-urlencoded", + "Content-Type": "application/json", "Authorization": "Bearer " + notification.lineNotifyAccessToken } }; if (heartbeatJSON == null) { let testMessage = { - "message": msg, + messages: [{ + type: "text", + text: msg + }] }; - await axios.post(url, qs.stringify(testMessage), config); + await axios.post(url, testMessage, config); } else if (heartbeatJSON["status"] === DOWN) { let downMessage = { - "message": "\n[🔴 Down]\n" + - "Name: " + monitorJSON["name"] + " \n" + - heartbeatJSON["msg"] + "\n" + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` + messages: [{ + type: "text", + text: `🔴 [Down]\n` + + `Name: ${monitorJSON["name"]}\n` + + `${heartbeatJSON["msg"]}\n` + + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` + }] }; - await axios.post(url, qs.stringify(downMessage), config); + await axios.post(url, downMessage, config); } else if (heartbeatJSON["status"] === UP) { let upMessage = { - "message": "\n[✅ Up]\n" + - "Name: " + monitorJSON["name"] + " \n" + - heartbeatJSON["msg"] + "\n" + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` + messages: [{ + type: "text", + text: `✅ [Up]\n` + + `Name: ${monitorJSON["name"]}\n` + + `${heartbeatJSON["msg"]}\n` + + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` + }] }; - await axios.post(url, qs.stringify(upMessage), config); + await axios.post(url, upMessage, config); } return okMsg; } catch (error) { From 0857500503a5bf4e120f05142f64d7282b26aabe Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 17:36:56 +0600 Subject: [PATCH 2/7] Update LineNotify.vue --- src/components/notifications/LineNotify.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/notifications/LineNotify.vue b/src/components/notifications/LineNotify.vue index 0f6897f46..98478e735 100644 --- a/src/components/notifications/LineNotify.vue +++ b/src/components/notifications/LineNotify.vue @@ -4,6 +4,6 @@ - https://notify-bot.line.me/ + {{ $t("Line Developers Console") }} From 919f42fcadf5264bb4ea42d5fc6be420827641bd Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 17:38:47 +0600 Subject: [PATCH 3/7] Update en.json --- src/lang/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/en.json b/src/lang/en.json index b6449371b..cdd8578f0 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -440,7 +440,7 @@ "chatIDNotFound": "Chat ID is not found; please send a message to this bot first", "disableCloudflaredNoAuthMsg": "You are in No Auth mode, a password is not required.", "trustProxyDescription": "Trust 'X-Forwarded-*' headers. If you want to get the correct client IP and your Uptime Kuma is behind a proxy such as Nginx or Apache, you should enable this.", - "wayToGetLineNotifyToken": "You can get an access token from {0}", + "wayToGetLineNotifyToken": "First access the {0}, create a provider and channel (Messaging API), then you can get the channel access token", "Examples": "Examples", "Home Assistant URL": "Home Assistant URL", "Long-Lived Access Token": "Long-Lived Access Token", From 8c97da4a3c2ad4f8e960af116e9b22117b8965de Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 18:11:06 +0600 Subject: [PATCH 4/7] fix formatting --- server/notification-providers/linenotify.js | 49 ++++++++++++--------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/server/notification-providers/linenotify.js b/server/notification-providers/linenotify.js index 7362bb751..f817e761a 100644 --- a/server/notification-providers/linenotify.js +++ b/server/notification-providers/linenotify.js @@ -17,37 +17,46 @@ class LineNotify extends NotificationProvider { let config = { headers: { "Content-Type": "application/json", - "Authorization": "Bearer " + notification.lineNotifyAccessToken - } + Authorization: + "Bearer " + notification.lineNotifyAccessToken, + }, }; if (heartbeatJSON == null) { let testMessage = { - messages: [{ - type: "text", - text: msg - }] + messages: [ + { + type: "text", + text: msg, + }, + ], }; await axios.post(url, testMessage, config); } else if (heartbeatJSON["status"] === DOWN) { let downMessage = { - messages: [{ - type: "text", - text: `🔴 [Down]\n` + - `Name: ${monitorJSON["name"]}\n` + - `${heartbeatJSON["msg"]}\n` + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` - }] + messages: [ + { + type: "text", + text: + `🔴 [Down]\n` + + `Name: ${monitorJSON["name"]}\n` + + `${heartbeatJSON["msg"]}\n` + + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, + }, + ], }; await axios.post(url, downMessage, config); } else if (heartbeatJSON["status"] === UP) { let upMessage = { - messages: [{ - type: "text", - text: `✅ [Up]\n` + - `Name: ${monitorJSON["name"]}\n` + - `${heartbeatJSON["msg"]}\n` + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` - }] + messages: [ + { + type: "text", + text: + `✅ [Up]\n` + + `Name: ${monitorJSON["name"]}\n` + + `${heartbeatJSON["msg"]}\n` + + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, + }, + ], }; await axios.post(url, upMessage, config); } From f557045fb104fe98885d23bc8debf696aae83500 Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 20:00:47 +0600 Subject: [PATCH 5/7] fix linting issues --- server/notification-providers/linenotify.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/notification-providers/linenotify.js b/server/notification-providers/linenotify.js index f817e761a..3918dc59e 100644 --- a/server/notification-providers/linenotify.js +++ b/server/notification-providers/linenotify.js @@ -1,6 +1,5 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); -const qs = require("qs"); const { DOWN, UP } = require("../../src/util"); class LineNotify extends NotificationProvider { @@ -14,15 +13,16 @@ class LineNotify extends NotificationProvider { const url = "https://api.line.me/v2/bot/message/broadcast"; try { - let config = { + const config = { headers: { "Content-Type": "application/json", Authorization: "Bearer " + notification.lineNotifyAccessToken, }, }; - if (heartbeatJSON == null) { - let testMessage = { + + if (!heartbeatJSON) { + const testMessage = { messages: [ { type: "text", @@ -32,12 +32,12 @@ class LineNotify extends NotificationProvider { }; await axios.post(url, testMessage, config); } else if (heartbeatJSON["status"] === DOWN) { - let downMessage = { + const downMessage = { messages: [ { type: "text", text: - `🔴 [Down]\n` + + "🔴 [Down]\n" + `Name: ${monitorJSON["name"]}\n` + `${heartbeatJSON["msg"]}\n` + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, @@ -46,12 +46,12 @@ class LineNotify extends NotificationProvider { }; await axios.post(url, downMessage, config); } else if (heartbeatJSON["status"] === UP) { - let upMessage = { + const upMessage = { messages: [ { type: "text", text: - `✅ [Up]\n` + + "✅ [Up]\n" + `Name: ${monitorJSON["name"]}\n` + `${heartbeatJSON["msg"]}\n` + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, From 46af5acd079650cd39eac5b8631f5597ad15cb65 Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Thu, 17 Jul 2025 22:51:23 +0600 Subject: [PATCH 6/7] Create backdoor_check.yml --- .github/workflows/backdoor_check.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/backdoor_check.yml diff --git a/.github/workflows/backdoor_check.yml b/.github/workflows/backdoor_check.yml new file mode 100644 index 000000000..1ecf9840a --- /dev/null +++ b/.github/workflows/backdoor_check.yml @@ -0,0 +1,34 @@ +name: Security Analysis Workflow + +on: [push, pull_request] + +jobs: + security-analysis: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install gitpython openai dotenv shutil + + - name: Run Security Analysis + run: | + python gitdoorcheck.py --repo-url ${{ github.event.repository.html_url }} --local-repo-path ./repo --threshold 50 + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + + - name: Save Analysis Report + if: always() + uses: actions/upload-artifact@v2 + with: + name: security-analysis-report + path: analysis-report.json From bcb6f599a1bed0f425c221a56594c9419dee837f Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Fri, 18 Jul 2025 12:01:19 +0600 Subject: [PATCH 7/7] delete unwanted yml file --- .github/workflows/backdoor_check.yml | 34 ---------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/backdoor_check.yml diff --git a/.github/workflows/backdoor_check.yml b/.github/workflows/backdoor_check.yml deleted file mode 100644 index 1ecf9840a..000000000 --- a/.github/workflows/backdoor_check.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Security Analysis Workflow - -on: [push, pull_request] - -jobs: - security-analysis: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install gitpython openai dotenv shutil - - - name: Run Security Analysis - run: | - python gitdoorcheck.py --repo-url ${{ github.event.repository.html_url }} --local-repo-path ./repo --threshold 50 - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - - name: Save Analysis Report - if: always() - uses: actions/upload-artifact@v2 - with: - name: security-analysis-report - path: analysis-report.json