diff --git a/Iceshrimp.Backend/Controllers/Federation/NodeInfoController.cs b/Iceshrimp.Backend/Controllers/Federation/NodeInfoController.cs index 1b50a5b9..3b3520b7 100644 --- a/Iceshrimp.Backend/Controllers/Federation/NodeInfoController.cs +++ b/Iceshrimp.Backend/Controllers/Federation/NodeInfoController.cs @@ -46,6 +46,7 @@ public class NodeInfoController(IOptions config, Databas Name = "Iceshrimp.NET", Version = instance.Version, Codename = instance.Codename, + Edition = instance.Edition, Homepage = new Uri(Constants.ProjectHomepageUrl), Repository = Request.Path.Value?.EndsWith("2.1") ?? false ? new Uri(Constants.RepositoryUrl) diff --git a/Iceshrimp.Backend/Core/Configuration/Config.cs b/Iceshrimp.Backend/Core/Configuration/Config.cs index 9dff6630..b6ebc80f 100644 --- a/Iceshrimp.Backend/Core/Configuration/Config.cs +++ b/Iceshrimp.Backend/Core/Configuration/Config.cs @@ -20,6 +20,7 @@ public sealed class Config private readonly VersionInfo _versionInfo = VersionHelpers.GetVersionInfo(); public string Codename => _versionInfo.Codename; + public string Edition => _versionInfo.Edition; public string? CommitHash => _versionInfo.CommitHash; public string RawVersion => _versionInfo.RawVersion; public string Version => _versionInfo.Version; diff --git a/Iceshrimp.Backend/Core/Federation/WebFinger/Types.cs b/Iceshrimp.Backend/Core/Federation/WebFinger/Types.cs index c0e6b567..04816231 100644 --- a/Iceshrimp.Backend/Core/Federation/WebFinger/Types.cs +++ b/Iceshrimp.Backend/Core/Federation/WebFinger/Types.cs @@ -94,6 +94,7 @@ public class NodeInfoResponse [J("name")] public string? Name { get; set; } [J("version")] public string? Version { get; set; } [J("codename")] public string? Codename { get; set; } + [J("edition")] public string? Edition { get; set; } [J("homepage")] public Uri? Homepage { get; set; } /// diff --git a/Iceshrimp.Frontend/Core/Services/VersionService.cs b/Iceshrimp.Frontend/Core/Services/VersionService.cs index 75997c1d..0a963fbd 100644 --- a/Iceshrimp.Frontend/Core/Services/VersionService.cs +++ b/Iceshrimp.Frontend/Core/Services/VersionService.cs @@ -7,6 +7,7 @@ public sealed class VersionService private readonly VersionInfo _versionInfo = VersionHelpers.GetVersionInfo(); public string Codename => _versionInfo.Codename; + public string Edition => _versionInfo.Edition; public string? CommitHash => _versionInfo.CommitHash; public string RawVersion => _versionInfo.RawVersion; public string Version => _versionInfo.Version; diff --git a/Iceshrimp.Shared/Helpers/VersionHelpers.cs b/Iceshrimp.Shared/Helpers/VersionHelpers.cs index f479df9d..1a1e5d6c 100644 --- a/Iceshrimp.Shared/Helpers/VersionHelpers.cs +++ b/Iceshrimp.Shared/Helpers/VersionHelpers.cs @@ -2,7 +2,7 @@ using System.Reflection; namespace Iceshrimp.Shared.Helpers; -public record VersionInfo(string Version, string RawVersion, string Codename, string? CommitHash); +public record VersionInfo(string Version, string RawVersion, string Codename, string Edition, string? CommitHash); public static class VersionHelpers { @@ -19,6 +19,13 @@ public static class VersionHelpers ?.Value ?? "unknown"; + // Get edition from assembly + var edition = attributes + .OfType() + .FirstOrDefault(p => p.Key == "edition") + ?.Value ?? + "unknown"; + string version; string rawVersion; string? commitHash = null; @@ -42,6 +49,6 @@ public static class VersionHelpers rawVersion = fullVersion; } - return new VersionInfo(version, rawVersion, codename, commitHash); + return new VersionInfo(version, rawVersion, codename, edition, commitHash); } } \ No newline at end of file