The checks engine, the path and the cards: me-web? 0.1 reads the connection

MeWeb.Core runs seven checks concurrently and reports each as it settles:
online or behind a login page, this connection, the public IPv4 and IPv6
seen from v4./v6.meweb, the provider from a built-in map, the router
(UPnP IGD, NAT-PMP and PCP, read-only), address sharing (router WAN
against the echo, TTL hops only as a hint), and the history kept on the
device. The app draws the path from this device to the internet and lights
it node by node, with a card per check and a sheet listing every host it
contacts.

The provider map is iptoasn's table compressed to 2.1 MB by
tools/knowledge.cs and built before every app release; eleven Italian
provider profiles carry each fact with who said it, the source and the
month. The server gains a download page (en, it) and /download/{platform}
from the latest Gitea release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-15 04:39:03 +02:00
1 parent 16a1cecaae
commit 0dffbc27d6
61 files changed
+3750 -149

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ public static class Languages
var found = Find(current.Name);
if (found is not null) return found;
}
return Fallback;
return Find(Fallback.Code) ?? Fallback;
}
static List<Language> Load()
+11 -1
View File
@@ -27,7 +27,17 @@ public sealed class Localizer : INotifyPropertyChanged
public string this[string key] => current.GetValueOrDefault(key) ?? english.GetValueOrDefault(key) ?? key;
public string Format(string key, params object[] args) => string.Format(Culture, this[key], args);
public string Format(string key, params object[] args)
{
try
{
return string.Format(Culture, this[key], args);
}
catch (FormatException)
{
return this[key];
}
}
public void SetLanguage(Language language)
{
-33
View File
@@ -1,33 +0,0 @@
using System.Net.Http.Json;
using MeWeb.Shared;
namespace MeWeb.App.Services;
public enum Reachability
{
Unknown,
Online,
Offline,
}
public class ServerClient(IHttpClientFactory factory)
{
public const string Name = "server";
public async Task<(Reachability State, ViewInfo Info)> Probe(CancellationToken ct)
{
try
{
var http = factory.CreateClient(Name);
using var timeout = CancellationTokenSource.CreateLinkedTokenSource(ct);
timeout.CancelAfter(TimeSpan.FromSeconds(6));
var info = await http.GetFromJsonAsync(Endpoints.Server.GET_Info, MeWebJsonContext.Default.ViewInfo, timeout.Token);
return (Reachability.Online, info);
}
catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException && !ct.IsCancellationRequested)
{
return (Reachability.Offline, null);
}
}
}
+52
View File
@@ -0,0 +1,52 @@
using System.Globalization;
using MeWeb.Core.Checks;
namespace MeWeb.App.Services;
public static class Texts
{
public static string Summary(Finding finding) => finding?.Summary is null ? "" : Localizer.Instance.Format(finding.Summary, finding.Args.Select(Argument).ToArray());
public static string Value(Fact fact)
{
if (fact.Text is not null) return Isolate(fact.Text);
if (fact.Key is null) return fact.Date is null ? "" : Date(fact.Date);
var args = fact.Amount is null ? fact.Args.Select(Argument).ToArray() : new object[] { Money(fact.Amount.Value, fact.Currency) };
return Localizer.Instance.Format(fact.Key, args);
}
public static string Source(Fact fact)
{
var parts = new List<string>();
if (fact.Basis is not null) parts.Add(Localizer.Instance[fact.Basis]);
if (fact.Date is not null && fact.Key is not null) parts.Add(Date(fact.Date));
return string.Join(", ", parts);
}
public static string Money(decimal amount, string currency)
{
var format = (NumberFormatInfo)Localizer.Instance.Culture.NumberFormat.Clone();
format.CurrencySymbol = currency switch
{
"EUR" => "€",
"USD" => "$",
"GBP" => "£",
_ => currency ?? "",
};
return amount.ToString("C2", format);
}
public static string Date(string text)
{
var culture = Localizer.Instance.Culture;
if (DateTime.TryParseExact(text, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var day)) return day.ToString("d", culture);
if (DateTime.TryParseExact(text, "yyyy-MM", CultureInfo.InvariantCulture, DateTimeStyles.None, out var month)) return month.ToString("Y", culture);
return text;
}
public static string Isolate(string text) => string.IsNullOrEmpty(text) ? text : $"\u2068{text}\u2069";
static object Argument(string text) =>
DateTime.TryParseExact(text, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var day) ? day.ToString("d", Localizer.Instance.Culture) : text;
}