Permalink
Browse files

Fixing secure for S3 and uploader

  • Loading branch information...
1 parent 5b4691d commit 60db0e61e4d98d1555d36c631e822f55a9288af2 @ghecquet ghecquet committed Sep 29, 2016
@@ -57,7 +57,7 @@ public static function getResolvedOptionsForNode($node)
$options = [
"TYPE" => "s3"
];
- $optKeys = ["API_KEY", "SECRET_KEY", "SIGNATURE_VERSION", "STORAGE_URL", "REGION", "PROXY", "API_VERSION", "VHOST_NOT_SUPPORTED"];
+ $optKeys = ["API_KEY", "SECRET_KEY", "CONTAINER", "SIGNATURE_VERSION", "STORAGE_URL", "REGION", "PROXY", "API_VERSION", "VHOST_NOT_SUPPORTED"];
foreach($optKeys as $key){
$options[$key] = $repository->getContextOption($context, $key);
}
@@ -683,19 +683,23 @@ Class.create("XHRUploader", {
uri += '&' + queryStringParam;
}
} else {
-
+
+ var secure = this.configs.get("BOOSTER_MAIN_SECURE");
+ 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']){
+ secure = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE'];
+ }
var host = this.configs.get("BOOSTER_MAIN_HOST");
- 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']){
- host = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST'];
+ 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']){
+ host = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST'];
}
var port = this.configs.get("BOOSTER_MAIN_PORT");
- 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']){
- port = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT'];
+ 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']){
+ port = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT'];
}
xhr.withCredentials = true;
- uri = "http"+(this.configs.get("UPLOAD_SECURE")?"s":"")+"://"+host+":"+port+"/"+this.configs.get("UPLOAD_PATH")+"/"+pydio.user.activeRepository + currentDir + item.file.name;
+ uri = "http"+(secure?"s":"")+"://"+host+":"+port+"/"+this.configs.get("UPLOAD_PATH")+"/"+pydio.user.activeRepository + currentDir + item.file.name;
}
@@ -184,21 +184,25 @@
tryAlternativeUpload(completeCallback, progressCallback, errorCallback){
let configs = this.getMqConfigs();
+ var secure = configs.get("BOOSTER_MAIN_SECURE");
+ if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE']){
+ secure = this.configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_SECURE'];
+ }
var host = configs.get("BOOSTER_MAIN_HOST");
- if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_ws_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST']){
- host = configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_HOST'];
+ if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST']){
+ host = configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_HOST'];
}
var port = configs.get("BOOSTER_MAIN_PORT");
- if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT']){
- port = configs.get("BOOSTER_UPLOAD_ADVANCED")['WS_PORT'];
+ if(configs.get("BOOSTER_UPLOAD_ADVANCED") && configs.get("BOOSTER_UPLOAD_ADVANCED")['booster_upload_advanced'] === 'custom' && configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT']){
+ port = configs.get("BOOSTER_UPLOAD_ADVANCED")['UPLOAD_PORT'];
}
let fullPath = this._targetNode.getPath();
if(this._relativePath) {
fullPath += PathUtils.getDirname(this._relativePath);
}
fullPath += '/' + PathUtils.getBasename(this._file.name);
- let url = "http"+(configs.get("UPLOAD_SECURE")?"s":"")+"://"+host+":"+port+"/"+configs.get("UPLOAD_PATH")+"/"+this._repositoryId + fullPath;
+ let url = "http"+(secure?"s":"")+"://"+host+":"+port+"/"+configs.get("UPLOAD_PATH")+"/"+this._repositoryId + fullPath;
let queryString = '';
let overwriteStatus = UploaderConfigs.getInstance().getOption("DEFAULT_EXISTING", "upload_existing");
if(overwriteStatus === 'rename') {

0 comments on commit 60db0e6

Please sign in to comment.