Merge pull request #216 from camjac251/master

Add S3 Endpoint Support
This commit is contained in:
Sergio Brighenti 2020-05-14 13:41:17 +02:00 committed by GitHub
commit 45cea0e794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View file

@ -54,6 +54,7 @@ return [
'secret' => $config['storage']['secret'],
],
'region' => $config['storage']['region'],
'endpoint' => $config['storage']['endpoint'],
'version' => 'latest',
'@http' => ['stream' => true],
]);

View file

@ -134,6 +134,7 @@ $app->post('/', function (Request $request, Response $response, \DI\Container $c
$config['storage']['key'] = param($request, 'storage_key');
$config['storage']['secret'] = param($request, 'storage_secret');
$config['storage']['region'] = param($request, 'storage_region');
$config['storage']['endpoint'] = !empty(param($request, 'storage_endpoint')) ? param($request, 'storage_endpoint') : null;
$config['storage']['bucket'] = param($request, 'storage_bucket');
$config['storage']['path'] = param($request, 'storage_path');
break;

View file

@ -71,7 +71,7 @@
<select id="storage_driver" name="storage_driver" class="form-control" required>
<option value="local">Local Storage</option>
<option value="ftp">FTP/FTPS</option>
<option value="s3">Amazon AWS S3</option>
<option value="s3">Amazon S3 (or compatible)</option>
<option value="google-cloud">Google Cloud Storage</option>
<option value="dropbox">Dropbox</option>
</select>
@ -101,6 +101,12 @@
<input type="text" class="form-control hook-storage-input" id="storage_region" name="storage_region" placeholder="your-region" autocomplete="off">
</div>
</div>
<div class="form-group row hook-storage">
<label for="storage_region" class="col-sm-3 col-form-label">AWS S3 endpoint</label>
<div class="col-sm-9">
<input type="text" class="form-control hook-storage-input" id="storage_endpoint" name="storage_endpoint" placeholder="optional (for S3-compatible services)" autocomplete="off">
</div>
</div>
<div class="form-group row hook-storage">
<label for="storage_token" class="col-sm-3 col-form-label">Dropbox token</label>
<div class="col-sm-9">

View file

@ -44,6 +44,7 @@ $(document).ready(function () {
$('#storage_key').prop('required', 'required').parent().parent().show();
$('#storage_secret').prop('required', 'required').parent().parent().show();
$('#storage_region').prop('required', 'required').parent().parent().show();
$("#storage_endpoint").parent().parent().show();
$('#storage_bucket').prop('required', 'required').parent().parent().show();
break;
case 'google-cloud':