mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
405 lines
14 KiB
JSON
Executable File
405 lines
14 KiB
JSON
Executable File
{
|
|
"code_name": "_publisher_webhook",
|
|
"unique_prefix": "WEBHOOK",
|
|
"plugin_type": "publisher",
|
|
"enabled": true,
|
|
"data_source": "script",
|
|
"show_ui": true,
|
|
"localized": ["display_name", "description", "icon"],
|
|
"display_name" : [
|
|
{
|
|
"language_code": "en_us",
|
|
"string" : "Webhook publisher"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Habilitar Webhook"
|
|
}
|
|
],
|
|
"icon":[{
|
|
"language_code": "en_us",
|
|
"string" : "<i class=\"fa-solid fa-circle-nodes\"></i>"
|
|
}],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string" : "A plugin to publish a notification via Webhooks."
|
|
}
|
|
],
|
|
"params" : [
|
|
],
|
|
"database_column_definitions":
|
|
[
|
|
{
|
|
"column": "Index",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "N/A"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "N/A"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Plugin",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "N/A"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "N/A"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Object_PrimaryID",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "N/A"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Object_SecondaryID",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Sent when"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Watched_Value1",
|
|
"css_classes": "col-sm-3",
|
|
"show": true,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Notification GUID"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Watched_Value2",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "textarea_readonly",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Response (stdout)"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Watched_Value3",
|
|
"css_classes": "col-sm-2",
|
|
"show": true,
|
|
"type": "textarea_readonly",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Response (stderr)"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Watched_Value4",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "device_mac",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Device"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"column": "UserData",
|
|
"css_classes": "col-sm-2",
|
|
"show": false,
|
|
"type": "textbox_save",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Comments"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Comentarios"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Status",
|
|
"css_classes": "col-sm-1",
|
|
"show": false,
|
|
"type": "replace",
|
|
"default_value":"",
|
|
"options": [
|
|
{
|
|
"equals": "watched-not-changed",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-square-check'></i><div></div>"
|
|
},
|
|
{
|
|
"equals": "watched-changed",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-triangle-exclamation'></i></div>"
|
|
},
|
|
{
|
|
"equals": "new",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-circle-plus'></i></div>"
|
|
},
|
|
{
|
|
"equals": "missing-in-last-scan",
|
|
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
|
}
|
|
],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Status"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Estado"
|
|
}]
|
|
},
|
|
{
|
|
"column": "Extra",
|
|
"css_classes": "col-sm-3",
|
|
"show": false,
|
|
"type": "label",
|
|
"default_value":"",
|
|
"options": [],
|
|
"localized": ["name"],
|
|
"name":[{
|
|
"language_code": "en_us",
|
|
"string" : "Extra"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Extra"
|
|
}]
|
|
}
|
|
],
|
|
"settings":[
|
|
{
|
|
"function": "RUN",
|
|
"events": ["test"],
|
|
"type": "text.select",
|
|
"default_value":"disabled",
|
|
"options": ["disabled", "on_notification" ],
|
|
"localized": ["name", "description"],
|
|
"name" :[{
|
|
"language_code": "en_us",
|
|
"string" : "When to run"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Cuando ejecuta"
|
|
}],
|
|
"description": [
|
|
{
|
|
"language_code": "en_us",
|
|
"string" : "Enable webhooks for notifications. Webhooks help you to connect to a lot of 3rd party tools, such as IFTTT, Zapier or <a href=\"https://n8n.io/\" target=\"_blank\">n8n</a> to name a few. Check out this simple <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/WEBHOOK_N8N.md\" target=\"_blank\">n8n guide here</a> to get started. If enabled, configure related settings below."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Habilite webhooks para notificaciones. Los webhooks lo ayudan a conectarse a muchas herramientas de terceros, como IFTTT, Zapier o <a href=\"https://n8n.io/\" target=\"_blank\">n8n</a>, por nombrar algunas. Consulte esta sencilla <a href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/WEBHOOK_N8N.md\" target=\"_blank\">guía de n8n aquí</a> para obtener comenzó. Si está habilitado, configure los ajustes relacionados a continuación."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"function": "CMD",
|
|
"type": "readonly",
|
|
"default_value":"python3 /home/pi/pialert/front/plugins/_publisher_webhook/webhook.py",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Command"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Comando"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "Command to run"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Comando a ejecutar"
|
|
}]
|
|
},
|
|
{
|
|
"function": "RUN_TIMEOUT",
|
|
"type": "integer",
|
|
"default_value": 10,
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Run timeout"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Tiempo de espera de ejecución"
|
|
},
|
|
{
|
|
"language_code": "de_de",
|
|
"string" : "Wartezeit"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Tiempo máximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela."
|
|
}]
|
|
},
|
|
{
|
|
"function": "URL",
|
|
"type": "text",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Target URL"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "URL de destino"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "Target URL starting with <code>http://</code> or <code>https://</code>."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "URL de destino comienza con <code>http://</code> o <code>https://</code>."
|
|
}]
|
|
},
|
|
{
|
|
"function": "PAYLOAD",
|
|
"type": "text.select",
|
|
"default_value": "json",
|
|
"options": ["json", "html", "text"],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Payload type"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Tipo de carga"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "The Webhook payload data format for the <code>body</code> > <code>attachments</code> > <code>text</code> attribute in the payload json. See an example of the payload <a target=\"_blank\" href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/back/webhook_json_sample.json\">here</a>. (e.g.: for discord use <code>text</code>)"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "El formato de datos de carga de Webhook para el atributo <code>body</code> > <code>attachments</code> > <code>text</code> en el json de carga. Vea un ejemplo de la carga <a target=\"_blank\" href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/back/webhook_json_sample.json\">aquí</a>. (por ejemplo: para discord use <code>text</code>)"
|
|
}]
|
|
},
|
|
{
|
|
"function": "REQUEST_METHOD",
|
|
"type": "text.select",
|
|
"default_value": "GET",
|
|
"options": ["GET", "POST", "PUT"],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Request method"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Método de solicitud"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "The HTTP request method to be used for the webhook call."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "El método de solicitud HTTP que se utilizará para la llamada de webhook."
|
|
}]
|
|
},
|
|
{
|
|
"function": "SIZE",
|
|
"type": "integer",
|
|
"default_value": 1024,
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "Max payload size"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "Tamaño máximo de carga útil"
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "The maximum size of the webhook payload as number of characters in the passed string. If above limit, it will be truncated and a <code>(text was truncated)</code> message is appended."
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : "El tamaño máximo de la carga útil del webhook como número de caracteres en la cadena pasada. Si supera el límite, se truncará y se agregará un mensaje <code>(text was truncated)</code>."
|
|
}]
|
|
},
|
|
{
|
|
"function": "SECRET",
|
|
"type": "text",
|
|
"default_value": "",
|
|
"options": [],
|
|
"localized": ["name", "description"],
|
|
"name" : [{
|
|
"language_code": "en_us",
|
|
"string" : "HMAC Secret"
|
|
},
|
|
{
|
|
"language_code": "es_es",
|
|
"string" : ""
|
|
}],
|
|
"description": [{
|
|
"language_code": "en_us",
|
|
"string" : "When set, use this secret to generate the SHA256-HMAC hex digest value of the request body, which will be passed as the <code>X-Webhook-Signature</code> header to the request. You can find more information <a target=\"_blank\" href=\"https://github.com/jokob-sk/Pi.Alert/blob/main/docs/WEBHOOK_SECRET.md\">here</a>."
|
|
}]
|
|
}
|
|
]
|
|
}
|