تنبيه انتهاء شهادة SSL
تنبيه على تيليجرام قبل 14 يومًا من انتهاء شهادة SSL لأي من مواقعك.
كيف تعمل
المشغّل: جدول زمني — كل يوم الساعة 9:00
- حدد النطاقات التي تريد مراقبتها.
- ابحث عن شهادات كل نطاق في سجل crt.sh العام.
- احسب الأيام المتبقية لأحدث شهادة.
- نبّه على تيليجرام إذا كانت أقل من 14 يومًا.
المخطط
مشغّل تطبيق منطق كود
الكود
كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.
// The domains to watch. Add yours here.
const DOMAINS = ["yourcompany.com", "shop.yourcompany.com"];
return DOMAINS.map((domain) => ({ json: { domain } }));// Mode: Run Once for Each Item
// crt.sh lists every certificate issued for the domain. The newest expiry date is
// almost always the certificate your site is using now.
const DAY = 24 * 60 * 60 * 1000;
const domain = $("Domains to check").item.json.domain;
const certs = Array.isArray($json) ? $json : Object.values($json);
const newest = certs
.map((c) => new Date(c.not_after + "Z").getTime())
.filter((t) => !isNaN(t))
.sort((a, b) => b - a)[0];
const daysLeft = newest ? Math.floor((newest - Date.now()) / DAY) : -1;
return { json: { domain, daysLeft, expires: newest ? new Date(newest).toISOString().slice(0, 10) : "unknown" } };ابنِها بأداتك
اختر أداتك — نفس الأتمتة، خطوة بخطوة.
انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.
عرض الكود (196 سطر)
{
"name": "تنبيه انتهاء شهادة SSL (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## تنبيه انتهاء شهادة SSL\nتنبيه على تيليجرام قبل 14 يومًا من انتهاء شهادة SSL لأي من مواقعك.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 9
}
]
}
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Every day 9:00",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
0,
0
]
},
{
"parameters": {
"jsCode": "// The domains to watch. Add yours here.\nconst DOMAINS = [\"yourcompany.com\", \"shop.yourcompany.com\"];\n\nreturn DOMAINS.map((domain) => ({ json: { domain } }));"
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Domains to check",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"url": "=https://crt.sh/?q={{ $json.domain }}&output=json&exclude=expired",
"options": {
"timeout": 30000
}
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Look up certificates",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
600,
0
]
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// crt.sh lists every certificate issued for the domain. The newest expiry date is\n// almost always the certificate your site is using now.\nconst DAY = 24 * 60 * 60 * 1000;\nconst domain = $(\"Domains to check\").item.json.domain;\nconst certs = Array.isArray($json) ? $json : Object.values($json);\n\nconst newest = certs\n .map((c) => new Date(c.not_after + \"Z\").getTime())\n .filter((t) => !isNaN(t))\n .sort((a, b) => b - a)[0];\n\nconst daysLeft = newest ? Math.floor((newest - Date.now()) / DAY) : -1;\n\nreturn { json: { domain, daysLeft, expires: newest ? new Date(newest).toISOString().slice(0, 10) : \"unknown\" } };",
"mode": "runOnceForEachItem"
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Days left",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
900,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "c1",
"leftValue": "={{ $json.daysLeft }}",
"rightValue": 14,
"operator": {
"type": "number",
"operation": "lt"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Expires within 14 days?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
1200,
0
]
},
{
"parameters": {
"chatId": "YOUR_CHAT_ID",
"text": "=🔐 SSL certificate for {{ $json.domain }} expires in {{ $json.daysLeft }} days ({{ $json.expires }}).",
"additionalFields": {
"appendAttribution": false
}
},
"id": "45822242-cb44-479c-a021-6611374be090",
"name": "Alert on Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1500,
0
]
}
],
"connections": {
"Every day 9:00": {
"main": [
[
{
"node": "Domains to check",
"type": "main",
"index": 0
}
]
]
},
"Domains to check": {
"main": [
[
{
"node": "Look up certificates",
"type": "main",
"index": 0
}
]
]
},
"Look up certificates": {
"main": [
[
{
"node": "Days left",
"type": "main",
"index": 0
}
]
]
},
"Days left": {
"main": [
[
{
"node": "Expires within 14 days?",
"type": "main",
"index": 0
}
]
]
},
"Expires within 14 days?": {
"main": [
[
{
"node": "Alert on Telegram",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}في Make، أنشئ سيناريو جديدًا وأضف هذه الوحدات بالترتيب:
- Schedule the scenario: Every day 9:00
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- HTTP › Make a request
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Filter on the next route: “Expires within 14 days?”
- إذا نعمTelegram Bot › Send a Text Message or a Reply
- كل تشغيل لوحدة يستهلك عمليات (operations) في Make — والباقة المجانية تتضمن حصة شهرية.
- دوال Make المدمجة (map و sum و formatDate…) تغني عن معظم خطوات Code؛ وللمنطق المعقد استخدم وحدة كود.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
في Zapier، أنشئ Zap جديدًا وأضف هذه الخطوات بالترتيب:
- Schedule by Zapier — Every day 9:00
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Webhooks by Zapier — GET
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Filter by Zapier: “Expires within 14 days?”
- إذا نعمTelegram — Send Message
- الـ Zaps التي فيها أكثر من خطوتين تحتاج باقة Zapier مدفوعة.
- الـ Webhooks والفلاتر/المسارات و Code by Zapier ميزات مدفوعة في بعض باقات Zapier.
- Code by Zapier يشغّل JavaScript: أعد استخدام الكود بالأعلى، مع قراءة المدخلات من inputData بدلًا من $json.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
نصائح
- crt.sh قد يكون بطيئًا — إذا انتهت مهلة فحص، سيلتقطه تشغيل اليوم التالي.
أتمتات مشابهة
المطورون وتقنية المعلوماتسهل
مراقبة مجانية لتوقف موقعك
افحص موقعك كل 5 دقائق وتلقَّ تنبيهًا على تيليجرام إذا توقف.
HTTP Request → Telegram4 س/شهر
المطورون وتقنية المعلوماتسهل
تنبيه انتهاء النطاقات على تيليجرام
كل أسبوع، افحص موعد انتهاء نطاقاتك واحصل على تنبيه على تيليجرام قبلها بـ 30 يومًا.
HTTP Request → Telegram1 س/شهر
المطورون وتقنية المعلوماتسهل
تنبيهات أخطاء التطبيق على تيليجرام
أرسل أخطاء تطبيقك أو خادمك إلى webhook واحصل على تنبيه واضح على تيليجرام خلال ثوانٍ.
Webhook → Telegram2 س/شهر