diff --git a/Controllers/OpsController.cs b/Controllers/OpsController.cs index a77be77..bce340f 100644 --- a/Controllers/OpsController.cs +++ b/Controllers/OpsController.cs @@ -36,10 +36,23 @@ namespace rockfishCore.Controllers { case "MailMirror": Ret.Status = RfMail.MailIsMirroringProperly(); + { + DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://mail.ayanova.com/"); + if (sslExpiry != null) + { + Ret.ServiceCheckError += "Mail server SSL expires: " + sslExpiry.ToString(); + } + } break; case "AyaNovaSite": Ret.Status = OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc."); - bool bssl = OpsDiagnostics.IsSSLCertAboutToExpire("https://www.ayanova.com"); + { + DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://www.ayanova.com"); + if (sslExpiry != null) + { + Ret.ServiceCheckError += "AyaNova.com SSL expires: " + sslExpiry.ToString(); + } + } break; case "APISite": Ret.Status = OpsDiagnostics.CheckWebsite("https://api.ayanova.com/", "WorkorderTypes Enumeration"); @@ -61,6 +74,14 @@ namespace rockfishCore.Controllers break; case "DevOps": Ret.Status = OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server"); + //devops https check url is https://www.helloayanova.com/ + { + DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://www.helloayanova.com/"); + if (sslExpiry != null) + { + Ret.ServiceCheckError += "DEVOPS SSL expires: " + sslExpiry.ToString(); + } + } break; case "Backup": Ret.Status = OpsDiagnostics.VerifyBackups(); diff --git a/util/OpsDiagnostics.cs b/util/OpsDiagnostics.cs index 2b771fd..951bd80 100644 --- a/util/OpsDiagnostics.cs +++ b/util/OpsDiagnostics.cs @@ -44,18 +44,18 @@ namespace rockfishCore.Util /// check if an ssl cert is within 10 days of expiry /// /// - /// - public static bool IsSSLCertAboutToExpire(string url) + /// null if more than 10 days before expiry or the expiry date for display + public static DateTime? SSLCertExpiryDate(string url) { var expires = GetServerCertificateExpiryAsync(url).Result; //In 10 days will we be past the expiry date - var deadline = DateTime.Now.AddDays(10); + var deadline = DateTime.Now.AddDays(100); if (expires < deadline) { - return true; + return expires; } - return false; + return null; } diff --git a/wwwroot/js/app.ops.js b/wwwroot/js/app.ops.js index cd4df45..c7969e2 100644 --- a/wwwroot/js/app.ops.js +++ b/wwwroot/js/app.ops.js @@ -27,10 +27,11 @@ app.ops = (function() { $.gevent.publish("app-show-error", res.msg); } else { if (res.serviceCheckError) { - var errorText = $("#rf-ops-error").text(); + var errorElement=$("#"+service+"-error"); + var errorText = errorElement.text(); errorText += "\r\n"; errorText += res.serviceCheckError; - $("#rf-ops-error").text(errorText); + errorElement.text(errorText); } var serviceElement = $("#" + service); diff --git a/wwwroot/js/templates/app.ops.handlebars b/wwwroot/js/templates/app.ops.handlebars index 74c608b..ed12d69 100644 --- a/wwwroot/js/templates/app.ops.handlebars +++ b/wwwroot/js/templates/app.ops.handlebars @@ -2,46 +2,76 @@

Operations status


     
-
- - Mail / mirror -
-
- - AyaNova site -
-
- - Backup -
-
- - Contact form -
-
- - Request form -
-
- - Request lite form -
-
- - Forum -
-
- - Subversion -
-
- - DevOps server -
-
- - API site -
+
+
+ + Mail / mirror +
+

+        
+
+
+ + AyaNova site +
+

+        
+
+
+ + Backup +
+

+        
+
+
+ + Contact form +
+

+        
+
+
+ + Request form +
+

+        
+
+
+ + Request lite form +
+

+        
+
+
+ + Forum +
+

+        
+
+
+ + Subversion +
+

+        
+
+
+ + DevOps server +
+

+        
+
+
+ + API site +
+

+        
- + \ No newline at end of file diff --git a/wwwroot/js/templates/templates.js b/wwwroot/js/templates/templates.js index b280a34..ef5fba3 100644 --- a/wwwroot/js/templates/templates.js +++ b/wwwroot/js/templates/templates.js @@ -1,2 +1 @@ -!function(){var n=Handlebars.template,e=Handlebars.templates=Handlebars.templates||{};e["app.authenticate"]=n({compiler:[7,">= 4.0.0"],main:function(n,e,a,l,i){return'
\n Rockfish logo\n

Login

\n
\n

\n

\n

\n
\n
'},useData:!0}),e["app.customerEdit"]=n({compiler:[7,">= 4.0.0"],main:function(n,e,a,l,i){return'
\n
\n\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n
\n\n\n
\n \n
\n\n\n\n
\n \n