Skip to content

Commit

Permalink
Show Unauthorized as an S3 stream status
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Oct 9, 2024
1 parent 09d1ab5 commit 2f7c1d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions OrcanodeMonitor/Core/Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,12 @@ public async static Task UpdateS3DataAsync(OrcanodeMonitorContext context, Orcan
node.LatestRecordedUtc = null;
return;
}
if (response.StatusCode == HttpStatusCode.Forbidden)
{
// Access denied.
node.LatestRecordedUtc = DateTime.MinValue;
return;
}
if (!response.IsSuccessStatusCode)
{
return;
Expand Down
5 changes: 5 additions & 0 deletions OrcanodeMonitor/Models/Orcanode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public enum OrcanodeOnlineStatus
Online,
Unintelligible,
Hidden,
Unauthorized,
}
public enum OrcanodeUpgradeStatus
{
Expand Down Expand Up @@ -287,6 +288,10 @@ public OrcanodeOnlineStatus S3StreamStatus
{
return OrcanodeOnlineStatus.Absent;
}
if (LatestRecordedUtc == DateTime.MinValue)
{
return OrcanodeOnlineStatus.Unauthorized;
}
if (!ManifestUpdatedUtc.HasValue || !LastCheckedUtc.HasValue)
{
return OrcanodeOnlineStatus.Absent;
Expand Down
2 changes: 1 addition & 1 deletion OrcanodeMonitor/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
else
{
<td style="background-color: @Model.NodeS3BackgroundColor(item)">
<a href="https://open.quiltdata.com/b/audio-orcasound-net/tree/@item.S3NodeName/" style="color: @Model.NodeS3TextColor(item)" target="_blank">
<a href="https://open.quiltdata.com/b/@item.S3Bucket/tree/@item.S3NodeName/" style="color: @Model.NodeS3TextColor(item)" target="_blank">
@Html.DisplayFor(modelItem => item.S3StreamStatus)
</a>
</td>
Expand Down

0 comments on commit 2f7c1d0

Please sign in to comment.