From b3634bc25be75cb9c2ae27193ab862ccd9ce2ba8 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Tue, 12 Nov 2019 14:26:59 +0530 Subject: [PATCH 01/10] Issue #000 feat: Set default values for create content --- .gitignore | 1 + .../sunbird/actors/content/ContentActor.java | 43 +++++++++++++++++-- .../operation/SearchAsyncOperations.java | 2 +- .../org/sunbird/common/ContentParams.java | 5 +++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 platform-core/platform-common/src/main/java/org/sunbird/common/ContentParams.java diff --git a/.gitignore b/.gitignore index 3b260408f..55eaad624 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store **/target/** **/.idea/** +**/*.iml \ No newline at end of file diff --git a/learning-api/orchestrator/src/main/java/org/sunbird/actors/content/ContentActor.java b/learning-api/orchestrator/src/main/java/org/sunbird/actors/content/ContentActor.java index 037022ab5..f7da436d0 100644 --- a/learning-api/orchestrator/src/main/java/org/sunbird/actors/content/ContentActor.java +++ b/learning-api/orchestrator/src/main/java/org/sunbird/actors/content/ContentActor.java @@ -1,19 +1,19 @@ package org.sunbird.actors.content; -import akka.dispatch.Futures; import akka.dispatch.Mapper; +import org.apache.commons.lang3.StringUtils; import org.sunbird.actor.core.BaseActor; +import org.sunbird.common.ContentParams; import org.sunbird.common.dto.Request; import org.sunbird.common.dto.Response; import org.sunbird.common.dto.ResponseHandler; +import org.sunbird.common.exception.ClientException; import org.sunbird.graph.dac.model.Node; import org.sunbird.graph.nodes.DataNode; import scala.concurrent.Future; public class ContentActor extends BaseActor { - public static String objectType = "Content"; - public static String version = "1.0"; public Future onReceive(Request request) throws Throwable { String operation = request.getOperation(); @@ -25,6 +25,7 @@ public Future onReceive(Request request) throws Throwable { } private Future create(Request request) throws Exception { + populateDefaultersForCreation(request); return DataNode.create(request, getContext().dispatcher()) .map(new Mapper() { @Override @@ -40,4 +41,40 @@ public Response apply(Node node) { private void update(Request request) { } + private static void populateDefaultersForCreation(Request request) { + setDefaultsBasedOnMimeType(request, ContentParams.create.name()); + validateLicense(request); + } + + private static void validateLicense(Request request) { + //TODO: for license validation + } + + private static void setDefaultsBasedOnMimeType(Request request, String operation) { + + String mimeType = (String) request.get(ContentParams.mimeType.name()); + if (StringUtils.isNotBlank(mimeType) && operation.equalsIgnoreCase(ContentParams.create.name())) { + if(StringUtils.equalsIgnoreCase("application/vnd.ekstep.plugin-archive", mimeType)) { + String code = (String) request.get(ContentParams.code.name()); + if (null == code || StringUtils.isBlank(code)) + throw new ClientException("ERR_PLUGIN_CODE_REQUIRED", "Unique code is mandatory for plugins"); + request.put(ContentParams.identifier.name(), request.get(ContentParams.code.name())); + } else { + request.put(ContentParams.osId.name(), "org.ekstep.quiz.app"); + } + + if (mimeType.endsWith("archive") || mimeType.endsWith("vnd.ekstep.content-collection") + || mimeType.endsWith("epub")) + request.put(ContentParams.contentEncoding.name(), ContentParams.gzip.name()); + else + request.put(ContentParams.contentEncoding.name(), ContentParams.identity.name()); + + if (mimeType.endsWith("youtube") || mimeType.endsWith("x-url")) + request.put(ContentParams.contentDisposition.name(), ContentParams.online.name()); + else + request.put(ContentParams.contentDisposition.name(), ContentParams.inline.name()); + } + } + + } diff --git a/ontology-engine/graph-dac-api/src/main/java/org/sunbird/graph/service/operation/SearchAsyncOperations.java b/ontology-engine/graph-dac-api/src/main/java/org/sunbird/graph/service/operation/SearchAsyncOperations.java index 3f16d949f..b4d106017 100644 --- a/ontology-engine/graph-dac-api/src/main/java/org/sunbird/graph/service/operation/SearchAsyncOperations.java +++ b/ontology-engine/graph-dac-api/src/main/java/org/sunbird/graph/service/operation/SearchAsyncOperations.java @@ -205,7 +205,7 @@ public static Future getNodeByUniqueId(String graphId, String nodeId, Bool "Error! Something went wrong while fetching node object. ", error); }); - return FutureConverters.toScala(cs) + return FutureConverters.toScala(cs); } } diff --git a/platform-core/platform-common/src/main/java/org/sunbird/common/ContentParams.java b/platform-core/platform-common/src/main/java/org/sunbird/common/ContentParams.java new file mode 100644 index 000000000..f40cd9473 --- /dev/null +++ b/platform-core/platform-common/src/main/java/org/sunbird/common/ContentParams.java @@ -0,0 +1,5 @@ +package org.sunbird.common; + +public enum ContentParams { + contentEncoding,gzip,identity,contentDisposition,online,inline,identifier,code,osId,mimeType,create +} From 6b27eedfe7c1dd05333c3de656ce0fd7657febc6 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Tue, 12 Nov 2019 14:35:14 +0530 Subject: [PATCH 02/10] Issue #000 feat: Changed learning-manager to learning-service --- learning-api/learning-manager/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/learning-api/learning-manager/pom.xml b/learning-api/learning-manager/pom.xml index b496cc69e..1b44a810a 100755 --- a/learning-api/learning-manager/pom.xml +++ b/learning-api/learning-manager/pom.xml @@ -1,8 +1,8 @@ 4.0.0 - learning-manager - learning-manager + learning-service + learning-service play2 org.sunbird From 644f6fabe1306f2b34aa17737f5beb06f17ffb5e Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Tue, 12 Nov 2019 14:43:18 +0530 Subject: [PATCH 03/10] Issue #000 feat: Changed learning-manager to learning-service --- learning-api/{learning-manager => learning-service}/.gitignore | 0 .../{learning-manager => learning-service}/app/Module.scala | 0 .../app/controllers/BaseController.scala | 0 .../app/controllers/HealthController.scala | 0 .../app/controllers/v3/ContentController.scala | 0 .../app/utils/ActorNames.scala | 0 .../app/utils/JavaJsonUtils.scala | 0 .../conf/application.conf | 0 .../{learning-manager => learning-service}/conf/logback.xml | 0 learning-api/{learning-manager => learning-service}/conf/routes | 0 .../conf/schemas/content-1.0/config.json | 0 .../conf/schemas/content-1.0/schema.json | 0 learning-api/{learning-manager => learning-service}/pom.xml | 0 learning-api/pom.xml | 2 +- 14 files changed, 1 insertion(+), 1 deletion(-) rename learning-api/{learning-manager => learning-service}/.gitignore (100%) rename learning-api/{learning-manager => learning-service}/app/Module.scala (100%) rename learning-api/{learning-manager => learning-service}/app/controllers/BaseController.scala (100%) rename learning-api/{learning-manager => learning-service}/app/controllers/HealthController.scala (100%) rename learning-api/{learning-manager => learning-service}/app/controllers/v3/ContentController.scala (100%) rename learning-api/{learning-manager => learning-service}/app/utils/ActorNames.scala (100%) rename learning-api/{learning-manager => learning-service}/app/utils/JavaJsonUtils.scala (100%) rename learning-api/{learning-manager => learning-service}/conf/application.conf (100%) rename learning-api/{learning-manager => learning-service}/conf/logback.xml (100%) rename learning-api/{learning-manager => learning-service}/conf/routes (100%) rename learning-api/{learning-manager => learning-service}/conf/schemas/content-1.0/config.json (100%) rename learning-api/{learning-manager => learning-service}/conf/schemas/content-1.0/schema.json (100%) rename learning-api/{learning-manager => learning-service}/pom.xml (100%) diff --git a/learning-api/learning-manager/.gitignore b/learning-api/learning-service/.gitignore similarity index 100% rename from learning-api/learning-manager/.gitignore rename to learning-api/learning-service/.gitignore diff --git a/learning-api/learning-manager/app/Module.scala b/learning-api/learning-service/app/Module.scala similarity index 100% rename from learning-api/learning-manager/app/Module.scala rename to learning-api/learning-service/app/Module.scala diff --git a/learning-api/learning-manager/app/controllers/BaseController.scala b/learning-api/learning-service/app/controllers/BaseController.scala similarity index 100% rename from learning-api/learning-manager/app/controllers/BaseController.scala rename to learning-api/learning-service/app/controllers/BaseController.scala diff --git a/learning-api/learning-manager/app/controllers/HealthController.scala b/learning-api/learning-service/app/controllers/HealthController.scala similarity index 100% rename from learning-api/learning-manager/app/controllers/HealthController.scala rename to learning-api/learning-service/app/controllers/HealthController.scala diff --git a/learning-api/learning-manager/app/controllers/v3/ContentController.scala b/learning-api/learning-service/app/controllers/v3/ContentController.scala similarity index 100% rename from learning-api/learning-manager/app/controllers/v3/ContentController.scala rename to learning-api/learning-service/app/controllers/v3/ContentController.scala diff --git a/learning-api/learning-manager/app/utils/ActorNames.scala b/learning-api/learning-service/app/utils/ActorNames.scala similarity index 100% rename from learning-api/learning-manager/app/utils/ActorNames.scala rename to learning-api/learning-service/app/utils/ActorNames.scala diff --git a/learning-api/learning-manager/app/utils/JavaJsonUtils.scala b/learning-api/learning-service/app/utils/JavaJsonUtils.scala similarity index 100% rename from learning-api/learning-manager/app/utils/JavaJsonUtils.scala rename to learning-api/learning-service/app/utils/JavaJsonUtils.scala diff --git a/learning-api/learning-manager/conf/application.conf b/learning-api/learning-service/conf/application.conf similarity index 100% rename from learning-api/learning-manager/conf/application.conf rename to learning-api/learning-service/conf/application.conf diff --git a/learning-api/learning-manager/conf/logback.xml b/learning-api/learning-service/conf/logback.xml similarity index 100% rename from learning-api/learning-manager/conf/logback.xml rename to learning-api/learning-service/conf/logback.xml diff --git a/learning-api/learning-manager/conf/routes b/learning-api/learning-service/conf/routes similarity index 100% rename from learning-api/learning-manager/conf/routes rename to learning-api/learning-service/conf/routes diff --git a/learning-api/learning-manager/conf/schemas/content-1.0/config.json b/learning-api/learning-service/conf/schemas/content-1.0/config.json similarity index 100% rename from learning-api/learning-manager/conf/schemas/content-1.0/config.json rename to learning-api/learning-service/conf/schemas/content-1.0/config.json diff --git a/learning-api/learning-manager/conf/schemas/content-1.0/schema.json b/learning-api/learning-service/conf/schemas/content-1.0/schema.json similarity index 100% rename from learning-api/learning-manager/conf/schemas/content-1.0/schema.json rename to learning-api/learning-service/conf/schemas/content-1.0/schema.json diff --git a/learning-api/learning-manager/pom.xml b/learning-api/learning-service/pom.xml similarity index 100% rename from learning-api/learning-manager/pom.xml rename to learning-api/learning-service/pom.xml diff --git a/learning-api/pom.xml b/learning-api/pom.xml index ff9d375f4..c26c8c135 100755 --- a/learning-api/pom.xml +++ b/learning-api/pom.xml @@ -21,7 +21,7 @@ 2.11.8 - learning-manager + learning-service orchestrator From 30fb08a923c8bb1cbf10db10524275be3c3d516f Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Tue, 12 Nov 2019 15:43:07 +0530 Subject: [PATCH 04/10] Issue #000 feat: Updated logback.xml to log all logs to stdout --- .../learning-service/conf/logback.xml | 57 ++++++------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/learning-api/learning-service/conf/logback.xml b/learning-api/learning-service/conf/logback.xml index 7c3291fdc..73529d622 100644 --- a/learning-api/learning-service/conf/logback.xml +++ b/learning-api/learning-service/conf/logback.xml @@ -1,53 +1,28 @@ + + + - - /data/logs/learning_service_mw.log - - /data/logs/learning_service_mw_${timestamp}-%i.log - 1 - 20 - - - 5MB - + %d %msg%n - - 1024 - 0 - true - + + + - - - + + + + - - /data/logs/learning_telemetry_event_mw.log - - /data/logs/learning_telemetry_event_mw_${timestamp}-%i.log - 1 - 20 - - - 5MB - - - %d %msg%n - - - - 1024 - 0 - true - - - - - + + + + + \ No newline at end of file From bb9f3a6d03e255c5c126a8e0ec7bb90ec6c8d945 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 12 Nov 2019 16:25:48 +0530 Subject: [PATCH 05/10] Issue #000 fix: reading schema from a public path. --- .../schema/impl/BaseSchemaValidator.java | 9 +++--- .../schema/impl/JsonSchemaValidator.java | 30 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java index 5619cdadb..2fa3ec59d 100644 --- a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java +++ b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/BaseSchemaValidator.java @@ -14,6 +14,7 @@ import javax.json.JsonReader; import javax.json.JsonReaderFactory; +import java.io.InputStream; import java.io.StringReader; import java.net.URI; import java.nio.file.Path; @@ -37,7 +38,7 @@ public BaseSchemaValidator(String name, String version) { this.name = name; this.version = version; this.schemaReaderFactory = service.createSchemaReaderFactoryBuilder() - .withSchemaResolver(this::resolveSchema) +// .withSchemaResolver(this::resolveSchema) .build(); } @@ -55,11 +56,11 @@ public Config getConfig() { /** * Reads the JSON schema from the specified path. * - * @param path the path to the schema. + * @param stream the InputStream for the schema. * @return the read schema. */ - protected JsonSchema readSchema(Path path) { - try (JsonSchemaReader reader = schemaReaderFactory.createSchemaReader(path)) { + protected JsonSchema readSchema(InputStream stream) { + try (JsonSchemaReader reader = schemaReaderFactory.createSchemaReader(stream)) { return reader.read(); } } diff --git a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/JsonSchemaValidator.java b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/JsonSchemaValidator.java index 937e731e7..233ea6ee9 100644 --- a/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/JsonSchemaValidator.java +++ b/platform-core/schema-validator/src/main/java/org/sunbird/schema/impl/JsonSchemaValidator.java @@ -3,32 +3,34 @@ import com.typesafe.config.ConfigFactory; import org.leadpony.justify.api.JsonSchema; +import java.io.InputStream; import java.net.URI; +import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; public class JsonSchemaValidator extends BaseSchemaValidator { - private static String basePath = "schemas/"; + private static String basePath = "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/schemas/"; public JsonSchemaValidator(String name, String version) throws Exception { super(name, version); - basePath = basePath + name.toLowerCase() + "-" + version + "/"; + basePath = basePath + name.toLowerCase() + "/" + version + "/"; loadSchema(); loadConfig(); } private void loadSchema() throws Exception { - URI uri = getClass().getClassLoader().getResource( basePath + "schema.json").toURI(); - Path schemaPath = Paths.get(uri); - this.schema = readSchema(schemaPath); + System.out.println("Schema path: " + basePath + "schema.json"); + InputStream stream = new URL( basePath + "schema.json").openStream(); + this.schema = readSchema(stream); } private void loadConfig() throws Exception { - URI uri = getClass().getClassLoader().getResource( basePath + "config.json").toURI(); - Path configPath = Paths.get(uri); - this.config = ConfigFactory.parseFile(configPath.toFile()); +// URI uri = getClass().getClassLoader().getResource( basePath + "config.json").toURI(); + System.out.println("Config path: " + basePath + "config.json"); + this.config = ConfigFactory.parseURL(new URL( basePath + "config.json")); } @@ -41,12 +43,12 @@ private void loadConfig() throws Exception { */ public JsonSchema resolveSchema(URI id) { // The schema is available in the local filesystem. - try { - Path path = Paths.get( getClass().getClassLoader().getResource(basePath + id.getPath()).toURI()); - return readSchema(path); - } catch (Exception e) { - e.printStackTrace(); - } +// try { +// Path path = Paths.get( getClass().getClassLoader().getResource(basePath + id.getPath()).toURI()); +// return readSchema(path); +// } catch (Exception e) { +// e.printStackTrace(); +// } return null; } } From 78b10b669768bda37d77937bac97885d9efd5252 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 12 Nov 2019 16:26:48 +0530 Subject: [PATCH 06/10] Issue #SC-1423 feat: learning-service Dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..f023b9410 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:8-jre-alpine +RUN apk update \ + && apk add unzip \ + && apk add curl \ + && adduser -u 1001 -h /home/sunbird/ -D sunbird \ + && mkdir -p /home/sunbird +RUN chown -R sunbird:sunbird /home/sunbird +USER sunbird +COPY ./learning-api/learning-service/target/learning-service-1.0-SNAPSHOT-dist.zip /home/sunbird/ +RUN unzip /home/sunbird/learning-service-1.0-SNAPSHOT-dist.zip -d /home/sunbird/ +RUN rm /home/sunbird/learning-service-1.0-SNAPSHOT-dist.zip +WORKDIR /home/sunbird/ +CMD java -cp '/home/sunbird/learning-service-1.0-SNAPSHOT/lib/*' play.core.server.ProdServerStart /home/sunbird/learning-service-1.0-SNAPSHOT From 584e50e7e8619186091b68dc76d30f3169b6b99a Mon Sep 17 00:00:00 2001 From: amitpriyadarshi Date: Tue, 12 Nov 2019 16:46:18 +0530 Subject: [PATCH 07/10] Issue #SC-1423 feat: Adding jenkins file --- Jenkinsfile | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ build.sh | 11 +++++++++++ 2 files changed, 67 insertions(+) create mode 100644 Jenkinsfile create mode 100755 build.sh diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..9f403b228 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,56 @@ +node('build-slave') { + try { + String ANSI_GREEN = "\u001B[32m" + String ANSI_NORMAL = "\u001B[0m" + String ANSI_BOLD = "\u001B[1m" + String ANSI_RED = "\u001B[31m" + String ANSI_YELLOW = "\u001B[33m" + + ansiColor('xterm') { + stage('Checkout') { + if (!env.hub_org) { + println(ANSI_BOLD + ANSI_RED + "Uh Oh! Please set a Jenkins environment variable named hub_org with value as registery/sunbidrded" + ANSI_NORMAL) + error 'Please resolve the errors and rerun..' + } else + println(ANSI_BOLD + ANSI_GREEN + "Found environment variable named hub_org with value as: " + hub_org + ANSI_NORMAL) + } + cleanWs() + if (params.github_release_tag == "") { + checkout scm + commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + branch_name = sh(script: 'git name-rev --name-only HEAD | rev | cut -d "/" -f1| rev', returnStdout: true).trim() + build_tag = branch_name + "_" + commit_hash + println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag not specified, using the latest commit hash: " + commit_hash + ANSI_NORMAL) + } else { + def scmVars = checkout scm + checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/$params.github_release_tag"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]] + build_tag = params.github_release_tag + println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag specified, building from tag: " + params.github_release_tag + ANSI_NORMAL) + } + echo "build_tag: " + build_tag + + stage('Build') { + env.NODE_ENV = "build" + print "Environment will be : ${env.NODE_ENV}" + sh 'mvn clean install -DskipTests=true ' + + } + + stage('Package') { + dir('learning-api') { + sh 'mvn play2:run -pl learning-service' + } + sh('chmod 777 ./build.sh') + sh("./build.sh ${build_tag} ${env.NODE_NAME} ${hub_org}") + } + stage('ArchiveArtifacts') { + archiveArtifacts "metadata.json" + currentBuild.description = "${build_tag}" + } + } + } + catch (err) { + currentBuild.result = "FAILURE" + throw err + } +} diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..e5f4616d4 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Build script +set -eo pipefail + +build_tag=$1 +name=learning_service +node=$2 +org=$3 + +docker build -f ./Dockerfile --label commitHash=$(git rev-parse --short HEAD) -t ${org}/${name}:${build_tag} . +echo {\"image_name\" : \"${name}\", \"image_tag\" : \"${build_tag}\", \"node_name\" : \"$node\"} > metadata.json From 2dfc78d41a9652b276f52f28cca50e4575290738 Mon Sep 17 00:00:00 2001 From: amitpriyadarshi Date: Tue, 12 Nov 2019 16:52:45 +0530 Subject: [PATCH 08/10] Issue #SC-1423 feat: Adding jenkins file --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index e5f4616d4..fe7888c0b 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ set -eo pipefail build_tag=$1 -name=learning_service +name=learning-service node=$2 org=$3 From 35198f74ab8881bf958692764c8661961f6790fe Mon Sep 17 00:00:00 2001 From: amitpriyadarshi Date: Tue, 12 Nov 2019 17:23:31 +0530 Subject: [PATCH 09/10] Issue #SC-1423 feat: Adding jenkins file --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f403b228..46401792f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ node('build-slave') { stage('Package') { dir('learning-api') { - sh 'mvn play2:run -pl learning-service' + sh 'mvn play2:dist -pl learning-service' } sh('chmod 777 ./build.sh') sh("./build.sh ${build_tag} ${env.NODE_NAME} ${hub_org}") From d48ec8a7cddd32cb572747bb8c9829da8f8f219d Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Wed, 13 Nov 2019 11:51:43 +0530 Subject: [PATCH 10/10] Issue #000 fix: remove local configuration --- .../learning-service/conf/application.conf | 207 ------------------ 1 file changed, 207 deletions(-) diff --git a/learning-api/learning-service/conf/application.conf b/learning-api/learning-service/conf/application.conf index 8eb98e3ee..87e85728d 100644 --- a/learning-api/learning-service/conf/application.conf +++ b/learning-api/learning-service/conf/application.conf @@ -270,210 +270,3 @@ play.filters { #allowed = [".example.com", "localhost:9000"] } } - -# Learning-Service Configuration -content.metadata.visibility.parent=["textbookunit", "courseunit", "lessonplanunit"] - -# Cassandra Configuration -content.keyspace.name=content_store -content.keyspace.table=content_data -#TODO: Add Configuration for assessment. e.g: question_data -orchestrator.keyspace.name=script_store -orchestrator.keyspace.table=script_data -cassandra.lp.connection="127.0.0.1:9042,127.0.0.2:9042,127.0.0.3:9042" -cassandra.lpa.connection="127.0.0.1:9042,127.0.0.2:9042,127.0.0.3:9042" - -# Redis Configuration -redis.host=localhost -redis.port=6379 -redis.maxConnections=128 - -#Condition to enable publish locally -content.publish_task.enabled=true - -#directory location where store unzip file -dist.directory=/data/tmp/dist/ -output.zipfile=/data/tmp/story.zip -source.folder=/data/tmp/temp2/ -save.directory=/data/tmp/temp/ - -# Content 2 vec analytics URL -CONTENT_TO_VEC_URL="http://172.31.27.233:9000/content-to-vec" - -# FOR CONTENT WORKFLOW PIPELINE (CWP) - -#--Content Workflow Pipeline Mode -OPERATION_MODE=TEST - -#--Maximum Content Package File Size Limit in Bytes (50 MB) -MAX_CONTENT_PACKAGE_FILE_SIZE_LIMIT=52428800 - -#--Maximum Asset File Size Limit in Bytes (20 MB) -MAX_ASSET_FILE_SIZE_LIMIT=20971520 - -#--No of Retry While File Download Fails -RETRY_ASSET_DOWNLOAD_COUNT=1 - -#Google-vision-API -google.vision.tagging.enabled = false - -#Orchestrator env properties -env="https://dev.ekstep.in/api/learning" - -#Current environment -cloud_storage.env=dev - - -#Folder configuration -cloud_storage.content.folder=content -cloud_storage.asset.folder=assets -cloud_storage.artefact.folder=artifact -cloud_storage.bundle.folder=bundle -cloud_storage.media.folder=media -cloud_storage.ecar.folder=ecar_files - -# Media download configuration -content.media.base.url="https://dev.open-sunbird.org" -plugin.media.base.url="https://dev.open-sunbird.org" - -# Configuration -graph.dir=/data/graphDB -akka.request_timeout=30 -environment.id=10000000 -graph.ids=["domain"] -graph.passport.key.base=31b6fd1c4d64e745c867e61a45edc34a -route.domain="bolt://localhost:7687" -route.bolt.write.domain="bolt://localhost:7687" -route.bolt.read.domain="bolt://localhost:7687" -route.bolt.comment.domain="bolt://localhost:7687" -route.all="bolt://localhost:7687" -route.bolt.write.all="bolt://localhost:7687" -route.bolt.read.all="bolt://localhost:7687" -route.bolt.comment.all="bolt://localhost:7687" - -shard.id=1 -platform.auth.check.enabled=false -platform.cache.ttl=3600000 - -# Elasticsearch properties -search.es_conn_info="localhost:9200" -search.fields.query=["name^100","title^100","lemma^100","code^100","tags^100","domain","subject","description^10","keywords^25","ageGroup^10","filter^10","theme^10","genre^10","objects^25","contentType^100","language^200","teachingMode^25","skills^10","learningObjective^10","curriculum^100","gradeLevel^100","developer^100","attributions^10","owner^50","text","words","releaseNotes"] -search.fields.date=["lastUpdatedOn","createdOn","versionDate","lastSubmittedOn","lastPublishedOn"] -search.batch.size=500 -search.connection.timeout=30 -platform-api-url="http://localhost:8080/language-service" -MAX_ITERATION_COUNT_FOR_SAMZA_JOB=2 - - -# DIAL Code Configuration -dialcode.keyspace.name="dialcode_store" -dialcode.keyspace.table="dial_code" -dialcode.max_count=1000 - -# System Configuration -system.config.keyspace.name="dialcode_store" -system.config.table="system_config" - -#Publisher Configuration -publisher.keyspace.name="dialcode_store" -publisher.keyspace.table="publisher" - -#DIAL Code Generator Configuration -dialcode.strip.chars="0" -dialcode.length=6.0 -dialcode.large.prime_number=1679979167 - -#DIAL Code ElasticSearch Configuration -dialcode.index=true -dialcode.object_type="DialCode" - -framework.max_term_creation_limit=200 - -# Enable Suggested Framework in Get Channel API. -channel.fetch.suggested_frameworks=true - -# Kafka configuration details -kafka.topics.instruction="local.learning.job.request" -kafka.urls="localhost:9092" - -#Youtube Standard Licence Validation -learning.content.youtube.validate.license=true -learning.content.youtube.application.name=fetch-youtube-license -youtube.license.regex.pattern=["\\?vi?=([^&]*)", "watch\\?.*v=([^&]*)", "(?:embed|vi?)/([^/?]*)","^([A-Za-z0-9\\-\\_]*)"] - -#Top N Config for Search Telemetry -telemetry_env=dev -telemetry.search.topn=5 - -installation.id=ekstep - -learning.content.copy.invalid_status_list=["Flagged","FlaggedDraft","FraggedReview","Retired", "Processing"] -learning.content.copy.props_to_remove=["downloadUrl", "artifactUrl", "variants", - "createdOn", "collections", "children", "lastUpdatedOn", "SYS_INTERNAL_LAST_UPDATED_ON", - "versionKey", "s3Key", "status", "pkgVersion", "toc_url", "mimeTypesCount", - "contentTypesCount", "leafNodesCount", "childNodes", "prevState", "lastPublishedOn", - "flagReasons", "compatibilityLevel", "size", "publishChecklist", "publishComment", - "LastPublishedBy", "rejectReasons", "rejectComment", "gradeLevel", "subject", - "medium", "board", "topic", "purpose", "subtopic", "contentCredits", - "owner", "collaborators", "creators", "contributors", "badgeAssertions", "dialcodes", - "concepts", "keywords", "reservedDialcodes", "dialcodeRequired", "leafNodes"] - -# Metadata to be added to copied content from origin -learning.content.copy.origin_data=["name", "author", "license", "organisation"] - -learning.content.type.not.copied.list=["Asset"] - -channel.default="in.ekstep" - -# DialCode Link API Config -learning.content.link_dialcode_validation=true -dialcode.api.search.url="http://localhost:8080/learning-service/v3/dialcode/search" -dialcode.api.authorization=auth_key - -# Language-Code Configuration -language.graph_ids=["as","bn","en","gu","hi","hoc","jun","ka","mai","mr","unx","or","san","sat","ta","te","urd", "pj"] - -# Kafka send event to topic enable -kafka.topic.send.enable=false - -learning.valid_license=["creativeCommon"] -learning.service_provider=["youtube"] - -stream.mime.type=video/mp4 -compositesearch.index.name="compositesearch" - -hierarchy.keyspace.name=hierarchy_store -content.hierarchy.table=content_hierarchy -framework.hierarchy.table=framework_hierarchy - -# Kafka topic for definition update event. -kafka.topic.system.command="dev.system.command" - -learning.reserve_dialcode.content_type=["TextBook"] -# restrict.metadata.objectTypes=["Content", "ContentImage", "AssessmentItem", "Channel", "Framework", "Category", "CategoryInstance", "Term"] - -#restrict.metadata.objectTypes="Content,ContentImage" - -publish.collection.fullecar.disable=true - -# Consistency Level for Multi Node Cassandra cluster -cassandra.lp.consistency.level=QUORUM - - -content.tagging.backward_enable=false -content.tagging.property="subject,medium" - -content.nested.fields="badgeAssertions,targets,badgeAssociations" - -content.cache.ttl=86400 -content.cache.read=true -content.cache.hierarchy=true -content.discard.status=["Draft","FlagDraft"] - -framework.categories_cached=["subject", "medium", "gradeLevel", "board"] -framework.cache.ttl=86400 -framework.cache.read=true - - -# Max size(width/height) of thumbnail in pixels -max.thumbnail.size.pixels=150