E2: API delle copie esterne, composizione e dimostrazione
Le copie esterne diventano usabili dall'interfaccia: ExportHub costruisce l'unico ExportService del web (segna «interrotto» ciò che l'arresto ha fermato e avvisa le pagine a lavoro finito), ExportApi espone cartelle, scelta e controllo della cartella, «Copia in…» (piano e avvio), «Copia di nuovo», avanzamento, lavori, ripresa, annullamento e resoconto. Gli endpoint esistenti portano le copie: filtro copies= della Libreria, segno «Copiato» / «Copiato in parte 1/3» sulle tessere, copie di ogni file nel visualizzatore, riquadro «Copie esterne» e interruttore «Esporta questo account» nella scheda. Una cartella di account o della libreria che finirebbe dentro (o attorno a) una cartella delle copie è rifiutata; dopo una ricostruzione le cartelle in conflitto vanno in pausa. Composizione: in Docker le copie si scrivono solo sotto /esporta, e solo con --esporta/FEBE_ESPORTA e un montaggio (riga di avvio e avviso se manca); sul desktop qualsiasi cartella con la finestra del sistema e lo spazio libero misurato anche sulle condivisioni di rete. La dimostrazione ha una cartella generale, una propria, un account non esportato e copie vere in ogni stato, scritte dal motore nella sua cartella temporanea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a112c92893
commit
4a7925ad23
30 files changed
+2299
-32
No files matched your search
@@ -66,6 +66,15 @@ internal sealed record ServerOptions
|
||||
/// <summary>Import sources, read-only (/importa).</summary>
|
||||
public string ImportFolder { get; init; } = "/importa";
|
||||
|
||||
/// <summary>
|
||||
/// <c>--esporta</c> or <c>FEBE_ESPORTA=1</c>: the copies to external folders are switched on (spec §4.10). They are
|
||||
/// written only below <see cref="ExportFolder"/>, and only when a folder of the server is mounted there.
|
||||
/// </summary>
|
||||
public bool ExportDeclared { get; init; }
|
||||
|
||||
/// <summary>Root of the copies to external folders (/esporta); not on the command line, tests change it.</summary>
|
||||
public string ExportFolder { get; init; } = "/esporta";
|
||||
|
||||
/// <summary>FEBE_HOST: names the interface is reached with (comma separated). Empty: any name.</summary>
|
||||
public IReadOnlyList<string> Hosts { get; init; } = [];
|
||||
|
||||
@@ -125,6 +134,7 @@ internal sealed record ServerOptions
|
||||
LibraryFolder = LibraryFolder,
|
||||
LibraryFolderFromSettings = false,
|
||||
ImportFolder = ImportFolder,
|
||||
ExportRoot = Core.Export.ExportRootOptions.Docker(Path.GetFullPath(ExportFolder), ExportDeclared),
|
||||
ZoneId = ZoneId,
|
||||
Zone = Zone,
|
||||
Language = Language,
|
||||
@@ -236,6 +246,7 @@ internal sealed record ServerOptions
|
||||
Hosts = SplitHosts(Env("FEBE_HOST")),
|
||||
TrustForwardedHost = Flag("FEBE_PROXY_FIDATO"),
|
||||
NoSandbox = Flag("FEBE_SENZA_SANDBOX"),
|
||||
ExportDeclared = Flag("FEBE_ESPORTA"),
|
||||
ChromiumPath = Env("FEBE_CHROMIUM"),
|
||||
DebugPort = debugPort,
|
||||
Display = Env("FEBE_DISPLAY") ?? DefaultDisplay,
|
||||
@@ -305,6 +316,9 @@ internal sealed record ServerOptions
|
||||
case "--senza-sandbox":
|
||||
options = options with { NoSandbox = true };
|
||||
break;
|
||||
case "--esporta":
|
||||
options = options with { ExportDeclared = true };
|
||||
break;
|
||||
case "--sito-di-prova":
|
||||
case "--cdn-di-prova":
|
||||
{
|
||||
@@ -400,7 +414,7 @@ internal sealed record ServerOptions
|
||||
var key = SessionKey is not null ? "impostata" : SessionKeyProblem is not null ? "non valida" : "assente";
|
||||
return string.Create(
|
||||
CultureInfo.InvariantCulture,
|
||||
$"ServerOptions {{ Dati = {DataFolder}, Libreria = {LibraryFolder}, Porta = {Port}, Sito = {Site.Name}, Raccolta = {CollectionRouteNames.Name(Collection)}, {ChildProcessEnvironment.PasswordVariable} = {password}, {Core.Security.SessionKey.EnvironmentVariable} = {key} }}");
|
||||
$"ServerOptions {{ Dati = {DataFolder}, Libreria = {LibraryFolder}, Porta = {Port}, Sito = {Site.Name}, Raccolta = {CollectionRouteNames.Name(Collection)}, Copie esterne = {(ExportDeclared ? "dichiarate" : "spente")}, {ChildProcessEnvironment.PasswordVariable} = {password}, {Core.Security.SessionKey.EnvironmentVariable} = {key} }}");
|
||||
}
|
||||
|
||||
/// <summary>The time zone named by TZ, or null when unknown.</summary>
|
||||
|
||||
Reference in new issue
Block a user