repman-io / repman

Repman - PHP Repository Manager: packagist proxy and host for private packages
https://repman.io
MIT License
515 stars 107 forks source link

Feature: Allow custom S3 endpoint #534

Closed xvilo closed 2 years ago

xvilo commented 2 years ago

Allow a custom S3 endpoint, used when not using AWS but a different S3 provider that is AWS compatible.

codecov[bot] commented 2 years ago

Codecov Report

Merging #534 (d484261) into master (174c381) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #534   +/-   ##
=========================================
  Coverage     99.32%   99.33%           
- Complexity     1884     1885    +1     
=========================================
  Files           300      300           
  Lines          5970     5973    +3     
=========================================
+ Hits           5930     5933    +3     
  Misses           40       40           
Impacted Files Coverage Δ
src/Service/Integration/Aws/S3AdapterFactory.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 174c381...d484261. Read the comment docs.

xvilo commented 2 years ago

Using the following environment variables, I was able to save files correctly to S3

STORAGE_SOURCE=storage.s3
STORAGE_AWS_BUCKET=repman
STORAGE_AWS_REGION=eu-central-1
STORAGE_AWS_OPAQUE_AUTH=true
STORAGE_AWS_KEY='*************'
STORAGE_AWS_SECRET='*************'
STORAGE_AWS_ENDPOINT="https://s3.example.com:443"

PROXY_DIST_DIR='/%kernel.environment%/proxy'
PACKAGES_DIST_DIR='/%kernel.environment%/repo'
SECURITY_ADVISORIES_DB_DIR='/%kernel.environment%/security-advisories'

S3 browser through Mountain duck on MacOS:

Screenshot 2022-01-05 at 09 27 44
xvilo commented 2 years ago

@akondas The following PR has been locally tested and verified as correctly working for our internal S3 set-up. Should work with most if not all Minio instances out there. Could you please review and possibly approve + merge this new feature?

If you're not the right person for this, could you mention the correct person(s) for this?