me-web? skeleton: Avalonia 12 app, server, packaging and CI
Build / Desktop, server and tools (push) Successful in 1m7s
Build / Desktop, server and tools (push) Successful in 1m7s
The first screen (online or not, a Check button, every language with a draft notice), the desktop and Android heads, the server's /api/info and /api/ip, a release tool that builds deb, rpm, a Windows exe, macOS zips, a signed APK and the server, and the Gitea workflows that run it. Rules adapted from passolo; AGPL-3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
commit
7589121846
76 files changed
+3082
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using System.Net.Sockets;
|
||||
|
||||
using MeWeb.Shared;
|
||||
|
||||
namespace MeWeb.Server;
|
||||
|
||||
public static class ServerApi
|
||||
{
|
||||
public static WebApplication MapMeWebApi(this WebApplication app)
|
||||
{
|
||||
app.MapGet(Endpoints.Server.GET_Info, Info);
|
||||
app.MapGet(Endpoints.Server.GET_Ip, Ip);
|
||||
return app;
|
||||
}
|
||||
|
||||
static ViewInfo Info() => new() { Version = BuildInfo.Version, Commit = BuildInfo.Commit, BuiltAt = BuildInfo.BuiltAt };
|
||||
|
||||
static IResult Ip(HttpContext context)
|
||||
{
|
||||
var address = context.Connection.RemoteIpAddress;
|
||||
if (address is null) return Results.BadRequest();
|
||||
if (address.IsIPv4MappedToIPv6) address = address.MapToIPv4();
|
||||
var family = address.AddressFamily == AddressFamily.InterNetworkV6 ? "ipv6" : "ipv4";
|
||||
return Results.Ok(new ViewIp { Address = address.ToString(), Family = family });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user