diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..2d5dd4c --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,30 @@ +tasks: + - name: Setup + openMode: tab-after + init: | + sed -i "s#mode_of_installation: localhost#mode_of_installation: public#" config_files/config.yml + export trimmed_gitpod_url=${GITPOD_WORKSPACE_URL:8} + sed -i "s#api_endpoint: localhost#api_endpoint: 80-$trimmed_gitpod_url#" config_files/config.yml + sudo chmod u+x install.sh + sudo ./install.sh + +ports: + - port: 4200 + onOpen: ignore + visibility: public + description: Cqube Dashboard + + - port: 8080 + onOpen: ignore + visibility: public + description: Keycloak + + - port: 80 + onOpen: ignore + visibility: public + description: Nginx HTTP + + - port: 443 + onOpen: ignore + visibility: public + description: Nginx HTTPS diff --git a/README.md b/README.md index 511f2d9..2281fa4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # cQube_devops Installation + +### Gitpod + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Samagra-Development/cqube-devops/tree/release-v5.0.3) + ### Prerequisites to install cQube_devops: - Ubuntu 22.04 (supported) diff --git a/ansible/roles/configurations/templates/keycloak.sh.j2 b/ansible/roles/configurations/templates/keycloak.sh.j2 index 4f9c218..80e2234 100644 --- a/ansible/roles/configurations/templates/keycloak.sh.j2 +++ b/ansible/roles/configurations/templates/keycloak.sh.j2 @@ -8,6 +8,12 @@ sudo docker exec -i keycloak_app sh << 'EOF' /opt/jboss/keycloak/bin/kcadm.sh create realms -s realm=cQube -s enabled=true -o -/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000 +{% if mode_of_installation == 'localhost' %} +/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000 -s 'redirectUris=["http://{{ api_endpoint }}/*"]' -s directAccessGrantsEnabled=true +{% else %} +/opt/jboss/keycloak/bin/kcadm.sh create clients -r cQube -s clientId=cqube-5.0 -s enabled=true -s clientAuthenticatorType=client-secret -s secret=d0b8122f-8dfb-46h7-b69a-f5cc4e25d000 -s 'redirectUris=["https://{{ api_endpoint }}/*"]' -s directAccessGrantsEnabled=true +{% endif %} -EOF +/opt/jboss/keycloak/bin/kcadm.sh create users -r cQube -s username={{ keycloak_adm_name }} -s enabled=true +/opt/jboss/keycloak/bin/kcadm.sh set-password --username {{ keycloak_adm_name }} -r cQube -p {{ keycloak_adm_password }} +EOF \ No newline at end of file diff --git a/config_files/config.yml b/config_files/config.yml new file mode 100644 index 0000000..4c1f5c6 --- /dev/null +++ b/config_files/config.yml @@ -0,0 +1,14 @@ +base_dir: /opt +system_user_name: gitpod +access_type: VSK +state_name: HP +local_ipv4_address: 10.0.0.1 +mode_of_installation: localhost +storage_type: local +api_endpoint: localhost +google_analytics_tracking_id: NA +db_user: cqube_user +db_name: cqube +db_password: cQube@123 +keycloak_adm_name: admin +keycloak_adm_password: Admin@123 diff --git a/install.sh b/install.sh index 9ba735e..2e948aa 100755 --- a/install.sh +++ b/install.sh @@ -110,4 +110,4 @@ fi #Running script to display important links chmod u+x shell_scripts/install_generate_access_links.sh -. "shell_scripts/install_generate_access_links.sh" +. "shell_scripts/install_generate_access_links.sh" \ No newline at end of file diff --git a/shell_scripts/config_file_generator.sh b/shell_scripts/config_file_generator.sh index 4ecd1cd..ce11991 100755 --- a/shell_scripts/config_file_generator.sh +++ b/shell_scripts/config_file_generator.sh @@ -465,24 +465,6 @@ printf "read_only_db_password: cQube@123\n" >> config_files/config.yml fi } -check_version -rm config_files/config.yml -touch config_files/config.yml -if [[ -e "config_files/config.yml" ]]; then -check_base_dir -check_sys_user -check_access_type -check_state -check_ip -check_mode_of_installation -check_storage_type -check_api_endpoint -check_google_analytics -check_config_db -#check_config_read_only_db -check_keycloak_name -check_keycloak_password -fi check_config_file(){ if [[ -e "config_files/config.yml" ]]; then @@ -500,8 +482,8 @@ echo -e "\e[0;33m${bold}If you want to edit config value please enter yes.${norm * ) echo "Please answer yes or no.";; esac done + if [[ $yn == yes ]]; then if [[ -e "config_files/config.yml" ]]; then - if [[ $yn == yes ]]; then rm config_files/config.yml touch config_files/config.yml check_base_dir @@ -527,4 +509,4 @@ if [[ $yn == no ]]; then fi } -check_config_file +check_config_file \ No newline at end of file