M6 Windows: composizione condivisa Febe.App per Server e Desktop; Febe per Windows (WPF) con l'interfaccia in WebView2, area di notifica, istanza unica, «Browser di Febe» su WebView2 con CDP filtrato (WebView2CdpSession) e ripieghi di S2 (composizione, Edge), guscio nativo, avvisi, spostamento verificato della cartella dei dati, icona del marchio; un solo Febe.exe, installatore NSIS e zip portabile; guida docs/windows.md e prove dal vivo S1–S3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
73 files changed
+7914
-699
No files matched your search
@@ -0,0 +1,65 @@
|
||||
using Febe.App;
|
||||
using Febe.Core.Library;
|
||||
using Febe.Web;
|
||||
using Febe.Web.Connection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Febe.Server;
|
||||
|
||||
/// <summary>
|
||||
/// The Docker edition's parts of the composition (spec §11): password-protected interface on every address, the
|
||||
/// password and the Data folder checked at start-up, Chromium on Xvfb supervised by Febe itself, the remote view of the
|
||||
/// browser in the Collegamento and Browser pages. No native shell: folders are read-only in the interface.
|
||||
/// </summary>
|
||||
internal sealed class DockerPlatform(ServerOptions options) : IFebePlatform
|
||||
{
|
||||
public ServerOptions Options { get; } = options ?? throw new ArgumentNullException(nameof(options));
|
||||
|
||||
public FebeWebOptions WebOptions => Options.WebOptions();
|
||||
|
||||
public FebeListen Listen => new(Options.ListenAddress, Options.Port);
|
||||
|
||||
/// <summary>The remote view of the browser, once the composition registered it.</summary>
|
||||
public BrowserRemoteViewHost? RemoteView { get; private set; }
|
||||
|
||||
public IReadOnlyList<ConfigurationProblem> CheckConfiguration(FebeAppOptions appOptions, DataFolderCheck dataFolderCheck) =>
|
||||
StartupChecks.Run(Options, dataFolderCheck);
|
||||
|
||||
public Task<IFebeBrowser> CreateBrowserAsync(FebePlatformContext context, CancellationToken ct)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(context);
|
||||
var home = Path.Combine(context.Data.Root, "home");
|
||||
return Task.FromResult<IFebeBrowser>(new ChromiumBrowser(
|
||||
new ChromiumBrowserSettings
|
||||
{
|
||||
ProfileDirectory = context.Data.BrowserProfile,
|
||||
HomeDirectory = home,
|
||||
WindowWidth = Options.WindowWidth,
|
||||
WindowHeight = Options.WindowHeight,
|
||||
DebugPort = Options.DebugPort,
|
||||
ExecutablePath = Options.ChromiumPath,
|
||||
|
||||
// Linux needs the virtual display; elsewhere (development on Windows) the browser opens a normal window.
|
||||
Display = OperatingSystem.IsLinux() ? Options.Display : null,
|
||||
Launch = Options.LaunchOptions(Path.GetFullPath(home)),
|
||||
ReadyRemark = Options.NoSandbox ? ", senza sandbox (FEBE_SENZA_SANDBOX)" : null,
|
||||
SandboxAdvice = " Se il registro parla della sandbox, vedi docs/docker.md: profilo seccomp oppure FEBE_SENZA_SANDBOX=1.",
|
||||
},
|
||||
context.Clock,
|
||||
context.Log));
|
||||
}
|
||||
|
||||
public void RegisterServices(IServiceCollection services, FebeApp app)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(services);
|
||||
ArgumentNullException.ThrowIfNull(app);
|
||||
RemoteView = new BrowserRemoteViewHost((ChromiumBrowser)app.Browser!, app.Tracker, app.Clock, app.Log);
|
||||
services.AddSingleton<IRemoteViewHost>(RemoteView);
|
||||
}
|
||||
|
||||
public void RegisterProblemServices(IServiceCollection services, FebeApp app)
|
||||
{
|
||||
}
|
||||
|
||||
public Task StoppingAsync() => RemoteView?.ShutdownAsync() ?? Task.CompletedTask;
|
||||
}
|
||||
Reference in new issue
Block a user