Repository navigation
Conversation
Analyst-only queries: a viewer now gets 403 on /query, /query/ and /QUERY/; analysts still get through. I attached the analyst requirement to the query endpoint itself instead of matching the URL. The engine middleware now picks the engine from the same kind of endpoint tag, so no check depends on how a URL is spelled. Sign-in redirects: return URLs with a tab, a newline or a backslash all end on the dashboard's front page after sign-in, and a normal path like /pages/?site=blog is kept. The check now asks the browser's own URL parser and accepts only the same origin. A new web test covers these cases. Reverse proxies: the server now reads the forwarded headers proxies send, trusting loopback proxies by default. Other proxy addresses go in a new Dashboard:KnownProxies setting, which the dashboard README and docs-site guide now describe. A sign-in through an HTTPS proxy succeeds and gets a Secure cookie, and other origins still get 403. Sign-in throttle: of 20 simultaneous wrong passwords, 5 get 401 and 15 get 429. Attempts are counted before the password check. A second, larger limit per client address stops user-name rotation. At most half the processors hash passwords at once; extra attempts wait their turn.
koculu
force-pushed
the
feature-dashboard-admin-auth-wizard
branch
from
October 19, 2026 03:43
b4b1708 to
9133ba7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dashboard: sign-in, setup wizard and administration
The dashboard was a single-user development demo: engine options lived in code, sites and the time zone in
appsettings.json, and nothing was protected. This PR turns it into an application you can deploy: users and sessions stored in ZoneTree, a first-run setup wizard, and an admin panel where every engine option, index and rollup can be changed.What changes for someone running the dashboard
/admin/): server status (engine state, background index builds, partitions), sites, users and their sessions, indexes and rollups, settings, audit log. Saving shows what changes and when each change applies: at once, after a short engine reopen, or after a restart. Changes that delete data need confirmation. If the engine can't open with the new settings, the previous settings are reopened.*.example.com). Traffic from other domains goes to the primary site or is ignored, depending on a setting. Recording visits to the dashboard itself is optional.Breaking changes
Analytics:DataDirectory,Analytics:TimeZone,Dashboard:Sites,Dashboard:RefreshSeconds. After setup, the stored settings are the source of truth. Server-level options left:Urls,Dashboard:SystemDirectory,Dashboard:Path,Dashboard:Watch, andAnalytics:SeedDemo(which now also seeds right after setup).DashboardAnalyticsOptions.ConfigurePrimaryis gone; that class now configures only the Development sample and benchmark engines.Implementation
Server (
apps/ZoneTree.Analytics.Dashboard/server)System/SystemStore: oneZoneTree<string,string>with the default AsyncCompressed WAL. Users, sessions, settings and the audit log share it through key prefixes. It refuses a non-empty directory it didn't create.Auth/: PBKDF2-SHA256 password hashes. Session tokens are 256-bit random values; the store keeps only their SHA-256. Session cookies are HttpOnly and SameSite=Lax, and Secure over HTTPS. A per-user security stamp ends all of a user's sessions when their role, sites, password or status changes. It also adds an ASP.NET Core authentication handler, a sign-in throttle, and a check that rejects state-changing requests from other origins.Settings/:DashboardSettingsis the persisted model. Its[Setting]metadata produces a schema that both the wizard and the admin forms render.SettingsMappermaps settings toAnalyticsOptionsand validates them with the engine's rules.SettingsServicereviews changes, classifies when each applies and saves them.Engine/EngineHost: requests take a lease on the engine; a reopen waits for leases to end, then reopens, rolling back on failure.EngineMiddlewaregives reporting and tracker requests the leased engine by wrappingRequestServices; a scoped registration would dispose the shared engine at the end of each request. It also resolves beacon sites.Setup/: the setup key, the wizard's API, and the console banner.server/data/**is excluded from build content; the Web SDK had been copying dataset metadata JSON into the build output.UI (
apps/ZoneTree.Analytics.Dashboard/ui)/signin/,/signout/,/setup/,/account/,/account/settings/and/admin/*. Sign-in, sign-out and setup use a newauthtemplate with a theme toggle.lib/session.ts,lib/settings-model.tswithcomponents/settings-fields.ts(the settings forms built from the schema),lib/admin.ts(review before save), andcomponents/sites-editor.ts.Library
AnalyticsOptions.Validate()is public: it runs the engine's option checks without opening storage.AddZoneTreeAnalyticsWeb()registers the web options and reporting limits without an engine, for hosts that replace engines at runtime.Testing
DashboardAdministrationTestscovering: