Commit Graph

42 Commits

Author SHA1 Message Date
Haitao Pan
a38345c69c Fix register send when email verification is disabled 2026-04-23 23:13:10 +08:00
Haitao Pan
d50a2b2486 Ensure review xworkmate sync contract at startup 2026-04-14 17:07:20 +08:00
Haitao Pan
c98688cd51 feat(accounts): add vault-backed xworkmate secrets 2026-04-02 09:14:19 +08:00
Haitao Pan
0180e6ace5 feat(api): add homepage video settings endpoints 2026-03-18 15:14:08 +08:00
Haitao Pan
e7001750a3 fix(startup): initialize tenant schema before bootstrap 2026-03-17 21:16:44 +08:00
Haitao Pan
823ef9761c Add multi-tenant XWorkmate backend 2026-03-17 13:25:29 +08:00
Haitao Pan
b653883c24 feat: add stripe billing endpoints 2026-03-16 20:10:33 +08:00
Haitao Pan
d500976236 feat(auth): add readonly review account 2026-03-16 09:24:49 +08:00
Haitao Pan
d59a8a0415 fix(accountsvc): guard nil agent registry on startup 2026-03-13 11:18:51 +08:00
Haitao Pan
0bd31e0707 fix(experience): consolidate demo account into sandbox@svc.plus 2026-02-10 11:52:45 +08:00
Haitao Pan
2c69f3c156 style: update SandboxEmail constant to lowercase. 2026-02-06 18:53:00 +08:00
Haitao Pan
97b7d64de3 fix: Remove redundant agent routes and handlers from main.go to resolve startup panic. 2026-02-06 18:18:46 +08:00
Haitao Pan
b6ab404206 fix: Remove duplicate route registration causing panic on startup. 2026-02-06 16:40:31 +08:00
Haitao Pan
1bfe4f1d53 fix: Robust DB connection retries and move sandbox routes to admin group. 2026-02-06 16:21:29 +08:00
Haitao Pan
33bd1b8beb fix: Refine error reporting in agent sync and fix lints. 2026-02-06 13:13:44 +08:00
Haitao Pan
3b818314db fix: Filter out wildcard agent (*) from the nodes list in SandboxNodeBindingPanel. 2026-02-06 13:12:40 +08:00
Haitao Pan
c366e96e5d fix: Ensure users table has required columns for agent sync and add explicit migrations. 2026-02-06 13:10:18 +08:00
Haitao Pan
4503b053f7 feat: Implement sandbox agent functionality with dedicated user, admin API, and agent-side user filtering. 2026-02-06 13:03:47 +08:00
Haitao Pan
cc0ff117f6 chore: commit pending agent/controller updates and docs 2026-02-05 16:56:17 +08:00
Haitao Pan
d849e3e6cc fix(admin): complete management APIs for console integration 2026-02-05 15:01:12 +08:00
Haitao Pan
3ffd39cc8b feat: add public.agents table and its set_updated_at trigger. 2026-02-05 13:10:56 +08:00
Haitao Pan
e48c23fab5 feat: add agent loading debug logging and fix nodes endpoint response format 2026-02-05 12:17:35 +08:00
Haitao Pan
4d5aae09ad fix: correct sessions table column name in applyRBACSchema to user_uuid 2026-02-05 11:10:25 +08:00
Haitao Pan
bc2562b877 fix: move mfa/status endpoint outside auth middleware and implement persistent session storage
- Moved /api/auth/mfa/status outside authProtected group to allow pre-login MFA checks
- Added session management to Store interface with CreateSession, GetSession, DeleteSession
- Implemented session persistence in both memoryStore and postgresStore
- Updated handler to use store-based sessions instead of in-memory map
- Added database schema for users, sessions, agents, and email_blacklist tables
- This fixes the 401 error when checking MFA status before login
2026-02-05 09:37:04 +08:00
Haitao Pan
8b8a2aa3fa feat(agent-persistence): implement PostgreSQL persistence for agent registry
Core Changes:
- Add Agent struct and management methods to Store interface
- Implement PostgreSQL store methods (UpsertAgent, ListAgents, DeleteAgent, DeleteStaleAgents)
- Integrate persistence into Registry with async database writes
- Add Load() method to restore agents from database on startup
- Implement runAgentCleanup background task (5min interval, 10min stale threshold)

Database:
- Update agents table schema to use JSONB for groups field
- Add indexes on last_heartbeat and healthy columns
- Support health tracking and automatic cleanup of stale agents

Documentation:
- Add comprehensive DB access and upgrade guide
- Include agent persistence implementation plan
- Document diagnostic procedures and troubleshooting steps
- Add walkthrough of multi-agent support implementation

This enables:
- Persistent agent state across service restarts
- Automatic cleanup of offline agents
- Multi-agent support with shared token authentication
2026-02-05 08:34:25 +08:00
Haitao Pan
c084cd4c8f feat: Implement dynamic agent registration using self-reported IDs and persist agent details in a new agents database table. 2026-02-05 00:07:30 +08:00
Haitao Pan
7cae075709 feat: Allow internal agent ID to be configured via AGENT_ID environment variable, defaulting to 'internal-agent'. 2026-02-05 00:06:18 +08:00
Haitao Pan
838b1a1c0f fix: enforce demo no-mfa login and expose proxy uuid in session 2026-02-04 14:59:19 +08:00
Haitao Pan
40bb141322 feat: enforce root account and introduce RBAC policy scaffolding 2026-02-04 13:36:24 +08:00
Haitao Pan
09eb26da25 feat: add read-only Demo account with hourly UUID rotation 2026-02-04 12:37:31 +08:00
Haitao Pan
89c8957c57 refactor: API routing by nesting agent endpoints under /api and fix user not found error handling. 2026-02-03 14:49:47 +08:00
Haitao Pan
3b8195fd08 feat: support internal agent auth token and update agent server API path 2026-01-31 17:42:05 +08:00
Haitao Pan
ccb0bada22 feat: Add endpoint to list agent VLESS nodes based on the server's public URL and introduce a configuration option for the public URL. 2026-01-31 13:52:31 +08:00
Haitao Pan
400c56e72d feat(auth): support shared session tokens and device/node pairing integration 2026-01-30 23:12:01 +08:00
Haitao Pan
6ba56841b5 feat: add OAuth2 authentication support with new API endpoints, configuration, and identity storage. 2026-01-30 08:46:24 +08:00
Haitao Pan
cb542092ce feat: Template Xray TCP certificate and key file paths using a domain placeholder. 2026-01-27 22:01:07 +08:00
Haitao Pan
e1e22bca62 feat: Introduce nodes table and refactor Xray config syncer to generate multiple protocol-specific configurations using new XHTTP and TCP templates. 2026-01-27 21:56:39 +08:00
Haitao Pan
d74372e592 fix: avoid duplicate healthz route 2026-01-24 00:50:47 +08:00
Haitao Pan
08a0a7a61b feat: add healthz endpoint 2026-01-24 00:00:30 +08:00
Haitao Pan
29ee491acf reset accounts.svc.plus repo 2026-01-23 23:16:37 +08:00
Haitao Pan
b0c1ce813e update cmd/accountsvc/main.go 2026-01-23 19:23:48 +08:00
Haitao Pan
ee6e1a6363 feat: move account service to repo root
# Conflicts:
#	account/Makefile
#	account/go.mod
#	docs/account-admin-settings.md
#	docs/account-svc-plus.md
2026-01-16 16:15:23 +08:00