feat: Enhance gin security and configuration options#18
Merged
timokoessler merged 5 commits intomainfrom Mar 22, 2026
Merged
Conversation
It also prevents a Windows Defender prompt during development if it's set to localhost
There was a problem hiding this comment.
Pull request overview
This PR introduces additional runtime configuration and security hardening for the Gin-based Hub server, while also preventing search indexing and improving Windows compatibility for backend build tooling.
Changes:
- Add new Hub config options (
APP_URL,HOST,TRUSTED_PROXIES) and wire them into server startup. - Add security-related middleware (security headers + Origin-based CSRF protection).
- Disable search indexing (robots + headers) and update the backend Justfile for Windows support.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/public/robots.txt | Blocks crawlers via Disallow (and adds a nonstandard Noindex directive). |
| backend/internal/hub/url.go | Adds APP_URL parsing/validation used for Origin checks. |
| backend/internal/hub/server.go | Extends Hub config and applies trusted proxies + new security middleware. |
| backend/internal/hub/middleware/security.go | Adds common security headers (CSP, clickjacking protection, etc.). |
| backend/internal/hub/middleware/csrf.go | Adds Origin validation middleware for non-safe HTTP methods. |
| backend/cmd/hub/main.go | Updates CLI to handle DefaultConfig() errors. |
| backend/Justfile | Adds Windows shell support and refactors env var handling for CGO. |
| .gitignore | Ignores a local Claude settings file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alex289
approved these changes
Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
APP_URL,HOST(optional),TRUSTED_PROXIES