feat: multi-admin support for self-hosted dashboard - #4
Open
adiraju13 wants to merge 24 commits into
Conversation
…des all previous fixes
…write, handle admin session refresh, and add unit tests
…ns`Adds regex validation to createAdminSchema so usernames containing path-separator characters (e.g. '/') cannot be created. Such usernames would make the DELETE /api/auth/admin/:username route permanently unreachable since Express only matches a single path segment.`Allowed characters: a-z, A-Z, 0-9, hyphens, underscores.
- Add .gitattributes with * text=auto eol=lf to enforce LF across all text files and prevent Windows autocrlf from breaking prettier/eslint - Set git core.autocrlf=false for this repo - Fix CRLF in backend/src/api/routes/docs/index.routes.ts - Normalize all packages (shared-schemas, ui, dashboard, backend) to LF All 5 packages now pass npm run lint.
RedesignChange password
Root notice
Prompt to build with AI |
Real account identity replaces a raw IDThe before showed the account as a raw ID string (11111111-2222-…) that means nothing to an admin. The after leads with a clear identity header — avatar, name, and role — so it's obvious whose password is being changed. Prompt to fix with AI |
One-click copy for the env variableBefore, the ROOT_ADMIN_PASSWORD line sat in a dead gray box you had to select by hand. Now it's a clear row with a one-click copy button, so root admins can grab the variable without fiddling. Prompt to fix with AI |
Password fields no longer bleed to the dialog edgesBefore, the password inputs stretched edge-to-edge and crowded together with no breathing room. After, the fields are padded and evenly spaced with clear labels, a helpful hint, and lock icons, so the form reads as one tidy sequence. Prompt to fix with AI |
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.





Softlight Overview
Design Score: 1/5
Suggested fixes
Redesign
The new Account Settings dialog looked unfinished — fields ran to the edges and it showed a raw account ID — so this pass rebuilt it on the product's own dialog styling with a clear identity header and a tidy layout.
Fix: [Feature]: Multi-admin support for self-hosted dashboard InsForge#1478
Issue : - InsForge#1478
Summary
This PR implements multi-admin support for self-hosted InsForge deployments, replacing the single env‑based admin with a database‑backed admin model.
What's changed:
Backend:
auth.project_adminstable (migration 049) with columns for username, password_hash, root status, and audit metadataAdminServicewith full CRUD operations (create, list, delete, password change)AuthService.adminLogin()to verify against database instead of env varsGET /api/auth/admin,POST /api/auth/admin,DELETE /api/auth/admin/:username,POST /api/auth/admin/change-passwordrequireRootmiddleware to protect root-only operationsFrontend:
username+ password instead of email + passwordAccountSettingsDialogfor password change (accessible from avatar dropdown)AdminManagementUI (root only) for creating/deleting adminsAuthContextto store admin session and root statusSecurity:
How did you test this change?
Automated Tests:
npm run typecheck- passes (0 errors)npm test- passes (1267 tests)Video
Watch Demo Video on YouTube
ScreenShot
Manual Testing Performed:
Backend API Testing: