diff --git a/Iceshrimp.Backend/Core/Configuration/Config.cs b/Iceshrimp.Backend/Core/Configuration/Config.cs index c1b502de..2acba058 100644 --- a/Iceshrimp.Backend/Core/Configuration/Config.cs +++ b/Iceshrimp.Backend/Core/Configuration/Config.cs @@ -16,15 +16,25 @@ public sealed class Config public sealed class InstanceSection { public readonly string Version; + public readonly string Codename; public InstanceSection() { + var attributes = Assembly.GetEntryAssembly()! + .GetCustomAttributes() + .ToList(); + + // Get codename from assembly + Codename = attributes + .OfType() + .FirstOrDefault(p => p.Key == "codename") + ?.Value ?? + "unknown"; + // Get version information from assembly - var version = Assembly.GetEntryAssembly()! - .GetCustomAttributes() - .OfType() - .First() - .InformationalVersion; + var version = attributes.OfType() + .First() + .InformationalVersion; // If we have a git revision, limit it to 10 characters if (version.Split('+') is { Length: 2 } split) diff --git a/Iceshrimp.Backend/Iceshrimp.Backend.csproj b/Iceshrimp.Backend/Iceshrimp.Backend.csproj index 901c0d1b..042ec9de 100644 --- a/Iceshrimp.Backend/Iceshrimp.Backend.csproj +++ b/Iceshrimp.Backend/Iceshrimp.Backend.csproj @@ -12,6 +12,10 @@ false 1 + + + + true