Unverified Commit 2744b45f authored by Anil Gupta's avatar Anil Gupta Committed by GitHub
Browse files

Issue #KN-439 merge: Merge pull request #1816 from AmiableAnil/csp-migration

Issue #KN-439 feat: Cloud agnostic changes
Showing with 16 additions and 27 deletions
+16 -27
......@@ -248,11 +248,11 @@ learning.content.type.not.copied.list=["Asset"]
#Youtube License Validation Regex Pattern
youtube.license.regex.pattern=["\\?vi?=([^&]*)", "watch\\?.*v=([^&]*)", "(?:embed|vi?)/([^/?]*)","^([A-Za-z0-9\\-\\_]*)"]
#Azure Storage details
cloud_storage_type="{{ cloud_store }}"
azure_storage_key="{{sunbird_public_storage_account_name}}"
azure_storage_secret="{{sunbird_public_storage_account_key}}"
azure_storage_container="{{ azure_public_container }}"
#Cloud Storage details
cloud_storage_type="{{ cloud_service_provider }}"
cloud_storage_key="{{ cloud_public_storage_accountname }}"
cloud_storage_secret="{{ cloud_public_storage_secret }}"
cloud_storage_container="{{ cloud_storage_content_bucketname }}"
installation.id="{{ instance_name }}"
......
......@@ -76,11 +76,11 @@ content.postpublish.topic="{{ env }}.content.postpublish.request"
search.lms_es_conn_info="{{ search_lms_index_host }}"
#Azure Storage details
cloud_storage_type="{{ cloud_store }}"
azure_storage_key="{{sunbird_public_storage_account_name}}"
azure_storage_secret="{{sunbird_public_storage_account_key}}"
azure_storage_container="{{ azure_public_container }}"
#Cloud Storage details
cloud_storage_type="{{ cloud_service_provider }}"
cloud_storage_key="{{ cloud_public_storage_accountname }}"
cloud_storage_secret="{{ cloud_public_storage_secret }}"
cloud_storage_container="{{ cloud_storage_content_bucketname }}"
contentTypeToPrimaryCategory {
ClassroomTeachingVideo: "Explanation Content"
......
......@@ -24,18 +24,9 @@ private static BaseStorageService storageService = null;
private static String cloudStoreType = Platform.config.getString("cloud_storage_type");
static {
if(StringUtils.equalsIgnoreCase(cloudStoreType, "azure")) {
String storageKey = Platform.config.getString("azure_storage_key");
String storageSecret = Platform.config.getString("azure_storage_secret");
storageService = StorageServiceFactory.getStorageService(new StorageConfig(cloudStoreType, storageKey, storageSecret));
}else if(StringUtils.equalsIgnoreCase(cloudStoreType, "aws")) {
String storageKey = Platform.config.getString("aws_storage_key");
String storageSecret = Platform.config.getString("aws_storage_secret");
storageService = StorageServiceFactory.getStorageService(new StorageConfig(cloudStoreType, storageKey, storageSecret));
}else {
throw new ServerException("ERR_INVALID_CLOUD_STORAGE", "Error while initialising cloud storage");
}
String storageKey = Platform.config.getString("cloud_storage_key");
String storageSecret = Platform.config.getString("cloud_storage_secret");
storageService = StorageServiceFactory.getStorageService(new StorageConfig(cloudStoreType, storageKey, storageSecret));
}
public static BaseStorageService getCloudStoreService() {
......@@ -43,10 +34,8 @@ private static String cloudStoreType = Platform.config.getString("cloud_storage_
}
public static String getContainerName() {
if(StringUtils.equalsIgnoreCase(cloudStoreType, "azure")) {
return Platform.config.getString("azure_storage_container");
}else if(StringUtils.equalsIgnoreCase(cloudStoreType, "aws")) {
return S3PropertyReader.getProperty("aws_storage_container");
if(Platform.config.hasPath("cloud_storage_container") && !Platform.config.getString("cloud_storage_container").equalsIgnoreCase("")) {
return Platform.config.getString("cloud_storage_container");
}else {
throw new ServerException("ERR_INVALID_CLOUD_STORAGE", "Error while getting container name");
}
......
......@@ -19,7 +19,7 @@
<version.compiler.plugin>2.3.1</version.compiler.plugin>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<cloud.store.version>1.2.8</cloud.store.version>
<cloud.store.version>1.4.3</cloud.store.version>
</properties>
<modules>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment