Commit Graph

943 Commits

Author SHA1 Message Date
Haitao Pan
d2dafabf65 feat(api): improve MFA detection and update MFA routes to async config
- Fix MFA detection logic to recognize mfa_code_required error
  - Remove strict mfaToken requirement when needMfa is determined by error code
  - Update mfa/status route to use async getAuthUrl() from runtime-loader
  - Update mfa/verify route to use async getAuthUrl() from runtime-loader
  - Add comprehensive structured logging across all MFA endpoints
  - Add timeout control (10s) for backend requests
  - Improve error handling with detailed console output
  - Add LOGIN_FLOW.md documentation in Chinese

  This completes the migration of all MFA-related endpoints to the new Deno
  native runtime configuration system.
2025-11-05 13:28:42 +08:00
Haitao Pan
66721ea54a feat(dashboard-fresh): implement multi-step login API and Deno native runtime config
- Add step-based login flow (check_email, login, verify_mfa)
  - Create Deno native runtime configuration loader
  - Fix all component imports to include file extensions
  - Add comprehensive API documentation
2025-11-05 13:07:58 +08:00
Haitao Pan
2a3e80c44f refactor(dashboard-fresh): extract user menu into standalone component
- Create islands/UserMenu.tsx with self-contained user menu functionality
  - Refactor islands/Navbar.tsx to use UserMenu component
  - Support both desktop and mobile layouts with single component
2025-11-05 09:18:56 +08:00
Haitao Pan
7edf4cb564 update: dashboard-fresh/docs/API_ENDPOINTS_TODO.md 2025-11-05 08:47:38 +08:00
Haitao Pan
12a914ee49 feat(api): migrate MFA authentication endpoints and add favicon
API Routes Migration:
   - Migrated /api/auth/mfa/status endpoint for checking MFA status
   - Migrated /api/auth/mfa/setup endpoint for TOTP provisioning
   - Migrated /api/auth/mfa/verify endpoint for code verification
   - Migrated /api/auth/mfa/disable endpoint for disabling MFA
   - All routes properly handle cookies (session and MFA tokens)
   - Implemented proper error handling and status codes

   Bug Fixes:
   - Added favicon.ico to static folder (fixes 404 error)
   - Updated fresh.gen.ts with new route manifests

   Migration Details:
   - Converted Next.js route handlers to Fresh Handlers pattern
   - Updated cookie management from Next.js cookies() to Deno's getCookies()
   - Changed Response handling from NextResponse to standard Response
   - Maintained compatibility with existing authentication flow
   - Proxies requests to backend account service API
2025-11-05 08:27:03 +08:00
Haitao Pan
d37f2dab42 feat(dashboard-fresh): improve homepage and navbar
- Enhanced homepage visuals: larger headings, gradient theme, improved CTA animations, and better text readability
- Added dynamic navbar offset using CSS variable (--app-shell-nav-offset)
- Fixed language toggle and routing consistency
- Introduced new components: Hero, CtaButtons, ShowcaseCarousel
- Resolved Preact version mismatch and <Head> rendering issues
2025-11-05 08:06:56 +08:00
Haitao Pan
dd6bb68d25 feat(dashboard-fresh): migrate panel routes to Fresh
- Panel Infrastructure:
  - Add lib/userSession.ts for user session utilities
  - Create islands/panel/Sidebar.tsx with navigation and MFA
  warnings
  - Create islands/panel/Header.tsx with user info and role badges
  - Create islands/panel/PanelLayout.tsx as layout wrapper
  - Add routes/panel/index.tsx as dashboard home page
  - Add routes/panel/account.tsx for account settings
  - Add routes/panel/mail.tsx for mail service (placeholder)
2025-11-04 23:37:58 +08:00
Haitao Pan
b542a0ae17 feat(auth): migrate register pages to Fresh/Deno
- /routes/register.tsx - Registration page with email verification
  - /islands/RegisterForm.tsx - Multi-step registration with email code
2025-11-04 22:50:56 +08:00
Haitao Pan
ae5e09be76 feat(auth): migrate login page to Fresh with AuthLayout and MFA support
- Migrate /components/auth/AuthLayout.tsx to Preact
 - Create /routes/login.tsx using Fresh handlers and SSR
 - Create /islands/LoginForm.tsx with MFA (TOTP) support
2025-11-04 22:26:05 +08:00
Haitao Pan
613dda4ad1 fix(navbar): restore original design and integrate Fresh migration
Changes:
  - Create /islands/Navbar.tsx with Preact/signals state management
  - Fix translucent background (bg-white/85) and backdrop-blur effect
  - Restore high-contrast branding (text-gray-900 for logo/title)
  - Fix menu item spacing (gap-6) and hover effects (hover:text-brand)
  - Add proper alignment for search bar, auth buttons, and icons
  - Integrate language selector and release channel icon (🧪)

Testing:
  - Homepage (/) loads successfully (200 OK)
  - Navbar demo (/navbar-demo) works correctly
