feat(deploy): TrueNAS Custom-App + Auto-Deploy, plus aufgelaufene Arbeit
Some checks failed
CI / Backend Tests (.NET) (push) Successful in 1m11s
CI / Frontend Tests (Node/Vite) (push) Failing after 4m59s
CI / Docker Build & Push (push) Has been skipped
CI / Deploy auf TrueNAS (Custom App) (push) Has been skipped

Deployment:
- custom-app.compose.yaml: self-contained Compose fuer TrueNAS "Custom App"
  (absolute Host-Bind-Pfade, postgres:18, pull_policy always, Port 8090)
- scripts/truenas-deploy.sh: Host-Skript create/redeploy via midclt (App
  bleibt unter Apps sichtbar) inkl. Image-Pull + Health-Check
- ci.yml Deploy-Job: laeuft auf ubuntu-latest-Runner, kopiert Deploy-Dateien
  per SSH auf den NAS-Host und triggert truenas-deploy.sh (statt runs-on goldeye)
- compose.yaml/.env.example: postgres:18 (Locale-Match zur Quell-DB), Port 8090
- .gitignore: .agents/, tools/rag/, deploy/truenas/.env (Secrets/Scratch)

Aufgelaufene Feature-Arbeit (verified/Freeze, Migrationen, Import-Triage):
- GerbilOverride/VerifiedGerbil-Endpoints + GerbilSnapshotService + Tests
- EF-Migrationen (ShowInChronicle, Stillborn, BirthOrder, ManualFlag, DSGVO)
- Frontend VerifizierteTierePage + verified-API + e2e-Spec
- diverse Import-/Triage-Skripte und -Tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-19 09:19:11 +02:00
parent 84365bba7f
commit 45b8533f18
93 changed files with 20477 additions and 432 deletions

View File

@@ -4,6 +4,13 @@ using System.Net.Sockets;
var builder = DistributedApplication.CreateBuilder(args);
// WEB-2: lokales Verzeichnis für die veröffentlichte öffentliche Seite. Die API schreibt
// nach <root>/live (POST /api/publish), der publicsite-nginx serviert genau dieses live/
// — dieselbe Form wie in Produktion (deploy/truenas), nur lokal zum Testen.
var publicSiteRoot = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "..", "deploy", ".local-publicsite"));
Directory.CreateDirectory(Path.Combine(publicSiteRoot, "live")); // leeres live/, damit nginx sofort startet
var publicSiteConf = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "..", "deploy", "truenas", "nginx", "publicsite.conf"));
var postgres = builder.AddPostgres("postgres")
.WithDataVolume();
@@ -19,6 +26,8 @@ var webapi = builder.AddProject<Projects.GerbilManagerWebAPI>("webapi")
// Proxyless so the app binds the port directly — Program.cs then widens the
// host to 0.0.0.0 for LAN access (the DCP proxy binds localhost only).
.WithEndpoint("http", e => { e.Port = ApiHttpPort; e.IsProxied = false; }, createIfNotExists: false)
// WEB-2: Publish-Ziel der öffentlichen Seite (sonst gibt POST /api/publish 503).
.WithEnvironment("PublicSite__RootPath", publicSiteRoot)
.WithExternalHttpEndpoints();
// The machine's LAN IP — the SPA runs in the phone's browser, so it must reach
@@ -40,6 +49,15 @@ builder.AddViteApp("frontend", "../gerbil-manager-web")
context.EnvironmentVariables["VITE_API_BASE_URL"] = $"http://{lanIp}:{ApiHttpPort}";
});
// WEB-2: publicsite-nginx — serviert die veröffentlichte öffentliche Seite lokal (gleiche
// nginx-Config wie in Produktion). Liest das live/-Verzeichnis aus dem Publish-Output der API.
// Test: in der App veröffentlichen (oder POST /api/publish), dann http://localhost:8081 öffnen.
builder.AddContainer("publicsite", "nginx", "alpine")
.WithBindMount(publicSiteRoot, "/usr/share/nginx/html", isReadOnly: true)
.WithBindMount(publicSiteConf, "/etc/nginx/conf.d/default.conf", isReadOnly: true)
.WithHttpEndpoint(port: 8081, targetPort: 80, name: "http")
.WithExternalHttpEndpoints();
builder.Build().Run();
// Picks the IPv4 address of the active physical LAN adapter (Wi-Fi/Ethernet),