Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 60db0e6

Browse files
committed
Fixing secure for S3 and uploader
1 parent 5b4691d commit 60db0e6

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

core/src/plugins/access.s3/S3AccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function getResolvedOptionsForNode($node)
5757
$options = [
5858
"TYPE" => "s3"
5959
];
60-
$optKeys = ["API_KEY", "SECRET_KEY", "SIGNATURE_VERSION", "STORAGE_URL", "REGION", "PROXY", "API_VERSION", "VHOST_NOT_SUPPORTED"];
60+
$optKeys = ["API_KEY", "SECRET_KEY", "CONTAINER", "SIGNATURE_VERSION", "STORAGE_URL", "REGION", "PROXY", "API_VERSION", "VHOST_NOT_SUPPORTED"];
6161
foreach($optKeys as $key){
6262
$options[$key] = $repository->getContextOption($context, $key);
6363
}

core/src/plugins/uploader.html/class.XHRUploader.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -683,19 +683,23 @@ Class.create("XHRUploader", {
683683
uri += '&' + queryStringParam;
684684
}
685685
} else {
686-
686+
687+
var secure = this.configs.get("BOOSTER_MAIN_SECURE");
688+
if(this.configs.get("BOOSTER_UPLOAD_ADVANCED") && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE']){
689+
secure = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE'];
690+
}
687691
var host = this.configs.get("BOOSTER_MAIN_HOST");
688-
if(this.configs.get("BOOSTER_UPLOAD_ADVANCED") && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_ws_advanced'] === 'custom' && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST']){
689-
host = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST'];
692+
if(this.configs.get("BOOSTER_UPLOAD_ADVANCED") && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST']){
693+
host = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST'];
690694
}
691695
var port = this.configs.get("BOOSTER_MAIN_PORT");
692-
if(this.configs.get("BOOSTER_UPLOAD_ADVANCED") && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT']){
693-
port = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT'];
696+
if(this.configs.get("BOOSTER_UPLOAD_ADVANCED") && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT']){
697+
port = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT'];
694698
}
695699

696700
xhr.withCredentials = true;
697701

698-
uri = "http"+(this.configs.get("UPLOAD_SECURE")?"s":"")+"://"+host+":"+port+"/"+this.configs.get("UPLOAD_PATH")+"/"+pydio.user.activeRepository + currentDir + item.file.name;
702+
uri = "http"+(secure?"s":"")+"://"+host+":"+port+"/"+this.configs.get("UPLOAD_PATH")+"/"+pydio.user.activeRepository + currentDir + item.file.name;
699703
}
700704

701705

core/src/plugins/uploader.html/js/react/UploaderModel.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,25 @@
184184

185185
tryAlternativeUpload(completeCallback, progressCallback, errorCallback){
186186
let configs = this.getMqConfigs();
187+
var secure = configs.get("BOOSTER_MAIN_SECURE");
188+
if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE']){
189+
secure = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE'];
190+
}
187191
var host = configs.get("BOOSTER_MAIN_HOST");
188-
if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_ws_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST']){
189-
host = configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST'];
192+
if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST']){
193+
host = configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST'];
190194
}
191195
var port = configs.get("BOOSTER_MAIN_PORT");
192-
if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT']){
193-
port = configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT'];
196+
if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT']){
197+
port = configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT'];
194198
}
195199
let fullPath = this._targetNode.getPath();
196200
if(this._relativePath) {
197201
fullPath += PathUtils.getDirname(this._relativePath);
198202
}
199203
fullPath += '/' + PathUtils.getBasename(this._file.name);
200204

201-
let url = "http"+(configs.get("UPLOAD_SECURE")?"s":"")+"://"+host+":"+port+"/"+configs.get("UPLOAD_PATH")+"/"+this._repositoryId + fullPath;
205+
let url = "http"+(secure?"s":"")+"://"+host+":"+port+"/"+configs.get("UPLOAD_PATH")+"/"+this._repositoryId + fullPath;
202206
let queryString = '';
203207
let overwriteStatus = UploaderConfigs.getInstance().getOption("DEFAULT_EXISTING", "upload_existing");
204208
if(overwriteStatus === 'rename') {

0 commit comments

Comments
 (0)