Minio and proper ssl - #1318
Open
tagantank wants to merge 2 commits into
Open
Conversation
…Total Cache
- Configuration key `cdn.s3_compatible.storage_type` in `ConfigKeys.php`
- UI dropdown for storage type selection (Auto/AWS/MinIO) in CDN settings
- Support for path-style URLs (MinIO) and virtual-hosted-style URLs (AWS S3)
- Automatic SSL detection based on port 443 in endpoint
- Separate port handling in S3 API requests
- Modified `Cdn_Core.php` to pass `storage_type` to engine configuration
- Updated `CdnEngine_S3_Compatible.php`:
- Proper SSL detection from configuration
- Automatic SSL detection by port 443
- Pass `storage_type` parameter to S3Compatible class
- Updated `lib/S3Compatible.php`:
- Store port separately from hostname (`$endpointPort` static property)
- Store storage type (`$storageType` static property)
- URL style determination based on `storage_type`:
- `aws`: virtual-hosted-style (bucket.host/path)
- `minio`: path-style (host:port/bucket/path)
- `auto`: automatic detection by endpoint domain
- Proper port handling in URL construction (without duplication)
- Proper Host header formation (without port for virtual-hosted-style)
- Fixed 404 error when uploading to MinIO (incorrect URL style)
- Fixed 400 error when uploading to MinIO (incorrect Host header and path construction)
- Fixed parse error in `S3Compatible.php` after applying patches
- Added `setStorageType()` static method to `S3Compatible` class
- Modified `S3Request` constructor to use `storage_type` for URL style determination
- Updated `getResponse()` method to include port in URL when needed
- Port extraction from endpoint in `__construct()` and `setEndpoint()` methods
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1318 +/- ##
============================================
- Coverage 1.54% 1.54% -0.01%
- Complexity 20415 20431 +16
============================================
Files 636 636
Lines 101964 102024 +60
============================================
Hits 1579 1579
- Misses 100385 100445 +60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
When trying to upload files to MinIO using the S3 Compatible engine, I experienced:
Root Causes
Proposed Solution
I’ve created a patch that adds:
Storage Type Selection: New cdn.s3_compatible.storage_type config option:
UI Enhancement: Dropdown field in CDN settings for easy selection
Proper SSL Detection:
Port Extraction:
Patch Details
Files Modified: 5
Backward Compatibility: Fully compatible – defaults to ‘auto’ mode
Tested With: