Conversation
Add setup flow endpoints for the installer UI to configure: - System validation checks - Domain configuration - CORS/UI origin settings - Initial user creation Note: Dynamic CORS middleware included but may be removed if installer UI is served from same origin. Signed-off-by: nfebe <fenn25.fn@gmail.com>
- Add duplicate domain+path validation in addDomain API endpoint - Add nginx warning tolerance (ssl_stapling warnings no longer fail) - Add location deduplication in config generator to prevent duplicate location "/" errors - Add vhost backup/restore on proxy setup failure instead of deletion - Add WriteVirtualHost and GetVirtualHost to NginxManager interface Fixes issue where adding domains would fail due to ssl_stapling warnings and corrupt vhost config by deleting it on failure.
Code Review SummaryThis pull request introduces a significant new feature: a comprehensive initial setup flow for the agent. This feature streamlines first-time configuration, including Docker environment validation, instance IP detection, domain/SSL setup, CORS configuration, and initial user creation. Beyond the new setup, the PR substantially enhances the robustness of the Nginx proxy management by implementing atomic configuration updates with rollback capabilities and intelligent handling of duplicate domain paths. Key dependencies have also been updated, improving overall stability. 🚀 Key Improvements
💡 Minor Suggestions
|
🔍 Code Review💡 1. **internal/nginx/manager.go** (Lines 230-236) - BUGThe modification to Suggested Code: Current Code: return fmt.Errorf("nginx config test failed: %s - %w", string(output), err)💡 2. **internal/nginx/manager.go** (Lines 443-447) - BUGThe addition of Suggested Code: Current Code: hasSSL := false💡 3. **internal/proxy/orchestrator.go** (Lines 108-115) - REFACTORThis change significantly improves the robustness of proxy setup. By backing up the previous Nginx configuration and restoring it if the new configuration fails the Suggested Code: Current Code: _ = o.nginx.DeleteVirtualHost(deployment.Name)Verdict: APPROVE Posted as a comment because posting a review failed. |
No description provided.