Commit graph

13 commits

Author SHA1 Message Date
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
269fb6f53a Security fixes
1. Password reset tokens: use crypto/rand instead of math/rand
2. IP spoofing: only trust X-Forwarded-For from configured trusted proxies
3. Cleanup: purge failed login attempts older than 24 hours
4. JWT secret: validate minimum 32 character length on startup

Updated .env.example with TRUSTED_PROXIES setting
2026-03-23 01:09:26 +01:00
2834657125 Switch from net/http to gin-gonic web framework
- Added gin-gonic v1.10.0 dependency
- Refactored router.go: clean route groups with middleware chains
- Refactored all handlers to use gin.Context instead of http.ResponseWriter/*http.Request
- Simplified response helpers (JSON, Error, Success, Created, NoContent)
- Clean auth middleware using Gin's c.Set() for context
- Cleaner route definitions with path parameters (e.g., /domains/:name/users/:id)
- Admin routes moved to /api/admin group with RequireAdmin middleware
2026-03-22 23:28:28 +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
3e3620a24f Remove USE_EMBEDDED option - always use embedded frontend 2026-03-22 22:08:45 +01:00
4b9db2c242 Use standard flag package with custom help format for double-hyphen style 2026-03-22 21:50:18 +01:00
1c9578cb56 Use double-hyphen style CLI flags with pflag 2026-03-22 21:49:04 +01:00
6ef558d44d Simplify CLI: replace --setup with --reset-admin-password flag
- Remove --setup and --admin-user flags
- Add --reset-admin-password flag that generates random password and exits
- Admin username is now always 'admin'
2026-03-22 21:47:23 +01:00
d56722ddb9 Remove build artifacts from repository tracking 2026-03-22 01:19:55 +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