From 52c0afd1a25cc89d281a25c7a2ed937979c54411 Mon Sep 17 00:00:00 2001 From: manzarul Date: Tue, 15 Oct 2019 12:50:29 +0530 Subject: [PATCH 001/126] issue #SB-14975 fix: adding env variable for email and sms --- .../templates/sunbird_notification-service.env | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ansible/roles/stack-sunbird/templates/sunbird_notification-service.env b/ansible/roles/stack-sunbird/templates/sunbird_notification-service.env index 1f41fe5785..e1c441c995 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_notification-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_notification-service.env @@ -1,3 +1,10 @@ sunbird_notification_fcm_account_key={{sunbird_fcm_account_key}} sunbird_notification_kafka_servers_config={{sunbird_processing_kafka_host}} sunbird_notification_kafka_topic={{env_name}}.lms.notification +sunbird_notification_msg_default_sender={{sunbird_msg_sender}} +sunbird_msg_91_auth={{sunbird_msg_91_auth}} +sunbird_mail_server_from_email={{sunbird_mail_server_from_email}} +sunbird_mail_server_host={{sunbird_mail_server_host}} +sunbird_mail_server_password={{sunbird_mail_server_password}} +sunbird_mail_server_username={{sunbird_mail_server_username}} +sunbird_mail_server_port={{sunbird_mail_server_port}} From a43de4f4a608bc34e3c652a39cac6289225dcf6f Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 17 Oct 2019 11:53:45 +0530 Subject: [PATCH 002/126] Proxy server tokens off --- ansible/roles/stack-proxy/templates/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/stack-proxy/templates/nginx.conf b/ansible/roles/stack-proxy/templates/nginx.conf index ff5ee83d09..945865c914 100644 --- a/ansible/roles/stack-proxy/templates/nginx.conf +++ b/ansible/roles/stack-proxy/templates/nginx.conf @@ -11,6 +11,7 @@ events { http { include /etc/nginx/mime.types; + server_tokens off; default_type application/octet-stream; lua_load_resty_core off; From 7ef029b012a1da0ba7bdddd1a954aca83a1410be Mon Sep 17 00:00:00 2001 From: SowmyaDixit Date: Thu, 17 Oct 2019 12:01:56 +0530 Subject: [PATCH 003/126] Issue #SC-1321 feat: GetDeviceProfile API on-boarding configurations --- ansible/roles/kong-api/defaults/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 643d3087c7..2b31d3da3e 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -3547,6 +3547,15 @@ kong_apis: - "{{ statsd_pulgin }}" - {name: 'rate-limiting', config.policy: "local", config.hour: "{{ medium_rate_limit_per_hour }}"} - {name: 'request-size-limiting', config.allowed_payload_size: "{{ small_request_size_limit }}" } + - name: "deviceProfile" + uris: "/v3/device/profile" + upstream_url: "{{ sunbird_analytics_api_base_url }}/v1/device/profile" + strip_uri: true + plugins: + - {name: 'cors'} + - "{{ statsd_pulgin }}" + - {name: 'rate-limiting', config.policy: "local", config.hour: "{{ medium_rate_limit_per_hour }}"} + - {name: 'request-size-limiting', config.allowed_payload_size: "{{ small_request_size_limit }}" } - name: "channelSpecificTelemetryExhaust" uris: "{{ data_service_prefix }}/v3/dataset/get" upstream_url: "{{ sunbird_analytics_api_base_url }}/dataset/get" From 2bacd3f0344360cd3f55184037bc5f03c68879b3 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 17 Oct 2019 14:15:28 +0530 Subject: [PATCH 004/126] Nginx Disbale Server Information --- ansible/roles/stack-proxy/templates/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/stack-proxy/templates/nginx.conf b/ansible/roles/stack-proxy/templates/nginx.conf index 945865c914..010ee653bb 100644 --- a/ansible/roles/stack-proxy/templates/nginx.conf +++ b/ansible/roles/stack-proxy/templates/nginx.conf @@ -42,6 +42,10 @@ http { metric_latency:observe(tonumber(ngx.var.request_time), {ngx.var.server_name}) '; + header_filter_by_lua_block { + ngx.header["server"] = nil + } + sendfile on; #tcp_nopush on; client_max_body_size 60M; From c5a043f0a89779a50e2e95aab0774bd08e0ac30a Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 17 Oct 2019 16:53:12 +0530 Subject: [PATCH 005/126] Nginx host injection issue fix --- ansible/roles/stack-proxy/templates/proxy-default.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible/roles/stack-proxy/templates/proxy-default.conf b/ansible/roles/stack-proxy/templates/proxy-default.conf index 8152bb1686..64e3c99eba 100644 --- a/ansible/roles/stack-proxy/templates/proxy-default.conf +++ b/ansible/roles/stack-proxy/templates/proxy-default.conf @@ -9,6 +9,11 @@ server { return 301 https://{{ proxy_server_name }}$request_uri; } {% endif %} +server { + listen 80; + server_name ""; + return 401; +} server { {% if proto=='http' %} listen 80; From cdc19c773859c9af98edbc9be61e04c74024d30f Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 17 Oct 2019 17:08:32 +0530 Subject: [PATCH 006/126] Nginx revert the old changes --- ansible/roles/stack-proxy/templates/nginx.conf | 1 - ansible/roles/stack-proxy/templates/proxy-default.conf | 5 ----- 2 files changed, 6 deletions(-) diff --git a/ansible/roles/stack-proxy/templates/nginx.conf b/ansible/roles/stack-proxy/templates/nginx.conf index 010ee653bb..075189a147 100644 --- a/ansible/roles/stack-proxy/templates/nginx.conf +++ b/ansible/roles/stack-proxy/templates/nginx.conf @@ -11,7 +11,6 @@ events { http { include /etc/nginx/mime.types; - server_tokens off; default_type application/octet-stream; lua_load_resty_core off; diff --git a/ansible/roles/stack-proxy/templates/proxy-default.conf b/ansible/roles/stack-proxy/templates/proxy-default.conf index 64e3c99eba..8152bb1686 100644 --- a/ansible/roles/stack-proxy/templates/proxy-default.conf +++ b/ansible/roles/stack-proxy/templates/proxy-default.conf @@ -9,11 +9,6 @@ server { return 301 https://{{ proxy_server_name }}$request_uri; } {% endif %} -server { - listen 80; - server_name ""; - return 401; -} server { {% if proto=='http' %} listen 80; From dc441eace19abc85c07df6cbe8d6622ec6b684f7 Mon Sep 17 00:00:00 2001 From: SMY ALTAMASH <30286162+SMYALTAMASH@users.noreply.github.com> Date: Fri, 18 Oct 2019 11:46:31 +0530 Subject: [PATCH 007/126] HTTP Response Header - Information Disclosure blocking to hide server information and version (#852) * Proxy server tokens off * Nginx Disbale Server Information * Nginx host injection issue fix * Nginx revert the old changes --- ansible/roles/stack-proxy/templates/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/stack-proxy/templates/nginx.conf b/ansible/roles/stack-proxy/templates/nginx.conf index ff5ee83d09..075189a147 100644 --- a/ansible/roles/stack-proxy/templates/nginx.conf +++ b/ansible/roles/stack-proxy/templates/nginx.conf @@ -41,6 +41,10 @@ http { metric_latency:observe(tonumber(ngx.var.request_time), {ngx.var.server_name}) '; + header_filter_by_lua_block { + ngx.header["server"] = nil + } + sendfile on; #tcp_nopush on; client_max_body_size 60M; From fe264613c9cb69507a6e0c5d578609ac85d8b521 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Fri, 18 Oct 2019 14:37:22 +0530 Subject: [PATCH 008/126] Issue#SB-15265 added indcies and mappings for certificate-registry service --- .../roles/es-mapping/files/indices/cert.json | 199 ++++++++++++++++++ .../files/mappings/cert-mapping.json | 150 +++++++++++++ 2 files changed, 349 insertions(+) create mode 100755 ansible/roles/es-mapping/files/indices/cert.json create mode 100755 ansible/roles/es-mapping/files/mappings/cert-mapping.json diff --git a/ansible/roles/es-mapping/files/indices/cert.json b/ansible/roles/es-mapping/files/indices/cert.json new file mode 100755 index 0000000000..dcfa094de1 --- /dev/null +++ b/ansible/roles/es-mapping/files/indices/cert.json @@ -0,0 +1,199 @@ +{ + "settings": { + "index": { + "number_of_shards": "5", + "number_of_replicas": "1", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + } + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "accessCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "related": { + "type": "object" + }, + "data": { + "type": "object" + }, + "recipient": { + "type": "object" + }, + "createdAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "pdfUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "jsonUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "isRevoked": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "reason": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es-mapping/files/mappings/cert-mapping.json b/ansible/roles/es-mapping/files/mappings/cert-mapping.json new file mode 100755 index 0000000000..f3129c964e --- /dev/null +++ b/ansible/roles/es-mapping/files/mappings/cert-mapping.json @@ -0,0 +1,150 @@ +{ + "dynamic": false, + "properties": { + "id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "accessCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "related": { + "type": "object" + }, + "data": { + "type": "object" + }, + "recipient": { + "type": "object" + }, + "createdAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "pdfUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "jsonUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "isRevoked": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "reason": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + } + } +} \ No newline at end of file From b1a0f2e00a24a7c739e95d36ae52aa3e330a8775 Mon Sep 17 00:00:00 2001 From: kaliraja Date: Fri, 18 Oct 2019 14:44:28 +0530 Subject: [PATCH 009/126] created the new playbook for es restore --- ansible/es-restore.yml | 25 +++++++++++++++++++++++++ ansible/es.yml | 31 +------------------------------ 2 files changed, 26 insertions(+), 30 deletions(-) create mode 100644 ansible/es-restore.yml diff --git a/ansible/es-restore.yml b/ansible/es-restore.yml new file mode 100644 index 0000000000..2b2bb48d15 --- /dev/null +++ b/ansible/es-restore.yml @@ -0,0 +1,25 @@ +- hosts: "{{remote}}" + gather_facts: no + become: yes + vars_files: + - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] + vars: + - es_restore_host: "{{remote}}" + - snapshot_base_path: "{{app_snapshot_base_path}}" + roles: + - es-azure-restore + tags: + - es_restore + +- hosts: "{{remote}}" + gather_facts: no + become: yes + vars_files: + - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] + vars: + - es_restore_host: "{{remote}}" + - snapshot_base_path: "{{log_snapshot_base_path}}" + roles: + - es-azure-restore + tags: + - log_es_restore diff --git a/ansible/es.yml b/ansible/es.yml index 52b9502a23..3aa369f112 100644 --- a/ansible/es.yml +++ b/ansible/es.yml @@ -1,5 +1,4 @@ - hosts: es-backup - gather_facts: no become: yes vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] @@ -12,21 +11,7 @@ tags: - es_backup -- hosts: "{{remote}}" - gather_facts: no - become: yes - vars_files: - - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] - vars: - - es_restore_host: "{{remote}}" - - snapshot_base_path: "{{app_snapshot_base_path}}" - roles: - - es-azure-restore - tags: - - es_restore - - hosts: log-es-backup - gather_facts: no become: yes vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] @@ -35,25 +20,11 @@ - snapshot_base_path: "{{log_snapshot_base_path}}" roles: - es-azure-snapshot - - es2-snapshot-purge + - es5-snapshot-purge tags: - log_es_backup -- hosts: "{{remote}}" - gather_facts: no - become: yes - vars_files: - - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] - vars: - - es_restore_host: "{{remote}}" - - snapshot_base_path: "{{log_snapshot_base_path}}" - roles: - - es-azure-restore - tags: - - log_es_restore - - hosts: log-es - gather_facts: no become: yes vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] From a01e6a226be998560c73cc031cf6300a1ebdecd3 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Fri, 18 Oct 2019 14:55:53 +0530 Subject: [PATCH 010/126] Issue#SB-15265 changed ES index from cert to certreg --- .../roles/es-mapping/files/indices/cert.json | 199 ------------------ .../es-mapping/files/indices/certreg.json | 0 ...cert-mapping.json => certreg-mapping.json} | 0 3 files changed, 199 deletions(-) delete mode 100755 ansible/roles/es-mapping/files/indices/cert.json create mode 100755 ansible/roles/es-mapping/files/indices/certreg.json rename ansible/roles/es-mapping/files/mappings/{cert-mapping.json => certreg-mapping.json} (100%) diff --git a/ansible/roles/es-mapping/files/indices/cert.json b/ansible/roles/es-mapping/files/indices/cert.json deleted file mode 100755 index dcfa094de1..0000000000 --- a/ansible/roles/es-mapping/files/indices/cert.json +++ /dev/null @@ -1,199 +0,0 @@ -{ - "settings": { - "index": { - "number_of_shards": "5", - "number_of_replicas": "1", - "analysis": { - "filter": { - "mynGram": { - "token_chars": [ - "letter", - "digit", - "whitespace", - "punctuation", - "symbol" - ], - "min_gram": "1", - "type": "ngram", - "max_gram": "20" - } - }, - "analyzer": { - "cs_index_analyzer": { - "filter": [ - "lowercase", - "mynGram" - ], - "type": "custom", - "tokenizer": "standard" - }, - "keylower": { - "filter": "lowercase", - "type": "custom", - "tokenizer": "keyword" - }, - "cs_search_analyzer": { - "filter": [ - "lowercase", - "standard" - ], - "type": "custom", - "tokenizer": "standard" - } - } - } - } - }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "id": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "accessCode": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "related": { - "type": "object" - }, - "data": { - "type": "object" - }, - "recipient": { - "type": "object" - }, - "createdAt": { - "type": "date", - "fields": { - "raw": { - "type": "date" - } - } - }, - "updatedAt": { - "type": "date", - "fields": { - "raw": { - "type": "date" - } - } - }, - "pdfUrl": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "jsonUrl": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "createdBy": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "updatedBy": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "isRevoked": { - "type": "boolean", - "fields": { - "raw": { - "type": "boolean" - } - } - }, - "reason": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - } - } - } - } -} \ No newline at end of file diff --git a/ansible/roles/es-mapping/files/indices/certreg.json b/ansible/roles/es-mapping/files/indices/certreg.json new file mode 100755 index 0000000000..e69de29bb2 diff --git a/ansible/roles/es-mapping/files/mappings/cert-mapping.json b/ansible/roles/es-mapping/files/mappings/certreg-mapping.json similarity index 100% rename from ansible/roles/es-mapping/files/mappings/cert-mapping.json rename to ansible/roles/es-mapping/files/mappings/certreg-mapping.json From 4526a8e79b8b19e764736fae4b04034d5c84de98 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Fri, 18 Oct 2019 14:59:11 +0530 Subject: [PATCH 011/126] Issue#SB-15265 changed ES index from cert to certreg --- .../es-mapping/files/indices/certreg.json | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) diff --git a/ansible/roles/es-mapping/files/indices/certreg.json b/ansible/roles/es-mapping/files/indices/certreg.json index e69de29bb2..dcfa094de1 100755 --- a/ansible/roles/es-mapping/files/indices/certreg.json +++ b/ansible/roles/es-mapping/files/indices/certreg.json @@ -0,0 +1,199 @@ +{ + "settings": { + "index": { + "number_of_shards": "5", + "number_of_replicas": "1", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + } + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "id": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "accessCode": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "related": { + "type": "object" + }, + "data": { + "type": "object" + }, + "recipient": { + "type": "object" + }, + "createdAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedAt": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "pdfUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "jsonUrl": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "isRevoked": { + "type": "boolean", + "fields": { + "raw": { + "type": "boolean" + } + } + }, + "reason": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + } + } + } + } +} \ No newline at end of file From 5fd10533495f0c42dba98093965b77a25bb1825e Mon Sep 17 00:00:00 2001 From: sudip mukherjee Date: Fri, 18 Oct 2019 15:49:50 +0530 Subject: [PATCH 012/126] Issue #SB-14782 feat: UI changes for login page --- ansible/artifacts/sunbird/login/login.ftl | 24 ++-- .../login/messages/messages_en.properties | 6 +- .../sunbird/login/resources/css/login.css | 113 ++++++++++++++++-- 3 files changed, 122 insertions(+), 21 deletions(-) diff --git a/ansible/artifacts/sunbird/login/login.ftl b/ansible/artifacts/sunbird/login/login.ftl index 22f6047014..8a2eb17f67 100644 --- a/ansible/artifacts/sunbird/login/login.ftl +++ b/ansible/artifacts/sunbird/login/login.ftl @@ -11,7 +11,7 @@
-
${msg("doSignIn")}
+
${msg("loginDiksha")}

${msg("mergeAccountMessage")}

${msg("migrateAccountMessage")}

@@ -39,9 +39,9 @@ <#if usernameEditDisabled??> - + <#else> - +
@@ -57,15 +57,15 @@ ${msg("placeholderForPassword")}
- + ${msg("inCorrectPasswordError")}
- +
-

OR

+

OR

