-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from Sunbird-cQube/dev
merge dev to staging
- Loading branch information
Showing
10 changed files
with
320 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
ansible/roles/configurations/tasks/configure_program_selector.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
- name: Generating program selection csv file | ||
- name: Generating state program selection csv file | ||
template: | ||
src: program_selector.csv.j2 | ||
dest: "../microservices/query-builder/program_selector.csv" | ||
mode: "0644" | ||
when: access_type == "VSK" | ||
tags: [ install, update ] | ||
|
||
- name: Generating national program selection csv file | ||
template: | ||
src: national_program_selector.csv.j2 | ||
dest: "../microservices/query-builder/program_selector.csv" | ||
mode: "0644" | ||
when: access_type == "NVSK" | ||
tags: [ install, update ] |
11 changes: 11 additions & 0 deletions
11
ansible/roles/configurations/templates/national_program_selector.csv.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
program_id,status | ||
nishtha,{% if nishtha == true %}true{% else %}false{% endif %}{{''}} | ||
pgi,{% if pgi == true %}true{% else %}false{% endif %}{{''}} | ||
pmPoshan,{% if pmPoshan == true %}true{% else %}false{% endif %}{{''}} | ||
diksha,{% if diksha == true %}true{% else %}false{% endif %}{{''}} | ||
microImprovements,{% if microImprovements == true %}true{% else %}false{% endif %}{{''}} | ||
nas,{% if nas == true %}true{% else %}false{% endif %}{{''}} | ||
udisePlus,{% if udisePlus == true %}true{% else %}false{% endif %}{{''}} | ||
nipunBharat,{% if nipunBharat == true %}true{% else %}false{% endif %}{{''}} | ||
ncertQuiz,{% if ncertQuiz == true %}true{% else %}false{% endif %}{{''}} | ||
ncf,{% if ncf == true %}true{% else %}false{% endif %}{{''}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,32 @@ server { | |
listen 80; | ||
listen [::]:80; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
gzip on; | ||
gzip_types application/javascript text/css; | ||
gzip_min_length 1000; | ||
gzip_static on; | ||
root /usr/share/nginx/html; | ||
server_tokens off; | ||
index index.html index.htm index.nginx-debian.html; | ||
|
||
add_header X-Frame-Options "SAMEORIGIN"; | ||
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; | ||
add_header X-Content-Type-Options nosniff; | ||
add_header Content-Security-Policy "default-src https://apis.mapmyindia.com 'self'; font-src https://fonts.gstatic.com https://cdnjs.cloudflare.com https://fonts.googleapis.com 'self' data:; script-src https://code.jquery.com https://cdnjs.cloudflare.com https://apis.mapmyindia.com 'unsafe-inline' 'self'; style-src https://fonts.googleapis.com https://cdnjs.cloudflare.com https://maxcdn.bootstrapcdn.com 'unsafe-inline' 'self'; img-src https://*.basemaps.cartocdn.com 'self'"; | ||
add_header X-XSS-Protection "1; mode=block"; | ||
add_header Content-Security-Policy "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"; | ||
add_header Referrer-Policy "strict-origin"; | ||
add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"; | ||
|
||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $host; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-Proto https; | ||
#proxy_set_header X-Forwarded-Port $server_port; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_set_header Accept-Encoding ""; | ||
|
||
server_name {{ api_endpoint }}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
nishtha: true | ||
pgi: true | ||
pmPoshan: true | ||
diksha: true | ||
microImprovements: true | ||
nas: true | ||
udisePlus: true | ||
nipunBharat: true | ||
ncertQuiz: true | ||
ncf: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
#!/bin/bash | ||
|
||
check_microImprovements(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable microImprovements program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read micro_Improvements | ||
if ! [[ $micro_Improvements == "true" || $micro_Improvements == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "microImprovements: $micro_Improvements\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_ncf(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable ncf program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read n_cf | ||
if ! [[ $n_cf == "true" || $n_cf == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "ncf: $n_cf\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_ncertQuiz(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable ncertQuiz program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read ncert_Quiz | ||
if ! [[ $ncert_Quiz == "true" || $ncert_Quiz == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "ncertQuiz: $ncert_Quiz\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_nipunBharat(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable nipunBharat program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read nipun_Bharat | ||
if ! [[ $nipun_Bharat == "true" || $nipun_Bharat == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "nipunBharat: $nipun_Bharat\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_udise_plus(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable udise+ program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read udise_plus | ||
if ! [[ $udise_plus == "true" || $udise_plus == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "udise+: $udise_plus\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_pgi(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable pgi program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read pg_i | ||
if ! [[ $pg_i == "true" || $pg_i == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "pgi: $pg_i\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_pmPoshan(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable pmPoshan program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read pm_Poshan | ||
if ! [[ $pm_Poshan == "true" || $pm_Poshan == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "pmPoshan: $pm_Poshan\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_nas(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable nas program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read n_as | ||
if ! [[ $n_as == "true" || $n_as == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "nas: $n_as\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_diksha(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable diksha program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read dik_sha | ||
if ! [[ $dik_sha == "true" || $dik_sha == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "diksha: $dik_sha\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_nishtha(){ | ||
while true | ||
do | ||
echo -e "\e[0;36m${bold}Hint: Enter true or false to enable nishtha program ${normal}" | ||
echo -e "\e[0;38m${bold}please enter true or false.${normal}" | ||
read nish_tha | ||
if ! [[ $nish_tha == "true" || $nish_tha == "false" ]]; then | ||
echo -e "\e[0;31m${bold}Error - Please enter either true or false ${normal}"; fail=1 | ||
else | ||
printf "nishtha: $nish_tha\n" >> config_files/national_program_selector.yml | ||
break; | ||
|
||
fi | ||
done | ||
} | ||
|
||
check_config_file(){ | ||
if [[ -e "config_files/national_program_selector.yml" ]]; then | ||
while true; do | ||
echo -e "\e[0;33m${bold}please preview the national_program_selector.yml file and confirm if everything is correct.${normal}" | ||
echo -e "\e[0;38m${bold} `cat config_files/national_program_selector.yml` ${normal}" | ||
echo -e "\e[0;33m${bold}Currently cQube national_program_selector.yml is entered. Follow Installation process with above config values.${normal}" | ||
echo -e "\e[0;33m${bold}If you want to edit config value please enter yes.${normal}" | ||
while true; do | ||
|
||
read -p "Do you still want to edit the national_program_selector.yml file (yes/no)? " yn | ||
case $yn in | ||
yes) break;; | ||
no) break 2;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done | ||
|
||
if [[ $yn == yes ]]; then | ||
|
||
if [[ -e "config_files/national_program_selector.yml" ]]; then | ||
rm config_files/national_program_selector.yml | ||
touch config_files/national_program_selector.yml | ||
check_microImprovements | ||
check_ncf | ||
check_ncertQuiz | ||
check_nipunBharat | ||
check_udise_plus | ||
check_pgi | ||
check_pmPoshan | ||
check_nas | ||
check_diksha | ||
check_nishtha | ||
fi | ||
fi | ||
done | ||
fi | ||
if [[ $yn == no ]]; then | ||
echo -e "\e[0;32m${bold}national_program_selector file has been generated and validated successfully${normal}" | ||
|
||
fi | ||
|
||
} | ||
|
||
|
||
check_program_file(){ | ||
if [[ -e "config_files/national_program_selector.yml" ]]; then | ||
while true; do | ||
echo -e "\e[0;33m${bold}please preview the national_program_selector.yml file and confirm if everything is correct.${normal}" | ||
echo -e "\e[0;38m${bold} `cat config_files/national_program_selector.yml` ${normal}" | ||
echo -e "\e[0;33m${bold}Currently cQube program_selector.yml is entered. Follow Installation process with above config values.${normal}" | ||
echo -e "\e[0;33m${bold}If you want to edit config value please enter yes.${normal}" | ||
while true; do | ||
|
||
read -p "Do you still want to edit the national_program_selector.yml file (yes/no)? " yn | ||
case $yn in | ||
yes) break;; | ||
no) break 2;; | ||
* ) echo "Please answer yes or no.";; | ||
esac | ||
done | ||
if [[ -e "config_files/national_program_selector.yml" ]]; then | ||
if [[ $yn == yes ]]; then | ||
rm config_files/program_selector.yml | ||
touch config_files/program_selector.yml | ||
check_microImprovements | ||
check_ncf | ||
check_ncertQuiz | ||
check_nipunBharat | ||
check_udise_plus | ||
check_pgi | ||
check_pmPoshan | ||
check_nas | ||
check_diksha | ||
check_nishtha | ||
|
||
fi | ||
fi | ||
done | ||
fi | ||
if [[ $yn == no ]]; then | ||
echo -e "\e[0;32m${bold}national_program_selector file has been generated and validated successfully${normal}" | ||
|
||
fi | ||
|
||
} | ||
|
||
check_config_file | ||
|
||
|