From acad52048a50807ade571202ce97e1b757ecd263 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Wed, 20 Jan 2021 01:13:39 -0500 Subject: [PATCH] Added instance name customization --- VARIABLES.md | 3 +- .../Settings/InstanceSettings.cs | 1 + src/BirdsiteLive/Views/Shared/_Layout.cshtml | 46 ++++++++++--------- src/BirdsiteLive/appsettings.json | 1 + 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/VARIABLES.md b/VARIABLES.md index b68d4de..3536069 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -4,9 +4,10 @@ You can configure some of BirdsiteLIVE's settings via environment variables (tho ## Logging -* `Logging:Type` set the type of the logging and monitoring system, currently the only type supported is `insights` for *Azure Application Insights* (PR welcome to support other types) +* `Logging:Type` (default: none) set the type of the logging and monitoring system, currently the only type supported is `insights` for *Azure Application Insights* (PR welcome to support other types) * `Logging:InstrumentationKey` the instrumentation key for Azure Application Insights ## Instance customization +* `Instance:Name` (default: BirdsiteLIVE) the name of the instance * `Instance:ResolveMentionsInProfiles` (default: true) to enable or disable mentions parsing in profile's description. Resolving it will consume more User's API calls since newly discovered account can also contain references to others accounts as well. On a big instance it is recommended to disable it. \ No newline at end of file diff --git a/src/BirdsiteLive.Common/Settings/InstanceSettings.cs b/src/BirdsiteLive.Common/Settings/InstanceSettings.cs index 2ce9715..fe303a7 100644 --- a/src/BirdsiteLive.Common/Settings/InstanceSettings.cs +++ b/src/BirdsiteLive.Common/Settings/InstanceSettings.cs @@ -2,6 +2,7 @@ { public class InstanceSettings { + public string Name { get; set; } public string Domain { get; set; } public string AdminEmail { get; set; } public bool ResolveMentionsInProfiles { get; set; } diff --git a/src/BirdsiteLive/Views/Shared/_Layout.cshtml b/src/BirdsiteLive/Views/Shared/_Layout.cshtml index 5275267..f9f571a 100644 --- a/src/BirdsiteLive/Views/Shared/_Layout.cshtml +++ b/src/BirdsiteLive/Views/Shared/_Layout.cshtml @@ -1,9 +1,11 @@ - +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration + - @ViewData["Title"] - BirdsiteLIVE + @Configuration.GetSection("Instance")["Name"] - @ViewData["Title"] @@ -12,21 +14,21 @@
@@ -36,14 +38,14 @@ - diff --git a/src/BirdsiteLive/appsettings.json b/src/BirdsiteLive/appsettings.json index d0c49bf..57bf945 100644 --- a/src/BirdsiteLive/appsettings.json +++ b/src/BirdsiteLive/appsettings.json @@ -10,6 +10,7 @@ }, "AllowedHosts": "*", "Instance": { + "Name": "BirdsiteLIVE", "Domain": "domain.name", "AdminEmail": "me@domain.name", "ResolveMentionsInProfiles": true