The Site:Audience setting was conflating two distinct concepts: an OAuth
JWT audience (a single resource identifier) and a CORS allow-list (an
array of origins). Collapsing them caused several latent bugs:
- OAuth/JWT validation expected a single string while CORS WithOrigins
accepts an array.
- Password-reset callback URLs and OAuth client RedirectUri/Origin were
being built from what was meant to be an audience identifier, not a
base URL.
- Yavsc.Org's main CORS policy was hardcoded to '*', with no way to
restrict it without code changes.
Changes:
- SiteSettings.Audience (string) replaced with CorsAllowedOrigins
(IList<string>).
- OAuth JWT Authority still reads Site:Authority; Audience now reads
Site:ExternalUrl (Org only; Api/Blogs use ValidateAudience=false).
- MailSender and AccountController build reset-callback URLs from
Site:ExternalUrl.
- ClientController uses Site:ExternalUrl for OAuth RedirectUri/Origin
defaults on newly created clients.
- Yavsc.Api and Yavsc.Blogs now read CORS origins from
Site:CorsAllowedOrigins instead of hardcoded URLs.
Add shared AddYavscCors / AddYavscJwtBearer extension methods in
Yavsc.Server/Helpers/ServiceExtensions.cs to enforce a single
configuration contract across all runtime services (Api, Blogs, Org).
Fails closed when CorsAllowedOrigins is empty; fails fast at startup
when Site:Authority is missing.
Remove obsolete ConfigurationHelpers.GetAudience (no remaining callers).
Local appsettings-*.json files (which carry deployment-specific values
and are gitignored) must be updated to add Site:CorsAllowedOrigins.
Drops 1038 files from src/Yavsc.Org/wwwroot/lib/ — they remain
on disk and are now restored via 'npm install' at build time
(see package.json and esbuild.config.mjs).
Exception: jonthornton-Datepair is not on npm, the bundled
files are kept in wwwroot/lib/jonthornton-Datepair/ as static
assets.
Also extends .gitignore to ignore:
- node_modules/, build/, package-lock.json (esbuild toolchain)
- wwwroot/js/*.min.js (regenerated by 'npm run build:js')
- .Production.env (added explicitly, not matched by '.*.env'
glob in some git versions)
This aligns themeok with the architecture already in place
on refac/js-bundle (commits ed7522c5, 196f4b0b, 292c0a2f on
that branch). The build artifacts were already present in
node_modules/ and build/ on disk; this commit only stops
tracking them.
Tested: dotnet test 11/11 green (no C# code touched).
The previous code computed the path as
Path.Combine(BaseDir, "../../src/Yavsc.Org")
which from `bin/Debug/net10.0/` resolved to a non-existent
`test/yavscTests/src/Yavsc.Org` (two levels up, not four).
Kestrel logged:
"The WebRootPath was not found: ... /wwwroot. Static files
may be unavailable."
The fix walks up the directory tree from BaseDir until it
finds a directory that contains `src/Yavsc.Org`. This is
robust against the test runner changing the current working
directory (which it does: it runs from
`test/yavscTests/bin/Debug/net10.0`, not the repo root).
After this fix, UseStaticFiles correctly resolves the
wwwroot, so static assets under `wwwroot/` are served.
Note: this does NOT make the in-memory WebServerFixture
fully functional. Two pre-existing issues remain:
1. _Layout.cshtml references `~/css/site.css` but the
actual file is now at `~/css/main/site.css` (moved by
commit 31906a78). The .cshtml was not updated.
2. HomeController.Index() throws NullReferenceException
on an empty EF Core InMemory database (no Activities
seeded). UseDeveloperExceptionPage returns a 500 page
that gets caught and re-rendered as 404 by the test
client.
Both will be addressed in follow-up commits.
Tested: dotnet test 11/11 green (existing tests use
Services DI, not HTTP). UI tests not added yet (blocked by
the issues above).
Énoncé du défi : aligner main sur l'intention trunk qui a
déjà opéré sur themeok, libérer le dépôt du code inutile,
bien nettoyer CSS/JS, sans casser le JS et le CSS de
_Layout.cshtml. Introduire immédiatement des tests d'UI
automatisés comme garde-fou.
Le document contient :
- Énoncé du défi
- État actuel des 3 branches (themeok, main, refac/js-bundle)
- Résultats du diagnostic de main (cause racine : contenu
vide + erreur JS sur carousel vide, pas un problème de
fichiers servis)
- 6 critères d'acceptation vérifiables
- Stratégie de tests UI automatisés (Playwright C#)
- Plan d'attaque en 6 étapes
- 5 risques identifiés (cache navigateur, double binding
Kestrel, .env non versionné, ports utilisés, quiproquos
de branches)
- Todo court/moyen/long terme
- Annexes : environnement d'exécution, procédure make reinstall
Le diagnostic a été reproduit en worktree diag/main sur
ports 5060/5061, en surchargeant la config Kestrel via
variables d'environnement pour ne pas écraser le service
systemd yavscOrg sur port 3002.
Chromium rejects cookies that have SameSite=None but no
Secure flag. The default Identity cookie policy uses
SameSite=None, which is invalid on http://localhost (no
TLS, no Secure). Result on http://localhost:5000:
Cookie '.AspNetCore.Identity.Application' rejected
because it has the 'SameSite=None' attribute but is
missing the 'secure' attribute.
Fix: in Development environment, configure
ConfigureApplicationCookie and ConfigureExternalCookie
to use SameSite=Lax and SameAsRequest SecurePolicy.
Lax is permissive enough for OAuth callbacks (top-level
GET navigations) and avoids the rejection.
Production (https://) is untouched — the default
SameSite=None is correct when Secure is set.
Note on the sameSiteMode reference: SameSiteMode is
defined in two namespaces
(Microsoft.AspNetCore.Http and Microsoft.Net.Http.Headers).
The file already uses 'using Microsoft.Net.Http.Headers;'
so a bare 'SameSiteMode' is ambiguous. Using the
fully-qualified name 'Microsoft.AspNetCore.Http.SameSiteMode'
to disambiguate, no new using needed.
Tested: dotnet build OK, dotnet test 11/11 green.
Quill was never wired up on themeok (no .cshtml reference,
no @addTagHelper, no C# binding). It lived only as static
CSS/JS in wwwroot/ — dead weight in the repo.
The rich text editor for blog posts is PostIt (XPlat), not
the browser. Quill is no longer needed.
Removes:
- src/Yavsc.Org/wwwroot/css/main/quill.snow.css
- src/Yavsc.Org/wwwroot/css/main/quill.snow.min.css
- src/Yavsc.Org/wwwroot/js/quill.js
- src/Yavsc.Org/wwwroot/js/quill.min.js
- (also removed from disk, was untracked: quill.bundle.min.js)
Tested: dotnet test 11/11 green (no C# touched, but rule is rule).
This commit marks the current state of themeok as the
canonical visual reference for the upcoming theme
refactoring.
What this point of the branch represents:
- Bootstrap 5 (quartz theme) loaded via wwwroot/lib/bootstrap.quartz.min.css
- jQuery 3 + jQuery UI 1.14 + Bootstrap 5 JS bundle loaded from wwwroot/lib/
- New navbar partial src/Yavsc.Org/Views/Shared/_Nav.cshtml
(Bootstrap 5 navbar-dark bg-dark with dropdowns)
- _Layout.cshtml loading the new navbar via <partial name="_Nav" />
- The WIP 'Js and css cleanup' (31906a78) — CSS vendor files
dropped from wwwroot/css/ and moved to wwwroot/css/main/
where appropriate
- The gitignore cleanup (ebfc3d77) — vendor lib files no
longer tracked in the repo, restored via npm at build time
Out of scope for this snapshot:
- Home/Index.cshtml content (still empty container)
- Other view migrations to Bootstrap 5
- Quill removal
- Cookie SameSite=None fix in Program.cs
- jQuery-as-global-script refac (lives on refac/js-bundle
branch, will be merged later)
Tested: dotnet test 11/11 green.
Drops 1038 files from src/Yavsc.Org/wwwroot/lib/ — they remain
on disk and are now restored via 'npm install' at build time
(see package.json and esbuild.config.mjs).
Exception: jonthornton-Datepair is not on npm, the bundled
files are kept in wwwroot/lib/jonthornton-Datepair/ as static
assets.
Also extends .gitignore to ignore:
- node_modules/, build/, package-lock.json (esbuild toolchain)
- wwwroot/js/*.min.js (regenerated by 'npm run build:js')
- .Production.env (added explicitly, not matched by '.*.env'
glob in some git versions)
This aligns themeok with the architecture already in place
on refac/js-bundle (commits ed7522c5, 196f4b0b, 292c0a2f on
that branch). The build artifacts were already present in
node_modules/ and build/ on disk; this commit only stops
tracking them.
Tested: dotnet test 11/11 green (no C# code touched).
datetime.bundle.min.js and timepicker.bundle.min.js no longer
bundle jQuery and jQuery UI. The datepicker and timepicker
plugins attach to global jQuery when they are evaluated, which
is already loaded by _Layout.cshtml.
Bundle sizes:
- datetime: 545 KB → 201 KB
- timepicker: 354 KB → 12 KB
NOTE: This commit does not touch any versioned file. The
build/ directory and the .min.js outputs under
wwwroot/js/ are gitignored. The bundles are regenerated by
'npm run build:js' (see INSTALL.md and the script 'build:js'
in package.json).
Build state is partially migrated: core, chat, datetime, and
timepicker are clean. dropzone is still pending. Redundancy is
harmless (the second jQuery load is a no-op override) but
wasteful; full cleanup is the goal of this refac.
Tested: dotnet test 11/11 green.
chat.bundle.min.js no longer bundles jQuery, jQuery UI,
jquery-validation, jquery-validation-unobtrusive, showdown,
or to-markdown. The application code (chat.js, comment.js)
consumes them from window.$ / window.jQuery (provided by the
layout's global scripts) or does not need them at all.
Bundle size: 591 KB → 7.6 KB.
NOTE: This commit does not touch any versioned file. The
build/ directory and the .min.js outputs under
wwwroot/js/ are gitignored. The bundle is regenerated by
'npm run build:js' (see INSTALL.md and the script 'build:js'
in package.json).
Build state is partially migrated: only chat is clean so far.
Other bundles (core, dropzone, datetime, timepicker) still
bundle jQuery — upcoming commits will clean them up too.
Redundancy is harmless (the second jQuery load is a no-op
override) but wasteful; full cleanup is the goal of this
refac.
Tested: dotnet test 11/11 green.
JQuery, jQuery UI, Bootstrap, jquery-validation and
jquery-validation-unobtrusive are now loaded as separate
<script> tags by _Layout.cshtml, BEFORE the core bundle.
Why: esbuild IIFE bundles do not expose jQuery ($ and jQuery)
on window — UMD-style modules bundled in IIFE format are wrapped
in a closure. The application code (site.js, md-helpers.js,
yavsc-remote-fs.js, etc.) consumes window.$ / window.jQuery, so
it broke at runtime. Loading these scripts as global <script> tags
restores the expected global exposure.
This commit only touches the layout. Future commits will remove
the corresponding imports from each bundle's entry (chat, dropzone,
datetime, timepicker) and let them rely on window.$ being already
defined by the layout.
Tested: dotnet test 11/11 green. The new global scripts are
served by ASP.NET static files (HTTP 200 verified). Server
restart by developer required to pick up the new layout.
Removing the 'bootstrap' and 'popper.js' NuGet package references
that were used solely to copy assets to wwwroot/ at build time.
The npm-based esbuild bundles now provide the same files, and the
duplicate-asset build error is gone.
'bootstrap 5.3.8' (NuGet) was flagged with vulnerabilities by
Dependabot. Pinning to 4.6.2 via npm (matching what the views
were using from wwwroot/lib/) is closer to what the rest of the
codebase expects.
Verified: 'dotnet test' passes (11/11).
Refs: this is the fix to make the 'separate front assets into
esbuild bundles' commit green.
Add ignore rules for the new front-end toolchain:
- node_modules/ : npm install output
- build/ : esbuild entry files (regenerated by build:js)
- package-lock.json : not committed (use package.json as canonical)
- src/Yavsc.Org/wwwroot/lib/ : vendor libs (replaced by bundles)
with exception for jonthornton-Datepair/ (not on npm)
- src/Yavsc.Org/wwwroot/js/*.min.js : generated by esbuild
The esbuild bundles under wwwroot/js and wwwroot/css are now
produced by 'npm run build:js'. Document this in INSTALL.md so
new contributors know to run 'npm install' before 'make install'.
Sort ~50 Mo de libs tierces hors du repo et regroupe le code
front en 6 bundles thématiques + 2 assets statiques.
Bundles produits par esbuild :
- core.bundle.min.js : jQuery + jQuery UI + Bootstrap 4 + validation
+ tout le code applicatif 'core'
(site, signout, signin, input-lib, md-helpers,
audiovideoinput, parallax, google.geocode,
google-geoloc). Chargé par _Layout.cshtml.
- chat.bundle.min.js : core subset (sans Bootstrap) + chat.js + comment.js
(SignalR client chargé séparément, voir plus bas)
- dropzone.bundle.min.js : jQuery + dropzone + yavsc-remote-fs
- datetime.bundle.min.js : jQuery + jQuery UI + eonasdan datetimepicker
+ jquery-timepicker
- timepicker.bundle.min.js : jQuery + jQuery UI + jquery-timepicker
- quill.bundle.min.js : Quill rich text editor
Assets statiques (non bundlés, copiés depuis node_modules) :
- signalr.min.js : client SignalR 2.x (legacy server)
- moment-with-locales.min.js : moment + 137 locales (require dynamique
non résolvable statiquement par esbuild)
CSS vendor copiées comme assets statiques vers wwwroot/css/ :
bootstrap.min.css, jquery-ui.min.css, dropzone.min.css,
dropzone-basic.min.css, bootstrap-datetimepicker.min.css,
jquery.timepicker.css
Exception gitignore : jonthornton-Datepair/jquery.datepair.min.js
n'est pas sur npm, conservé comme asset statique sous
wwwroot/lib/jonthornton-Datepair/ (téléchargé depuis upstream).
Vues Razor mises à jour (15 fichiers) pour pointer vers les bundles
et les CSS vendor. Suppression de la majorité de wwwroot/lib/ (1300+
fichiers). Suppression des jquery*.js, quill.js, showdown.js,
to-markdown.js, jquery.signalR-2.2.1.js, dropzone.js et de leurs
.min.js associés.
'jquery-datepair' et 'jquery-ui-map' non publiés sur npm :
- jquery-ui-map n'est utilisé nulle part dans le repo (vérifié),
la dépendance est purement historique.
- datepair reste en static sous wwwroot/lib/jonthornton-Datepair/.
Pose les fondations du bundle front unique :
- package.json : deps npm (jQuery, jQuery UI, jQuery plugins,
Bootstrap 5, SignalR, Moment, Quill, Showdown, To-markdown,
Dropzone, eonasdan-datetimepicker) + esbuild.
- esbuild.config.mjs : produit src/Yavsc.Org/wwwroot/js/site.bundle.min.js
à partir des .js à nous + des libs npm.
- .gitignore : exclut node_modules/, wwwroot/lib/, et les *.min.js
sous wwwroot/js (générés au build, non versionnés).
Le bundle généré sera commité au commit suivant pour que le
runtime .NET n'ait pas besoin de node au publish time.
TODO.fr.md (2016-2017) archivé en TODO.fr.md.archive.
ROADMAP.md reformule les jalons en s'appuyant sur l'Architecture
et la session DDD du 14 juin 2026.
doc/Architecture.md: section 'Droits de yavsc' ajoutée (admin, groupes, user yavsc).
doc/ddd-exploration-2026-06-14.md: première session d'Event Storming narratif.