<#if realm.password && social.providers??> - - +
<#if realm.password && realm.registrationAllowed && !usernameEditDisabled??>
- ${msg("noAccount")} ${msg("doRegister")} to access relevant learning material and enroll for courses. + ${msg("noAccount")} ${msg("registerHere")}
diff --git a/ansible/artifacts/sunbird/login/messages/messages_en.properties b/ansible/artifacts/sunbird/login/messages/messages_en.properties index fbb920b630..0cfbc61631 100644 --- a/ansible/artifacts/sunbird/login/messages/messages_en.properties +++ b/ansible/artifacts/sunbird/login/messages/messages_en.properties @@ -2,7 +2,7 @@ doLogIn=Log In doRegister=Sign Up doSignIn=Sign In doSignWithGoogle=with Google -doSignWithState=Sign In with State System +doSignWithState=Log In with State System doCancel=Cancel doSubmit=Submit doReset=Reset @@ -267,4 +267,8 @@ requiredAction.UPDATE_PROFILE=Update Profile requiredAction.VERIFY_EMAIL=Verify Email user_not_found=This email ID/mobile number doesn''t belong to a valid user p3pPolicy=CP="This is not a P3P policy!" +usernamePlaceholder = Enter your registered Phone No. / Email address +passwordPlaceholder = Enter password +loginDiksha = Log into DIKSHA +registerHere = Register here diff --git a/ansible/artifacts/sunbird/login/resources/css/login.css b/ansible/artifacts/sunbird/login/resources/css/login.css index 71863254ae..f9255e2cf9 100644 --- a/ansible/artifacts/sunbird/login/resources/css/login.css +++ b/ansible/artifacts/sunbird/login/resources/css/login.css @@ -54,9 +54,9 @@ input:focus{ border: 1px solid #024f9d !important; } .signInWithGoogle{ - vertical-align: bottom; + /* vertical-align: bottom; */ height: 18px !important; - margin-right: 5px; + margin-right: 8px; } .ui.basic.blue.button.googleButton{ @@ -80,11 +80,13 @@ input:focus{ color: #F9F9F9; } .or{ - color: #9B9B9B; - background-image:linear-gradient(#979797,#979797),linear-gradient(#979797,#979797); + color: #333; + background-image:linear-gradient(#ccc,#ccc),linear-gradient(#ccc,#ccc); background-size:45% 1px; background-position:center left,center right; background-repeat:no-repeat; + font-weight: 700; + font-size: 12px; } .signUpMsg{ font-size: 12px; @@ -106,17 +108,17 @@ input:focus{ font-weight: 500; } .forgetPasswordLink{ - color: #9B9B9B !important; + color: #024f9d; font-size: 12px; line-height: 17px; float: right; } .forgetPasswordLink:hover, .forgetPasswordLink:focus{ - color:#024f9d !important; + color: #002e50; outline: none; cursor: pointer; - font-weight:bold; + /* font-weight:bold; */ } .textCenter { text-align: center !important; @@ -217,8 +219,9 @@ a{ color: #024f9d !important; } .registerLink{ - color: #024f9d !important; + color: #024f9d; font-weight: bold; + text-decoration: underline; } .registerLink:hover, .registerLink:focus{ @@ -292,3 +295,97 @@ h1, h2, h3, h4, h5, .cursor-pointer { cursor: pointer } + +.width-100 { + width: 100%; +} +/* Design System Utilities */ + +/* 1. Button Utilities */ + +.sb-btn { + -webkit-tap-highlight-color: transparent; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + outline: 0; + display: inline-block; + border: 1px solid; + color: var(--white); + cursor: pointer; + min-width: 64px; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + position: relative; + text-transform: capitalize; + text-decoration: none; +} + +.sb-btn-normal { + padding: 8px 16px; + height: 36px; + font-size: 12px; +} + +.sb-btn-primary { + border-color: #024f9d; + background-color: #024f9d; + color: white; +} + +.sb-btn-primary:hover { + background-color: #002e50; +} + +.sb-btn-success { + border-color: #07bc81; + background-color: #07bc81; + color: white; +} + +.sb-btn-success:hover { + background-color: #008840; + border-color: #008840; +} + +.sb-btn-outline-primary { + background-color: white; + color: #024f9d; + border-color: #024f9d; +} + +.sb-btn-outline-primary:hover { + border-color: #002e50; + color: #002e50; + background-color: #edf4f9; +} + +/* Margin Utilities */ + +.mb-16 { + margin-bottom: 16px !important; +} + +.my-16 { + margin: 16px 0 !important; +} + +.mx-16 { + margin: 0 16px !important; +} + +/* Flex Utilities */ + +.d-flex { + display: flex !important; +} + +.flex-ai-center { + align-items: center !important; +} + +.flex-jc-center { + justify-content: center !important; +} \ No newline at end of file From ef3b08f92459b249426a8ed84b02dc3e47568802 Mon Sep 17 00:00:00 2001 From: Anmol Gupta Date: Fri, 18 Oct 2019 16:46:49 +0530 Subject: [PATCH 013/126] Issue#SB-15265 added envsa (#860) --- .../stack-sunbird/templates/sunbird_cert-registry-service.env | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env b/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env index 92199b38e1..4f8512c702 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env @@ -1 +1,3 @@ cert_service_base_url=http://cert-service:9000 +sunbird_es_host={{sunbird_es_host}} +sunbird_es_port={{sunbird_es_port}} From 26b1f89d6e4629898d7e5d2db0400af02679920e Mon Sep 17 00:00:00 2001 From: kaliraja <34502260+Kaali09@users.noreply.github.com> Date: Fri, 18 Oct 2019 16:48:42 +0530 Subject: [PATCH 014/126] updated the curator version (#861) --- ansible/roles/es5-snapshot-purge/meta/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/es5-snapshot-purge/meta/main.yml b/ansible/roles/es5-snapshot-purge/meta/main.yml index 1a1e252d00..e26db1f145 100644 --- a/ansible/roles/es5-snapshot-purge/meta/main.yml +++ b/ansible/roles/es5-snapshot-purge/meta/main.yml @@ -1,3 +1,3 @@ --- dependencies: - - { role: es-curator, es_curator_major_version: 5, es_curator_version: 5.7.6, python_es_curator_version: 3.4.1-1 } + - { role: es-curator, es_curator_major_version: 5, es_curator_version: 5.8.1, python_es_curator_version: 3.4.1-1 } From a5ea5fc39649c35b225eef7c1cae522f5546ab51 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Mon, 21 Oct 2019 13:42:48 +0530 Subject: [PATCH 015/126] fix: shared lib call --- pipelines/release/Jenkinsfile.rc.tag | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/release/Jenkinsfile.rc.tag b/pipelines/release/Jenkinsfile.rc.tag index f8fb3b631f..9ad9bbd2da 100644 --- a/pipelines/release/Jenkinsfile.rc.tag +++ b/pipelines/release/Jenkinsfile.rc.tag @@ -1,3 +1,4 @@ +@Library('deploy-conf') _ node { try { repositories = ['Sunbird-Ed/SunbirdEd-portal', From 7e7ebb3a1b95f1d4b0269add11e556c8708dd8e4 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Mon, 21 Oct 2019 14:27:46 +0530 Subject: [PATCH 016/126] Issue#SB-15352 added certificate-registry verify API --- ansible/roles/kong-api/defaults/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 2b31d3da3e..8b2cb3061e 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4580,4 +4580,20 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: verifyRegCertificate + uris: "{{ cert_registry_service_prefix }}/v1/certs/verify" + upstream_url: "{{ cert_registry_service_url }}/certs/v1/registry/verify" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: publicUser + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" From e081bfd70250e29cbd9b6d737ba2891ca1e787f8 Mon Sep 17 00:00:00 2001 From: S M Y Date: Tue, 22 Oct 2019 16:37:58 +0530 Subject: [PATCH 017/126] Upload the artifact to latest folder --- .../roles/offline-installer/tasks/uploadToAzure.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 737a44a94c..58d5627fec 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -13,3 +13,13 @@ AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" async: 60 poll: 10 + +- name: Upload to azure blob storage in latest folder + command: az storage blob upload-batch --destination {{offline_installer_container_name}}/latest/ --source "offline_artifacts" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/" + environment: + AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" + AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" + async: 60 + poll: 10 From 8a1422916d257324ee489fbc507d2debb2facef4 Mon Sep 17 00:00:00 2001 From: S M Y Date: Tue, 22 Oct 2019 17:32:18 +0530 Subject: [PATCH 018/126] upload to azure with latest folder changes --- .../roles/offline-installer/tasks/uploadToAzure.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index daca32222f..dddda6c504 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -21,6 +21,16 @@ - debug: msg: "{{folderName.stdout}}" +- name: Upload to azure blob storage + command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}/" --source "{{folderName.stdout}}" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" + environment: + AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" + AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" + async: 60 + poll: 10 + - name: Create a zip of the folder to archieve the artifact archive: path: From 2f05bac518f84650733f2dab18fbbe55549cc0b6 Mon Sep 17 00:00:00 2001 From: Anmol Gupta Date: Tue, 22 Oct 2019 18:08:27 +0530 Subject: [PATCH 019/126] Issue#SC-1390 added migrate reject API (#867) --- ansible/roles/kong-api/defaults/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 2b31d3da3e..0718725177 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4580,4 +4580,20 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: rejectMigrate + uris: "{{ user_service_prefix }}/v1/migrate/reject" + upstream_url: "{{ learning_service_url }}/v1/user/migrate/reject" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: publicUser + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" From a6752879c03726863b7bd4868a034a7bccd1edca Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 10:40:59 +0530 Subject: [PATCH 020/126] uncomment delete workspace --- pipelines/offlineinstaller/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index c24ee78c22..42cf855279 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -65,7 +65,7 @@ node() { values.put('ansiblePlaybook', ansiblePlaybook) values.put('ansibleExtraArgs', ansibleExtraArgs) println values - ansible_playbook_run(values) +// ansible_playbook_run(values) currentBuild.result = 'SUCCESS' } } From 1e20cb7e81c1e62d4f047d769af515b0107f5654 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 11:22:28 +0530 Subject: [PATCH 021/126] constructing metadata for offline installer --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ansible/roles/offline-installer/templates/metadata.sh.j2 diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 new file mode 100644 index 0000000000..0e2e037051 --- /dev/null +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -0,0 +1,6 @@ +#!/bin/bash + +version=$(cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r ".version") + +# constructing the latest.json file +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diskha_${version}_32bit.exe\",\"64bit\":\"diskha_${version}_64bit.exe\"},\"linux\":{\"64bit\":\"diskah_${version}_64bit.deb\"}}" > latest.json From 59c7b8e1582a1513a2fb75dde2f5269d41a03875 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 11:23:54 +0530 Subject: [PATCH 022/126] metadata file logic changes --- ansible/roles/offline-installer/tasks/main.yml | 1 + ansible/roles/offline-installer/templates/metadata.sh.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index c24130f041..bfed09df9b 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -23,6 +23,7 @@ - build.sh - envfile - 32-bit-prerequisite.sh + - metadata.sh when: uploadInstaller is not defined - name: create a directory to store artifacts diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 0e2e037051..ea0c835aa5 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -1,6 +1,6 @@ #!/bin/bash -version=$(cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r ".version") +version=$(cat src/package.json | jq -r ".version") # constructing the latest.json file echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diskha_${version}_32bit.exe\",\"64bit\":\"diskha_${version}_64bit.exe\"},\"linux\":{\"64bit\":\"diskah_${version}_64bit.deb\"}}" > latest.json From 572262412ab914cee0a20fe804556613375556e1 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 11:49:01 +0530 Subject: [PATCH 023/126] metadata file with parsed and readable json --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index ea0c835aa5..b03fb0f947 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -1,6 +1,6 @@ #!/bin/bash -version=$(cat src/package.json | jq -r ".version") +version=$(cat src/package.json | jq -r '.version') # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diskha_${version}_32bit.exe\",\"64bit\":\"diskha_${version}_64bit.exe\"},\"linux\":{\"64bit\":\"diskah_${version}_64bit.deb\"}}" > latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_32bit.exe\",\"64bit\":\"diksha_${version}_64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_64bit.deb\"}}" | jq '.' | tee -a latest.json From cb0eb8d1780d785ce81bde5c329406fbbfa2ba60 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 12:05:00 +0530 Subject: [PATCH 024/126] renaming installer type with correct syntax --- ansible/roles/offline-installer/templates/build.sh.j2 | 2 +- .../templates/setupOfflineInstaller.sh.j2 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/roles/offline-installer/templates/build.sh.j2 b/ansible/roles/offline-installer/templates/build.sh.j2 index be33e2a591..720b64b8c6 100644 --- a/ansible/roles/offline-installer/templates/build.sh.j2 +++ b/ansible/roles/offline-installer/templates/build.sh.j2 @@ -5,7 +5,7 @@ echo "Offline Installer for Sunbird" # Build script set -eo pipefail -if [ "{{offline_installer_type}}" == "windows32" ]; +if [ "{{offline_installer_type}}" == "windows32bit" ]; then docker run --rm -v ${PWD}:/private/ i386/node:8.16.2-stretch bash -x /private/32-bit-prerequisite.sh diff --git a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 index a7d0c718c0..622c1ecdc1 100644 --- a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 +++ b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 @@ -5,23 +5,23 @@ npm install -g n n 8.16 cd /project/src -if [ "{{offline_installer_type}}" != "windows32" ]; +if [ "{{offline_installer_type}}" != "windows32bit" ]; then #Build the offline installer npm install npm run dist fi -if [ "{{offline_installer_type}}" == "windows32" ]; +if [ "{{offline_installer_type}}" == "windows32bit" ]; then # npm run dist npm run dist-win32 cp '/project/src/dist/1.0.0/win/ia32/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ -elif [ "{{offline_installer_type}}" == "windows64" ]; +elif [ "{{offline_installer_type}}" == "windows64bit" ]; then npm run dist-win64 cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ -elif [ "{{offline_installer_type}}" == "debian" ]; +elif [ "{{offline_installer_type}}" == "debian64bit" ]; then npm run dist-linux cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/ From e072e795d119dc6aaa4dfe4c5341b3202fc7cab8 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 12:07:49 +0530 Subject: [PATCH 025/126] construct latest.json file with correct naming convention --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index b03fb0f947..3e5f65eb0c 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -3,4 +3,4 @@ version=$(cat src/package.json | jq -r '.version') # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_32bit.exe\",\"64bit\":\"diksha_${version}_64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_64bit.deb\"}}" | jq '.' | tee -a latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_debian64bit.deb\"}}" | jq '.' | tee latest.json From c300cd1f165d3847ed58100504ef6dcce532dad1 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 12:19:11 +0530 Subject: [PATCH 026/126] Generic name to any linux distribution --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 2 +- ansible/roles/offline-installer/templates/metadata.sh.j2 | 2 +- .../offline-installer/templates/setupOfflineInstaller.sh.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index dddda6c504..f839bc06b5 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -22,7 +22,7 @@ msg: "{{folderName.stdout}}" - name: Upload to azure blob storage - command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}/" --source "{{folderName.stdout}}" + command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}" --source "{{folderName.stdout}}" args: chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" environment: diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 3e5f65eb0c..492af51648 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -3,4 +3,4 @@ version=$(cat src/package.json | jq -r '.version') # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_debian64bit.deb\"}}" | jq '.' | tee latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee latest.json diff --git a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 index 622c1ecdc1..8e6c3ff936 100644 --- a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 +++ b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 @@ -21,7 +21,7 @@ elif [ "{{offline_installer_type}}" == "windows64bit" ]; then npm run dist-win64 cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ -elif [ "{{offline_installer_type}}" == "debian64bit" ]; +elif [ "{{offline_installer_type}}" == "linux64bit" ]; then npm run dist-linux cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/ From e151d14f35b12100e762e5a529fbdc4ce5843d7b Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 13:04:52 +0530 Subject: [PATCH 027/126] linux installer changes --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 3 +++ ansible/roles/offline-installer/templates/metadata.sh.j2 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index f839bc06b5..57cc496f63 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -21,6 +21,9 @@ - debug: msg: "{{folderName.stdout}}" +- name: get the installer version + + - name: Upload to azure blob storage command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}" --source "{{folderName.stdout}}" args: diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 492af51648..320942b260 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -1,6 +1,8 @@ #!/bin/bash version=$(cat src/package.json | jq -r '.version') +artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee ${artifactFolder}/latest.json + From e59dd01cde8a42d1a1d1387c588ae98792497068 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:07:12 +0530 Subject: [PATCH 028/126] Installer logic changes --- .../roles/offline-installer/tasks/main.yml | 30 ++++++++++++++++++- .../offline-installer/tasks/uploadToAzure.yml | 7 +++-- .../templates/metadata.sh.j2 | 1 + .../templates/setupOfflineInstaller.sh.j2 | 18 +++++------ 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index bfed09df9b..10541b486c 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -19,7 +19,6 @@ dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" mode: '0755' with_items: - - setupOfflineInstaller.sh - build.sh - envfile - 32-bit-prerequisite.sh @@ -33,6 +32,34 @@ recurse: yes when: uploadInstaller is not defined +- name: Get the version from the package.json file + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq '.version'" + register: version + when: uploadInstaller is not defined + +- name: Display the version number of the installer + debug: + msg: "{{version.stdout}}" + when: uploadInstaller is not defined + +- name: Create a variable to inject version in the template + set_fact: + installer_version: "{{ version.stdout }}" + when: uploadInstaller is not defined + +- name: Generate the latest.json file + shell: "bash -x {{offline_repo_location}}/offline-installer-repo/metadata.sh" + when: uploadInstaller is not defined + +- name: copy the installer script file and build script for building offline installer + template: + src: "{{item}}.j2" + dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" + mode: '0755' + with_items: + - setupOfflineInstaller.sh + when: uploadInstaller is not defined + - name: upload to azure include: uploadToAzure.yml when: uploadInstaller is defined @@ -40,3 +67,4 @@ - name: Delete offline installer folder if any issue include: remove.yml when: removeOfflineInstallerFolder is defined + diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 57cc496f63..213522a716 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -21,8 +21,10 @@ - debug: msg: "{{folderName.stdout}}" -- name: get the installer version - +- name: Generate the latest json file + command: ls + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/" - name: Upload to azure blob storage command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}" --source "{{folderName.stdout}}" @@ -40,3 +42,4 @@ - "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}" dest: "{{offline_repo_location}}/{{offline_installer_type}}.zip" format: zip + diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 320942b260..cbb9666f50 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -6,3 +6,4 @@ artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee ${artifactFolder}/latest.json + diff --git a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 index 8e6c3ff936..c6f50a9323 100644 --- a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 +++ b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 @@ -8,21 +8,21 @@ cd /project/src if [ "{{offline_installer_type}}" != "windows32bit" ]; then #Build the offline installer - npm install - npm run dist + npm install + npm run dist fi if [ "{{offline_installer_type}}" == "windows32bit" ]; then -# npm run dist - npm run dist-win32 - cp '/project/src/dist/1.0.0/win/ia32/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ +# npm run dist + npm run dist-win32 + cp '/project/src/dist/1.0.0/win/ia32/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_windows32bit.exe elif [ "{{offline_installer_type}}" == "windows64bit" ]; then - npm run dist-win64 - cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ + npm run dist-win64 + cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_windows64bit.exe elif [ "{{offline_installer_type}}" == "linux64bit" ]; then - npm run dist-linux - cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/ + npm run dist-linux + cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_linux64bit.deb fi From fce3a973ae23e4d5ad68d43c8a8e9b7e7126ab58 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:24:08 +0530 Subject: [PATCH 029/126] metadata file for installer --- ansible/roles/offline-installer/tasks/main.yml | 2 ++ ansible/roles/offline-installer/templates/metadata.sh.j2 | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 10541b486c..64eaac47d6 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -49,6 +49,8 @@ - name: Generate the latest.json file shell: "bash -x {{offline_repo_location}}/offline-installer-repo/metadata.sh" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/" when: uploadInstaller is not defined - name: copy the installer script file and build script for building offline installer diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index cbb9666f50..fdcbbef010 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -1,9 +1,7 @@ #!/bin/bash -version=$(cat src/package.json | jq -r '.version') +version={{installer_version}} artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee ${artifactFolder}/latest.json - - +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee {{offline_repo_location}}/offline-installer-repo/offline_artifacts/${artifactFolder}/latest.json From 4e9f8f5bb4390c34eb25d155f55f29f3d91b9101 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:29:45 +0530 Subject: [PATCH 030/126] metadata file for installer with custom version --- .../roles/offline-installer/tasks/main.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 64eaac47d6..295858e7c5 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -13,6 +13,16 @@ - env.json when: uploadInstaller is not defined +- name: Display the version number of the installer + debug: + msg: "{{version.stdout}}" + when: uploadInstaller is not defined + +- name: Create a variable to inject version in the template + set_fact: + installer_version: "{{ version.stdout }}" + when: uploadInstaller is not defined + - name: copy the installer script file and build script for building offline installer template: src: "{{item}}.j2" @@ -32,16 +42,6 @@ recurse: yes when: uploadInstaller is not defined -- name: Get the version from the package.json file - shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq '.version'" - register: version - when: uploadInstaller is not defined - -- name: Display the version number of the installer - debug: - msg: "{{version.stdout}}" - when: uploadInstaller is not defined - - name: Create a variable to inject version in the template set_fact: installer_version: "{{ version.stdout }}" From d1ed7038f36088a292c457290eec5615700af138 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:33:29 +0530 Subject: [PATCH 031/126] metadata file for offline version --- ansible/roles/offline-installer/tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 295858e7c5..5a98b1aceb 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -13,6 +13,11 @@ - env.json when: uploadInstaller is not defined +- name: Get the version from the package.json file + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq '.version'" + register: version + when: uploadInstaller is not defined + - name: Display the version number of the installer debug: msg: "{{version.stdout}}" From afad8f7a233d3a2473b30ba1cdb019c242f09c8d Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:41:31 +0530 Subject: [PATCH 032/126] tee comamnd changes --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index fdcbbef010..4287c9645a 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -4,4 +4,4 @@ version={{installer_version}} artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee {{offline_repo_location}}/offline-installer-repo/offline_artifacts/${artifactFolder}/latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/offline_artifacts/${artifactFolder}/latest.json From a2bf8545aa8ae61db5e5911facff2d31224173f4 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 14:51:26 +0530 Subject: [PATCH 033/126] offline installer metadata file location --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 4287c9645a..6cabcaa097 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -4,4 +4,4 @@ version={{installer_version}} artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/offline_artifacts/${artifactFolder}/latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/${artifactFolder}/latest.json From 6d7392f6b6982bd1803934dfe02d11cfcfc72b18 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 16:14:38 +0530 Subject: [PATCH 034/126] jq remove quotes --- ansible/roles/offline-installer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 5a98b1aceb..9368acc0a2 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -14,7 +14,7 @@ when: uploadInstaller is not defined - name: Get the version from the package.json file - shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq '.version'" + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r '.version'" register: version when: uploadInstaller is not defined From 25384e8dfe41a24a1101b1c7fbcd5118b97726d4 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 16:15:10 +0530 Subject: [PATCH 035/126] Upload the artifact in latest folder with latest.json file --- .../offline-installer/tasks/uploadToAzure.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 213522a716..e88e4cdbc0 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -21,13 +21,18 @@ - debug: msg: "{{folderName.stdout}}" -- name: Generate the latest json file - command: ls +- name: Upload to azure blob storage + command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" args: - chdir: "{{offline_repo_location}}/offline-installer-repo/" + chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" + environment: + AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" + AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" + async: 60 + poll: 10 -- name: Upload to azure blob storage - command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest/{{offline_installer_type}}" --source "{{folderName.stdout}}" +- name: Upload to latest.json file to blob + command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" args: chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" environment: @@ -42,4 +47,3 @@ - "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}" dest: "{{offline_repo_location}}/{{offline_installer_type}}.zip" format: zip - From 8b6fc66cbca93737c8bee8875c9dabece4cc8e5e Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 16:55:39 +0530 Subject: [PATCH 036/126] Removing unwanted files from the installation --- pipelines/offlineinstaller/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index 42cf855279..c24ee78c22 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -65,7 +65,7 @@ node() { values.put('ansiblePlaybook', ansiblePlaybook) values.put('ansibleExtraArgs', ansibleExtraArgs) println values -// ansible_playbook_run(values) + ansible_playbook_run(values) currentBuild.result = 'SUCCESS' } } From b97f6f177a53ac5daca44f21a72b7b6e6f8a6b48 Mon Sep 17 00:00:00 2001 From: S M Y Date: Wed, 23 Oct 2019 17:02:50 +0530 Subject: [PATCH 037/126] Archieve the latest.json file in jenkins --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 6 ++++++ pipelines/offlineinstaller/Jenkinsfile | 1 + 2 files changed, 7 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index e88e4cdbc0..cbc8d2097a 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -47,3 +47,9 @@ - "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}" dest: "{{offline_repo_location}}/{{offline_installer_type}}.zip" format: zip + +- name: copy latest.json file to archieve it in jenkins + copy: + src: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}/latest.json" + dest: "{{offline_repo_location}}/latest.json" + remote_src: yes diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index c24ee78c22..1f5bda8075 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -52,6 +52,7 @@ node() { println values ansible_playbook_run(values) archiveArtifacts artifacts: '*.zip', onlyIfSuccessful: true + archiveArtifacts artifacts: 'latest.json', onlyIfSuccessful: true } } catch (err) { From babfce955a47887774b5ee3d6ff3d770aea1ba52 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 10:31:05 +0530 Subject: [PATCH 038/126] Disable deletion --- pipelines/offlineinstaller/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index 1f5bda8075..b02492d122 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -66,7 +66,7 @@ node() { values.put('ansiblePlaybook', ansiblePlaybook) values.put('ansibleExtraArgs', ansibleExtraArgs) println values - ansible_playbook_run(values) +// ansible_playbook_run(values) currentBuild.result = 'SUCCESS' } } From 779b5c1ae3f1539b4fd4475d9bf735bb2debbdaf Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:15:39 +0530 Subject: [PATCH 039/126] Logic to take the installer name dynamicly --- ansible/roles/offline-installer/tasks/main.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 9368acc0a2..d40616eeb9 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -37,7 +37,6 @@ - build.sh - envfile - 32-bit-prerequisite.sh - - metadata.sh when: uploadInstaller is not defined - name: create a directory to store artifacts @@ -52,12 +51,6 @@ installer_version: "{{ version.stdout }}" when: uploadInstaller is not defined -- name: Generate the latest.json file - shell: "bash -x {{offline_repo_location}}/offline-installer-repo/metadata.sh" - args: - chdir: "{{offline_repo_location}}/offline-installer-repo/" - when: uploadInstaller is not defined - - name: copy the installer script file and build script for building offline installer template: src: "{{item}}.j2" From 6cfa4384ecb1df8fce0a3af2324ac0e7a52a887e Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:16:01 +0530 Subject: [PATCH 040/126] Get the artifact name from the env.json file --- .../offline-installer/tasks/uploadToAzure.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index cbc8d2097a..a728bb76fb 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -4,6 +4,35 @@ AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" +- name: Get the environment name for the artifact name + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/env.json | jq -r '.APP_NAME'" + register: env_name + +- name: Display the environment name of the installer + debug: + msg: "{{env_name.stdout}}" + +- name: Create a variable to inject environment name to upload to azure blob + set_fact: + environment_name: "{{ env_name.stdout }}" + +- name: copy the installer artifacts to upload it to azure blob + template: + src: "{{item}}.j2" + dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" + mode: '0755' + with_items: + - artifacts.sh + - metadata.sh + +- name: copy the artifacts and generate the metadata file + shell: "bash {{offline_repo_location}}/offline-installer-repo/{{item}}" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/" + with_items: + - artifacts.sh + - metadata.sh + - name: Upload to azure blob storage command: az storage blob upload-batch --destination {{offline_installer_container_name}} --source "offline_artifacts" args: From 60bff6efc6ca065d31f6937b98097157de4454be Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:16:34 +0530 Subject: [PATCH 041/126] Dynamic metadata file changes --- ansible/roles/offline-installer/templates/metadata.sh.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 index 6cabcaa097..9d7e7a0dd7 100644 --- a/ansible/roles/offline-installer/templates/metadata.sh.j2 +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -1,7 +1,8 @@ #!/bin/bash +env_name={{environment_name}} version={{installer_version}} artifactFolder=$(find offline_artifacts/* -type d) # constructing the latest.json file -echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"diksha_${version}_windows32bit.exe\",\"64bit\":\"diksha_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"diksha_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/${artifactFolder}/latest.json +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"${env_name}_${version}_windows32bit.exe\",\"64bit\":\"${env_name}_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"${env_name}_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/${artifactFolder}/latest.json From 5cf4aa7fd140580ec6be97c6458527f0c37539bd Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:16:51 +0530 Subject: [PATCH 042/126] Remove copy artifact logic --- .../offline-installer/templates/setupOfflineInstaller.sh.j2 | 3 --- 1 file changed, 3 deletions(-) diff --git a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 index c6f50a9323..64b5a019b8 100644 --- a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 +++ b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 @@ -16,13 +16,10 @@ if [ "{{offline_installer_type}}" == "windows32bit" ]; then # npm run dist npm run dist-win32 - cp '/project/src/dist/1.0.0/win/ia32/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_windows32bit.exe elif [ "{{offline_installer_type}}" == "windows64bit" ]; then npm run dist-win64 - cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_windows64bit.exe elif [ "{{offline_installer_type}}" == "linux64bit" ]; then npm run dist-linux - cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/diksha_{{installer_version}}_linux64bit.deb fi From 6ad2cc137bee09450b89a9d0891de94305a0361f Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:17:19 +0530 Subject: [PATCH 043/126] Copy artifacts dynamicly using the environment name --- .../offline-installer/templates/artifacts.sh.j2 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ansible/roles/offline-installer/templates/artifacts.sh.j2 diff --git a/ansible/roles/offline-installer/templates/artifacts.sh.j2 b/ansible/roles/offline-installer/templates/artifacts.sh.j2 new file mode 100644 index 0000000000..900d7b975d --- /dev/null +++ b/ansible/roles/offline-installer/templates/artifacts.sh.j2 @@ -0,0 +1,15 @@ +#!/bin/bash + + +if [ "{{offline_installer_type}}" == "windows32bit" ]; +then + cp '/project/src/dist/1.0.0/win/ia32/{{environment_name}} Setup 1.0.0.exe' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows32bit.exe +elif [ "{{offline_installer_type}}" == "windows64bit" ]; +then + cp '/project/src/dist/1.0.0/win/x64/{{environment_name}} Setup 1.0.0.exe' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows64bit.exe +elif [ "{{offline_installer_type}}" == "linux64bit" ]; +then + cp '/project/src/dist/1.0.0/linux/x64/{{environment_name}}_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_linux64bit.deb +fi + + From e0ed647a0d9f2571d3adc7e1d4f6cd467fde05a6 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:20:04 +0530 Subject: [PATCH 044/126] Artifact relative path to copy --- ansible/roles/offline-installer/templates/artifacts.sh.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/offline-installer/templates/artifacts.sh.j2 b/ansible/roles/offline-installer/templates/artifacts.sh.j2 index 900d7b975d..ed3fa51a18 100644 --- a/ansible/roles/offline-installer/templates/artifacts.sh.j2 +++ b/ansible/roles/offline-installer/templates/artifacts.sh.j2 @@ -3,13 +3,13 @@ if [ "{{offline_installer_type}}" == "windows32bit" ]; then - cp '/project/src/dist/1.0.0/win/ia32/{{environment_name}} Setup 1.0.0.exe' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows32bit.exe + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/win/ia32/{{environment_name}} Setup 1.0.0.exe' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows32bit.exe elif [ "{{offline_installer_type}}" == "windows64bit" ]; then - cp '/project/src/dist/1.0.0/win/x64/{{environment_name}} Setup 1.0.0.exe' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows64bit.exe + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/win/x64/{{environment_name}} Setup 1.0.0.exe' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows64bit.exe elif [ "{{offline_installer_type}}" == "linux64bit" ]; then - cp '/project/src/dist/1.0.0/linux/x64/{{environment_name}}_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_linux64bit.deb + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/linux/x64/{{environment_name}}_1.0.0_amd64.deb' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_linux64bit.deb fi From 9bc861d6b98949be01e58099d34b34aba7ac7e9a Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 11:41:08 +0530 Subject: [PATCH 045/126] set the version mumber to versionize artifact uploads --- ansible/roles/offline-installer/tasks/main.yml | 15 --------------- .../offline-installer/tasks/uploadToAzure.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index d40616eeb9..6c817af78a 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -13,21 +13,6 @@ - env.json when: uploadInstaller is not defined -- name: Get the version from the package.json file - shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r '.version'" - register: version - when: uploadInstaller is not defined - -- name: Display the version number of the installer - debug: - msg: "{{version.stdout}}" - when: uploadInstaller is not defined - -- name: Create a variable to inject version in the template - set_fact: - installer_version: "{{ version.stdout }}" - when: uploadInstaller is not defined - - name: copy the installer script file and build script for building offline installer template: src: "{{item}}.j2" diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index a728bb76fb..51249260bd 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -16,6 +16,18 @@ set_fact: environment_name: "{{ env_name.stdout }}" +- name: Get the version from the package.json file + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r '.version'" + register: version + +- name: Display the version number of the installer + debug: + msg: "{{version.stdout}}" + +- name: Create a variable to inject version in the template + set_fact: + installer_version: "{{ version.stdout }}" + - name: copy the installer artifacts to upload it to azure blob template: src: "{{item}}.j2" From 253a96aa5f3eca6f04cf327cdda32436ab050e80 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 12:04:03 +0530 Subject: [PATCH 046/126] make the version number dynamic with timestamp --- .../offline-installer/tasks/uploadToAzure.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 51249260bd..67e8d7547a 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -1,3 +1,8 @@ +- name: get the date and time for the artifact + set_fact: + time: "{{ lookup('pipe', 'date +\"%Y-%b-%d-%H-%M-%S\"') }}-{{offline_installer_type}}" + when: uploadInstaller is not defined + - name: Ensure azure blob storage container exists command: az storage container create --name {{offline_installer_container_name}} --public-access off environment: @@ -28,6 +33,13 @@ set_fact: installer_version: "{{ version.stdout }}" +- name: get the directory name + shell: "ls {{offline_repo_location}}/offline-installer-repo/offline_artifacts/" + register: folderName + +- debug: + msg: "{{folderName.stdout}}" + - name: copy the installer artifacts to upload it to azure blob template: src: "{{item}}.j2" @@ -55,13 +67,6 @@ async: 60 poll: 10 -- name: get the directory name - shell: "ls {{offline_repo_location}}/offline-installer-repo/offline_artifacts/" - register: folderName - -- debug: - msg: "{{folderName.stdout}}" - - name: Upload to azure blob storage command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" args: From 4c95bae8ac35e71e2781afc10eab625344c08887 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 12:07:39 +0530 Subject: [PATCH 047/126] Remove the duplicate code and run the installer --- .../roles/offline-installer/tasks/uploadToAzure.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 67e8d7547a..70186c828e 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -40,7 +40,7 @@ - debug: msg: "{{folderName.stdout}}" -- name: copy the installer artifacts to upload it to azure blob +- name: copy the installer artifacts and metadata files to upload it to azure blob and generate latest.json file template: src: "{{item}}.j2" dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" @@ -67,16 +67,6 @@ async: 60 poll: 10 -- name: Upload to azure blob storage - command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" - args: - chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" - environment: - AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" - AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" - async: 60 - poll: 10 - - name: Upload to latest.json file to blob command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" args: From f8c6d85a13411814661feb310cc60788a8d6f8d4 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 12:13:53 +0530 Subject: [PATCH 048/126] Uplaod the artifacts to azure blob --- .../roles/offline-installer/tasks/uploadToAzure.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 70186c828e..a6f431ab37 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -1,8 +1,3 @@ -- name: get the date and time for the artifact - set_fact: - time: "{{ lookup('pipe', 'date +\"%Y-%b-%d-%H-%M-%S\"') }}-{{offline_installer_type}}" - when: uploadInstaller is not defined - - name: Ensure azure blob storage container exists command: az storage container create --name {{offline_installer_container_name}} --public-access off environment: @@ -40,6 +35,10 @@ - debug: msg: "{{folderName.stdout}}" +- name: set the folder name to copy the artifacts + set_fact: + time: "{{folderName.stdout}}" + - name: copy the installer artifacts and metadata files to upload it to azure blob and generate latest.json file template: src: "{{item}}.j2" @@ -54,7 +53,7 @@ args: chdir: "{{offline_repo_location}}/offline-installer-repo/" with_items: - - artifacts.sh + - artifacts.sh - metadata.sh - name: Upload to azure blob storage From 76b53fe8591a531135299f49c9527008890956d9 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 12:32:45 +0530 Subject: [PATCH 049/126] remove unwanted code --- ansible/roles/offline-installer/tasks/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index 6c817af78a..31bc47f627 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -31,11 +31,6 @@ recurse: yes when: uploadInstaller is not defined -- name: Create a variable to inject version in the template - set_fact: - installer_version: "{{ version.stdout }}" - when: uploadInstaller is not defined - - name: copy the installer script file and build script for building offline installer template: src: "{{item}}.j2" From 70d2cd98db4d4dab0839c47488ecdd0500d00610 Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 12:43:02 +0530 Subject: [PATCH 050/126] Error handling in the code --- pipelines/offlineinstaller/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index b02492d122..1f5bda8075 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -66,7 +66,7 @@ node() { values.put('ansiblePlaybook', ansiblePlaybook) values.put('ansibleExtraArgs', ansibleExtraArgs) println values -// ansible_playbook_run(values) + ansible_playbook_run(values) currentBuild.result = 'SUCCESS' } } From 5c4ec4a0a1cbef4680580e03f0f0230fe6af751c Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 13:39:17 +0530 Subject: [PATCH 051/126] changing the ownership to jenkins user to archieve contents --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index a6f431ab37..86794b6c79 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -81,10 +81,14 @@ path: - "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}" dest: "{{offline_repo_location}}/{{offline_installer_type}}.zip" + owner: jenkins + group: jenkins format: zip - name: copy latest.json file to archieve it in jenkins copy: src: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}/latest.json" dest: "{{offline_repo_location}}/latest.json" + owner: jenkins + group: jenkins remote_src: yes From 4af66d83d3c28206e7214b2da37c189a1a5fdabc Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 24 Oct 2019 14:26:39 +0530 Subject: [PATCH 052/126] change the ownership of the folders to jenkins user --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 86794b6c79..8ffa232eac 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -92,3 +92,12 @@ owner: jenkins group: jenkins remote_src: yes + +- name: change the ownership of the directory to jenkins user + file: + path: "{{offline_repo_location}}" + state: directory + recurse: yes + owner: jenkins + group: jenkins + From f4d2cdaf9efd859e8a5ab7306d41b1899bad05df Mon Sep 17 00:00:00 2001 From: Sourav Dey Date: Thu, 24 Oct 2019 15:00:45 +0530 Subject: [PATCH 053/126] Issue #Sb-12681 feat: Adding new app update api --- ansible/roles/kong-api/defaults/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 5f9edb52ce..2d9ae6f1e7 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -56,6 +56,7 @@ otp_service_prefix: /otp sso_service_prefix: /sso cert_service_prefix: /cert cert_registry_service_prefix: /certreg +desktop_app_prefix: /desktop # Service URLs content_service_url: "http://content-service:5000" @@ -4612,4 +4613,20 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: updateDesktopApp + uris: "{{ desktop_app_prefix }}/v1/update" + upstream_url: "{{ player_service_url }}/v1/desktop/update" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: contentUser + - name: rate-limiting + config.policy: local + config.hour: "{{ large_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" From 4e38944319cfef20547768b8f1cd853847d002d4 Mon Sep 17 00:00:00 2001 From: SMY ALTAMASH <30286162+SMYALTAMASH@users.noreply.github.com> Date: Thu, 24 Oct 2019 16:11:51 +0530 Subject: [PATCH 054/126] Offline installer Upload strategy changes with latest folder with artifacts metadata changes and archieve the latest.json in jenkins with artifact naming convention changes (#868) * Proxy server tokens off * Nginx Disbale Server Information * Nginx host injection issue fix * Nginx revert the old changes * Upload the artifact to latest folder * upload to azure with latest folder changes * uncomment delete workspace * constructing metadata for offline installer * metadata file logic changes * metadata file with parsed and readable json * renaming installer type with correct syntax * construct latest.json file with correct naming convention * Generic name to any linux distribution * linux installer changes * Installer logic changes * metadata file for installer * metadata file for installer with custom version * metadata file for offline version * tee comamnd changes * offline installer metadata file location * jq remove quotes * Upload the artifact in latest folder with latest.json file * Removing unwanted files from the installation * Archieve the latest.json file in jenkins * Disable deletion * Logic to take the installer name dynamicly * Get the artifact name from the env.json file * Dynamic metadata file changes * Remove copy artifact logic * Copy artifacts dynamicly using the environment name * Artifact relative path to copy * set the version mumber to versionize artifact uploads * make the version number dynamic with timestamp * Remove the duplicate code and run the installer * Uplaod the artifacts to azure blob * remove unwanted code * Error handling in the code * changing the ownership to jenkins user to archieve contents * change the ownership of the folders to jenkins user --- .../roles/offline-installer/tasks/main.yml | 11 ++- .../offline-installer/tasks/uploadToAzure.yml | 85 +++++++++++++++++-- .../templates/artifacts.sh.j2 | 15 ++++ .../offline-installer/templates/build.sh.j2 | 2 +- .../templates/metadata.sh.j2 | 8 ++ .../templates/setupOfflineInstaller.sh.j2 | 23 +++-- pipelines/offlineinstaller/Jenkinsfile | 1 + 7 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 ansible/roles/offline-installer/templates/artifacts.sh.j2 create mode 100644 ansible/roles/offline-installer/templates/metadata.sh.j2 diff --git a/ansible/roles/offline-installer/tasks/main.yml b/ansible/roles/offline-installer/tasks/main.yml index c24130f041..31bc47f627 100644 --- a/ansible/roles/offline-installer/tasks/main.yml +++ b/ansible/roles/offline-installer/tasks/main.yml @@ -19,7 +19,6 @@ dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" mode: '0755' with_items: - - setupOfflineInstaller.sh - build.sh - envfile - 32-bit-prerequisite.sh @@ -32,6 +31,15 @@ recurse: yes when: uploadInstaller is not defined +- name: copy the installer script file and build script for building offline installer + template: + src: "{{item}}.j2" + dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" + mode: '0755' + with_items: + - setupOfflineInstaller.sh + when: uploadInstaller is not defined + - name: upload to azure include: uploadToAzure.yml when: uploadInstaller is defined @@ -39,3 +47,4 @@ - name: Delete offline installer folder if any issue include: remove.yml when: removeOfflineInstallerFolder is defined + diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 0e3323837d..8ffa232eac 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -4,6 +4,58 @@ AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" +- name: Get the environment name for the artifact name + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/env.json | jq -r '.APP_NAME'" + register: env_name + +- name: Display the environment name of the installer + debug: + msg: "{{env_name.stdout}}" + +- name: Create a variable to inject environment name to upload to azure blob + set_fact: + environment_name: "{{ env_name.stdout }}" + +- name: Get the version from the package.json file + shell: "cat {{offline_repo_location}}/offline-installer-repo/src/package.json | jq -r '.version'" + register: version + +- name: Display the version number of the installer + debug: + msg: "{{version.stdout}}" + +- name: Create a variable to inject version in the template + set_fact: + installer_version: "{{ version.stdout }}" + +- name: get the directory name + shell: "ls {{offline_repo_location}}/offline-installer-repo/offline_artifacts/" + register: folderName + +- debug: + msg: "{{folderName.stdout}}" + +- name: set the folder name to copy the artifacts + set_fact: + time: "{{folderName.stdout}}" + +- name: copy the installer artifacts and metadata files to upload it to azure blob and generate latest.json file + template: + src: "{{item}}.j2" + dest: "{{offline_repo_location}}/offline-installer-repo/{{item}}" + mode: '0755' + with_items: + - artifacts.sh + - metadata.sh + +- name: copy the artifacts and generate the metadata file + shell: "bash {{offline_repo_location}}/offline-installer-repo/{{item}}" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/" + with_items: + - artifacts.sh + - metadata.sh + - name: Upload to azure blob storage command: az storage blob upload-batch --destination {{offline_installer_container_name}} --source "offline_artifacts" args: @@ -14,17 +66,38 @@ async: 60 poll: 10 -- name: get the directory name - shell: "ls {{offline_repo_location}}/offline-installer-repo/offline_artifacts/" - register: folderName - -- debug: - msg: "{{folderName.stdout}}" +- name: Upload to latest.json file to blob + command: az storage blob upload-batch --destination "{{offline_installer_container_name}}/latest" --source "{{folderName.stdout}}" + args: + chdir: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/" + environment: + AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" + AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" + async: 60 + poll: 10 - name: Create a zip of the folder to archieve the artifact archive: path: - "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}" dest: "{{offline_repo_location}}/{{offline_installer_type}}.zip" + owner: jenkins + group: jenkins format: zip +- name: copy latest.json file to archieve it in jenkins + copy: + src: "{{offline_repo_location}}/offline-installer-repo/offline_artifacts/{{folderName.stdout}}/latest.json" + dest: "{{offline_repo_location}}/latest.json" + owner: jenkins + group: jenkins + remote_src: yes + +- name: change the ownership of the directory to jenkins user + file: + path: "{{offline_repo_location}}" + state: directory + recurse: yes + owner: jenkins + group: jenkins + diff --git a/ansible/roles/offline-installer/templates/artifacts.sh.j2 b/ansible/roles/offline-installer/templates/artifacts.sh.j2 new file mode 100644 index 0000000000..ed3fa51a18 --- /dev/null +++ b/ansible/roles/offline-installer/templates/artifacts.sh.j2 @@ -0,0 +1,15 @@ +#!/bin/bash + + +if [ "{{offline_installer_type}}" == "windows32bit" ]; +then + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/win/ia32/{{environment_name}} Setup 1.0.0.exe' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows32bit.exe +elif [ "{{offline_installer_type}}" == "windows64bit" ]; +then + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/win/x64/{{environment_name}} Setup 1.0.0.exe' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_windows64bit.exe +elif [ "{{offline_installer_type}}" == "linux64bit" ]; +then + cp '{{offline_repo_location}}/offline-installer-repo/src/dist/1.0.0/linux/x64/{{environment_name}}_1.0.0_amd64.deb' offline_artifacts/{{time}}/{{environment_name}}_{{installer_version}}_linux64bit.deb +fi + + diff --git a/ansible/roles/offline-installer/templates/build.sh.j2 b/ansible/roles/offline-installer/templates/build.sh.j2 index be33e2a591..720b64b8c6 100644 --- a/ansible/roles/offline-installer/templates/build.sh.j2 +++ b/ansible/roles/offline-installer/templates/build.sh.j2 @@ -5,7 +5,7 @@ echo "Offline Installer for Sunbird" # Build script set -eo pipefail -if [ "{{offline_installer_type}}" == "windows32" ]; +if [ "{{offline_installer_type}}" == "windows32bit" ]; then docker run --rm -v ${PWD}:/private/ i386/node:8.16.2-stretch bash -x /private/32-bit-prerequisite.sh diff --git a/ansible/roles/offline-installer/templates/metadata.sh.j2 b/ansible/roles/offline-installer/templates/metadata.sh.j2 new file mode 100644 index 0000000000..9d7e7a0dd7 --- /dev/null +++ b/ansible/roles/offline-installer/templates/metadata.sh.j2 @@ -0,0 +1,8 @@ +#!/bin/bash + +env_name={{environment_name}} +version={{installer_version}} +artifactFolder=$(find offline_artifacts/* -type d) + +# constructing the latest.json file +echo "{\"version\":\"${version}\",\"windows\":{\"32bit\":\"${env_name}_${version}_windows32bit.exe\",\"64bit\":\"${env_name}_${version}_windows64bit.exe\"},\"linux\":{\"64bit\":\"${env_name}_${version}_linux64bit.deb\"}}" | jq '.' | tee -a {{offline_repo_location}}/offline-installer-repo/${artifactFolder}/latest.json diff --git a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 index a7d0c718c0..64b5a019b8 100644 --- a/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 +++ b/ansible/roles/offline-installer/templates/setupOfflineInstaller.sh.j2 @@ -5,24 +5,21 @@ npm install -g n n 8.16 cd /project/src -if [ "{{offline_installer_type}}" != "windows32" ]; +if [ "{{offline_installer_type}}" != "windows32bit" ]; then #Build the offline installer - npm install - npm run dist + npm install + npm run dist fi -if [ "{{offline_installer_type}}" == "windows32" ]; +if [ "{{offline_installer_type}}" == "windows32bit" ]; then -# npm run dist - npm run dist-win32 - cp '/project/src/dist/1.0.0/win/ia32/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ -elif [ "{{offline_installer_type}}" == "windows64" ]; +# npm run dist + npm run dist-win32 +elif [ "{{offline_installer_type}}" == "windows64bit" ]; then - npm run dist-win64 - cp '/project/src/dist/1.0.0/win/x64/DIKSHA Setup 1.0.0.exe' ../offline_artifacts/{{time}}/ -elif [ "{{offline_installer_type}}" == "debian" ]; + npm run dist-win64 +elif [ "{{offline_installer_type}}" == "linux64bit" ]; then - npm run dist-linux - cp '/project/src/dist/1.0.0/linux/x64/DIKSHA_1.0.0_amd64.deb' ../offline_artifacts/{{time}}/ + npm run dist-linux fi diff --git a/pipelines/offlineinstaller/Jenkinsfile b/pipelines/offlineinstaller/Jenkinsfile index c24ee78c22..1f5bda8075 100644 --- a/pipelines/offlineinstaller/Jenkinsfile +++ b/pipelines/offlineinstaller/Jenkinsfile @@ -52,6 +52,7 @@ node() { println values ansible_playbook_run(values) archiveArtifacts artifacts: '*.zip', onlyIfSuccessful: true + archiveArtifacts artifacts: 'latest.json', onlyIfSuccessful: true } } catch (err) { From a8022c727588b49ffbb8e64d992983899b457ed3 Mon Sep 17 00:00:00 2001 From: AMIT KUMAR Date: Fri, 25 Oct 2019 11:17:58 +0530 Subject: [PATCH 055/126] Issue #SC-1392 feat:ftl issue fix (#872) --- ansible/artifacts/sunbird/login/info.ftl | 1 + ansible/artifacts/sunbird/login/login-page-expired.ftl | 1 + ansible/artifacts/sunbird/login/login-reset-password.ftl | 1 + ansible/artifacts/sunbird/login/login-update-password.ftl | 1 + ansible/artifacts/sunbird/login/login.ftl | 2 ++ ansible/artifacts/sunbird/login/template.ftl | 1 + 6 files changed, 7 insertions(+) diff --git a/ansible/artifacts/sunbird/login/info.ftl b/ansible/artifacts/sunbird/login/info.ftl index f151cfde5b..169d70ae16 100755 --- a/ansible/artifacts/sunbird/login/info.ftl +++ b/ansible/artifacts/sunbird/login/info.ftl @@ -1,4 +1,5 @@ <#import "template.ftl" as layout> +<#ftl autoesc=false> <@layout.registrationLayout displayMessage=false; section> <#if section = "title"> ${message.summary} diff --git a/ansible/artifacts/sunbird/login/login-page-expired.ftl b/ansible/artifacts/sunbird/login/login-page-expired.ftl index b266614420..99cd0c48f8 100644 --- a/ansible/artifacts/sunbird/login/login-page-expired.ftl +++ b/ansible/artifacts/sunbird/login/login-page-expired.ftl @@ -1,4 +1,5 @@ <#import "template.ftl" as layout> +<#ftl autoesc=false> <@layout.registrationLayout; section> <#if section = "title"> ${msg("pageExpiredTitle")} diff --git a/ansible/artifacts/sunbird/login/login-reset-password.ftl b/ansible/artifacts/sunbird/login/login-reset-password.ftl index 5d81b0c7ad..2b299b4823 100644 --- a/ansible/artifacts/sunbird/login/login-reset-password.ftl +++ b/ansible/artifacts/sunbird/login/login-reset-password.ftl @@ -1,5 +1,6 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=true; section> +<#ftl autoesc=false> <#if section = "title"> ${msg("emailForgotTitle")} <#elseif section = "form"> diff --git a/ansible/artifacts/sunbird/login/login-update-password.ftl b/ansible/artifacts/sunbird/login/login-update-password.ftl index 434a269858..2a327b3cd8 100644 --- a/ansible/artifacts/sunbird/login/login-update-password.ftl +++ b/ansible/artifacts/sunbird/login/login-update-password.ftl @@ -1,5 +1,6 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=true; section> +<#ftl autoesc=false> <#if section = "title"> ${msg("updatePasswordTitle")} <#elseif section = "form"> diff --git a/ansible/artifacts/sunbird/login/login.ftl b/ansible/artifacts/sunbird/login/login.ftl index 8a2eb17f67..9586da0ee4 100644 --- a/ansible/artifacts/sunbird/login/login.ftl +++ b/ansible/artifacts/sunbird/login/login.ftl @@ -1,5 +1,6 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=social.displayInfo; section> +<#ftl autoesc=false> <#if section = "title"> ${msg("loginTitle",(realm.displayName!''))} <#elseif section = "header"> @@ -38,6 +39,7 @@ <#else>${msg("email")} + <#ftl autoesc=false> <#if usernameEditDisabled??> <#else> diff --git a/ansible/artifacts/sunbird/login/template.ftl b/ansible/artifacts/sunbird/login/template.ftl index 23e7579f51..544cb593c5 100644 --- a/ansible/artifacts/sunbird/login/template.ftl +++ b/ansible/artifacts/sunbird/login/template.ftl @@ -1,5 +1,6 @@ <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true> +<#ftl autoesc=false> From a15737293428f0a72af0b6631ff46836ef457236 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Fri, 25 Oct 2019 16:08:23 +0530 Subject: [PATCH 056/126] Issue #000 fix: create cert-templates es index. --- .../files/indices/cert-templates.json | 47 +++++ .../files/mappings/cert-templates.json | 177 ++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 ansible/roles/es-mapping/files/indices/cert-templates.json create mode 100644 ansible/roles/es-mapping/files/mappings/cert-templates.json diff --git a/ansible/roles/es-mapping/files/indices/cert-templates.json b/ansible/roles/es-mapping/files/indices/cert-templates.json new file mode 100644 index 0000000000..adb3af3688 --- /dev/null +++ b/ansible/roles/es-mapping/files/indices/cert-templates.json @@ -0,0 +1,47 @@ +{ + "settings": { + "index": { + "number_of_shards": "5", + "number_of_replicas": "1", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + } + } +} \ No newline at end of file diff --git a/ansible/roles/es-mapping/files/mappings/cert-templates.json b/ansible/roles/es-mapping/files/mappings/cert-templates.json new file mode 100644 index 0000000000..e8af59a9b7 --- /dev/null +++ b/ansible/roles/es-mapping/files/mappings/cert-templates.json @@ -0,0 +1,177 @@ +{ + "settings": { + "index": { + "number_of_shards": "5", + "number_of_replicas": "1", + "analysis": { + "filter": { + "mynGram": { + "token_chars": [ + "letter", + "digit", + "whitespace", + "punctuation", + "symbol" + ], + "min_gram": "1", + "type": "ngram", + "max_gram": "20" + } + }, + "analyzer": { + "cs_index_analyzer": { + "filter": [ + "lowercase", + "mynGram" + ], + "type": "custom", + "tokenizer": "standard" + }, + "keylower": { + "filter": "lowercase", + "type": "custom", + "tokenizer": "keyword" + }, + "cs_search_analyzer": { + "filter": [ + "lowercase", + "standard" + ], + "type": "custom", + "tokenizer": "standard" + } + } + } + } + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "template": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "params": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + } + } + } + } +} \ No newline at end of file From af193d6b0e50cd11665666809d8c38975380b5b0 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Fri, 25 Oct 2019 16:23:35 +0530 Subject: [PATCH 057/126] Issue #000 fix: es connection details for cert service. --- ansible/roles/stack-sunbird/templates/sunbird_cert-service.env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env b/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env index 4f8b5dffbe..775fbdf0cf 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env @@ -4,4 +4,5 @@ AZURE_STORAGE_SECRET={{sunbird_azure_storage_key}} AZURE_STORAGE_KEY={{sunbird_azure_storage_account}} sunbird_cert_domain_url={{proto}}://{{proxy_server_name}} sunbird_cert_enc_service_url=http://enc-service:8013 -download_link_expiry_timeout=600 \ No newline at end of file +download_link_expiry_timeout=600 +es_conn_info={{sunbird_es_host}}:{{sunbird_es_port}} \ No newline at end of file From 50cbafba129b746adcef3975da6692c6c689beec Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Fri, 25 Oct 2019 16:28:50 +0530 Subject: [PATCH 058/126] Issue #000 fix: file name changes. --- .../mappings/{cert-templates.json => cert-templates-mapping.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ansible/roles/es-mapping/files/mappings/{cert-templates.json => cert-templates-mapping.json} (100%) diff --git a/ansible/roles/es-mapping/files/mappings/cert-templates.json b/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json similarity index 100% rename from ansible/roles/es-mapping/files/mappings/cert-templates.json rename to ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json From 67f0cad0aae90e2d7924dd6817e2b50d3ad5ece5 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Fri, 25 Oct 2019 17:24:04 +0530 Subject: [PATCH 059/126] Issue #000 fix: updates to mapping and index file. --- .../files/indices/cert-templates.json | 130 ++++++++ .../mappings/cert-templates-mapping.json | 293 ++++++++---------- 2 files changed, 252 insertions(+), 171 deletions(-) diff --git a/ansible/roles/es-mapping/files/indices/cert-templates.json b/ansible/roles/es-mapping/files/indices/cert-templates.json index adb3af3688..e8af59a9b7 100644 --- a/ansible/roles/es-mapping/files/indices/cert-templates.json +++ b/ansible/roles/es-mapping/files/indices/cert-templates.json @@ -43,5 +43,135 @@ } } } + }, + "mappings": { + "_doc": { + "dynamic": false, + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" + } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" + }, + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "template": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "params": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + } + } + } } } \ No newline at end of file diff --git a/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json b/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json index e8af59a9b7..b9c7b9ca26 100644 --- a/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json +++ b/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json @@ -1,177 +1,128 @@ { - "settings": { - "index": { - "number_of_shards": "5", - "number_of_replicas": "1", - "analysis": { - "filter": { - "mynGram": { - "token_chars": [ - "letter", - "digit", - "whitespace", - "punctuation", - "symbol" - ], - "min_gram": "1", - "type": "ngram", - "max_gram": "20" - } - }, - "analyzer": { - "cs_index_analyzer": { - "filter": [ - "lowercase", - "mynGram" - ], - "type": "custom", - "tokenizer": "standard" - }, - "keylower": { - "filter": "lowercase", - "type": "custom", - "tokenizer": "keyword" - }, - "cs_search_analyzer": { - "filter": [ - "lowercase", - "standard" - ], - "type": "custom", - "tokenizer": "standard" - } - } - } + "dynamic": false, + "properties": { + "all_fields": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower" } + }, + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer" }, - "mappings": { - "_doc": { - "dynamic": false, - "properties": { - "all_fields": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower" - } - }, - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer" - }, - "identifier": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "name": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "template": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "params": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "createdBy": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "updatedBy": { - "type": "text", - "fields": { - "raw": { - "type": "text", - "analyzer": "keylower", - "fielddata": true - } - }, - "copy_to": [ - "all_fields" - ], - "analyzer": "cs_index_analyzer", - "search_analyzer": "cs_search_analyzer", - "fielddata": true - }, - "createdOn": { - "type": "date", - "fields": { - "raw": { - "type": "date" - } - } - }, - "updatedOn": { - "type": "date", - "fields": { - "raw": { - "type": "date" - } - } - } - } + "identifier": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "name": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "template": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "params": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "updatedBy": { + "type": "text", + "fields": { + "raw": { + "type": "text", + "analyzer": "keylower", + "fielddata": true + } + }, + "copy_to": [ + "all_fields" + ], + "analyzer": "cs_index_analyzer", + "search_analyzer": "cs_search_analyzer", + "fielddata": true + }, + "createdOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } + }, + "updatedOn": { + "type": "date", + "fields": { + "raw": { + "type": "date" + } + } } + } } \ No newline at end of file From 38e454253566b96af0b63f7e10784d1d99d7e271 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Mon, 28 Oct 2019 13:09:44 +0530 Subject: [PATCH 060/126] ES port number change (#876) * Issue #000 fix: ES port number change * Issue #000 fix: es port changes. --- ansible/roles/stack-sunbird/defaults/main.yml | 1 + ansible/roles/stack-sunbird/templates/sunbird_cert-service.env | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index dd49c4c338..ede358fee9 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -10,6 +10,7 @@ sunbird_keycloak_public: sunbird_cache_store: sunbird_cache_ttl: 1800 sunbird_es_port: 9300 # If this port is same for all the machines, single vaule is enough! else comma seperated values +sunbird_es_http_port: 9200 actor_replicas: 1 actor_reservation_memory: 768M actor_limit_memory: 1024M diff --git a/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env b/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env index 775fbdf0cf..8bbafae36e 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_cert-service.env @@ -5,4 +5,4 @@ AZURE_STORAGE_KEY={{sunbird_azure_storage_account}} sunbird_cert_domain_url={{proto}}://{{proxy_server_name}} sunbird_cert_enc_service_url=http://enc-service:8013 download_link_expiry_timeout=600 -es_conn_info={{sunbird_es_host}}:{{sunbird_es_port}} \ No newline at end of file +es_conn_info={{sunbird_es_host}}:{{sunbird_es_http_port}} \ No newline at end of file From 053f516864587cb1b517dc5855d8c37388e93058 Mon Sep 17 00:00:00 2001 From: rahul-tarento <44634103+rahul-tarento@users.noreply.github.com> Date: Mon, 28 Oct 2019 18:57:15 +0530 Subject: [PATCH 061/126] changes for calling cert template for batch (#874) --- ansible/roles/kong-api/defaults/main.yml | 32 +++++++++++++++++++ .../templates/sunbird_lms-service.env | 4 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 2d9ae6f1e7..e9e3898ca5 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4501,6 +4501,38 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: courseBatchAddCertificateTemplate + uris: "{{ course_service_prefix }}/batch/cert/v1/template/add" + upstream_url: "{{ lms_service_url }}/v1/course/batch/cert/template/add" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: courseUser + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: courseBatchRemoveCertificateTemplate + uris: "{{ course_service_prefix }}/batch/cert/v1/template/remove" + upstream_url: "{{ lms_service_url }}/v1/course/batch/cert/template/remove" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: courseUser + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" - name: downloadCertificate uris: "{{ user_service_prefix }}/v1/certs/download" upstream_url: "{{ learning_service_url }}/v1/user/certs/download" diff --git a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env index 4a0efe1ace..65ad37428d 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env @@ -104,4 +104,6 @@ sunbird_user_org_api_base_url={{sunbird_user_org_api_base_url}} kafka_topics_instruction={{kafka_topics_instruction}} kafka_urls={{kafka_urls}} kafka_topics_certificate_instruction={{kafka_topics_certificate_instruction}} -kafka_assessment_topic={{kafka_assessment_topic}} \ No newline at end of file +kafka_assessment_topic={{kafka_assessment_topic}} +# Required by lms service to call cert service +sunbird_cert_service_base_url=http://cert-service:9000 \ No newline at end of file From f4c8ba0f44ffb6d23fa7fe791108663c4c5e0145 Mon Sep 17 00:00:00 2001 From: Harikumar Palemkota Date: Tue, 29 Oct 2019 14:42:19 +0530 Subject: [PATCH 062/126] Issue #SB-00 added env variables for notification-samza job --- ansible/roles/samza-jobs/defaults/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ansible/roles/samza-jobs/defaults/main.yml b/ansible/roles/samza-jobs/defaults/main.yml index 122263e128..e09e3d0530 100644 --- a/ansible/roles/samza-jobs/defaults/main.yml +++ b/ansible/roles/samza-jobs/defaults/main.yml @@ -7,6 +7,13 @@ __yarn_port__: 8000 cassandra_port: 9042 es_port: 9200 __fcm_account_key__: "{{sunbird_fcm_account_key}}" +__sunbird_msg_91_auth__: "{{sunbird_msg_91_auth}}" +__sunbird_notification_msg_default_sender__: "{{sunbird_msg_sender}}" +__sunbird_mail_server_from_email__:"{{sunbird_mail_server_from_email}}" +__sunbird_mail_server_host__:"{{sunbird_mail_server_host}}" +__sunbird_mail_server_password__:"{{sunbird_mail_server_port}}" +__sunbird_mail_server_username__:"{{sunbird_mail_server_username}}" +__sunbird_mail_server_password__:"{{sunbird_mail_server_password}}" samza_tar_files_localpath: roles/samza-jobs/defaults job_names: lms.user-account-merger_1: From aaaa78a59d7e7478031f4781b4468219f5672761 Mon Sep 17 00:00:00 2001 From: Harikumar Palemkota Date: Tue, 29 Oct 2019 14:56:19 +0530 Subject: [PATCH 063/126] Issue #SB-15312 added env variables for notification-samza job --- ansible/roles/samza-jobs/defaults/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/roles/samza-jobs/defaults/main.yml b/ansible/roles/samza-jobs/defaults/main.yml index e09e3d0530..2c1a64f509 100644 --- a/ansible/roles/samza-jobs/defaults/main.yml +++ b/ansible/roles/samza-jobs/defaults/main.yml @@ -9,11 +9,11 @@ es_port: 9200 __fcm_account_key__: "{{sunbird_fcm_account_key}}" __sunbird_msg_91_auth__: "{{sunbird_msg_91_auth}}" __sunbird_notification_msg_default_sender__: "{{sunbird_msg_sender}}" -__sunbird_mail_server_from_email__:"{{sunbird_mail_server_from_email}}" -__sunbird_mail_server_host__:"{{sunbird_mail_server_host}}" -__sunbird_mail_server_password__:"{{sunbird_mail_server_port}}" -__sunbird_mail_server_username__:"{{sunbird_mail_server_username}}" -__sunbird_mail_server_password__:"{{sunbird_mail_server_password}}" +__sunbird_mail_server_from_email__: "{{sunbird_mail_server_from_email}}" +__sunbird_mail_server_host__: "{{sunbird_mail_server_host}}" +__sunbird_mail_server_password__: "{{sunbird_mail_server_port}}" +__sunbird_mail_server_username__: "{{sunbird_mail_server_username}}" +__sunbird_mail_server_password__: "{{sunbird_mail_server_password}}" samza_tar_files_localpath: roles/samza-jobs/defaults job_names: lms.user-account-merger_1: From a4b883241e3c215c69a730ff0e55a48dd956a225 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 29 Oct 2019 17:00:24 +0530 Subject: [PATCH 064/126] Cert Template APIs on-boarding and Course-Batch mapping changes (#878) * Issue #000 fix: ES port number change * Issue #000 fix: es port changes. * Issue #000 feat: cert template APIs onboarding * Issue #000 fix: update course-batch mapping for cert-templates. --- .../files/mappings/course-batch-mapping.json | 3 ++ ansible/roles/kong-api/defaults/main.yml | 48 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/ansible/roles/es-mapping/files/mappings/course-batch-mapping.json b/ansible/roles/es-mapping/files/mappings/course-batch-mapping.json index 722516897d..b94aad2590 100644 --- a/ansible/roles/es-mapping/files/mappings/course-batch-mapping.json +++ b/ansible/roles/es-mapping/files/mappings/course-batch-mapping.json @@ -259,6 +259,9 @@ "type": "date" } } + }, + "cert_templates": { + "type": "nested" } } } \ No newline at end of file diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index e9e3898ca5..e4f3309492 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4447,6 +4447,54 @@ kong_apis: - {name: 'acl', config.whitelist: 'userUpdate'} - {name: 'rate-limiting', config.policy: "local", config.hour: "{{ medium_rate_limit_per_hour }}"} - {name: 'request-size-limiting', config.allowed_payload_size: "{{ small_request_size_limit }}" } + - name: createCertTemplate + uris: "{{ cert_service_prefix }}/v1/template/create" + upstream_url: "{{ cert_service_url }}/cert/v1/template/create" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: orgUpdate + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: updateCertTemplate + uris: "{{ cert_service_prefix }}/v1/template/update" + upstream_url: "{{ cert_service_url }}/cert/v1/template/update" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: orgUpdate + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" + - name: readCertTemplate + uris: "{{ cert_service_prefix }}/v1/template/read" + upstream_url: "{{ cert_service_url }}/cert/v1/template/read" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: orgUpdate + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ medium_request_size_limit }}" - name: "orgAssignKeys" uris: "{{ org_service_prefix }}/v1/assign/key" upstream_url: "{{ learning_service_url }}/v1/org/assign/key" From d6da0e76fad63dd44c160004c58f3d1bca9adb12 Mon Sep 17 00:00:00 2001 From: S M Y Date: Tue, 29 Oct 2019 17:59:58 +0530 Subject: [PATCH 065/126] Port variable changes --- ansible/roles/samza-jobs/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/samza-jobs/defaults/main.yml b/ansible/roles/samza-jobs/defaults/main.yml index 2c1a64f509..bcf48ef719 100644 --- a/ansible/roles/samza-jobs/defaults/main.yml +++ b/ansible/roles/samza-jobs/defaults/main.yml @@ -11,7 +11,7 @@ __sunbird_msg_91_auth__: "{{sunbird_msg_91_auth}}" __sunbird_notification_msg_default_sender__: "{{sunbird_msg_sender}}" __sunbird_mail_server_from_email__: "{{sunbird_mail_server_from_email}}" __sunbird_mail_server_host__: "{{sunbird_mail_server_host}}" -__sunbird_mail_server_password__: "{{sunbird_mail_server_port}}" +__sunbird_mail_server_port__: "{{sunbird_mail_server_port}}" __sunbird_mail_server_username__: "{{sunbird_mail_server_username}}" __sunbird_mail_server_password__: "{{sunbird_mail_server_password}}" samza_tar_files_localpath: roles/samza-jobs/defaults From 5270510ceaf97e088c69a41675c479164cf07d44 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Wed, 30 Oct 2019 14:01:33 +0530 Subject: [PATCH 066/126] Cert Tempalte Index changes (#885) * Issue #000 fix: ES port number change * Issue #000 fix: es port changes. * Issue #000 feat: cert template APIs onboarding * Issue #000 fix: update course-batch mapping for cert-templates. * Issue #000 fix: strict mapping for cert-templates. --- .../roles/es-mapping/files/mappings/cert-templates-mapping.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json b/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json index b9c7b9ca26..bdddd11afc 100644 --- a/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json +++ b/ansible/roles/es-mapping/files/mappings/cert-templates-mapping.json @@ -1,5 +1,5 @@ { - "dynamic": false, + "dynamic": "strict", "properties": { "all_fields": { "type": "text", From 32a2035823ae7749d3e357dc3eb611acdd4f51b8 Mon Sep 17 00:00:00 2001 From: Keshav Prasad Date: Thu, 31 Oct 2019 14:16:10 +0530 Subject: [PATCH 067/126] fix: adding x forward for api block (#887) --- ansible/roles/stack-proxy/templates/proxy-default.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/stack-proxy/templates/proxy-default.conf b/ansible/roles/stack-proxy/templates/proxy-default.conf index 8152bb1686..3095bc57c6 100644 --- a/ansible/roles/stack-proxy/templates/proxy-default.conf +++ b/ansible/roles/stack-proxy/templates/proxy-default.conf @@ -107,6 +107,7 @@ server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 5; proxy_send_timeout 60; proxy_read_timeout 70; From 7ff6b9412716e201bd7f2c5499003895d1d3c52f Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 31 Oct 2019 18:53:28 +0530 Subject: [PATCH 068/126] Issue #000 feat: updated Forwarded-for to real-ip; --- ansible/roles/stack-proxy/templates/proxy-default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-proxy/templates/proxy-default.conf b/ansible/roles/stack-proxy/templates/proxy-default.conf index 3095bc57c6..f05beacc19 100644 --- a/ansible/roles/stack-proxy/templates/proxy-default.conf +++ b/ansible/roles/stack-proxy/templates/proxy-default.conf @@ -107,7 +107,7 @@ server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 5; proxy_send_timeout 60; proxy_read_timeout 70; From 862ec9aae0ebf3e06c75d19245948948367bf7ed Mon Sep 17 00:00:00 2001 From: S M Y Date: Mon, 4 Nov 2019 11:59:37 +0530 Subject: [PATCH 069/126] Offline installer container to be public --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 8ffa232eac..3c8c4f1d50 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -1,5 +1,5 @@ - name: Ensure azure blob storage container exists - command: az storage container create --name {{offline_installer_container_name}} --public-access off + command: az storage container create --name {{offline_installer_container_name}} --public-access container environment: AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" From 18a1855a5ebf6ad90c3def9264ae94783c6f3edb Mon Sep 17 00:00:00 2001 From: S M Y Date: Mon, 4 Nov 2019 11:59:55 +0530 Subject: [PATCH 070/126] Offline installer safe defaults --- ansible/roles/stack-proxy/defaults/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible/roles/stack-proxy/defaults/main.yml b/ansible/roles/stack-proxy/defaults/main.yml index 09d29817ec..67e6340b35 100644 --- a/ansible/roles/stack-proxy/defaults/main.yml +++ b/ansible/roles/stack-proxy/defaults/main.yml @@ -39,3 +39,8 @@ ep_es_host: upstream_url: "ekstep-public-{{ekstep_s3_env}}.s3-ap-south-1.amazonaws.com" plugin_upstream_url: "ekstep-public-{{ekstep_s3_env}}.s3-ap-south-1.amazonaws.com" +sunbird_offline_azure_storage_account_url: "{{ sunbird_offline_azure_storage_account }}.blob.core.windows.net/{{ offline_installer_container_name }}" + +offline_installer_container_name: "{{env}}-offlineinstaller" +sunbird_offline_azure_storage_account: "sunbirdofflineinstaller" +sunbird_offline_azure_storage_key: "{{core_vault_sunbird_offline_azure_storage_key}}" From 4b6b06b65e41ff05ddc050234a557ec09bc9443c Mon Sep 17 00:00:00 2001 From: S M Y Date: Mon, 4 Nov 2019 12:00:56 +0530 Subject: [PATCH 071/126] Offline installer safe defaults --- ansible/roles/stack-proxy/defaults/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ansible/roles/stack-proxy/defaults/main.yml b/ansible/roles/stack-proxy/defaults/main.yml index 67e6340b35..8019d1971f 100644 --- a/ansible/roles/stack-proxy/defaults/main.yml +++ b/ansible/roles/stack-proxy/defaults/main.yml @@ -40,7 +40,3 @@ ep_es_host: upstream_url: "ekstep-public-{{ekstep_s3_env}}.s3-ap-south-1.amazonaws.com" plugin_upstream_url: "ekstep-public-{{ekstep_s3_env}}.s3-ap-south-1.amazonaws.com" sunbird_offline_azure_storage_account_url: "{{ sunbird_offline_azure_storage_account }}.blob.core.windows.net/{{ offline_installer_container_name }}" - -offline_installer_container_name: "{{env}}-offlineinstaller" -sunbird_offline_azure_storage_account: "sunbirdofflineinstaller" -sunbird_offline_azure_storage_key: "{{core_vault_sunbird_offline_azure_storage_key}}" From 1cbcbad2623a5f22247e7569cc84a73d146d5611 Mon Sep 17 00:00:00 2001 From: S M Y Date: Mon, 4 Nov 2019 12:01:24 +0530 Subject: [PATCH 072/126] Offline installer proxy redirections --- .../stack-proxy/templates/proxy-default.conf | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ansible/roles/stack-proxy/templates/proxy-default.conf b/ansible/roles/stack-proxy/templates/proxy-default.conf index f05beacc19..6ac6da5375 100644 --- a/ansible/roles/stack-proxy/templates/proxy-default.conf +++ b/ansible/roles/stack-proxy/templates/proxy-default.conf @@ -410,6 +410,46 @@ location ~* ^/content-plugins/(.*) { proxy_pass http://player; } +location ~* ^/desktop/(.*) { + # Enabling cache for Response code 200 + expires 1M; + add_header Pragma public; + add_header Cache-Control "public"; + + # Enabling compression + gzip on; + gzip_min_length 100000; + gzip_proxied expired no-cache no-store private auth; + gzip_types application/javascript application/x-javascript text/css text/javascript; + + if ($request_method = OPTIONS ) { + add_header Access-Control-Allow-Origin "*" ; + add_header Access-Control-Allow-Methods "GET, OPTIONS, PATCH, POST"; + add_header Access-Control-Allow-Headers "Access-Control-Allow-Origin, Authorization, Content-Type, user-id"; + # add_header Access-Control-Allow-Credentials "true"; + add_header Content-Length 0; + add_header Content-Type text/plain; + return 200; + } + set $offline_bucket "{{ sunbird_offline_azure_storage_account_url }}"; + + set $url_full '$1'; + proxy_http_version 1.1; + proxy_set_header Host "{{sunbird_offline_azure_storage_account_url.split('/')[0]|lower}}"; + proxy_set_header Authorization ''; + proxy_hide_header Access-Control-Allow-Origin; + proxy_hide_header Access-Control-Allow-Methods; + proxy_hide_header x-amz-id-2; + proxy_hide_header x-amz-request-id; + proxy_hide_header Set-Cookie; + proxy_ignore_headers "Set-Cookie"; + proxy_buffering off; + proxy_intercept_errors on; + add_header Access-Control-Allow-Origin "*"; + add_header Access-Control-Allow-Methods GET; + proxy_pass https://$offline_bucket/$url_full; +} + location / { rewrite ^/(.*) /$1 break; From e8a7ef72a51b643828c75317c515224da1b33fc3 Mon Sep 17 00:00:00 2001 From: S M Y Date: Mon, 4 Nov 2019 12:10:42 +0530 Subject: [PATCH 073/126] Read only access to the blobs and not list access --- ansible/roles/offline-installer/tasks/uploadToAzure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/offline-installer/tasks/uploadToAzure.yml b/ansible/roles/offline-installer/tasks/uploadToAzure.yml index 3c8c4f1d50..aa06b7e6d7 100644 --- a/ansible/roles/offline-installer/tasks/uploadToAzure.yml +++ b/ansible/roles/offline-installer/tasks/uploadToAzure.yml @@ -1,5 +1,5 @@ - name: Ensure azure blob storage container exists - command: az storage container create --name {{offline_installer_container_name}} --public-access container + command: az storage container create --name {{offline_installer_container_name}} --public-access blob environment: AZURE_STORAGE_ACCOUNT: "{{sunbird_offline_azure_storage_account}}" AZURE_STORAGE_KEY: "{{sunbird_offline_azure_storage_key}}" From 4c80a3e8c7d18aac1e9cfb71a5f4ad4ccadd7ff6 Mon Sep 17 00:00:00 2001 From: Arjun Khetia Date: Tue, 5 Nov 2019 14:05:31 +0530 Subject: [PATCH 074/126] SB-15468 - Text Modifications --- .../sunbird/login/messages/messages_en.properties | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ansible/artifacts/sunbird/login/messages/messages_en.properties b/ansible/artifacts/sunbird/login/messages/messages_en.properties index 0cfbc61631..a9655ba233 100644 --- a/ansible/artifacts/sunbird/login/messages/messages_en.properties +++ b/ansible/artifacts/sunbird/login/messages/messages_en.properties @@ -1,8 +1,8 @@ -doLogIn=Log In +doLogIn=Login doRegister=Sign Up doSignIn=Sign In doSignWithGoogle=with Google -doSignWithState=Log In with State System +doSignWithState=Login with State System doCancel=Cancel doSubmit=Submit doReset=Reset @@ -56,8 +56,8 @@ goBack=<<Go Back mergeAccountMessage=Enter Mobile number / Email ID OR use Google Sign in to identify the account from which you want to merge usage details migrateAccountMessage=Confirm the password for the DIKSHA account you want to merge of cick Sign in with Google to sign in using your Gmail account inCorrectPasswordError=The password entered is incorrect. Enter the password again. -emailOrPhone=Mobile number / Email ID -placeholderForEmailOrPhone=Enter Mobile number / Email ID +emailOrPhone=Email ID / Mobile number +placeholderForEmailOrPhone=Enter Email ID / Mobile number firstName=First name givenName=Given name fullName=Full name @@ -267,8 +267,7 @@ requiredAction.UPDATE_PROFILE=Update Profile requiredAction.VERIFY_EMAIL=Verify Email user_not_found=This email ID/mobile number doesn''t belong to a valid user p3pPolicy=CP="This is not a P3P policy!" -usernamePlaceholder = Enter your registered Phone No. / Email address +usernamePlaceholder = Enter your Registered Email address/Mobile number passwordPlaceholder = Enter password loginDiksha = Log into DIKSHA registerHere = Register here - From e92c097b7eb4d7aa8016bdaf63d7159178c0a919 Mon Sep 17 00:00:00 2001 From: Arjun Khetia Date: Tue, 5 Nov 2019 14:18:57 +0530 Subject: [PATCH 075/126] SB-15468 - Text Modifications --- .../sunbird/login/messages/messages_en.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/artifacts/sunbird/login/messages/messages_en.properties b/ansible/artifacts/sunbird/login/messages/messages_en.properties index a9655ba233..b9d375c916 100644 --- a/ansible/artifacts/sunbird/login/messages/messages_en.properties +++ b/ansible/artifacts/sunbird/login/messages/messages_en.properties @@ -38,7 +38,7 @@ emailVerifyTitle=Email verification emailForgotTitle=Forgot Your Password? updatePasswordTitle=Update Password newPasswordTitle=Create New Password -enterEmailPhonenumberToGetCode=Enter your Email ID/ Mobile number and we will send you instructions on how to reset your password +enterEmailPhonenumberToGetCode=Enter your Email Address/ Mobile number and we will send you instructions on how to reset your password codeSuccessTitle=Success code codeErrorTitle=Error code\: {0} @@ -53,11 +53,11 @@ consentDenied=Consent denied. noAccount=Don''t have an account? username=Username or Mobile number goBack=<<Go Back -mergeAccountMessage=Enter Mobile number / Email ID OR use Google Sign in to identify the account from which you want to merge usage details +mergeAccountMessage=Enter Mobile number / Email Address OR use Google Sign in to identify the account from which you want to merge usage details migrateAccountMessage=Confirm the password for the DIKSHA account you want to merge of cick Sign in with Google to sign in using your Gmail account inCorrectPasswordError=The password entered is incorrect. Enter the password again. -emailOrPhone=Email ID / Mobile number -placeholderForEmailOrPhone=Enter Email ID / Mobile number +emailOrPhone=Email Address / Mobile number +placeholderForEmailOrPhone=Enter Email Address / Mobile number firstName=First name givenName=Given name fullName=Full name @@ -135,7 +135,7 @@ client_admin-cli=Admin CLI client_realm-management=Realm Management client_broker=Broker -invalidUserMessage=Invalid email ID/Mobile number or password. Please try again with valid credentials +invalidUserMessage=Invalid Email Address/Mobile number or password. Please try again with valid credentials invalidEmailMessage=Invalid email address. accountDisabledMessage=Account is disabled, contact admin. accountTemporarilyDisabledMessage=Your account has been locked due to too many incorrect login attempts. You can re-attempt to login after 24 hours. Please get in touch with the help desk team for support @@ -265,7 +265,7 @@ requiredAction.terms_and_conditions=Terms and Conditions requiredAction.UPDATE_PASSWORD=Update Password requiredAction.UPDATE_PROFILE=Update Profile requiredAction.VERIFY_EMAIL=Verify Email -user_not_found=This email ID/mobile number doesn''t belong to a valid user +user_not_found=This Email Address/Mobile Number doesn''t belong to a valid user p3pPolicy=CP="This is not a P3P policy!" usernamePlaceholder = Enter your Registered Email address/Mobile number passwordPlaceholder = Enter password From 29561420abc641cce76661e5209e56580b6501ec Mon Sep 17 00:00:00 2001 From: Rajeev Sathish Date: Tue, 5 Nov 2019 15:27:28 +0530 Subject: [PATCH 076/126] Issue #SC-1321 device location changes --- ansible/inventory/env/group_vars/all.yml | 1 + ansible/roles/stack-sunbird/templates/sunbird_player.env | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index eb51998eb4..7fba94bc00 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -678,3 +678,4 @@ kafka_assessment_topic: "{{env_name}}.telemetry.assess" # Portal vars for reports sunbird_portal_azure_storage_account: "{{sunbird_azure_storage_account}}" sunbird_portal_azure_storage_key: "{{sunbird_azure_storage_key}}" +sunbird_device_api: "{{proto}}://{{ proxy_server_name }}/api/" diff --git a/ansible/roles/stack-sunbird/templates/sunbird_player.env b/ansible/roles/stack-sunbird/templates/sunbird_player.env index c7191bcd50..b47140fe36 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_player.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_player.env @@ -74,3 +74,6 @@ sunbird_android_keycloak_client_id={{sunbird_android_keycloak_client_id}} #Release-2.3.5 sunbird_portal_merge_auth_server_url={{sunbird_subdomain_keycloak_base_url | d('')}} + +#Release-2.5.0 +sunbird_device_api={{sunbird_device_api}} From f3967b247f09a05d1e70872d235cf0287ed09a9e Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Tue, 5 Nov 2019 17:36:31 +0530 Subject: [PATCH 077/126] fix: download new m2 --- deploy/jenkins/jenkins-plugins-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/jenkins/jenkins-plugins-setup.sh b/deploy/jenkins/jenkins-plugins-setup.sh index 85368199d9..ee6d0744f3 100755 --- a/deploy/jenkins/jenkins-plugins-setup.sh +++ b/deploy/jenkins/jenkins-plugins-setup.sh @@ -9,8 +9,8 @@ read -sp 'Jenkins admin Password: ' password if [[ ! -d /var/lib/jenkins/.m2 ]]; then echo -e "\n\e[0;32m${bold}Downloading and copying m2 directory to Jenkins ${normal}" -wget https://sunbirdpublic.blob.core.windows.net/installation/m2_updated.zip -unzip m2_updated.zip +wget https://sunbirdpublic.blob.core.windows.net/installation/m2_new.zip +unzip m2_new.zip mv .m2 /var/lib/jenkins chown -R jenkins:jenkins /var/lib/jenkins/.m2 fi From b368ce738395452d88320eabd19a80e0dc3e356a Mon Sep 17 00:00:00 2001 From: Devesh Date: Tue, 12 Nov 2019 12:54:29 +0530 Subject: [PATCH 078/126] Issue #SB-0000 fix:syncing of keyclaock migration from local to sessionstorage --- .../sunbird/login/resources/js/login.js | 114 +++++++++++++----- 1 file changed, 87 insertions(+), 27 deletions(-) diff --git a/ansible/artifacts/sunbird/login/resources/js/login.js b/ansible/artifacts/sunbird/login/resources/js/login.js index 5f50ca645b..6b524f72f0 100644 --- a/ansible/artifacts/sunbird/login/resources/js/login.js +++ b/ansible/artifacts/sunbird/login/resources/js/login.js @@ -5,6 +5,7 @@ function getQueryStringValue (key) { window.onload = function(){ var mergeaccountprocess = (new URLSearchParams(window.location.search)).get('mergeaccountprocess'); var version = (new URLSearchParams(window.location.search)).get('version'); + var isForgetPasswordAllow = getValueFromSession('version'); var renderingType = 'queryParams'; if (!mergeaccountprocess) { mergeaccountprocess = localStorage.getItem('mergeaccountprocess'); @@ -26,7 +27,7 @@ window.onload = function(){ addVersionToURL(version); var error_message = (new URLSearchParams(window.location.search)).get('error_message'); var success_message = (new URLSearchParams(window.location.search)).get('success_message'); - var version = (new URLSearchParams(window.location.search)).get('version'); + if(error_message){ var error_msg = document.getElementById('error-msg'); error_msg.className = error_msg.className.replace("hide",""); @@ -38,13 +39,23 @@ window.onload = function(){ } if (version >= 4) { var forgotElement = document.getElementById("fgtPortalFlow"); - forgotElement.className = forgotElement.className.replace("hide",""); + if(forgotElement){ + forgotElement.className = forgotElement.className.replace("hide",""); + } } else { var forgotElement = document.getElementById("fgtKeycloakFlow"); - forgotElement.className = forgotElement.className.replace("hide",""); - forgotElement.href = forgotElement.href + '&version=' + version ; + if(forgotElement){ + forgotElement.className = forgotElement.className.replace("hide",""); + forgotElement.href = forgotElement.href + '&version=' + version ; + } + } + if(!version && isForgetPasswordAllow >=4 ){ + hideElement("fgtKeycloakFlow"); + var forgotElement = document.getElementById("fgtPortalFlow"); + if(forgotElement){ + forgotElement.className = forgotElement.className.replace("hide",""); + } } - if (mergeaccountprocess === '1') { hideElement("kc-registration"); hideElement("stateButton"); @@ -75,12 +86,7 @@ window.onload = function(){ mergeAccountMessage.className = mergeAccountMessage.className.replace("hide", ""); } } - - var response_type = (new URLSearchParams(window.location.search)).get('response_type'); - if ((new URLSearchParams(window.location.search)).get('automerge') !== '1' && response_type === 'code') { - localStorage.clear(); - } - var autoMerge = getValue('automerge'); + var autoMerge = getValueFromSession('automerge'); if (autoMerge === '1') { decoratePage('autoMerge'); storeValueForMigration(); @@ -88,14 +94,29 @@ window.onload = function(){ }; var storeValueForMigration = function () { - // storing values in localstorage for future references - localStorage.setItem('automerge', getValue('automerge')); - localStorage.setItem('goBackUrl', getValue('goBackUrl')); - localStorage.setItem('identifierValue', getValue('identifierValue')); - localStorage.setItem('identifierType', getValue('identifierType')); - localStorage.setItem('userId', getValue('userId')); + // storing values in sessionStorage for future references + sessionStorage.setItem('automerge', getValueFromSession('automerge')); + sessionStorage.setItem('goBackUrl', getValueFromSession('goBackUrl')); + sessionStorage.setItem('identifierValue', getValueFromSession('identifierValue')); + sessionStorage.setItem('identifierType', getValueFromSession('identifierType')); + sessionStorage.setItem('userId', getValueFromSession('userId')); +}; +var getValueFromSession = function (valueId) { + var value = (new URLSearchParams(window.location.search)).get(valueId); + if (value) { + sessionStorage.setItem(valueId, value); + sessionStorage.setItem('renderingType', 'queryParams'); + return value + } else { + value = sessionStorage.getItem(valueId); + if (value) { + sessionStorage.setItem('renderingType', 'sessionStorage'); + } + return value + } }; + var getValue = function (valueId) { var value = (new URLSearchParams(window.location.search)).get(valueId); if (value) { @@ -113,13 +134,17 @@ var getValue = function (valueId) { var decoratePage = function (pageType) { if (pageType === 'autoMerge') { - var identifierValue = getValue('identifierValue'); - var goBackUrl = getValue('goBackUrl'); + var identifierValue = getValueFromSession('identifierValue'); + var goBackUrl = getValueFromSession('goBackUrl'); var signIn = document.getElementById("signIn"); if (signIn) { signIn.innerText = 'Merge Account'; signIn.classList.add('fs-22'); } + var loginButton = document.getElementById("login"); + if (loginButton) { + loginButton.innerText = 'Next'; + } setElementValue('username', identifierValue); var elementsToHide = ['kc-registration', 'stateButton', 'fgtKeycloakFlow', 'fgtPortalFlow', @@ -131,11 +156,11 @@ var decoratePage = function (pageType) { if (goBackElement) { goBackElement.href = goBackUrl; } - if (localStorage.getItem('renderingType') === 'localStorage') { + if (sessionStorage.getItem('renderingType') === 'sessionStorage') { unHideElement('selfSingUp'); var errorElement = document.getElementById('error-summary'); if (errorElement) { - if (errorElement.innerText === 'Invalid email ID/Mobile number or password. Please try again with valid credentials') { + if (errorElement.innerText === 'Invalid email Address/Mobile number or password. Please try again with valid credentials') { unHideElement('inCorrectPasswordError'); handlePasswordFailure(); } @@ -149,12 +174,12 @@ var decoratePage = function (pageType) { }; var handlePasswordFailure = function () { - var passwordFailCount = Number(localStorage.getItem('passwordFailCount') || 0); + var passwordFailCount = Number(sessionStorage.getItem('passwordFailCount') || 0); passwordFailCount = passwordFailCount + 1; - localStorage.setItem('passwordFailCount', passwordFailCount); + sessionStorage.setItem('passwordFailCount', passwordFailCount); if (passwordFailCount >= 2) { - const url = '/sign-in/sso/auth?status=error' + '&identifierType=' + getValue('identifierType'); - const query = '&userId=' + getValue('userId') + '&identifierValue=' + getValue('identifierValue'); + const url = '/sign-in/sso/auth?status=error' + '&identifierType=' + getValueFromSession('identifierType'); + const query = '&userId=' + getValueFromSession('userId') + '&identifierValue=' + getValueFromSession('identifierValue'); window.location.href = window.location.protocol + '//' + window.location.host + url + query; } }; @@ -199,7 +224,7 @@ var makeDivUnclickable = function() { }; var inputBoxFocusIn = function(currentElement){ - var autoMerge = getValue('automerge'); + var autoMerge = getValueFromSession('automerge'); if (autoMerge === '1') { return; } @@ -211,7 +236,7 @@ var inputBoxFocusIn = function(currentElement){ } }; var inputBoxFocusOut = function (currentElement) { - var autoMerge = getValue('automerge'); + var autoMerge = getValueFromSession('automerge'); if (autoMerge === '1') { return; } @@ -276,6 +301,41 @@ var navigate = function(type) { } } } + +var initialize = () => { + getValueFromSession('redirect_uri'); + if (!sessionStorage.getItem('session_url')) { + sessionStorage.setItem('session_url', window.location.href); + } +}; + +initialize(); + +var forgetPassword = (redirectUrlPath) => { + const curUrlObj = window.location; + var redirect_uri = getValueFromSession('redirect_uri'); + var client_id = (new URLSearchParams(curUrlObj.search)).get('client_id'); + const sessionUrl = sessionStorage.getItem('session_url'); + if (sessionUrl) { + const sessionUrlObj = new URL(sessionUrl); + const updatedQuery = sessionUrlObj.search + '&error_callback=' + sessionUrlObj.href.split('?')[0]; + if (redirect_uri) { + const redirect_uriLocation = new URL(redirect_uri); + if(client_id === 'android'){ + window.location.href = sessionUrlObj.protocol + '//' + sessionUrlObj.host + redirectUrlPath + updatedQuery; + } + else{ + window.location.href = redirect_uriLocation.protocol + '//' + redirect_uriLocation.host + + redirectUrlPath + updatedQuery; + } + } else { + redirectToLib(); + } + } else { + redirectToLib(); + } +} + var redirect = (redirectUrlPath) => { console.log('redirect', redirectUrlPath) const curUrlObj = window.location; From 0777b30991109a809f21510c32d228288321c3fd Mon Sep 17 00:00:00 2001 From: manzarul Date: Tue, 12 Nov 2019 13:53:47 +0530 Subject: [PATCH 079/126] issue #SB-00 feat: adding new env to run scheduler job --- ansible/inventory/env/group_vars/all.yml | 1 + .../roles/stack-sunbird/templates/sunbird_learner-service.env | 1 + 2 files changed, 2 insertions(+) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index 148dcba1ea..9bae0e3d43 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -674,3 +674,4 @@ job_names: ### api call report mailing list #### api_report_mailing_list: "" ## This mailing list to send the daily api count report. if adaptor want to use they have to override in common.yml kafka_assessment_topic: "{{env_name}}.telemetry.assess" +sunbird_quartz_shadow_user_migration_timer: "0 0 1 1/1 * ? *" diff --git a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env index 8f67b05662..5e6bace5c3 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env @@ -106,3 +106,4 @@ sunbird_fuzzy_search_threshold={{sunbird_fuzzy_search_threshold | d('0.5')}} sunbird_subdomain_keycloak_base_url={{sunbird_subdomain_keycloak_base_url | d('')}}/ #Required by Learner-service to call cert service sunbird_cert_service_base_url=http://cert-service:9000 +quartz_shadow_user_migration_timer={{sunbird_quartz_shadow_user_migration_timer}} From 399d603be7933ffe063d7278d149b15a648f7243 Mon Sep 17 00:00:00 2001 From: Devesh Date: Tue, 12 Nov 2019 13:58:15 +0530 Subject: [PATCH 080/126] Issue #SB-0000 fix:syncing of keyclaock migration from local to sessionstorage ftl --- ansible/artifacts/sunbird/login/login.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/artifacts/sunbird/login/login.ftl b/ansible/artifacts/sunbird/login/login.ftl index 9586da0ee4..ee3b49ae57 100644 --- a/ansible/artifacts/sunbird/login/login.ftl +++ b/ansible/artifacts/sunbird/login/login.ftl @@ -53,7 +53,7 @@ <#if realm.resetPasswordAllowed> ${msg("doForgotPassword")} - + - <#ftl autoesc=false> <#if usernameEditDisabled??> <#else> diff --git a/ansible/artifacts/sunbird/login/template.ftl b/ansible/artifacts/sunbird/login/template.ftl index 544cb593c5..23e7579f51 100644 --- a/ansible/artifacts/sunbird/login/template.ftl +++ b/ansible/artifacts/sunbird/login/template.ftl @@ -1,6 +1,5 @@ <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true> -<#ftl autoesc=false> From 6eb868afcbd63ae36031b93e217cfe05ce07cac7 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Fri, 15 Nov 2019 18:01:27 +0530 Subject: [PATCH 094/126] Issue#SC-1487 onboarded migrate and feed API and deboarded reject API --- ansible/roles/kong-api/defaults/main.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index e4f3309492..3ac253a62f 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4662,8 +4662,8 @@ kong_apis: - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" - name: rejectMigrate - uris: "{{ user_service_prefix }}/v1/migrate/reject" - upstream_url: "{{ learning_service_url }}/v1/user/migrate/reject" + uris: "{{ user_service_prefix }}/v1/migrate" + upstream_url: "{{ learning_service_url }}/v1/user/migrate" strip_uri: true plugins: - name: jwt @@ -4709,4 +4709,20 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" + - name: userFeed + uris: "{{ user_service_prefix }}/v1/feed" + upstream_url: "{{ learning_service_url }}/v1/user/feed" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: publicUser + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ small_request_size_limit }}" From 715d0caf4a5bfa667cb6959167a8b8c3f66f4ba0 Mon Sep 17 00:00:00 2001 From: anmol2302 Date: Fri, 15 Nov 2019 18:03:52 +0530 Subject: [PATCH 095/126] Issue#SC-1487 onboarded migrate and feed API and deboarded reject API --- ansible/roles/kong-api/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index 3ac253a62f..e8c464b905 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -4661,7 +4661,7 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ small_request_size_limit }}" - - name: rejectMigrate + - name: userMigrate uris: "{{ user_service_prefix }}/v1/migrate" upstream_url: "{{ learning_service_url }}/v1/user/migrate" strip_uri: true From 49e186385608f029d6d711843f7c7f7ebcfef281 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Mon, 18 Nov 2019 11:49:44 +0530 Subject: [PATCH 096/126] Fix: remove underscores --- ansible/inventory/env/group_vars/all.yml | 6 +++--- ansible/roles/kong-api/defaults/main.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index 46d8582a22..b86ec685dc 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -105,7 +105,7 @@ keystore_password: "{{core_vault_keystore_password}}" #Password to use for encr truststore_password: "{{core_vault_truststore_password}}" #Password to use for encrypting cassandra truststore. Use a strong password. # APPLICATION CONFIGURATION -kong_host: api-manager_kong +kong_host: kong ## DB address application_postgres_host: "{{groups['postgres'][0]}}" #Private IP of Postgres server @@ -166,8 +166,8 @@ cassandra_backup_dir: /data/cassandra/backup keycloak_realm: sunbird -sunbird_content_player_url: "http://api-manager_kong:8000/" -sunbird_learner_player_url: "http://api-manager_kong:8000/" +sunbird_content_player_url: "http://kong:8000/" +sunbird_learner_player_url: "http://kong:8000/" sunbird_sso_client_id: admin-cli sunbird_portal_realm: sunbird sunbird_portal_auth_server_client: portal diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index e8c464b905..2045f5ac08 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -63,9 +63,9 @@ content_service_url: "http://content-service:5000" learning_service_url: "http://learner-service:9000" vm_learning_service_url: "http://{{learningservice_ip}}:8080/learning-service" telemetry_service_url: "http://telemetry-service:9001" -player_service_url: "http://player_player:3000" -echo_service_url: "http://api-manager_echo:9595" -am_util_url: http://adminutil_adminutil:4000 +player_service_url: "http://player:3000" +echo_service_url: "http://echo:9595" +am_util_url: "http://adminutil:4000" config_service_url: "http://config-service:8080" user_org_service_url: "http://user-org-service:9000" lms_service_url: "http://lms-service:9000" From 26fb39a9c4d2862b99fe549fc555e838eff33f36 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Mon, 18 Nov 2019 16:52:14 +0530 Subject: [PATCH 097/126] fix: updating url of kong --- ansible/roles/stack-sunbird/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index ede358fee9..7cf864a9e3 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -33,7 +33,7 @@ notification_limit_cpu: 1 # This variable is not to access learner service but to call the api # learner-service:9000/org/v1/search -sunbird_learner_service_base_url: http://api-manager_kong:8000/ +sunbird_learner_service_base_url: http://kong:8000/ telemetry_replicas: 1 telemetry_reservation_memory: 300M From 23fa030314abd973585765d04e876a069c26a444 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Mon, 18 Nov 2019 18:14:09 +0530 Subject: [PATCH 098/126] fix: incase of no RC tags --- pipelines/deploy/ContentFramework/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/deploy/ContentFramework/Jenkinsfile b/pipelines/deploy/ContentFramework/Jenkinsfile index 6c18a855fe..1bfc4efe9a 100644 --- a/pipelines/deploy/ContentFramework/Jenkinsfile +++ b/pipelines/deploy/ContentFramework/Jenkinsfile @@ -18,7 +18,7 @@ node() { stage('get artifact') { currentWs = sh(returnStdout: true, script: 'pwd').trim() artifact = values.artifact_name + ":" + values.artifact_version - commit_hash = values.artifact_version.split('_')[1] + commit_hash = values.artifact_version.split('-')[1] values.put('currentWs', currentWs) values.put('artifact', artifact) artifact_download(values) From 53fc7028eef9eca45391086be9bfbcb970903ba0 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Tue, 19 Nov 2019 11:03:10 +0530 Subject: [PATCH 099/126] feat: updating api paths for kong --- ansible/inventory/env/group_vars/all.yml | 6 +++--- ansible/roles/kong-api/defaults/main.yml | 6 +++--- ansible/roles/stack-sunbird/defaults/main.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index 46d8582a22..b86ec685dc 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -105,7 +105,7 @@ keystore_password: "{{core_vault_keystore_password}}" #Password to use for encr truststore_password: "{{core_vault_truststore_password}}" #Password to use for encrypting cassandra truststore. Use a strong password. # APPLICATION CONFIGURATION -kong_host: api-manager_kong +kong_host: kong ## DB address application_postgres_host: "{{groups['postgres'][0]}}" #Private IP of Postgres server @@ -166,8 +166,8 @@ cassandra_backup_dir: /data/cassandra/backup keycloak_realm: sunbird -sunbird_content_player_url: "http://api-manager_kong:8000/" -sunbird_learner_player_url: "http://api-manager_kong:8000/" +sunbird_content_player_url: "http://kong:8000/" +sunbird_learner_player_url: "http://kong:8000/" sunbird_sso_client_id: admin-cli sunbird_portal_realm: sunbird sunbird_portal_auth_server_client: portal diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index e4f3309492..0634c9a7c7 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -63,9 +63,9 @@ content_service_url: "http://content-service:5000" learning_service_url: "http://learner-service:9000" vm_learning_service_url: "http://{{learningservice_ip}}:8080/learning-service" telemetry_service_url: "http://telemetry-service:9001" -player_service_url: "http://player_player:3000" -echo_service_url: "http://api-manager_echo:9595" -am_util_url: http://adminutil_adminutil:4000 +player_service_url: "http://player:3000" +echo_service_url: "http://echo:9595" +am_util_url: "http://adminutil:4000" config_service_url: "http://config-service:8080" user_org_service_url: "http://user-org-service:9000" lms_service_url: "http://lms-service:9000" diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index ede358fee9..7cf864a9e3 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -33,7 +33,7 @@ notification_limit_cpu: 1 # This variable is not to access learner service but to call the api # learner-service:9000/org/v1/search -sunbird_learner_service_base_url: http://api-manager_kong:8000/ +sunbird_learner_service_base_url: http://kong:8000/ telemetry_replicas: 1 telemetry_reservation_memory: 300M From 296b238590f9ae52109f9282c5fb210bfb23aec2 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 19 Nov 2019 13:16:06 +0530 Subject: [PATCH 100/126] Issue #SC-1492 feat: content-service rename to knowledge-mw-service - 1 --- .../roles/stack-sunbird/tasks/content_service.yml | 13 ------------- .../stack-sunbird/tasks/knowledge-mw-service.yml | 13 +++++++++++++ ansible/roles/stack-sunbird/tasks/main.yml | 4 ++-- ...service.env => sunbird_knowledge-mw-service.env} | 0 .../{content => knowledge-mw-service}/Jenkinsfile | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 ansible/roles/stack-sunbird/tasks/content_service.yml create mode 100644 ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml rename ansible/roles/stack-sunbird/templates/{sunbird_content-service.env => sunbird_knowledge-mw-service.env} (100%) rename pipelines/deploy/{content => knowledge-mw-service}/Jenkinsfile (88%) diff --git a/ansible/roles/stack-sunbird/tasks/content_service.yml b/ansible/roles/stack-sunbird/tasks/content_service.yml deleted file mode 100644 index d13f312179..0000000000 --- a/ansible/roles/stack-sunbird/tasks/content_service.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Remove content service from stack (previous mode of deploy) - shell: "docker service rm content_service_content_service" - ignore_errors: yes - -- name: Remove content service - shell: "docker service rm content-service" - ignore_errors: yes - -- name: Deploy content service - shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5000:5000 --name content-service --hostname content-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- content-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_content-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" - args: - chdir: /home/deployer/stack diff --git a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml new file mode 100644 index 0000000000..522ab9c49b --- /dev/null +++ b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml @@ -0,0 +1,13 @@ +--- +- name: Remove content service from stack (previous mode of deploy) + shell: "docker service rm content_service_content_service" + ignore_errors: yes + +- name: Remove content service + shell: "docker service rm knowledge-mw-service" + ignore_errors: yes + +- name: Deploy content service + shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5000:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" + args: + chdir: /home/deployer/stack diff --git a/ansible/roles/stack-sunbird/tasks/main.yml b/ansible/roles/stack-sunbird/tasks/main.yml index de36ed29e8..e691934b89 100644 --- a/ansible/roles/stack-sunbird/tasks/main.yml +++ b/ansible/roles/stack-sunbird/tasks/main.yml @@ -25,8 +25,8 @@ - include: notification_service.yml when: deploy_notification is defined - - include: content_service.yml - when: deploy_content is defined + - include: knowledge-mw-service.yml + when: deploy_knowledge_mw is defined - include: telemetry_service.yml when: deploy_telemetry is defined diff --git a/ansible/roles/stack-sunbird/templates/sunbird_content-service.env b/ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env similarity index 100% rename from ansible/roles/stack-sunbird/templates/sunbird_content-service.env rename to ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env diff --git a/pipelines/deploy/content/Jenkinsfile b/pipelines/deploy/knowledge-mw-service/Jenkinsfile similarity index 88% rename from pipelines/deploy/content/Jenkinsfile rename to pipelines/deploy/knowledge-mw-service/Jenkinsfile index 0be3b9cc35..629ca40e07 100644 --- a/pipelines/deploy/content/Jenkinsfile +++ b/pipelines/deploy/knowledge-mw-service/Jenkinsfile @@ -10,7 +10,7 @@ node() { values = docker_params() currentWs = sh(returnStdout: true, script: 'pwd').trim() ansiblePlaybook = "$currentWs/ansible/deploy.yml" - ansibleExtraArgs = "--tags \"stack-sunbird\" --extra-vars \"hub_org=$hub_org image_name=$values.image_name image_tag=$values.image_tag service_name=content-service deploy_content=True\" --vault-password-file /var/lib/jenkins/secrets/vault-pass" + ansibleExtraArgs = "--tags \"stack-sunbird\" --extra-vars \"hub_org=$hub_org image_name=$values.image_name image_tag=$values.image_tag service_name=knowledge-mw-service deploy_knowledge_mw=True\" --vault-password-file /var/lib/jenkins/secrets/vault-pass" values.put('currentWs', currentWs) values.put('ansiblePlaybook', ansiblePlaybook) values.put('ansibleExtraArgs', ansibleExtraArgs) From 8167718f7d4898d924a1ee378d2b5580f562f06c Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 19 Nov 2019 14:18:22 +0530 Subject: [PATCH 101/126] Issue #SC-1492 feat: rename content-service to knowledge-mw-service --- .../roles/stack-sunbird/tasks/knowledge-mw-service.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml index 522ab9c49b..a855ca06db 100644 --- a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml +++ b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml @@ -1,13 +1,9 @@ --- -- name: Remove content service from stack (previous mode of deploy) - shell: "docker service rm content_service_content_service" - ignore_errors: yes - -- name: Remove content service +- name: Remove knowledge-mw service shell: "docker service rm knowledge-mw-service" ignore_errors: yes -- name: Deploy content service +- name: Deploy knowledge-mw service shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5000:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" args: chdir: /home/deployer/stack From 3a9cfb5fc576fa539358139f23fe58b5372c45a6 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 19 Nov 2019 14:26:35 +0530 Subject: [PATCH 102/126] Issue #SC-1492 feat: knowledge-mw-service port changes. --- ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml index a855ca06db..68cfd53adb 100644 --- a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml +++ b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml @@ -4,6 +4,6 @@ ignore_errors: yes - name: Deploy knowledge-mw service - shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5000:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" + shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5001:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" args: chdir: /home/deployer/stack From 6bb5d614970bcec3a103a4ea3727f0860662a1ce Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Gangula Date: Tue, 19 Nov 2019 15:25:06 +0530 Subject: [PATCH 103/126] Issue #SC-1492 feat: update config to knowledge-mw-service --- ansible/roles/kong-api/defaults/main.yml | 2 +- ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml | 2 +- .../roles/stack-sunbird/templates/sunbird_learner-service.env | 4 ++-- ansible/roles/stack-sunbird/templates/sunbird_lms-service.env | 4 ++-- ansible/roles/stack-sunbird/templates/sunbird_player.env | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index e4f3309492..0a8c7bdef1 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -59,7 +59,7 @@ cert_registry_service_prefix: /certreg desktop_app_prefix: /desktop # Service URLs -content_service_url: "http://content-service:5000" +content_service_url: "http://knowledge-mw-service:5000" learning_service_url: "http://learner-service:9000" vm_learning_service_url: "http://{{learningservice_ip}}:8080/learning-service" telemetry_service_url: "http://telemetry-service:9001" diff --git a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml index 68cfd53adb..a855ca06db 100644 --- a/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml +++ b/ansible/roles/stack-sunbird/tasks/knowledge-mw-service.yml @@ -4,6 +4,6 @@ ignore_errors: yes - name: Deploy knowledge-mw service - shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5001:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" + shell: "docker service create --with-registry-auth --replicas {{ content_replicas }} -p 5000:5000 --name knowledge-mw-service --hostname knowledge-mw-service --reserve-memory {{ content_reservation_memory }} --limit-memory {{ content_limit_memory }} --limit-cpu {{ content_limit_cpu }} --reserve-cpu {{ content_reservation_cpu }} --health-cmd 'wget -qO- knowledge-mw-service:5000/service/health || exit 1' --health-timeout 3s --health-retries 3 --network application_default --env-file /home/deployer/env/sunbird_knowledge-mw-service.env {{hub_org}}/{{image_name}}:{{image_tag}}" args: chdir: /home/deployer/stack diff --git a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env index 5e6bace5c3..f24d32f01f 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env @@ -54,14 +54,14 @@ badging_authorization_key={{vault_badging_authorization_key}} sunbird_badger_baseurl=http://badger-service:8004 sunbird_remote_req_router_path=akka.tcp://SunbirdMWSystem@actor-service:8088/user/RequestRouter sunbird_remote_bg_req_router_path=akka.tcp://SunbirdMWSystem@actor-service:8088/user/BackgroundRequestRouter -sunbird_api_base_url=http://content-service:5000 +sunbird_api_base_url=http://knowledge-mw-service:5000 sunbird_authorization={{sunbird_api_auth_token}} telemetry_pdata_id={{sunbird_telemetry_pdata_id}} telemetry_pdata_pid=learner-service sunbird_telemetry_base_url=http://telemetry-service:9001 telemetry_queue_threshold_value=100 sunbird_default_channel={{sunbird_default_channel}} -sunbird_api_mgr_base_url=http://content-service:5000 +sunbird_api_mgr_base_url=http://knowledge-mw-service:5000 sunbird_cs_base_url={{sunbird_cs_base_url}} sunbird_cs_search_path=/v1/content/search diff --git a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env index 65ad37428d..67652c19db 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env @@ -54,14 +54,14 @@ badging_authorization_key={{vault_badging_authorization_key}} sunbird_badger_baseurl=http://badger-service:8004 sunbird_remote_req_router_path=akka.tcp://SunbirdMWSystem@actor-service:8088/user/RequestRouter sunbird_remote_bg_req_router_path=akka.tcp://SunbirdMWSystem@actor-service:8088/user/BackgroundRequestRouter -sunbird_api_base_url=http://content-service:5000 +sunbird_api_base_url=http://knowledge-mw-service:5000 sunbird_authorization={{sunbird_api_auth_token}} telemetry_pdata_id={{sunbird_telemetry_pdata_id}} telemetry_pdata_pid=lms-service sunbird_telemetry_base_url=http://telemetry-service:9001 telemetry_queue_threshold_value=100 sunbird_default_channel={{sunbird_default_channel}} -sunbird_api_mgr_base_url=http://content-service:5000 +sunbird_api_mgr_base_url=http://knowledge-mw-service:5000 sunbird_cs_base_url={{sunbird_cs_base_url}} sunbird_cs_search_path=/v1/content/search diff --git a/ansible/roles/stack-sunbird/templates/sunbird_player.env b/ansible/roles/stack-sunbird/templates/sunbird_player.env index b47140fe36..2fb6f623ea 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_player.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_player.env @@ -1,7 +1,7 @@ sunbird_port=3000 sunbird_content_player_url={{sunbird_content_player_url}} sunbird_learner_player_url={{sunbird_learner_player_url}} -sunbird_content_proxy_url=http://content-service:5000 +sunbird_content_proxy_url=http://knowledge-mw-service:5000 sunbird_echo_api_url={{sunbird_echo_api_url}} sunbird_autocreate_trampoline_user=false sunbird_portal_realm={{keycloak_realm}} From 1b28d8371ed94584745ed3357cd6a28d430a1887 Mon Sep 17 00:00:00 2001 From: deveshMantra <48819442+deveshMantra@users.noreply.github.com> Date: Tue, 19 Nov 2019 17:13:37 +0530 Subject: [PATCH 104/126] Issue #SC-1473 fix keyclaock migration from 3 to 6 (#920) * Issue #SC-1473 fix keyclaock migration from 3 to 6 --- ansible/artifacts/sunbird/login/info.ftl | 1 - ansible/artifacts/sunbird/login/login-page-expired.ftl | 1 - ansible/artifacts/sunbird/login/login-reset-password.ftl | 1 - ansible/artifacts/sunbird/login/login-update-password.ftl | 1 - ansible/artifacts/sunbird/login/login.ftl | 7 +++---- ansible/artifacts/sunbird/login/template.ftl | 1 - 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ansible/artifacts/sunbird/login/info.ftl b/ansible/artifacts/sunbird/login/info.ftl index 169d70ae16..f151cfde5b 100755 --- a/ansible/artifacts/sunbird/login/info.ftl +++ b/ansible/artifacts/sunbird/login/info.ftl @@ -1,5 +1,4 @@ <#import "template.ftl" as layout> -<#ftl autoesc=false> <@layout.registrationLayout displayMessage=false; section> <#if section = "title"> ${message.summary} diff --git a/ansible/artifacts/sunbird/login/login-page-expired.ftl b/ansible/artifacts/sunbird/login/login-page-expired.ftl index 99cd0c48f8..b266614420 100644 --- a/ansible/artifacts/sunbird/login/login-page-expired.ftl +++ b/ansible/artifacts/sunbird/login/login-page-expired.ftl @@ -1,5 +1,4 @@ <#import "template.ftl" as layout> -<#ftl autoesc=false> <@layout.registrationLayout; section> <#if section = "title"> ${msg("pageExpiredTitle")} diff --git a/ansible/artifacts/sunbird/login/login-reset-password.ftl b/ansible/artifacts/sunbird/login/login-reset-password.ftl index 2b299b4823..5d81b0c7ad 100644 --- a/ansible/artifacts/sunbird/login/login-reset-password.ftl +++ b/ansible/artifacts/sunbird/login/login-reset-password.ftl @@ -1,6 +1,5 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=true; section> -<#ftl autoesc=false> <#if section = "title"> ${msg("emailForgotTitle")} <#elseif section = "form"> diff --git a/ansible/artifacts/sunbird/login/login-update-password.ftl b/ansible/artifacts/sunbird/login/login-update-password.ftl index 2a327b3cd8..434a269858 100644 --- a/ansible/artifacts/sunbird/login/login-update-password.ftl +++ b/ansible/artifacts/sunbird/login/login-update-password.ftl @@ -1,6 +1,5 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=true; section> -<#ftl autoesc=false> <#if section = "title"> ${msg("updatePasswordTitle")} <#elseif section = "form"> diff --git a/ansible/artifacts/sunbird/login/login.ftl b/ansible/artifacts/sunbird/login/login.ftl index ee3b49ae57..ebc500b4ec 100644 --- a/ansible/artifacts/sunbird/login/login.ftl +++ b/ansible/artifacts/sunbird/login/login.ftl @@ -1,6 +1,5 @@ <#import "template.ftl" as layout> <@layout.registrationLayout displayInfo=social.displayInfo; section> -<#ftl autoesc=false> <#if section = "title"> ${msg("loginTitle",(realm.displayName!''))} <#elseif section = "header"> @@ -39,11 +38,11 @@ <#else>${msg("email")} - <#ftl autoesc=false> <#if usernameEditDisabled??> - + <#-- TODO: need to find alternative for prepopulating username --> + <#else> - +
diff --git a/ansible/artifacts/sunbird/login/template.ftl b/ansible/artifacts/sunbird/login/template.ftl index 544cb593c5..23e7579f51 100644 --- a/ansible/artifacts/sunbird/login/template.ftl +++ b/ansible/artifacts/sunbird/login/template.ftl @@ -1,6 +1,5 @@ <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true> -<#ftl autoesc=false> From dc374ea708737293da414d30e6b99d728f95ae12 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 12:03:20 +0530 Subject: [PATCH 105/126] fix: updating postgres role for non managed service --- ansible/postgresql-data-update-managed.yml | 2 +- .../defaults/main.yml | 114 +++++++++++ .../tasks/databases.yml | 14 ++ .../tasks/main.yml | 41 ++++ .../tasks/users.yml | 17 ++ .../templates/enc_postgres.sql | 12 ++ .../templates/tables_postgres.sql | 181 ++++++++++++++++++ .../tasks/databases.yml | 5 +- .../postgresql-data-update/tasks/users.yml | 5 +- 9 files changed, 386 insertions(+), 5 deletions(-) create mode 100755 ansible/roles/postgresql-data-update-managed/defaults/main.yml create mode 100644 ansible/roles/postgresql-data-update-managed/tasks/databases.yml create mode 100644 ansible/roles/postgresql-data-update-managed/tasks/main.yml create mode 100755 ansible/roles/postgresql-data-update-managed/tasks/users.yml create mode 100644 ansible/roles/postgresql-data-update-managed/templates/enc_postgres.sql create mode 100644 ansible/roles/postgresql-data-update-managed/templates/tables_postgres.sql diff --git a/ansible/postgresql-data-update-managed.yml b/ansible/postgresql-data-update-managed.yml index e8cd6b30f4..145efd0efc 100644 --- a/ansible/postgresql-data-update-managed.yml +++ b/ansible/postgresql-data-update-managed.yml @@ -4,4 +4,4 @@ vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] roles: - - postgresql-data-update + - postgresql-data-update-managed diff --git a/ansible/roles/postgresql-data-update-managed/defaults/main.yml b/ansible/roles/postgresql-data-update-managed/defaults/main.yml new file mode 100755 index 0000000000..9a65ac5302 --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/defaults/main.yml @@ -0,0 +1,114 @@ +--- +postgresql_user: postgres +postgresql_group: postgres +postgresql_unix_socket_directories: + - /var/run/postgresql + +############# Postgres users and databases ############### +postgresql_users: + - name: "{{kong_postgres_user}}" + login_host: "{{kong_postgres_host}}" + login_password: "{{kong_postgres_password}}" + password: "{{postgres_password}}" + db: "{{kong_postgres_database}}" + login_user: "{{kong_postgres_user}}" + priv: "ALL" + - name: "{{keycloak_postgres_user}}" + login_host: "{{keycloak_postgres_host}}" + login_password: "{{keycloak_postgres_password}}" + password: "{{postgres_password}}" + db: "{{keycloak_postgres_database}}" + login_user: "{{keycloak_postgres_user}}" + priv: "ALL" + - name: "{{application_postgres_user}}" + login_host: "{{application_postgres_host}}" + login_password: "{{application_postgres_password}}" + password: "{{postgres_password}}" + db: "{{application_postgres_database}}" + login_user: "{{application_postgres_user}}" + priv: "ALL" + - name: "{{badger_postgres_user}}" + login_host: "{{badger_postgres_host}}" + login_password: "{{badger_postgres_password}}" + password: "{{postgres_password}}" + login_user: "{{badger_postgres_user}}" + db: "{{badger_postgres_database}}" + priv: "ALL" + - name: "{{user_org_service_postgres_user}}" + login_host: "{{user_org_service_postgres_host}}" + login_password: "{{user_org_service_postgres_password}}" + password: "{{user_org_service_postgres_password}}" + db: "{{user_org_service_postgres_database}}" + login_user: "{{user_org_service_postgres_user}}" + priv: "ALL" + - name: "{{enc_postgres_user}}" + login_host: "{{enc_postgres_host}}" + login_password: "{{enc_postgres_password}}" + password: "{{enc_postgres_password}}" + db: "{{enc_postgres_database}}" + login_user: "{{enc_postgres_user}}" + priv: "ALL" + + +postgresql_databases: + - name: "{{kong_postgres_database}}" + login_host: "{{kong_postgres_host}}" + login_password: "{{kong_postgres_password}}" + owner: "{{kong_postgres_user}}" + login_user: "{{kong_postgres_user}}" + - name: "{{keycloak_postgres_database}}" + login_host: "{{keycloak_postgres_host}}" + login_password: "{{keycloak_postgres_password}}" + owner: "{{keycloak_postgres_user}}" + login_user: "{{keycloak_postgres_user}}" + - name: "{{application_postgres_database}}" + login_host: "{{application_postgres_host}}" + login_password: "{{application_postgres_password}}" + owner: "{{application_postgres_user}}" + login_user: "{{application_postgres_user}}" + - name: "{{badger_postgres_database}}" + login_host: "{{badger_postgres_host}}" + login_password: "{{badger_postgres_password}}" + owner: "{{badger_postgres_user}}" + login_user: "{{badger_postgres_user}}" + - name: "{{user_org_service_postgres_database}}" + login_host: "{{user_org_service_postgres_host}}" + login_password: "{{user_org_service_postgres_password}}" + owner: "{{user_org_service_postgres_user}}" + login_user: "{{user_org_service_postgres_user}}" + - name: "{{enc_postgres_database}}" + login_host: "{{enc_postgres_host}}" + login_password: "{{enc_postgres_password}}" + owner: "{{enc_postgres_user}}" + login_user: "{{enc_postgres_user}}" + +########################################################## + + +# Databases to ensure exist. +#postgresql_databases: [] + # - name: exampledb # required; the rest are optional + # lc_collate: # defaults to 'en_US.UTF-8' + # lc_ctype: # defaults to 'en_US.UTF-8' + # encoding: # defaults to 'UTF-8' + # template: # defaults to 'template0' + # login_host: # defaults to 'localhost' + # login_password: # defaults to not set + # login_user: # defaults to '{{ postgresql_user }}' + # login_unix_socket: # defaults to 1st of postgresql_unix_socket_directories + # port: # defaults to not set + # state: # defaults to 'present' + +# Users to ensure exist. +#postgresql_users: [] + # - name: jdoe #required; the rest are optional + # password: # defaults to not set + # priv: # defaults to not set + # role_attr_flags: # defaults to not set + # db: # defaults to not set + # login_host: # defaults to 'localhost' + # login_password: # defaults to not set + # login_user: # defaults to '{{ postgresql_user }}' + # login_unix_socket: # defaults to 1st of postgresql_unix_socket_directories + # port: # defaults to not set + # state: # defaults to 'present' diff --git a/ansible/roles/postgresql-data-update-managed/tasks/databases.yml b/ansible/roles/postgresql-data-update-managed/tasks/databases.yml new file mode 100644 index 0000000000..dc96ae4cc9 --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/tasks/databases.yml @@ -0,0 +1,14 @@ +--- +- name: Ensure PostgreSQL databases are present. + postgresql_db: + name: "{{ item.name }}" + login_host: "{{ item.login_host | default('localhost') }}" + login_password: "{{ item.login_password | default(omit) }}" + login_user: "{{ item.login_user | default(postgresql_user) }}" + login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}" + port: "{{ item.port | default(omit) }}" + owner: '{{ item.owner.split("@")[0] | default(postgresql_user) }}' + state: "{{ item.state | default('present') }}" + with_items: "{{ postgresql_databases }}" + vars: + ansible_ssh_pipelining: true diff --git a/ansible/roles/postgresql-data-update-managed/tasks/main.yml b/ansible/roles/postgresql-data-update-managed/tasks/main.yml new file mode 100644 index 0000000000..250de30d7d --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/tasks/main.yml @@ -0,0 +1,41 @@ +- name: install psycopg2 + package: + name: python-psycopg2 + state: present + +- name: Verifying db users are present else creating them + include: databases.yml + +- name: creating database + include: users.yml + +- name: Copy the templates + become: yes + template: src={{item}} dest=/tmp/{{item}} + with_items: + - tables_postgres.sql + - enc_postgres.sql + +- name: Install postgres client to create schema from file + apt: + name: postgresql-client + state: present + update_cache: yes + +- name: Dump api manager database to a file + postgresql_db: + login_user: "{{ application_postgres_user }}" + login_password: "{{ application_postgres_password }}" + login_host: "{{ application_postgres_host }}" + name: "{{ application_postgres_database }}" + state: restore + target: "/tmp/tables_postgres.sql" + +- name: Create the schema for encryption service + postgresql_db: + login_user: "{{ enc_postgres_user }}" + login_password: "{{ enc_postgres_password }}" + login_host: "{{ enc_postgres_host }}" + name: "{{ enc_postgres_database }}" + state: restore + target: "/tmp/enc_postgres.sql" diff --git a/ansible/roles/postgresql-data-update-managed/tasks/users.yml b/ansible/roles/postgresql-data-update-managed/tasks/users.yml new file mode 100755 index 0000000000..fdbb3b43dc --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/tasks/users.yml @@ -0,0 +1,17 @@ +--- +- name: Ensure PostgreSQL users are present. + postgresql_user: + name: "{{ item.name }}" + password: "{{ item.password | default(omit) }}" + priv: "{{ item.priv | default(omit) }}" + role_attr_flags: "{{ item.role_attr_flags | default(omit) }}" + db: "{{ item.db | default(omit) }}" + login_host: "{{ item.login_host | default('localhost') }}" + login_password: "{{ item.login_password | default(omit) }}" + login_user: "{{ item.login_user | default(postgresql_user) }}" + encrypted: "{{ item.encrypted | default('yes')}}" + state: "{{ item.state | default('present') }}" + with_items: "{{ postgresql_users }}" + vars: + ansible_ssh_pipelining: true + diff --git a/ansible/roles/postgresql-data-update-managed/templates/enc_postgres.sql b/ansible/roles/postgresql-data-update-managed/templates/enc_postgres.sql new file mode 100644 index 0000000000..ada819c60f --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/templates/enc_postgres.sql @@ -0,0 +1,12 @@ +CREATE TYPE "enum_Keys_type" AS ENUM ('MASTER','OTHER'); +CREATE TABLE "Keys" ( + id SERIAL PRIMARY KEY, + public text NOT NULL, + private text NOT NULL, + type "enum_Keys_type" NOT NULL, + active boolean DEFAULT true NOT NULL, + reserved boolean DEFAULT false NOT NULL, + "createdAt" timestamp with time zone NOT NULL, + "updatedAt" timestamp with time zone NOT NULL +); +commit; diff --git a/ansible/roles/postgresql-data-update-managed/templates/tables_postgres.sql b/ansible/roles/postgresql-data-update-managed/templates/tables_postgres.sql new file mode 100644 index 0000000000..e2da042a1a --- /dev/null +++ b/ansible/roles/postgresql-data-update-managed/templates/tables_postgres.sql @@ -0,0 +1,181 @@ +drop table qrtz_fired_triggers; +DROP TABLE QRTZ_PAUSED_TRIGGER_GRPS; +DROP TABLE QRTZ_SCHEDULER_STATE; +DROP TABLE QRTZ_LOCKS; +drop table qrtz_simple_triggers; +drop table qrtz_cron_triggers; +drop table qrtz_simprop_triggers; +DROP TABLE QRTZ_BLOB_TRIGGERS; +drop table qrtz_triggers; +drop table qrtz_job_details; +drop table qrtz_calendars; + +CREATE TABLE qrtz_job_details + ( + SCHED_NAME VARCHAR(120) NOT NULL, + JOB_NAME VARCHAR(200) NOT NULL, + JOB_GROUP VARCHAR(200) NOT NULL, + DESCRIPTION VARCHAR(250) NULL, + JOB_CLASS_NAME VARCHAR(250) NOT NULL, + IS_DURABLE BOOL NOT NULL, + IS_NONCONCURRENT BOOL NOT NULL, + IS_UPDATE_DATA BOOL NOT NULL, + REQUESTS_RECOVERY BOOL NOT NULL, + JOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +CREATE TABLE qrtz_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + JOB_NAME VARCHAR(200) NOT NULL, + JOB_GROUP VARCHAR(200) NOT NULL, + DESCRIPTION VARCHAR(250) NULL, + NEXT_FIRE_TIME BIGINT NULL, + PREV_FIRE_TIME BIGINT NULL, + PRIORITY INTEGER NULL, + TRIGGER_STATE VARCHAR(16) NOT NULL, + TRIGGER_TYPE VARCHAR(8) NOT NULL, + START_TIME BIGINT NOT NULL, + END_TIME BIGINT NULL, + CALENDAR_NAME VARCHAR(200) NULL, + MISFIRE_INSTR SMALLINT NULL, + JOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) + REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) +); + +CREATE TABLE qrtz_simple_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + REPEAT_COUNT BIGINT NOT NULL, + REPEAT_INTERVAL BIGINT NOT NULL, + TIMES_TRIGGERED BIGINT NOT NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_cron_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + CRON_EXPRESSION VARCHAR(120) NOT NULL, + TIME_ZONE_ID VARCHAR(80), + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_simprop_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + STR_PROP_1 VARCHAR(512) NULL, + STR_PROP_2 VARCHAR(512) NULL, + STR_PROP_3 VARCHAR(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 BOOL NULL, + BOOL_PROP_2 BOOL NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_blob_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + BLOB_DATA BYTEA NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP), + FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) + REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_calendars + ( + SCHED_NAME VARCHAR(120) NOT NULL, + CALENDAR_NAME VARCHAR(200) NOT NULL, + CALENDAR BYTEA NOT NULL, + PRIMARY KEY (SCHED_NAME,CALENDAR_NAME) +); + + +CREATE TABLE qrtz_paused_trigger_grps + ( + SCHED_NAME VARCHAR(120) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) +); + +CREATE TABLE qrtz_fired_triggers + ( + SCHED_NAME VARCHAR(120) NOT NULL, + ENTRY_ID VARCHAR(95) NOT NULL, + TRIGGER_NAME VARCHAR(200) NOT NULL, + TRIGGER_GROUP VARCHAR(200) NOT NULL, + INSTANCE_NAME VARCHAR(200) NOT NULL, + FIRED_TIME BIGINT NOT NULL, + SCHED_TIME BIGINT NOT NULL, + PRIORITY INTEGER NOT NULL, + STATE VARCHAR(16) NOT NULL, + JOB_NAME VARCHAR(200) NULL, + JOB_GROUP VARCHAR(200) NULL, + IS_NONCONCURRENT BOOL NULL, + REQUESTS_RECOVERY BOOL NULL, + PRIMARY KEY (SCHED_NAME,ENTRY_ID) +); + +CREATE TABLE qrtz_scheduler_state + ( + SCHED_NAME VARCHAR(120) NOT NULL, + INSTANCE_NAME VARCHAR(200) NOT NULL, + LAST_CHECKIN_TIME BIGINT NOT NULL, + CHECKIN_INTERVAL BIGINT NOT NULL, + PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) +); + +CREATE TABLE qrtz_locks + ( + SCHED_NAME VARCHAR(120) NOT NULL, + LOCK_NAME VARCHAR(40) NOT NULL, + PRIMARY KEY (SCHED_NAME,LOCK_NAME) +); + +create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP); + +create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME); +create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); +create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE); +create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); +create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); +create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); + +commit; diff --git a/ansible/roles/postgresql-data-update/tasks/databases.yml b/ansible/roles/postgresql-data-update/tasks/databases.yml index dc96ae4cc9..a5ddf0c11d 100644 --- a/ansible/roles/postgresql-data-update/tasks/databases.yml +++ b/ansible/roles/postgresql-data-update/tasks/databases.yml @@ -1,9 +1,10 @@ --- - name: Ensure PostgreSQL databases are present. + become_user: postgres postgresql_db: name: "{{ item.name }}" - login_host: "{{ item.login_host | default('localhost') }}" - login_password: "{{ item.login_password | default(omit) }}" + login_host: "localhost" + login_password: "{{ omit }}" login_user: "{{ item.login_user | default(postgresql_user) }}" login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}" port: "{{ item.port | default(omit) }}" diff --git a/ansible/roles/postgresql-data-update/tasks/users.yml b/ansible/roles/postgresql-data-update/tasks/users.yml index fdbb3b43dc..939fa1d185 100755 --- a/ansible/roles/postgresql-data-update/tasks/users.yml +++ b/ansible/roles/postgresql-data-update/tasks/users.yml @@ -1,13 +1,14 @@ --- - name: Ensure PostgreSQL users are present. + become_user: postgres postgresql_user: name: "{{ item.name }}" password: "{{ item.password | default(omit) }}" priv: "{{ item.priv | default(omit) }}" role_attr_flags: "{{ item.role_attr_flags | default(omit) }}" db: "{{ item.db | default(omit) }}" - login_host: "{{ item.login_host | default('localhost') }}" - login_password: "{{ item.login_password | default(omit) }}" + login_host: "localhost" + login_password: "{{ omit }}" login_user: "{{ item.login_user | default(postgresql_user) }}" encrypted: "{{ item.encrypted | default('yes')}}" state: "{{ item.state | default('present') }}" From 8e305e1a4538a36d5e55973e156b39f4be68e07d Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 13:30:45 +0530 Subject: [PATCH 106/126] fix: non managed service user.yml fix for password --- ansible/roles/postgresql-data-update/tasks/users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/postgresql-data-update/tasks/users.yml b/ansible/roles/postgresql-data-update/tasks/users.yml index 939fa1d185..c94fc73bf0 100755 --- a/ansible/roles/postgresql-data-update/tasks/users.yml +++ b/ansible/roles/postgresql-data-update/tasks/users.yml @@ -7,8 +7,8 @@ priv: "{{ item.priv | default(omit) }}" role_attr_flags: "{{ item.role_attr_flags | default(omit) }}" db: "{{ item.db | default(omit) }}" - login_host: "localhost" - login_password: "{{ omit }}" + login_host: "{{ item.login_host | default('localhost') }}" + login_password: "{{ item.login_password | default(omit) }}" login_user: "{{ item.login_user | default(postgresql_user) }}" encrypted: "{{ item.encrypted | default('yes')}}" state: "{{ item.state | default('present') }}" From de36260387f6bd7af97005fb1fe05b2136a15999 Mon Sep 17 00:00:00 2001 From: Devesh Date: Wed, 20 Nov 2019 15:19:26 +0530 Subject: [PATCH 107/126] Issue #SB-15901 fix:auto merge does not show wrong password error message --- ansible/artifacts/sunbird/login/resources/js/login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/artifacts/sunbird/login/resources/js/login.js b/ansible/artifacts/sunbird/login/resources/js/login.js index 0ae07de0e8..850dd06a7c 100644 --- a/ansible/artifacts/sunbird/login/resources/js/login.js +++ b/ansible/artifacts/sunbird/login/resources/js/login.js @@ -160,7 +160,7 @@ var decoratePage = function (pageType) { unHideElement('selfSingUp'); var errorElement = document.getElementById('error-summary'); if (errorElement) { - if (errorElement.innerText === 'Invalid email Address/Mobile number or password. Please try again with valid credentials') { + if (errorElement.innerText === 'Invalid Email Address/Mobile number or password. Please try again with valid credentials') { unHideElement('inCorrectPasswordError'); handlePasswordFailure(); } From 8c6342fa5c0d944b5931f0b47ffb2cfcc4baf408 Mon Sep 17 00:00:00 2001 From: Devesh Date: Wed, 20 Nov 2019 15:27:52 +0530 Subject: [PATCH 108/126] Issue #SB-15901 fix:auto merge does not show wrong password error with lower case --- ansible/artifacts/sunbird/login/resources/js/login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/artifacts/sunbird/login/resources/js/login.js b/ansible/artifacts/sunbird/login/resources/js/login.js index 850dd06a7c..e3e86fb5aa 100644 --- a/ansible/artifacts/sunbird/login/resources/js/login.js +++ b/ansible/artifacts/sunbird/login/resources/js/login.js @@ -160,7 +160,8 @@ var decoratePage = function (pageType) { unHideElement('selfSingUp'); var errorElement = document.getElementById('error-summary'); if (errorElement) { - if (errorElement.innerText === 'Invalid Email Address/Mobile number or password. Please try again with valid credentials') { + var errorMessage = 'Invalid Email Address/Mobile number or password. Please try again with valid credentials'; + if (errorElement.innerText.toLowerCase() === errorMessage.toLowerCase()) { unHideElement('inCorrectPasswordError'); handlePasswordFailure(); } From d13e4d91dec5fe4d18eefd63ab50c8cad9f8c341 Mon Sep 17 00:00:00 2001 From: Devesh Date: Wed, 20 Nov 2019 15:32:41 +0530 Subject: [PATCH 109/126] Issue #SB-15901 fix:auto merge does not show wrong password error with lower case compare --- ansible/artifacts/sunbird/login/resources/js/login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/artifacts/sunbird/login/resources/js/login.js b/ansible/artifacts/sunbird/login/resources/js/login.js index e3e86fb5aa..8c4b5e5e0f 100644 --- a/ansible/artifacts/sunbird/login/resources/js/login.js +++ b/ansible/artifacts/sunbird/login/resources/js/login.js @@ -160,8 +160,8 @@ var decoratePage = function (pageType) { unHideElement('selfSingUp'); var errorElement = document.getElementById('error-summary'); if (errorElement) { - var errorMessage = 'Invalid Email Address/Mobile number or password. Please try again with valid credentials'; - if (errorElement.innerText.toLowerCase() === errorMessage.toLowerCase()) { + var wrongPasswordError = 'Invalid Email Address/Mobile number or password. Please try again with valid credentials'; + if (errorElement.innerText.toLowerCase() === wrongPasswordError.toLowerCase()) { unHideElement('inCorrectPasswordError'); handlePasswordFailure(); } From 922f7c48b06398116f2dbbae8b290015b6a1c3af Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 15:33:36 +0530 Subject: [PATCH 110/126] fix: for postgres pass error --- ansible/roles/postgresql-data-update/tasks/databases.yml | 5 ++--- ansible/roles/postgresql-data-update/tasks/users.yml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ansible/roles/postgresql-data-update/tasks/databases.yml b/ansible/roles/postgresql-data-update/tasks/databases.yml index a5ddf0c11d..dc96ae4cc9 100644 --- a/ansible/roles/postgresql-data-update/tasks/databases.yml +++ b/ansible/roles/postgresql-data-update/tasks/databases.yml @@ -1,10 +1,9 @@ --- - name: Ensure PostgreSQL databases are present. - become_user: postgres postgresql_db: name: "{{ item.name }}" - login_host: "localhost" - login_password: "{{ omit }}" + login_host: "{{ item.login_host | default('localhost') }}" + login_password: "{{ item.login_password | default(omit) }}" login_user: "{{ item.login_user | default(postgresql_user) }}" login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}" port: "{{ item.port | default(omit) }}" diff --git a/ansible/roles/postgresql-data-update/tasks/users.yml b/ansible/roles/postgresql-data-update/tasks/users.yml index c94fc73bf0..fdbb3b43dc 100755 --- a/ansible/roles/postgresql-data-update/tasks/users.yml +++ b/ansible/roles/postgresql-data-update/tasks/users.yml @@ -1,6 +1,5 @@ --- - name: Ensure PostgreSQL users are present. - become_user: postgres postgresql_user: name: "{{ item.name }}" password: "{{ item.password | default(omit) }}" From e4489065696c1794c98e604b3c12c360a020f2c6 Mon Sep 17 00:00:00 2001 From: deveshMantra <48819442+deveshMantra@users.noreply.github.com> Date: Wed, 20 Nov 2019 16:09:17 +0530 Subject: [PATCH 111/126] Issue #SB-15901 fix:error message not displayed after wrong password (#923) --- ansible/artifacts/sunbird/login/resources/js/login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/artifacts/sunbird/login/resources/js/login.js b/ansible/artifacts/sunbird/login/resources/js/login.js index 0ae07de0e8..8c4b5e5e0f 100644 --- a/ansible/artifacts/sunbird/login/resources/js/login.js +++ b/ansible/artifacts/sunbird/login/resources/js/login.js @@ -160,7 +160,8 @@ var decoratePage = function (pageType) { unHideElement('selfSingUp'); var errorElement = document.getElementById('error-summary'); if (errorElement) { - if (errorElement.innerText === 'Invalid email Address/Mobile number or password. Please try again with valid credentials') { + var wrongPasswordError = 'Invalid Email Address/Mobile number or password. Please try again with valid credentials'; + if (errorElement.innerText.toLowerCase() === wrongPasswordError.toLowerCase()) { unHideElement('inCorrectPasswordError'); handlePasswordFailure(); } From 066adf8e563869754fe757b200ef343e18b0241a Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 18:27:51 +0530 Subject: [PATCH 112/126] fix: updating postgres provision for adopters --- ansible/inventory/env/group_vars/all.yml | 80 ------------------- .../postgresql-data-update/defaults/main.yml | 36 --------- 2 files changed, 116 deletions(-) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index f1f50b3f35..b284533475 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -380,86 +380,6 @@ grafana_dashboards_git_repo_url_with_credentails: "{{core_vault_grafana_dashboar monitor_alerts_slack_url: "{{core_vault_monitor_alerts_slack_url}}" kong__test_jwt: "{{core_vault_kong__test_jwt}}" -############# Postgres users and databases ############### -postgresql_users: - - name: "{{kong_postgres_user}}" - login_host: "{{kong_postgres_host}}" - login_password: "{{kong_postgres_password}}" - password: "{{postgres_password}}" - db: "{{kong_postgres_database}}" - login_user: "{{kong_postgres_user}}" - priv: "ALL" - - name: "{{keycloak_postgres_user}}" - login_host: "{{keycloak_postgres_host}}" - login_password: "{{keycloak_postgres_password}}" - password: "{{postgres_password}}" - db: "{{keycloak_postgres_database}}" - login_user: "{{keycloak_postgres_user}}" - priv: "ALL" - - name: "{{application_postgres_user}}" - login_host: "{{application_postgres_host}}" - login_password: "{{application_postgres_password}}" - password: "{{postgres_password}}" - db: "{{application_postgres_database}}" - login_user: "{{application_postgres_user}}" - priv: "ALL" - - name: "{{badger_postgres_user}}" - login_host: "{{badger_postgres_host}}" - login_password: "{{badger_postgres_password}}" - password: "{{postgres_password}}" - login_user: "{{badger_postgres_user}}" - db: "{{badger_postgres_database}}" - priv: "ALL" - - name: "{{user_org_service_postgres_user}}" - login_host: "{{user_org_service_postgres_host}}" - login_password: "{{user_org_service_postgres_password}}" - password: "{{user_org_service_postgres_password}}" - db: "{{user_org_service_postgres_database}}" - login_user: "{{user_org_service_postgres_user}}" - priv: "ALL" - - name: "{{enc_postgres_user}}" - login_host: "{{enc_postgres_host}}" - login_password: "{{enc_postgres_password}}" - password: "{{enc_postgres_password}}" - db: "{{enc_postgres_database}}" - login_user: "{{enc_postgres_user}}" - priv: "ALL" - - -postgresql_databases: - - name: "{{kong_postgres_database}}" - login_host: "{{kong_postgres_host}}" - login_password: "{{kong_postgres_password}}" - owner: "{{kong_postgres_user}}" - login_user: "{{kong_postgres_user}}" - - name: "{{keycloak_postgres_database}}" - login_host: "{{keycloak_postgres_host}}" - login_password: "{{keycloak_postgres_password}}" - owner: "{{keycloak_postgres_user}}" - login_user: "{{keycloak_postgres_user}}" - - name: "{{application_postgres_database}}" - login_host: "{{application_postgres_host}}" - login_password: "{{application_postgres_password}}" - owner: "{{application_postgres_user}}" - login_user: "{{application_postgres_user}}" - - name: "{{badger_postgres_database}}" - login_host: "{{badger_postgres_host}}" - login_password: "{{badger_postgres_password}}" - owner: "{{badger_postgres_user}}" - login_user: "{{badger_postgres_user}}" - - name: "{{user_org_service_postgres_database}}" - login_host: "{{user_org_service_postgres_host}}" - login_password: "{{user_org_service_postgres_password}}" - owner: "{{user_org_service_postgres_user}}" - login_user: "{{user_org_service_postgres_user}}" - - name: "{{enc_postgres_database}}" - login_host: "{{enc_postgres_host}}" - login_password: "{{enc_postgres_password}}" - owner: "{{enc_postgres_user}}" - login_user: "{{enc_postgres_user}}" - -########################################################## - ####### App ES ######## diff --git a/ansible/roles/postgresql-data-update/defaults/main.yml b/ansible/roles/postgresql-data-update/defaults/main.yml index 9a65ac5302..a97bea933a 100755 --- a/ansible/roles/postgresql-data-update/defaults/main.yml +++ b/ansible/roles/postgresql-data-update/defaults/main.yml @@ -7,80 +7,44 @@ postgresql_unix_socket_directories: ############# Postgres users and databases ############### postgresql_users: - name: "{{kong_postgres_user}}" - login_host: "{{kong_postgres_host}}" - login_password: "{{kong_postgres_password}}" password: "{{postgres_password}}" db: "{{kong_postgres_database}}" - login_user: "{{kong_postgres_user}}" priv: "ALL" - name: "{{keycloak_postgres_user}}" - login_host: "{{keycloak_postgres_host}}" - login_password: "{{keycloak_postgres_password}}" password: "{{postgres_password}}" db: "{{keycloak_postgres_database}}" - login_user: "{{keycloak_postgres_user}}" priv: "ALL" - name: "{{application_postgres_user}}" - login_host: "{{application_postgres_host}}" - login_password: "{{application_postgres_password}}" password: "{{postgres_password}}" db: "{{application_postgres_database}}" - login_user: "{{application_postgres_user}}" priv: "ALL" - name: "{{badger_postgres_user}}" - login_host: "{{badger_postgres_host}}" - login_password: "{{badger_postgres_password}}" password: "{{postgres_password}}" - login_user: "{{badger_postgres_user}}" db: "{{badger_postgres_database}}" priv: "ALL" - name: "{{user_org_service_postgres_user}}" - login_host: "{{user_org_service_postgres_host}}" - login_password: "{{user_org_service_postgres_password}}" password: "{{user_org_service_postgres_password}}" db: "{{user_org_service_postgres_database}}" - login_user: "{{user_org_service_postgres_user}}" priv: "ALL" - name: "{{enc_postgres_user}}" - login_host: "{{enc_postgres_host}}" - login_password: "{{enc_postgres_password}}" password: "{{enc_postgres_password}}" - db: "{{enc_postgres_database}}" login_user: "{{enc_postgres_user}}" priv: "ALL" postgresql_databases: - name: "{{kong_postgres_database}}" - login_host: "{{kong_postgres_host}}" - login_password: "{{kong_postgres_password}}" owner: "{{kong_postgres_user}}" - login_user: "{{kong_postgres_user}}" - name: "{{keycloak_postgres_database}}" - login_host: "{{keycloak_postgres_host}}" - login_password: "{{keycloak_postgres_password}}" owner: "{{keycloak_postgres_user}}" - login_user: "{{keycloak_postgres_user}}" - name: "{{application_postgres_database}}" - login_host: "{{application_postgres_host}}" - login_password: "{{application_postgres_password}}" owner: "{{application_postgres_user}}" - login_user: "{{application_postgres_user}}" - name: "{{badger_postgres_database}}" - login_host: "{{badger_postgres_host}}" - login_password: "{{badger_postgres_password}}" owner: "{{badger_postgres_user}}" - login_user: "{{badger_postgres_user}}" - name: "{{user_org_service_postgres_database}}" - login_host: "{{user_org_service_postgres_host}}" - login_password: "{{user_org_service_postgres_password}}" owner: "{{user_org_service_postgres_user}}" - login_user: "{{user_org_service_postgres_user}}" - name: "{{enc_postgres_database}}" - login_host: "{{enc_postgres_host}}" - login_password: "{{enc_postgres_password}}" owner: "{{enc_postgres_user}}" - login_user: "{{enc_postgres_user}}" ########################################################## From 10881e9467fad95a05855f93c280c27ae0e84f8c Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 19:19:14 +0530 Subject: [PATCH 113/126] fix: adding skip tags --- pipelines/provision/postgres/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/provision/postgres/Jenkinsfile b/pipelines/provision/postgres/Jenkinsfile index dec776381b..5693fe7ec4 100644 --- a/pipelines/provision/postgres/Jenkinsfile +++ b/pipelines/provision/postgres/Jenkinsfile @@ -20,7 +20,7 @@ node() { module = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-2].trim() jobName = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-1].trim() ansiblePlaybook = "${currentWs}/ansible/provision.yml" - ansibleExtraArgs = "--tags postgresql-master --vault-password-file /var/lib/jenkins/secrets/vault-pass -v" + ansibleExtraArgs = "--skip-tags \"cassandra,es,log-es,postgresql-slave\" --vault-password-file /var/lib/jenkins/secrets/vault-pass -v" values.put('currentWs', currentWs) values.put('env', envDir) values.put('module', module) From 1435b4f01412f5ae5e3824a3376ecb4d52b76d35 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 22:06:16 +0530 Subject: [PATCH 114/126] fix: postgres fix for localhost --- .../postgresql-data-update/defaults/main.yml | 45 ------------------- .../tasks/databases.yml | 6 ++- .../postgresql-data-update/tasks/users.yml | 8 ++-- 3 files changed, 9 insertions(+), 50 deletions(-) diff --git a/ansible/roles/postgresql-data-update/defaults/main.yml b/ansible/roles/postgresql-data-update/defaults/main.yml index a97bea933a..998588f529 100755 --- a/ansible/roles/postgresql-data-update/defaults/main.yml +++ b/ansible/roles/postgresql-data-update/defaults/main.yml @@ -4,51 +4,6 @@ postgresql_group: postgres postgresql_unix_socket_directories: - /var/run/postgresql -############# Postgres users and databases ############### -postgresql_users: - - name: "{{kong_postgres_user}}" - password: "{{postgres_password}}" - db: "{{kong_postgres_database}}" - priv: "ALL" - - name: "{{keycloak_postgres_user}}" - password: "{{postgres_password}}" - db: "{{keycloak_postgres_database}}" - priv: "ALL" - - name: "{{application_postgres_user}}" - password: "{{postgres_password}}" - db: "{{application_postgres_database}}" - priv: "ALL" - - name: "{{badger_postgres_user}}" - password: "{{postgres_password}}" - db: "{{badger_postgres_database}}" - priv: "ALL" - - name: "{{user_org_service_postgres_user}}" - password: "{{user_org_service_postgres_password}}" - db: "{{user_org_service_postgres_database}}" - priv: "ALL" - - name: "{{enc_postgres_user}}" - password: "{{enc_postgres_password}}" - login_user: "{{enc_postgres_user}}" - priv: "ALL" - - -postgresql_databases: - - name: "{{kong_postgres_database}}" - owner: "{{kong_postgres_user}}" - - name: "{{keycloak_postgres_database}}" - owner: "{{keycloak_postgres_user}}" - - name: "{{application_postgres_database}}" - owner: "{{application_postgres_user}}" - - name: "{{badger_postgres_database}}" - owner: "{{badger_postgres_user}}" - - name: "{{user_org_service_postgres_database}}" - owner: "{{user_org_service_postgres_user}}" - - name: "{{enc_postgres_database}}" - owner: "{{enc_postgres_user}}" - -########################################################## - - # Databases to ensure exist. #postgresql_databases: [] # - name: exampledb # required; the rest are optional diff --git a/ansible/roles/postgresql-data-update/tasks/databases.yml b/ansible/roles/postgresql-data-update/tasks/databases.yml index dc96ae4cc9..1d9087d6a4 100644 --- a/ansible/roles/postgresql-data-update/tasks/databases.yml +++ b/ansible/roles/postgresql-data-update/tasks/databases.yml @@ -2,13 +2,15 @@ - name: Ensure PostgreSQL databases are present. postgresql_db: name: "{{ item.name }}" - login_host: "{{ item.login_host | default('localhost') }}" - login_password: "{{ item.login_password | default(omit) }}" + login_host: "localhost" + login_password: "{{ omit }}" login_user: "{{ item.login_user | default(postgresql_user) }}" login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}" port: "{{ item.port | default(omit) }}" owner: '{{ item.owner.split("@")[0] | default(postgresql_user) }}' state: "{{ item.state | default('present') }}" with_items: "{{ postgresql_databases }}" + become: yes + become_user: "{{ postgresql_user }}" vars: ansible_ssh_pipelining: true diff --git a/ansible/roles/postgresql-data-update/tasks/users.yml b/ansible/roles/postgresql-data-update/tasks/users.yml index fdbb3b43dc..fea2331ac5 100755 --- a/ansible/roles/postgresql-data-update/tasks/users.yml +++ b/ansible/roles/postgresql-data-update/tasks/users.yml @@ -6,12 +6,14 @@ priv: "{{ item.priv | default(omit) }}" role_attr_flags: "{{ item.role_attr_flags | default(omit) }}" db: "{{ item.db | default(omit) }}" - login_host: "{{ item.login_host | default('localhost') }}" - login_password: "{{ item.login_password | default(omit) }}" + login_host: "localhost" + login_password: "{{ omit }}" login_user: "{{ item.login_user | default(postgresql_user) }}" + login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}" encrypted: "{{ item.encrypted | default('yes')}}" state: "{{ item.state | default('present') }}" with_items: "{{ postgresql_users }}" + become: yes + become_user: "{{ postgresql_user }}" vars: ansible_ssh_pipelining: true - From ffdcf5aee59d88a81989674539038877d6b7f64d Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Wed, 20 Nov 2019 22:08:06 +0530 Subject: [PATCH 115/126] fix: revert all.yml --- ansible/inventory/env/group_vars/all.yml | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml index b284533475..f1f50b3f35 100644 --- a/ansible/inventory/env/group_vars/all.yml +++ b/ansible/inventory/env/group_vars/all.yml @@ -380,6 +380,86 @@ grafana_dashboards_git_repo_url_with_credentails: "{{core_vault_grafana_dashboar monitor_alerts_slack_url: "{{core_vault_monitor_alerts_slack_url}}" kong__test_jwt: "{{core_vault_kong__test_jwt}}" +############# Postgres users and databases ############### +postgresql_users: + - name: "{{kong_postgres_user}}" + login_host: "{{kong_postgres_host}}" + login_password: "{{kong_postgres_password}}" + password: "{{postgres_password}}" + db: "{{kong_postgres_database}}" + login_user: "{{kong_postgres_user}}" + priv: "ALL" + - name: "{{keycloak_postgres_user}}" + login_host: "{{keycloak_postgres_host}}" + login_password: "{{keycloak_postgres_password}}" + password: "{{postgres_password}}" + db: "{{keycloak_postgres_database}}" + login_user: "{{keycloak_postgres_user}}" + priv: "ALL" + - name: "{{application_postgres_user}}" + login_host: "{{application_postgres_host}}" + login_password: "{{application_postgres_password}}" + password: "{{postgres_password}}" + db: "{{application_postgres_database}}" + login_user: "{{application_postgres_user}}" + priv: "ALL" + - name: "{{badger_postgres_user}}" + login_host: "{{badger_postgres_host}}" + login_password: "{{badger_postgres_password}}" + password: "{{postgres_password}}" + login_user: "{{badger_postgres_user}}" + db: "{{badger_postgres_database}}" + priv: "ALL" + - name: "{{user_org_service_postgres_user}}" + login_host: "{{user_org_service_postgres_host}}" + login_password: "{{user_org_service_postgres_password}}" + password: "{{user_org_service_postgres_password}}" + db: "{{user_org_service_postgres_database}}" + login_user: "{{user_org_service_postgres_user}}" + priv: "ALL" + - name: "{{enc_postgres_user}}" + login_host: "{{enc_postgres_host}}" + login_password: "{{enc_postgres_password}}" + password: "{{enc_postgres_password}}" + db: "{{enc_postgres_database}}" + login_user: "{{enc_postgres_user}}" + priv: "ALL" + + +postgresql_databases: + - name: "{{kong_postgres_database}}" + login_host: "{{kong_postgres_host}}" + login_password: "{{kong_postgres_password}}" + owner: "{{kong_postgres_user}}" + login_user: "{{kong_postgres_user}}" + - name: "{{keycloak_postgres_database}}" + login_host: "{{keycloak_postgres_host}}" + login_password: "{{keycloak_postgres_password}}" + owner: "{{keycloak_postgres_user}}" + login_user: "{{keycloak_postgres_user}}" + - name: "{{application_postgres_database}}" + login_host: "{{application_postgres_host}}" + login_password: "{{application_postgres_password}}" + owner: "{{application_postgres_user}}" + login_user: "{{application_postgres_user}}" + - name: "{{badger_postgres_database}}" + login_host: "{{badger_postgres_host}}" + login_password: "{{badger_postgres_password}}" + owner: "{{badger_postgres_user}}" + login_user: "{{badger_postgres_user}}" + - name: "{{user_org_service_postgres_database}}" + login_host: "{{user_org_service_postgres_host}}" + login_password: "{{user_org_service_postgres_password}}" + owner: "{{user_org_service_postgres_user}}" + login_user: "{{user_org_service_postgres_user}}" + - name: "{{enc_postgres_database}}" + login_host: "{{enc_postgres_host}}" + login_password: "{{enc_postgres_password}}" + owner: "{{enc_postgres_user}}" + login_user: "{{enc_postgres_user}}" + +########################################################## + ####### App ES ######## From 8dbee58c0ab3275eae8152c35c3dcde2e2ed76eb Mon Sep 17 00:00:00 2001 From: Devesh Date: Thu, 21 Nov 2019 11:29:54 +0530 Subject: [PATCH 116/126] Issue #SB-15878 fix:removal of placeholders from login screen --- ansible/artifacts/sunbird/login/login.ftl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/artifacts/sunbird/login/login.ftl b/ansible/artifacts/sunbird/login/login.ftl index d61af51e29..dd7f0ccf89 100644 --- a/ansible/artifacts/sunbird/login/login.ftl +++ b/ansible/artifacts/sunbird/login/login.ftl @@ -39,9 +39,9 @@ <#if usernameEditDisabled??> - + <#else> - +
@@ -57,7 +57,7 @@ ${msg("placeholderForPassword")}
- + ${msg("inCorrectPasswordError")}
From f2ddf147a28e751f10a5480e2d2a44476a0f72bc Mon Sep 17 00:00:00 2001 From: kaliraja Date: Thu, 21 Nov 2019 11:48:48 +0530 Subject: [PATCH 117/126] DO-1840 added the dp logstash to filebeat --- ansible/logging.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ansible/logging.yml b/ansible/logging.yml index 490398d2bb..c7252e7728 100644 --- a/ansible/logging.yml +++ b/ansible/logging.yml @@ -87,11 +87,21 @@ vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] roles: - - { role: vm-agents-filebeat, filebeat_log_path: '/mount/data/analytics/logs/services/api-service.log' } + - { role: vm-agents-filebeat, filebeat_log_path: '/mount/data/analytics/logs/services/api-service.log', '/var/log/logstash/logstash-plain.log' } tags: - analytics - filebeat +- hosts: dp-kafkaindexer-ps + become: yes + vars_files: + - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] + roles: + - { role: vm-agents-filebeat, filebeat_log_path: '/var/log/logstash/logstash-plain.log' } + tags: + - kafkaindexer + - filebeat + - hosts: zookeeper become: yes vars_files: From 0ad255fd9ec2eee33c2bd345094b45525893eb1a Mon Sep 17 00:00:00 2001 From: kaliraja Date: Thu, 21 Nov 2019 11:56:39 +0530 Subject: [PATCH 118/126] DO-1840 added the dp logstash to filebeat --- ansible/logging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/logging.yml b/ansible/logging.yml index c7252e7728..ca8beb0e13 100644 --- a/ansible/logging.yml +++ b/ansible/logging.yml @@ -87,7 +87,7 @@ vars_files: - ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml'] roles: - - { role: vm-agents-filebeat, filebeat_log_path: '/mount/data/analytics/logs/services/api-service.log', '/var/log/logstash/logstash-plain.log' } + - { role: vm-agents-filebeat, filebeat_log_path: '/mount/data/analytics/logs/services/api-service.log, /var/log/logstash/logstash-plain.log' } tags: - analytics - filebeat From 6e0cbd3255a9ab413a489c16fd9995025acb2a2b Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Thu, 21 Nov 2019 12:49:18 +0530 Subject: [PATCH 119/126] Fix: typo variable name --- ansible/roles/stack-sunbird/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index 3902352229..53a5cfabbf 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -36,7 +36,7 @@ notification_limit_cpu: 1 sunbird_learner_service_base_url: http://api-manager_kong:8000/ telemetry_replicas: 1 -telemetryreservation_memory: 300M +telemetry_reservation_memory: 300M telemetry_limit_memory: 300M sunbird_telemetry_kafka_servers: "{{groups['kafka']|join(':9092,')}}:9092" sunbird_data_pipeline_kafka_servers: "{{groups['processing-cluster-kafka']|join(':9092,')}}:9092" From bf927e88de63bd1d40585aed17f9c2ebaf534a2d Mon Sep 17 00:00:00 2001 From: S M Y Date: Thu, 21 Nov 2019 14:18:03 +0530 Subject: [PATCH 120/126] Error handling in keycloak to avoid issues related to monit --- ansible/keycloak.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ansible/keycloak.yml b/ansible/keycloak.yml index ab8963bb41..a54b953dc9 100644 --- a/ansible/keycloak.yml +++ b/ansible/keycloak.yml @@ -5,8 +5,29 @@ - ['{{ inventory_dir }}/secrets.yml', 'secrets/{{ env }}.yml'] # --tags provision/deployment will trigger respective roles # --tags bootstrap will trigger user/realm creation + pre_tasks: + - name: Get the list of all the services running in our OS + become: yes + service_facts: + + - name: Stop the monit to ensure that it doesn't start keycloak + service: name=monit state=stopped + become: yes + when: ansible_facts.services.monit is defined + roles: - {role: openjdk, tags: provision} - {role: keycloak-provision, tags: provision} - keycloak-deploy - {role: monit, monit_checks: ['keycloak'], tags: deploy} + + post_tasks: + - name: get the list of all services in the system + become: yes + service_facts: + + - name: After succesful migration and staring of keycloak, start back monit if installed + service: name=monit state=started + become: yes + when: ansible_facts.services.monit is defined + From 512c0833a8b3994605a768058e3c852befbe23c8 Mon Sep 17 00:00:00 2001 From: Anoop HM Date: Thu, 21 Nov 2019 19:22:29 +0530 Subject: [PATCH 121/126] issue 0000 feat: Added desktop app blob url Added desktop app blob url --- ansible/roles/stack-sunbird/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index 7cf864a9e3..6b16cc7990 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -68,6 +68,7 @@ sunbird_telemetry_dispatchers: kafka content_service_whitelisted_channels: content_service_blacklisted_channels: sunbird_env_logo_url: +desktop_app_storage_url: "https://{{sunbird_offline_azure_storage_account}}.blob.core.windows.net/{{offline_installer_container_name}}" telemetry_logstash_heap_size: 512m From fce2705ec5ac36f49f876ec3ea9c916bd5d69fdb Mon Sep 17 00:00:00 2001 From: Anoop HM Date: Thu, 21 Nov 2019 19:24:42 +0530 Subject: [PATCH 122/126] Issue 0000 feat: Added desktop app blob url --- ansible/roles/stack-sunbird/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index 7cf864a9e3..fc8f25b678 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -68,7 +68,7 @@ sunbird_telemetry_dispatchers: kafka content_service_whitelisted_channels: content_service_blacklisted_channels: sunbird_env_logo_url: - +desktop_app_storage_url: "https://{{sunbird_offline_azure_storage_account}}.blob.core.windows.net/{{offline_installer_container_name}}" telemetry_logstash_heap_size: 512m telemetry_logstash_replicas: 1 From 76f869572cabc08c5a940289483b79150ac5fc0e Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Thu, 21 Nov 2019 21:17:24 +0530 Subject: [PATCH 123/126] fix: adding swarm manager lb ip to template --- private_repo/ansible/inventory/dev/Core/common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private_repo/ansible/inventory/dev/Core/common.yml b/private_repo/ansible/inventory/dev/Core/common.yml index efabe3d7c9..bf711fc9a9 100644 --- a/private_repo/ansible/inventory/dev/Core/common.yml +++ b/private_repo/ansible/inventory/dev/Core/common.yml @@ -17,7 +17,7 @@ sunbird_default_channel: # Organization channel name which portal sunbird_app_name: # By default app name will be sunbird azure_account_name: # Storage account name for blobs sunbird_content_azure_storage_container: # Conatainer store assets/public -swarm_load_balancer: # Loadbalancer ip to push the logspout result to logstash in swarm +unbird_swarm_manager_lb_ip: # Swarm manager load balancer private IP. If you don't have a load swarm manager load balancer, you can use swarm manager private ip. # Blob where data analytics pushing content # Check same variable in DP common.yml From c6c0d343e77ceba6e096a688c880854fd64cf841 Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Fri, 22 Nov 2019 01:29:26 +0530 Subject: [PATCH 124/126] Fix: portal fix for reposrts --- ansible/roles/stack-sunbird/templates/sunbird_player.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/stack-sunbird/templates/sunbird_player.env b/ansible/roles/stack-sunbird/templates/sunbird_player.env index 41fb4f71b3..1756db83f3 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_player.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_player.env @@ -43,8 +43,8 @@ sunbird_google_keycloak_client_id={{sunbird_google_keycloak_client_id}} sunbird_google_keycloak_secret={{sunbird_google_keycloak_secret}} sunbird_help_link_visibility={{sunbird_help_link_visibility|default('FALSE')}} sunbird_azure_report_container_name={{sunbird_azure_report_container_name}} -sunbird_azure_account_name={{sunbird_azure_account_name}} -sunbird_azure_account_key={{sunbird_azure_storage_key}} +sunbird_azure_account_name={{sunbird_portal_azure_storage_account}} +sunbird_azure_account_key={{sunbird_portal_azure_storage_key}} sunbird_response_cache_ttl={{sunbird_response_cache_ttl}} sunbird_portal_preview_cdn_url={{sunbird_portal_preview_cdn_url}} From c70fc02ea158c376e077ea8d949b48bb2b6ada36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2019 10:15:15 +0530 Subject: [PATCH 125/126] Bump requests (#889) Bumps [requests](https://github.com/requests/requests) from 2.18.4 to 2.20.0. - [Release notes](https://github.com/requests/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/requests/requests/compare/v2.18.4...v2.20.0) Signed-off-by: dependabot[bot] --- .../python_keycloak.egg-info/requires.txt | 2 +- .../roles/keycloak-deploy/files/python-keycloak-0.12.0/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/python_keycloak.egg-info/requires.txt b/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/python_keycloak.egg-info/requires.txt index d6eafdf657..f3221c8ab6 100644 --- a/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/python_keycloak.egg-info/requires.txt +++ b/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/python_keycloak.egg-info/requires.txt @@ -1,3 +1,3 @@ -requests==2.18.4 +requests==2.20.0 httmock==1.2.5 python-jose==1.4.0 diff --git a/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/setup.py b/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/setup.py index bf6a505f0a..7f8e077f9a 100644 --- a/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/setup.py +++ b/ansible/roles/keycloak-deploy/files/python-keycloak-0.12.0/setup.py @@ -12,7 +12,7 @@ keywords='keycloak openid', description=u'python-keycloak is a Python package providing access to the Keycloak API.', packages=['keycloak', 'keycloak.authorization', 'keycloak.tests'], - install_requires=['requests==2.18.4', 'httmock==1.2.5', 'python-jose==1.4.0'], + install_requires=['requests==2.20.0', 'httmock==1.2.5', 'python-jose==1.4.0'], classifiers=[ 'Programming Language :: Python :: 3', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', From 72cac3fdda2fb3f4b9c1d0cd0f179d06a323fb7f Mon Sep 17 00:00:00 2001 From: keshavprasadms Date: Fri, 22 Nov 2019 17:02:49 +0530 Subject: [PATCH 126/126] Fix: variable name --- private_repo/ansible/inventory/dev/Core/common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private_repo/ansible/inventory/dev/Core/common.yml b/private_repo/ansible/inventory/dev/Core/common.yml index bf711fc9a9..0923e704f5 100644 --- a/private_repo/ansible/inventory/dev/Core/common.yml +++ b/private_repo/ansible/inventory/dev/Core/common.yml @@ -17,7 +17,7 @@ sunbird_default_channel: # Organization channel name which portal sunbird_app_name: # By default app name will be sunbird azure_account_name: # Storage account name for blobs sunbird_content_azure_storage_container: # Conatainer store assets/public -unbird_swarm_manager_lb_ip: # Swarm manager load balancer private IP. If you don't have a load swarm manager load balancer, you can use swarm manager private ip. +sunbird_swarm_manager_lb_ip: # Swarm manager load balancer private IP. If you don't have a load swarm manager load balancer, you can use swarm manager private ip. # Blob where data analytics pushing content # Check same variable in DP common.yml