a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/web] Add version endpoint

authored by

Lilian and committed by
Laura Hausmann
aa72e521 8b9019b7

+43
+33
Iceshrimp.Backend/Controllers/Web/VersionController.cs
··· 1 + using System.Net; 2 + using System.Net.Mime; 3 + using Iceshrimp.Backend.Controllers.Shared.Attributes; 4 + using Iceshrimp.Backend.Core.Middleware; 5 + using Iceshrimp.Shared.Helpers; 6 + using Iceshrimp.Shared.Schemas.Web; 7 + using Microsoft.AspNetCore.Mvc; 8 + using Microsoft.AspNetCore.RateLimiting; 9 + 10 + namespace Iceshrimp.Backend.Controllers.Web; 11 + 12 + [ApiController] 13 + [Authenticate] 14 + [EnableRateLimiting("sliding")] 15 + [Route("/api/iceshrimp/version")] 16 + [Produces(MediaTypeNames.Application.Json)] 17 + public class VersionController : ControllerBase 18 + { 19 + [HttpGet] 20 + [ProducesResults(HttpStatusCode.OK)] 21 + public Task<VersionResponse> GetVersion() 22 + { 23 + var version = VersionHelpers.VersionInfo.Value; 24 + return Task.FromResult(new VersionResponse 25 + { 26 + Codename = version.Codename, 27 + CommitHash = version.CommitHash, 28 + Edition = version.Edition, 29 + Version = version.Version, 30 + RawVersion = version.RawVersion 31 + }); 32 + } 33 + }
+10
Iceshrimp.Shared/Schemas/Web/VersionResponse.cs
··· 1 + namespace Iceshrimp.Shared.Schemas.Web; 2 + 3 + public class VersionResponse 4 + { 5 + public required string Codename { get; set; } 6 + public required string Edition { get; set; } 7 + public required string? CommitHash { get; set; } 8 + public required string RawVersion { get; set; } 9 + public required string Version { get; set; } 10 + }