2025-11-04 21:40:29 +08:00
shenlan
f6703962f2 fix: align fresh navbar theming (#646) 2025-11-04 20:18:35 +08:00
shenlan
0ad9888b0a feat: refine fresh homepage layout (#645) 2025-11-04 18:31:55 +08:00
Haitao Pan
9c877ceb3c feat(dashboard-fresh): migrate and integrate dashboard source
- Add fresh app structure (auth, tenant, mail, insight, docs, panel)
- Include CMS content, API routes, scripts, and config
- Migrate UI components, themes, and extensions to fresh runtime
2025-11-04 18:06:21 +08:00
shenlan
d6299f8ca4 docs: align dashboard plan with fresh deno migration (#644) 2025-11-04 12:57:02 +08:00
Haitao Pan
8096601118 fix(account): add timeout and email validation for verification sending 2025-11-04 09:38:15 +08:00
shenlan
1e01279678 feat: enable mail demo preview and fix extension import (#643) 2025-11-03 07:56:18 +08:00
shenlan
9fc3765c38 Add email verification auth page (#642) 2025-11-02 23:09:51 +08:00
shenlan
42dc37a45c Simplify verification step notice (#641) 2025-11-02 22:43:00 +08:00
shenlan
9dcb8eab79 Improve registration feedback and verification flow (#640) 2025-11-02 19:34:26 +08:00
shenlan
e1fa949d68 Keep registration code inputs enabled (#639) 2025-11-02 18:44:34 +08:00
shenlan
db07406186 Fix runtime loader search path for sit env (#638) 2025-11-02 18:11:33 +08:00
shenlan
22d1907828 Merge pull request #637 from Cloud-Neutral/codex/refactor-runtime-loader-for-server-only 2025-11-02 15:42:57 +08:00
shenlan
350f6b92a4 refactor runtime loader to server module 2025-11-02 15:41:55 +08:00
root
1d4e858348 update prod runtime config and cleanup: adjust .gitignore, remove account-export.yaml 2025-11-02 12:07:13 +08:00
shenlan
333421a8ec Limit SMTP send duration with request-scoped timeouts (#636) 2025-11-02 11:54:59 +08:00
shenlan
0a255ed1b8 Simplify runtime config loading (#635) 2025-11-02 11:51:46 +08:00
Haitao Pan
3a6a7f62f7 add docs/account-test-cases.md 2025-11-02 11:50:12 +08:00
shenlan
bdc3dc405f Fix runtime env detection for SIT domains (#634) 2025-11-02 11:00:56 +08:00
shenlan
4a03a0e783 Detect implicit TLS when auto mode uses port 465 (#633) 2025-11-02 10:47:20 +08:00
Haitao Pan
9090040451 merged: refactor-project-for-environment-auto-detection 2025-11-02 10:42:26 +08:00
shenlan
c9c9cd255a feat: add runtime config loader 2025-11-02 10:38:06 +08:00
Haitao Pan
5600460751 Adjust SIT environment configuration: runtime-service-config + dev Nginx 2025-11-02 10:35:37 +08:00
shenlan
175eecfb84 Disable caching in SIT Nginx config (#631) 2025-11-02 09:06:57 +08:00
shenlan
bb84b65845 feat: align svc.plus gateway layering (#630) 2025-11-02 07:11:11 +08:00
shenlan
6575449e0d fix(next): rewrite API trailing slashes (#629) 2025-11-01 23:52:34 +08:00
shenlan
9af421d6e3 fix(next): rewrite trailing api slashes in config (#628) 2025-11-01 23:44:51 +08:00
shenlan
3e98c22655 fix(next): rewrite API trailing slashes (#627) 2025-11-01 23:25:55 +08:00
Haitao Pan
163ae0f5c4 fix(next): disable trailingSlash to restore API route matching for /api/auth/* 2025-11-01 23:14:12 +08:00
shenlan
91b32e8a48 Fix register send proxy handler (#626) 2025-11-01 22:41:26 +08:00
shenlan
8bc62f088c feat: show real-time register validation hints (#625) 2025-11-01 22:14:59 +08:00
shenlan
cde2ccdf80 Fix account service API URL joining (#624) 2025-11-01 21:53:15 +08:00
shenlan
9daf5a3378 Refine registration flow with verification gate (#623) 2025-11-01 21:34:35 +08:00
Haitao Pan
164eda0fe8 add scripts/install_stalwart_mailserver.sh 2025-11-01 20:27:32 +08:00
shenlan
32784d74b6 Rename register resend endpoint to send (#622) 2025-11-01 20:25:37 +08:00
shenlan
a898b95248 Refine register messaging and avoid redundant resend call (#621) 2025-11-01 18:57:17 +08:00
Haitao Pan
9b72d94903 --amend 2025-11-01 18:10:46 +08:00
Haitao Pan
c7ec0013db scripts/install_postfix_sendonly.sh: udpate show_dns_record 2025-11-01 18:10:46 +08:00
Haitao Pan
91a566c39b add scripts/install_postfix_sendonly.sh 2025-11-01 18:10:46 +08:00
shenlan
de9001f20a Optimize register flow with verification popups (#620) 2025-11-01 17:24:10 +08:00
Haitao Pan
9133ff5d5a scripts/install_opensmtpd_sendonly.sh: update check_send_email() 2025-11-01 13:09:55 +08:00