Add comprehensive configuration and testing for HMAC File Server 3.2

- Introduced configuration files for Docker, Podman, and SystemD deployments.
- Implemented a comprehensive test suite for HMAC validation, file uploads, and network resilience.
- Added debugging scripts for live monitoring of upload issues and service status.
- Created minimal configuration for testing purposes.
- Developed multiple test scripts to validate HMAC calculations and response handling.
- Enhanced upload tests to cover various scenarios including invalid HMAC and unsupported file extensions.
- Improved logging and error analysis capabilities for better diagnostics.
This commit is contained in:
2025-07-20 18:04:23 +00:00
parent f8e4d8fcba
commit 68ede52336
37 changed files with 2754 additions and 591 deletions

View File

@ -682,21 +682,30 @@ func setupRouter() *http.ServeMux {
// Catch-all handler for all upload protocols (v, v2, token, v3)
// This must be added last as it matches all paths
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Infof("🔍 ROUTER DEBUG: Catch-all handler called - method:%s path:%s query:%s", r.Method, r.URL.Path, r.URL.RawQuery)
// Handle PUT requests for all upload protocols
if r.Method == http.MethodPut {
query := r.URL.Query()
log.Infof("🔍 ROUTER DEBUG: Query parameters - v:%s v2:%s v3:%s token:%s expires:%s",
query.Get("v"), query.Get("v2"), query.Get("v3"), query.Get("token"), query.Get("expires"))
// Check if this is a v3 request (mod_http_upload_external)
if query.Get("v3") != "" && query.Get("expires") != "" {
log.Info("🔍 ROUTER DEBUG: Routing to handleV3Upload")
handleV3Upload(w, r)
return
}
// Check if this is a legacy protocol request (v, v2, token)
if query.Get("v") != "" || query.Get("v2") != "" || query.Get("token") != "" {
log.Info("🔍 ROUTER DEBUG: Routing to handleLegacyUpload")
handleLegacyUpload(w, r)
return
}
log.Info("🔍 ROUTER DEBUG: PUT request with no matching protocol parameters")
}
// Handle GET/HEAD requests for downloads