 131868bdca
			
		
	
	131868bdca
	
	
	
		
			
			Major security, observability, and configuration improvements:
## Security Hardening
- Implemented configurable CORS (no more wildcards)
- Added comprehensive auth middleware for admin endpoints
- Enhanced webhook HMAC validation
- Added input validation and rate limiting
- Security headers and CSP policies
## Configuration Management
- Made N8N webhook URL configurable (WHOOSH_N8N_BASE_URL)
- Replaced all hardcoded endpoints with environment variables
- Added feature flags for LLM vs heuristic composition
- Gitea fetch hardening with EAGER_FILTER and FULL_RESCAN options
## API Completeness
- Implemented GetCouncilComposition function
- Added GET /api/v1/councils/{id} endpoint
- Council artifacts API (POST/GET /api/v1/councils/{id}/artifacts)
- /admin/health/details endpoint with component status
- Database lookup for repository URLs (no hardcoded fallbacks)
## Observability & Performance
- Added OpenTelemetry distributed tracing with goal/pulse correlation
- Performance optimization database indexes
- Comprehensive health monitoring
- Enhanced logging and error handling
## Infrastructure
- Production-ready P2P discovery (replaces mock implementation)
- Removed unused Redis configuration
- Enhanced Docker Swarm integration
- Added migration files for performance indexes
## Code Quality
- Comprehensive input validation
- Graceful error handling and failsafe fallbacks
- Backwards compatibility maintained
- Following security best practices
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
		
	
		
			
				
	
	
		
			70 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2018 The Go Authors. All rights reserved.
 | |
| // Use of this source code is governed by a BSD-style
 | |
| // license that can be found in the LICENSE file.
 | |
| 
 | |
| //go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd
 | |
| 
 | |
| package unix
 | |
| 
 | |
| import (
 | |
| 	"unsafe"
 | |
| )
 | |
| 
 | |
| // ioctl itself should not be exposed directly, but additional get/set
 | |
| // functions for specific types are permissible.
 | |
| 
 | |
| // IoctlSetInt performs an ioctl operation which sets an integer value
 | |
| // on fd, using the specified request number.
 | |
| func IoctlSetInt(fd int, req uint, value int) error {
 | |
| 	return ioctl(fd, req, uintptr(value))
 | |
| }
 | |
| 
 | |
| // IoctlSetPointerInt performs an ioctl operation which sets an
 | |
| // integer value on fd, using the specified request number. The ioctl
 | |
| // argument is called with a pointer to the integer value, rather than
 | |
| // passing the integer value directly.
 | |
| func IoctlSetPointerInt(fd int, req uint, value int) error {
 | |
| 	v := int32(value)
 | |
| 	return ioctlPtr(fd, req, unsafe.Pointer(&v))
 | |
| }
 | |
| 
 | |
| // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
 | |
| //
 | |
| // To change fd's window size, the req argument should be TIOCSWINSZ.
 | |
| func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
 | |
| 	// TODO: if we get the chance, remove the req parameter and
 | |
| 	// hardcode TIOCSWINSZ.
 | |
| 	return ioctlPtr(fd, req, unsafe.Pointer(value))
 | |
| }
 | |
| 
 | |
| // IoctlSetTermios performs an ioctl on fd with a *Termios.
 | |
| //
 | |
| // The req value will usually be TCSETA or TIOCSETA.
 | |
| func IoctlSetTermios(fd int, req uint, value *Termios) error {
 | |
| 	// TODO: if we get the chance, remove the req parameter.
 | |
| 	return ioctlPtr(fd, req, unsafe.Pointer(value))
 | |
| }
 | |
| 
 | |
| // IoctlGetInt performs an ioctl operation which gets an integer value
 | |
| // from fd, using the specified request number.
 | |
| //
 | |
| // A few ioctl requests use the return value as an output parameter;
 | |
| // for those, IoctlRetInt should be used instead of this function.
 | |
| func IoctlGetInt(fd int, req uint) (int, error) {
 | |
| 	var value int
 | |
| 	err := ioctlPtr(fd, req, unsafe.Pointer(&value))
 | |
| 	return value, err
 | |
| }
 | |
| 
 | |
| func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
 | |
| 	var value Winsize
 | |
| 	err := ioctlPtr(fd, req, unsafe.Pointer(&value))
 | |
| 	return &value, err
 | |
| }
 | |
| 
 | |
| func IoctlGetTermios(fd int, req uint) (*Termios, error) {
 | |
| 	var value Termios
 | |
| 	err := ioctlPtr(fd, req, unsafe.Pointer(&value))
 | |
| 	return &value, err
 | |
| }
 |