From afdeeb686f3aa022bec19084a337e233c622b4e3 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sun, 27 Aug 2023 22:28:34 -0400 Subject: pre backend update client performance bufs and fixes --- back-end/src/CMNextEntry.cs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'back-end/src/CMNextEntry.cs') diff --git a/back-end/src/CMNextEntry.cs b/back-end/src/CMNextEntry.cs index 2382b33..2800c08 100644 --- a/back-end/src/CMNextEntry.cs +++ b/back-end/src/CMNextEntry.cs @@ -20,6 +20,9 @@ */ using System; +using System.Linq; +using System.Text; +using System.Text.Json; using VNLib.Plugins; using VNLib.Utils.Logging; @@ -46,6 +49,7 @@ namespace Content.Publishing.Blog.Admin this.Route(); Log.Information("Plugin loaded"); + PrintHelloMessage(); } protected override void OnUnLoad() @@ -57,5 +61,41 @@ namespace Content.Publishing.Blog.Admin { throw new NotImplementedException(); } + + private void PrintHelloMessage() + { + const string template = +@" +****************************************************************************** + CMNext - A dead-simple, multi-channel cms for your blog or podcast. + By Vaughn Nugent - vnpublic@proton.me + https://www.vaughnnugent.com/resources/software + License: GNU Affero General Public License v3.0 + This application comes with ABSOLUTELY NO WARRANTY. + + Your server is now running at the following locations: +{0} +****************************************************************************** +"; + string[] interfaces = HostConfig.GetProperty("virtual_hosts") + .EnumerateArray() + .Select(e => + { + JsonElement el = e.GetProperty("interface"); + string ipAddress = el.GetProperty("address").GetString()!; + int port = el.GetProperty("port").GetInt32(); + return $"{ipAddress}:{port}"; + }) + .ToArray(); + + StringBuilder sb = new(); + foreach ( string intf in interfaces ) + { + sb.Append('\t'); + sb.AppendLine(intf); + } + + Log.Information(template, sb); + } } } \ No newline at end of file -- cgit