Commit graph

19 commits

Author SHA1 Message Date
33552aa648 Add gin.Logger() middleware for HTTP request logging in dev mode 2026-03-29 19:10:44 +02:00
8b2d2649ac Add random password generation for new users
- Move GenerateRandomPassword to auth package for reuse
- Make password optional in user creation (generates 16-char if empty)
- Return generated password in response for user to copy
- Add Generate/Copy UI with show/hide toggle
2026-03-29 14:52:59 +02:00
c4e3a31b69 Complete GORM to sqlc migration
- Remove GORM dependency, use sqlc for type-safe SQL queries
- Update all handlers to use sqlc patterns (context, value types)
- Fix N+1 query problem in domain listing with JOIN query
- Enable SQL query logging in debug mode (USE_EMBEDDED=false)
- Add comprehensive comments for non-Go developers
2026-03-29 13:56:14 +02:00
dad96978e0 WIP: Migrate from GORM to sqlc - partial migration, build broken 2026-03-28 18:26:45 +01:00
560b40503a Migrate GORM to generics API, simplify user-domain relationship, refactor models 2026-03-28 17:21:00 +01:00
19ce2224b8 Add comments to virtual_* database files
Add human-readable comments explaining each function's purpose,
parameters, and return values for better documentation.
2026-03-28 14:58:11 +01:00
0e6fad65e2 Rename db files to match model names
- users.go -> virtual_users.go
- domains.go -> virtual_domains.go
- aliases.go -> virtual_aliases.go
2026-03-26 23:55:24 +01:00
d5880d5096 Rename ISPmail models to use Virtual* prefix
- Domain -> VirtualDomain
- User -> VirtualUser
- Alias -> VirtualAlias

This clarifies which tables are ISPmail tables vs IMC tables.
2026-03-26 23:34:05 +01:00
270cee44ff Change Go module path to git.workaround.org
- Update module path from github.com/imc/backend to git.workaround.org/chaas/imc/backend
- Update git remote to use git.workaround.org
2026-03-24 23:50:34 +01:00
ff52be8adf Rename project from imc-vibe to imc
- Binary name: imc-vibe -> imc
- Go module: github.com/imc-vibe/backend -> github.com/imc/backend
- JWT issuer: imc-vibe -> imc
- UI labels: IMC Vibe -> IMC
- Update all imports and comments
2026-03-24 23:42:37 +01:00
53261dec0c Add backend validation for aliases
- Validate source email format (RFC 5321 local-part)
- Ensure source is in the correct domain
- Validate destination (single or comma-separated emails)
- Check for duplicate aliases
- Add GetAliasBySource database method
2026-03-24 21:57:32 +01:00
abd7e3a97f Remove password reset functionality
Backend:
- Remove ForgotPassword API handler
- Remove password reset token model and database table
- Remove email service for sending reset emails
- Remove SMTP configuration

Frontend:
- Remove /auth/forgot page
- Remove forgot password link from login page
- Remove forgot route from auth-only routes check
2026-03-23 22:35:30 +01:00
88c870ab3c Restore --reset-admin-password flag for CLI admin password reset 2026-03-23 21:58:41 +01:00
b76ea568ae Remove ADMIN_PASSWORD configuration
Authentication now works only via hashed passwords in imc_users table.
Users must be created through the password reset flow or directly in the database.
2026-03-23 21:28:52 +01:00
36258bf53c Sort domains alphabetically
- GetAllDomains: order by name ASC
- GetUserAccessibleDomains: order by name ASC for both admin and regular users
2026-03-23 00:11:03 +01:00
68285d861a Add comprehensive human-readable comments to all Go files
- Comments explain what each function does and why
- Fixed unused strconv import in queue.go
- Better documentation for SMTP email service
- Explained journalctl log parsing in logs.go
- Clarified queue operations in queue.go
2026-03-22 22:43:41 +01:00
53ce3b06ae Add CLI flags for setup and server configuration
- Add --setup flag to create admin user
- Add --admin-user and --admin-password for setup
- Generate cryptographically random passwords for --setup
- Add --bind and --port flags for server binding
- Add BIND env var support
- Add SMTP email service for password reset
- Add password reset token storage
- Add auth header to queue/logs frontend pages
- Fix journalctl timestamp format
- Fix logs to return empty array instead of error when no entries
- Fix queue handler to return proper error message
- Hide Users/Aliases nav links when no domain selected
2026-03-22 01:17:43 +01:00
3cb21bf5cf remove build artifacts that should not be checked in 2026-03-21 23:57:01 +01:00
f4be03ceba first 2026-03-21 22:41:23 +01:00