fix: retain help image formats and document independent application help store

This commit is contained in:
Nick Beckley 2026-11-27 21:42:27 +00:00
parent cf4e742f5e
commit 27bc77b40a
3 changed files with 17 additions and 3 deletions

View File

@ -3,7 +3,9 @@
The authoritative application-help source remains The authoritative application-help source remains
`PlotDirector/PlotLine/Help/Articles`. Context keys, category slugs, article slugs, `PlotDirector/PlotLine/Help/Articles`. Context keys, category slugs, article slugs,
search, related articles and the existing Markdown renderer are retained. The search, related articles and the existing Markdown renderer are retained. The
application's contextual drawer continues to read its own source. Website content application's contextual drawer retains the same service/renderer and can read its
own separately installed approved publication. Without HelpContent:Path it keeps
the original file-source behavior used by source tools and existing tests. Website content
never comes from a running application, SQL query or an HTTP call to the application. never comes from a running application, SQL query or an HTTP call to the application.
`Help/published` is the checked-in, generated bootstrap publication, not an editable `Help/published` is the checked-in, generated bootstrap publication, not an editable
@ -61,7 +63,14 @@ For the installed Atlas website, the administrator uses
`--store /opt/plotdirector-website-dev/shared/help`; Production uses `--store /opt/plotdirector-website-dev/shared/help`; Production uses
`/srv/plotdirector-website/shared/help` and **must use `--channel Production`**. `/srv/plotdirector-website/shared/help` and **must use `--channel Production`**.
Both channels are usable in Development, but explicitly choose the approved channel. Both channels are usable in Development, but explicitly choose the approved channel.
The store is administrator-owned. The helper validates checksums, channel, paths and For application help, consume the **same artifact and approved digest** into
`/opt/plotdirector-dev/shared/help` (Development) or `/srv/plotdirector/shared/help`
(Production), using the application's `HelpContent__Path` to select its own `current`.
These are separate immutable copies of one publication, not separately edited sources.
Neither deployment operates the other's store. Publish/rollback each pointer explicitly;
both services reload their own approved content without a restart.
The stores are administrator-owned. The helper validates checksums, channel, paths and
public article identities, installs an immutable digest-named directory and atomically public article identities, installs an immutable digest-named directory and atomically
switches `current`. No service restart follows. `HelpContent__Path` selects `current`. switches `current`. No service restart follows. `HelpContent__Path` selects `current`.
Retain old directories. Rollback is an atomic `current` symlink replacement to a Retain old directories. Rollback is an atomic `current` symlink replacement to a

View File

@ -9,7 +9,7 @@ public sealed class HelpImageController(IWebHostEnvironment environment,IConfigu
var root=Path.GetFullPath(Path.Combine(configuration["HelpContent:Path"]??Path.Combine(environment.ContentRootPath,"Help/published"),"assets")); var root=Path.GetFullPath(Path.Combine(configuration["HelpContent:Path"]??Path.Combine(environment.ContentRootPath,"Help/published"),"assets"));
var path=Path.GetFullPath(Path.Combine(root,file)); var path=Path.GetFullPath(Path.Combine(root,file));
if(!path.StartsWith(root+Path.DirectorySeparatorChar,StringComparison.Ordinal)||!System.IO.File.Exists(path))return NotFound(); if(!path.StartsWith(root+Path.DirectorySeparatorChar,StringComparison.Ordinal)||!System.IO.File.Exists(path))return NotFound();
var type=Path.GetExtension(path).ToLowerInvariant() switch {".png"=>"image/png",".jpg" or ".jpeg"=>"image/jpeg",".webp"=>"image/webp",".avif"=>"image/avif",_=>null}; var type=Path.GetExtension(path).ToLowerInvariant() switch {".png"=>"image/png",".jpg" or ".jpeg"=>"image/jpeg",".webp"=>"image/webp",".avif"=>"image/avif",".gif"=>"image/gif",".svg"=>"image/svg+xml",_=>null};
return type is null?NotFound():PhysicalFile(path,type); return type is null?NotFound():PhysicalFile(path,type);
} }
} }

View File

@ -0,0 +1,5 @@
# Merge these non-secret values into the EXISTING application configuration at
# approved cutover. Do not replace its environment file, secrets, workers or keys.
Site__WebsiteBaseUrl=https://plotdirector.com
AllowedHosts=app.plotdirector.com;plotdirector.com;127.0.0.1
HelpContent__Path=/srv/plotdirector/shared/help/current