commit
2192bfa42b
@ -0,0 +1,26 @@
|
|||||||
|
exports.up = function (knex) {
|
||||||
|
return knex.schema
|
||||||
|
.alterTable("stat_daily", function (table) {
|
||||||
|
table.text("extras").defaultTo(null).comment("Extra statistics during this time period");
|
||||||
|
})
|
||||||
|
.alterTable("stat_minutely", function (table) {
|
||||||
|
table.text("extras").defaultTo(null).comment("Extra statistics during this time period");
|
||||||
|
})
|
||||||
|
.alterTable("stat_hourly", function (table) {
|
||||||
|
table.text("extras").defaultTo(null).comment("Extra statistics during this time period");
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (knex) {
|
||||||
|
return knex.schema
|
||||||
|
.alterTable("stat_daily", function (table) {
|
||||||
|
table.dropColumn("extras");
|
||||||
|
})
|
||||||
|
.alterTable("stat_minutely", function (table) {
|
||||||
|
table.dropColumn("extras");
|
||||||
|
})
|
||||||
|
.alterTable("stat_hourly", function (table) {
|
||||||
|
table.dropColumn("extras");
|
||||||
|
});
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
PRAGMA writable_schema = TRUE;
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
SQLITE_MASTER
|
||||||
|
SET
|
||||||
|
sql = replace(sql,
|
||||||
|
'monitor_id INTEGER NOT NULL',
|
||||||
|
'monitor_id INTEGER NOT NULL REFERENCES [monitor] ([id]) ON DELETE CASCADE ON UPDATE CASCADE'
|
||||||
|
)
|
||||||
|
WHERE
|
||||||
|
name = 'monitor_tls_info'
|
||||||
|
AND type = 'table';
|
||||||
|
|
||||||
|
PRAGMA writable_schema = RESET;
|
||||||
|
|
||||||
|
COMMIT;
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
|||||||
|
const NotificationProvider = require("./notification-provider");
|
||||||
|
const axios = require("axios");
|
||||||
|
|
||||||
|
class CallMeBot extends NotificationProvider {
|
||||||
|
name = "CallMeBot";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
|
const okMsg = "Sent Successfully.";
|
||||||
|
try {
|
||||||
|
const url = new URL(notification.callMeBotEndpoint);
|
||||||
|
url.searchParams.set("text", msg);
|
||||||
|
await axios.get(url.toString());
|
||||||
|
return okMsg;
|
||||||
|
} catch (error) {
|
||||||
|
this.throwGeneralAxiosError(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = CallMeBot;
|
@ -0,0 +1,39 @@
|
|||||||
|
const NotificationProvider = require("./notification-provider");
|
||||||
|
const axios = require("axios");
|
||||||
|
|
||||||
|
class Cellsynt extends NotificationProvider {
|
||||||
|
name = "Cellsynt";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
|
const okMsg = "Sent Successfully.";
|
||||||
|
const data = {
|
||||||
|
// docs at https://www.cellsynt.com/en/sms/api-integration
|
||||||
|
params: {
|
||||||
|
"username": notification.cellsyntLogin,
|
||||||
|
"password": notification.cellsyntPassword,
|
||||||
|
"destination": notification.cellsyntDestination,
|
||||||
|
"text": msg.replace(/[^\x00-\x7F]/g, ""),
|
||||||
|
"originatortype": notification.cellsyntOriginatortype,
|
||||||
|
"originator": notification.cellsyntOriginator,
|
||||||
|
"allowconcat": notification.cellsyntAllowLongSMS ? 6 : 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const resp = await axios.post("https://se-1.cellsynt.net/sms.php", null, data);
|
||||||
|
if (resp.data == null ) {
|
||||||
|
throw new Error("Could not connect to Cellsynt, please try again.");
|
||||||
|
} else if (resp.data.includes("Error:")) {
|
||||||
|
resp.data = resp.data.replaceAll("Error:", "");
|
||||||
|
throw new Error(resp.data);
|
||||||
|
}
|
||||||
|
return okMsg;
|
||||||
|
} catch (error) {
|
||||||
|
this.throwGeneralAxiosError(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Cellsynt;
|
@ -0,0 +1,33 @@
|
|||||||
|
const NotificationProvider = require("./notification-provider");
|
||||||
|
const axios = require("axios");
|
||||||
|
|
||||||
|
class GtxMessaging extends NotificationProvider {
|
||||||
|
name = "gtxmessaging";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
|
const okMsg = "Sent Successfully.";
|
||||||
|
|
||||||
|
// The UP/DOWN symbols will be replaced with `???` by gtx-messaging
|
||||||
|
const text = msg.replaceAll("🔴 ", "").replaceAll("✅ ", "");
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = new URLSearchParams();
|
||||||
|
data.append("from", notification.gtxMessagingFrom.trim());
|
||||||
|
data.append("to", notification.gtxMessagingTo.trim());
|
||||||
|
data.append("text", text);
|
||||||
|
|
||||||
|
const url = `https://rest.gtx-messaging.net/smsc/sendsms/${notification.gtxMessagingApiKey}/json`;
|
||||||
|
|
||||||
|
await axios.post(url, data);
|
||||||
|
|
||||||
|
return okMsg;
|
||||||
|
} catch (error) {
|
||||||
|
this.throwGeneralAxiosError(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = GtxMessaging;
|
@ -0,0 +1,39 @@
|
|||||||
|
const NotificationProvider = require("./notification-provider");
|
||||||
|
const axios = require("axios");
|
||||||
|
|
||||||
|
class Whapi extends NotificationProvider {
|
||||||
|
name = "whapi";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
|
const okMsg = "Sent Successfully.";
|
||||||
|
|
||||||
|
try {
|
||||||
|
const config = {
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": "Bearer " + notification.whapiAuthToken,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
"to": notification.whapiRecipient,
|
||||||
|
"body": msg,
|
||||||
|
};
|
||||||
|
|
||||||
|
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/\/+$/, "") + "/messages/text";
|
||||||
|
|
||||||
|
await axios.post(url, data, config);
|
||||||
|
|
||||||
|
return okMsg;
|
||||||
|
} catch (error) {
|
||||||
|
this.throwGeneralAxiosError(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Whapi;
|
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="callmebot-endpoint" class="form-label">{{ $t("Endpoint") }}</label>
|
||||||
|
<input id="callmebot-endpoint" v-model="$parent.notification.callMeBotEndpoint" type="text" class="form-control" required>
|
||||||
|
<i18n-t tag="div" keypath="callMeBotGet" class="form-text">
|
||||||
|
<a href="https://www.callmebot.com/blog/free-api-facebook-messenger/" target="_blank">Facebook Messenger</a>
|
||||||
|
<a href="https://www.callmebot.com/blog/test-whatsapp-api/" target="_blank">WhatsApp</a>
|
||||||
|
<a href="https://www.callmebot.com/blog/telegram-phone-call-using-your-browser/" target="_blank">Telegram Call</a>
|
||||||
|
1 message / 10 sec; 1 call / 65 sec
|
||||||
|
<!--There is no public documentation available. This data is based on testing!-->
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -0,0 +1,54 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cellsynt-login" class="form-label">{{ $t("Username") }}</label>
|
||||||
|
<input id="cellsynt-login" v-model="$parent.notification.cellsyntLogin" type="text" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cellsynt-key" class="form-label">{{ $t("Password") }}</label>
|
||||||
|
<HiddenInput id="cellsynt-key" v-model="$parent.notification.cellsyntPassword" :required="true" autocomplete="new-password"></HiddenInput>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cellsynt-Originatortype" class="form-label">{{ $t("Originator type") }}</label>
|
||||||
|
<select id="cellsynt-Originatortype" v-model="$parent.notification.cellsyntOriginatortype" :required="true" class="form-select">
|
||||||
|
<option value="alpha">{{ $t("Alphanumeric (recommended)") }}</option>
|
||||||
|
<option value="numeric">{{ $t("Telephone number") }}</option>
|
||||||
|
</select>
|
||||||
|
<div class="form-text">
|
||||||
|
<p><b>{{ $t("Alphanumeric (recommended)") }}:</b><br /> {{ $t("Alphanumeric string (max 11 alphanumeric characters). Recipients can not reply to the message.") }}</p>
|
||||||
|
<p><b>{{ $t("Telephone number") }}:</b><br /> {{ $t("Numeric value (max 15 digits) with telephone number on international format without leading 00 (example UK number 07920 110 000 should be set as 447920110000). Recipients can reply to the message.") }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cellsynt-originator" class="form-label">{{ $t("Originator") }} <small>({{ $parent.notification.cellsyntOriginatortype === 'alpha' ? $t("max 11 alphanumeric characters") : $t("max 15 digits") }})</small></label>
|
||||||
|
<input v-if="$parent.notification.cellsyntOriginatortype === 'alpha'" id="cellsynt-originator" v-model="$parent.notification.cellsyntOriginator" type="text" class="form-control" pattern="[a-zA-Z0-9\s]+" maxlength="11" required>
|
||||||
|
<input v-else id="cellsynt-originator" v-model="$parent.notification.cellsyntOriginator" type="number" class="form-control" pattern="[0-9]+" maxlength="15" required>
|
||||||
|
<div class="form-text"><p>{{ $t("Visible on recipient's mobile phone as originator of the message. Allowed values and function depends on parameter originatortype.") }}</p></div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cellsynt-destination" class="form-label">{{ $t("Destination") }}</label>
|
||||||
|
<input id="cellsynt-destination" v-model="$parent.notification.cellsyntDestination" type="text" class="form-control" required>
|
||||||
|
<div class="form-text"><p>{{ $t("Recipient's telephone number using international format with leading 00 followed by country code, e.g. 00447920110000 for the UK number 07920 110 000 (max 17 digits in total). Max 25000 comma separated recipients per HTTP request.") }}</p></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input id="cellsynt-allow-long" v-model="$parent.notification.cellsyntAllowLongSMS" type="checkbox" class="form-check-input">
|
||||||
|
<label for="cellsynt-allow-long" class="form-label">{{ $t("Allow Long SMS") }}</label>
|
||||||
|
<div class="form-text">{{ $t("Split long messages into up to 6 parts. 153 x 6 = 918 characters.") }}</div>
|
||||||
|
</div>
|
||||||
|
<i18n-t tag="p" keypath="More info on:" style="margin-top: 8px;">
|
||||||
|
<a href="https://www.cellsynt.com/en/" target="_blank">https://www.cellsynt.com/en/</a>
|
||||||
|
</i18n-t>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import HiddenInput from "../HiddenInput.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
HiddenInput
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$parent.notification.cellsyntOriginatortype ||= "alpha";
|
||||||
|
this.$parent.notification.cellsyntOriginator ||= "uptimekuma";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="gtxmessaging-api-key" class="form-label">{{ $t("API Key") }}</label>
|
||||||
|
<HiddenInput id="gtxmessaging-api-key" v-model="$parent.notification.gtxMessagingApiKey" :required="true"></HiddenInput>
|
||||||
|
<div class="form-text">
|
||||||
|
{{ $t("gtxMessagingApiKeyHint") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="gtxmessaging-from" class="form-label">{{ $t("From Phone Number / Transmission Path Originating Address (TPOA)") }}</label>
|
||||||
|
<input id="gtxmessaging-from" v-model="$parent.notification.gtxMessagingFrom" type="text" class="form-control" required>
|
||||||
|
<i18n-t tag="div" keypath="gtxMessagingFromHint" class="form-text">
|
||||||
|
<template #e164>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.164">E.164</a>
|
||||||
|
</template>
|
||||||
|
<template #e212>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.212">E.212</a>
|
||||||
|
</template>
|
||||||
|
<template #e214>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.214">E.214</a>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="gtxmessaging-to" class="form-label">{{ $t("To Phone Number") }}</label>
|
||||||
|
<input id="gtxmessaging-to" v-model="$parent.notification.gtxMessagingTo" type="text" pattern="^\+\d+$" class="form-control" required>
|
||||||
|
<i18n-t tag="div" keypath="gtxMessagingToHint" class="form-text">
|
||||||
|
<template #e164>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.164">E.164</a>
|
||||||
|
</template>
|
||||||
|
<template #e212>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.212">E.212</a>
|
||||||
|
</template>
|
||||||
|
<template #e214>
|
||||||
|
<a href="https://wikipedia.org/wiki/E.214">E.214</a>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import HiddenInput from "../HiddenInput.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
HiddenInput
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="whapi-api-url" class="form-label">{{ $t("API URL") }}</label>
|
||||||
|
<input id="whapi-api-url" v-model="$parent.notification.whapiApiUrl" placeholder="https://gate.whapi.cloud/" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="whapi-auth-token" class="form-label">{{ $t("Token") }}</label>
|
||||||
|
<HiddenInput id="whapi-auth-token" v-model="$parent.notification.whapiAuthToken" :required="true" autocomplete="new-password"></HiddenInput>
|
||||||
|
<i18n-t tag="div" keypath="wayToGetWhapiUrlAndToken" class="form-text">
|
||||||
|
<a href="https://panel.whapi.cloud/dashboard" target="_blank">https://panel.whapi.cloud/dashboard</a>
|
||||||
|
</i18n-t>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="whapi-recipient" class="form-label">{{ $t("whapiRecipient") }}</label>
|
||||||
|
<input id="whapi-recipient" v-model="$parent.notification.whapiRecipient" type="text" pattern="^[\d-]{10,31}(@[\w\.]{1,})?$" class="form-control" required>
|
||||||
|
<div class="form-text">{{ $t("wayToWriteWhapiRecipient", ["00117612345678", "00117612345678@s.whatsapp.net", "123456789012345678@g.us"]) }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<i18n-t tag="div" keypath="More info on:" class="mb-3 form-text">
|
||||||
|
<a href="https://whapi.cloud/" target="_blank">https://whapi.cloud/</a>
|
||||||
|
</i18n-t>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import HiddenInput from "../HiddenInput.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
HiddenInput,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue