Add Gitea deploy workflow, compose stack and health endpoint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c39cb5562
commit
e9758499ff
13 files changed
+421
-2
No files matched your search
@@ -18,7 +18,7 @@ internal sealed class FlypaperMiddleware(
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
var request = context.Request;
|
||||
if (matcher.Match(request.Host.Host, request.Path.Value) == TrapMatch.None)
|
||||
if (IsInternalHealthProbe(context) || matcher.Match(request.Host.Host, request.Path.Value) == TrapMatch.None)
|
||||
{
|
||||
await next(context);
|
||||
return;
|
||||
@@ -46,6 +46,11 @@ internal sealed class FlypaperMiddleware(
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsInternalHealthProbe(HttpContext context) =>
|
||||
context.Request.Path.Equals(HttpTrapOptions.HealthPath, StringComparison.OrdinalIgnoreCase)
|
||||
&& context.Connection.RemoteIpAddress is { } remoteIp
|
||||
&& PrivateNetworks.Contains(remoteIp);
|
||||
|
||||
private static async ValueTask<ITrapChannel> OpenChannelAsync(
|
||||
HttpContext context,
|
||||
TrapSession session,
|
||||
|
||||
Reference in new issue
Block a user