Browse Source

add etv env vars to troubleshooting > general info (#2064)

pull/2065/head
Jason Dove 12 hours ago committed by GitHub
parent
commit
76f7c88375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 11
      ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs
  3. 1
      ErsatzTV.Application/Troubleshooting/TroubleshootingInfo.cs
  4. 4
      ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj
  5. 10
      ErsatzTV/Pages/Troubleshooting.razor

1
CHANGELOG.md

@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Quotes are *always* required when using this feature
- e.g. `smart_collection:"one" NOT smart_collection:"two"`
- Cycles will be detected and logged, and searches with cycles will not work as expected
- Add all `ETV_*` environment variables to Troubleshooting > General info
### Changed
- Start to make UI minimally responsive (functional on smaller screens)

11
ErsatzTV.Application/Troubleshooting/Queries/GetTroubleshootingInfoHandler.cs

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
using System.Collections;
using System.Collections.Immutable;
using System.Reflection;
using System.Runtime.InteropServices;
@ -133,8 +134,18 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI @@ -133,8 +134,18 @@ public class GetTroubleshootingInfoHandler : IRequestHandler<GetTroubleshootingI
}
}
var environment = new Dictionary<string, string>();
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
{
if (de is { Key: string key, Value: string value } && key.StartsWith("ETV_", StringComparison.OrdinalIgnoreCase))
{
environment[key] = value;
}
}
return new TroubleshootingInfo(
version,
environment,
healthCheckSummaries,
ffmpegSettings,
activeFFmpegProfiles,

1
ErsatzTV.Application/Troubleshooting/TroubleshootingInfo.cs

@ -5,6 +5,7 @@ namespace ErsatzTV.Application.Troubleshooting; @@ -5,6 +5,7 @@ namespace ErsatzTV.Application.Troubleshooting;
public record TroubleshootingInfo(
string Version,
Dictionary<string, string> Environment,
IEnumerable<HealthCheckResultSummary> Health,
FFmpegSettingsViewModel FFmpegSettings,
IEnumerable<FFmpegProfile> FFmpegProfiles,

4
ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

@ -35,8 +35,8 @@ @@ -35,8 +35,8 @@
<PackageReference Include="TagLibSharp" Version="2.3.0" />
<!-- transitive; upgrading for vuln -->
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
<!-- transitive; upgrading for vuln -->
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" />
</ItemGroup>
<ItemGroup>

10
ErsatzTV/Pages/Troubleshooting.razor

@ -76,7 +76,15 @@ @@ -76,7 +76,15 @@
TroubleshootingInfo info = await Mediator.Send(new GetTroubleshootingInfo(), _cts.Token);
_troubleshootingInfo = JsonSerializer.Serialize(
new { info.Version, info.Health, info.FFmpegSettings, info.Channels, info.FFmpegProfiles },
new
{
info.Version,
Environment = info.Environment.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value),
info.Health,
info.FFmpegSettings,
info.Channels,
info.FFmpegProfiles
},
new JsonSerializerOptions
{
Converters = { new JsonStringEnumConverter() },

Loading…
Cancel
Save