Skip to content

Commit 1861790

Browse files
committed
fix(daemon): onboarding seed persists site + version sync to 0.2.7
Two bugs in one commit, both caught while E2E-testing the v0.2.6 install: 1. /api/onboarding/complete seeded the Apache vhost via SiteOrchestrator but never registered the site in SiteManager — so SELECT domain FROM sites returned nothing, GET /api/sites returned [], and the seeded localhost site vanished on next daemon restart. Fix mirrors the /api/sites POST handler: sm.CreateAsync(site) first, then orch.ApplyAsync(created). Live /api/status output from v0.2.6 proved the gap — sites table empty despite flag file + default-site/ docroot present on disk. 2. Daemon csproj was pinned at 0.2.3 while the frontend shipped 0.2.6. /api/status reported version="0.2.3+<git-sha>" — misleading in logs and crash reports. Bumped Version/AssemblyVersion/FileVersion/ InformationalVersion in lockstep with the frontend package.json to 0.2.7.
1 parent c65c6fb commit 1861790

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/daemon/NKS.WebDevConsole.Daemon/NKS.WebDevConsole.Daemon.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
<!-- F92: single source of truth for daemon version. Keep in sync with
3434
src/frontend/package.json on every bump so /api/status and
3535
/api/system return the real shipped version instead of hardcoded "0.1.0". -->
36-
<Version>0.2.3</Version>
37-
<AssemblyVersion>0.2.3.0</AssemblyVersion>
38-
<FileVersion>0.2.3.0</FileVersion>
39-
<InformationalVersion>0.2.3</InformationalVersion>
36+
<Version>0.2.7</Version>
37+
<AssemblyVersion>0.2.7.0</AssemblyVersion>
38+
<FileVersion>0.2.7.0</FileVersion>
39+
<InformationalVersion>0.2.7</InformationalVersion>
4040
<!-- Default release manifest: requireAdministrator (one UAC at
4141
launch, every child op inherits elevation). CI smoke test
4242
jobs pass -p:CiBuild=true to swap in app.ci.manifest which

src/daemon/NKS.WebDevConsole.Daemon/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3206,14 +3206,20 @@ await File.WriteAllTextAsync(indexPath,
32063206
}
32073207
if (!siteManager.Sites.Keys.Any(d => string.Equals(d, "localhost", StringComparison.OrdinalIgnoreCase)))
32083208
{
3209-
await siteOrch.ApplyAsync(new NKS.WebDevConsole.Core.Models.SiteConfig
3209+
// CreateAsync persists the vhost TOML + registers the site in the
3210+
// SiteManager dictionary. ApplyAsync alone would generate the Apache
3211+
// vhost file but leave SiteManager unaware of the site, so on next
3212+
// daemon restart the site would vanish. This is the same order the
3213+
// /api/sites POST handler uses.
3214+
var created = await siteManager.CreateAsync(new NKS.WebDevConsole.Core.Models.SiteConfig
32103215
{
32113216
Domain = "localhost",
32123217
DocumentRoot = docRoot,
32133218
PhpVersion = "8.5",
32143219
SslEnabled = false,
32153220
Enabled = true,
3216-
}, CancellationToken.None);
3221+
});
3222+
await siteOrch.ApplyAsync(created, CancellationToken.None);
32173223
}
32183224
}
32193225
catch (Exception ex)

src/frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nks-hub/webdev-console",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "Unified local development environment for Windows, macOS, and Linux \u2014 manage Apache/Nginx, PHP versions, MySQL/MariaDB, and SSL from one interface.",
55
"author": {
66
"name": "NKS Hub",

0 commit comments

Comments
 (0)