├── PROJECT_1 ├── README.md ├── images │ ├── architecture.png │ ├── db_verification.png │ ├── des-vag.png │ ├── ip_addr.png │ ├── mariadb_setup.png │ ├── memcache.png │ ├── memcached.png │ ├── memcached_valid.png │ ├── rabbit.png │ ├── rabbitmq_validation.png │ ├── setup.png │ ├── vagrant.png │ ├── vagrant_validate.png │ ├── vprofile_web_arc.png │ ├── web.png │ └── welcome_page.png ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── visualpathit │ │ │ │ └── account │ │ │ │ ├── beans │ │ │ │ └── Components.java │ │ │ │ ├── controller │ │ │ │ ├── ElasticSearchController.java │ │ │ │ ├── FileUploadController.java │ │ │ │ └── UserController.java │ │ │ │ ├── model │ │ │ │ ├── Role.java │ │ │ │ └── User.java │ │ │ │ ├── repository │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── service │ │ │ │ ├── ConsumerService.java │ │ │ │ ├── ConsumerServiceImpl.java │ │ │ │ ├── ProducerService.java │ │ │ │ ├── ProducerServiceImpl.java │ │ │ │ ├── SecurityService.java │ │ │ │ ├── SecurityServiceImpl.java │ │ │ │ ├── UserDetailsServiceImpl.java │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ │ │ ├── utils │ │ │ │ ├── ElasticsearchUtil.java │ │ │ │ ├── MemcachedUtils.java │ │ │ │ └── RabbitMqUtil.java │ │ │ │ └── validator │ │ │ │ └── UserValidator.java │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── db_backup.sql │ │ │ ├── logback.xml │ │ │ └── validation.properties │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── appconfig-data.xml │ │ │ ├── appconfig-mvc.xml │ │ │ ├── appconfig-rabbitmq.xml │ │ │ ├── appconfig-root.xml │ │ │ ├── appconfig-security.xml │ │ │ ├── views │ │ │ │ ├── elasticeSearchRes.jsp │ │ │ │ ├── index_home.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── rabbitmq.jsp │ │ │ │ ├── registration.jsp │ │ │ │ ├── upload.jsp │ │ │ │ ├── user.jsp │ │ │ │ ├── userList.jsp │ │ │ │ ├── userUpdate.jsp │ │ │ │ └── welcome.jsp │ │ │ └── web.xml │ │ │ └── resources │ │ │ ├── Images │ │ │ ├── background.png │ │ │ ├── header.jpg │ │ │ ├── technologies │ │ │ │ ├── Ansible_logo.png │ │ │ │ ├── Vagrant.png │ │ │ │ ├── aws.png │ │ │ │ ├── docker.png │ │ │ │ ├── git.jpg │ │ │ │ ├── jenkins.png │ │ │ │ ├── puppet.jpg │ │ │ │ └── python-logo.png │ │ │ ├── user │ │ │ │ ├── giphy.gif │ │ │ │ ├── logo.png │ │ │ │ ├── user.png │ │ │ │ ├── user2.png │ │ │ │ └── user3.png │ │ │ ├── visualpath.png │ │ │ ├── visualpathlogo2.png │ │ │ └── visualpathlogo3.png │ │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ ├── common.css │ │ │ ├── profile.css │ │ │ └── w3.css │ │ │ └── js │ │ │ └── bootstrap.min.js │ └── test │ │ └── java │ │ └── com │ │ └── visualpathit │ │ └── account │ │ ├── controllerTest │ │ ├── SampleTest.java │ │ └── UserControllerTest.java │ │ ├── modelTest │ │ ├── RoleTest.java │ │ └── UserTest.java │ │ └── setup │ │ └── StandaloneMvcTestViewResolver.java └── vagrant │ └── Vagrantfile ├── PROJECT_10 ├── README.md └── images │ ├── DNS.png │ ├── Project-10.png │ ├── app-in-prod-server.png │ ├── ci-confirm.png │ ├── cred_details.png │ ├── deploy-prod-pipeline.png │ ├── inventory_file.png │ ├── stage_ans.png │ └── stage_view.png ├── PROJECT_11 ├── README.md └── images │ ├── Project-11.png │ ├── bean_prod.png │ ├── beanstalk1.png │ ├── healthcheck.png │ ├── pro.png │ ├── prod_approcal.png │ ├── prod_bean.png │ ├── slack.png │ ├── stage_cicd.png │ ├── stage_s3.png │ ├── stage_version.png │ └── validate_ci.png ├── PROJECT_12 ├── README.md └── images │ ├── composeup.png │ ├── docker_install.png │ ├── dockerhub.png │ ├── images.png │ ├── lodin.png │ ├── sys_des.png │ └── target.png ├── PROJECT_13 ├── README.md └── images │ ├── app-secret.png │ ├── db_deploy.png │ ├── dockerfiles.png │ ├── ebs_vo;ume.png │ ├── encoded.png │ ├── get-all.png │ ├── kops_cluster.png │ ├── kubectl_nodes.png │ ├── label_node.png │ ├── login.png │ ├── memcache.png │ ├── ns-lookup.png │ ├── ns-record.png │ ├── rabbitmq.png │ ├── record.png │ └── verify.png ├── PROJECT_14 ├── README.md ├── Terraform-files │ ├── backend-s3.tf │ ├── backend-services.tf │ ├── bastion-host.tf │ ├── bean-app.tf │ ├── bean-env.tf │ ├── keypairs.tf │ ├── providers.tf │ ├── secgrp.tf │ ├── templates │ │ └── db-deploy.tftpls │ ├── vars.tf │ └── vpc.tf └── images │ ├── Project-14.png │ ├── app-deployed.png │ ├── aws_conf.png │ ├── aws_tf.png │ ├── first_init.png │ ├── repo.png │ ├── ssh-key.png │ ├── ssh.png │ ├── subnet.png │ └── vpc.png ├── PROJECT_15 ├── README.md └── images │ ├── Project-15.png │ ├── app-page.png │ ├── docker-int.png │ ├── docker_install.png │ ├── docker_start.png │ ├── error_docker.png │ ├── helm.png │ ├── install_helm_init.png │ ├── instances.png │ ├── kops_sg_update.png │ ├── modes.png │ ├── ns.png │ ├── pipeline-success.png │ └── sonar-tok.png ├── PROJECT_2 ├── .vagrant │ ├── bundler │ │ └── global.sol │ ├── hostmanager │ │ └── id │ └── rgloader │ │ └── loader.rb ├── README.md ├── Vagrantfile ├── application.properties ├── backend.sh ├── images │ ├── cache.png │ ├── destro.png │ ├── rabbitmq.png │ ├── system-design.png │ ├── user.png │ ├── vm.png │ └── welcome.png ├── memcache.sh ├── mysql.sh ├── nginx.sh ├── rabbitmq.sh ├── tomcat.sh ├── tomcat_ubuntu.sh └── ubuntu-xenial-16.04-cloudimg-console.log ├── PROJECT_3 ├── README.md ├── images │ ├── asg.png │ ├── back_inst.png │ ├── index.png │ ├── instance_final.png │ ├── launch_conf.png │ ├── mem_valid.png │ ├── mysql_valid.png │ ├── rabbitmq.png │ ├── route53.png │ ├── sys_adm.png │ └── validate_login.png ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── visualpathit │ │ │ │ └── account │ │ │ │ ├── beans │ │ │ │ └── Components.java │ │ │ │ ├── controller │ │ │ │ ├── ElasticSearchController.java │ │ │ │ ├── FileUploadController.java │ │ │ │ └── UserController.java │ │ │ │ ├── model │ │ │ │ ├── Role.java │ │ │ │ └── User.java │ │ │ │ ├── repository │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── service │ │ │ │ ├── ConsumerService.java │ │ │ │ ├── ConsumerServiceImpl.java │ │ │ │ ├── ProducerService.java │ │ │ │ ├── ProducerServiceImpl.java │ │ │ │ ├── SecurityService.java │ │ │ │ ├── SecurityServiceImpl.java │ │ │ │ ├── UserDetailsServiceImpl.java │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ │ │ ├── utils │ │ │ │ ├── ElasticsearchUtil.java │ │ │ │ ├── MemcachedUtils.java │ │ │ │ └── RabbitMqUtil.java │ │ │ │ └── validator │ │ │ │ └── UserValidator.java │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── db_backup.sql │ │ │ ├── logback.xml │ │ │ └── validation.properties │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── appconfig-data.xml │ │ │ ├── appconfig-mvc.xml │ │ │ ├── appconfig-rabbitmq.xml │ │ │ ├── appconfig-root.xml │ │ │ ├── appconfig-security.xml │ │ │ ├── views │ │ │ │ ├── elasticeSearchRes.jsp │ │ │ │ ├── index_home.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── rabbitmq.jsp │ │ │ │ ├── registration.jsp │ │ │ │ ├── upload.jsp │ │ │ │ ├── user.jsp │ │ │ │ ├── userList.jsp │ │ │ │ ├── userUpdate.jsp │ │ │ │ └── welcome.jsp │ │ │ └── web.xml │ │ │ └── resources │ │ │ ├── Images │ │ │ ├── background.png │ │ │ ├── header.jpg │ │ │ ├── technologies │ │ │ │ ├── Ansible_logo.png │ │ │ │ ├── Vagrant.png │ │ │ │ ├── aws.png │ │ │ │ ├── docker.png │ │ │ │ ├── git.jpg │ │ │ │ ├── jenkins.png │ │ │ │ ├── puppet.jpg │ │ │ │ └── python-logo.png │ │ │ ├── user │ │ │ │ ├── giphy.gif │ │ │ │ ├── logo.png │ │ │ │ ├── user.png │ │ │ │ ├── user2.png │ │ │ │ └── user3.png │ │ │ ├── visualpath.png │ │ │ ├── visualpathlogo2.png │ │ │ └── visualpathlogo3.png │ │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ ├── common.css │ │ │ ├── profile.css │ │ │ └── w3.css │ │ │ └── js │ │ │ └── bootstrap.min.js │ └── test │ │ └── java │ │ └── com │ │ └── visualpathit │ │ └── account │ │ ├── controllerTest │ │ ├── SampleTest.java │ │ └── UserControllerTest.java │ │ ├── modelTest │ │ ├── RoleTest.java │ │ └── UserTest.java │ │ └── setup │ │ └── StandaloneMvcTestViewResolver.java └── userdata │ ├── backend.sh │ ├── memcache.sh │ ├── mysql.sh │ ├── nginx.sh │ ├── rabbitmq.sh │ ├── tomcat.sh │ └── tomcat_ubuntu.sh ├── PROJECT_4 ├── Jenkinsfile ├── README.md ├── ansible │ ├── ansible.cfg │ ├── site.yml │ ├── templates │ │ ├── application.j2 │ │ ├── epel6-svcfile.j2 │ │ ├── epel7-svcfile.j2 │ │ ├── ubuntu14_15-svcfile.j2 │ │ └── ubuntu16-svcfile.j2 │ ├── tomcat_setup.yml │ └── vpro-app-setup.yml ├── images │ ├── Screenshot 2023-01-18 at 09.25.35.png │ ├── bean-ver.png │ ├── beanstalk.png │ ├── cloudfront.png │ ├── elastic.png │ ├── elasticache.png │ ├── fromcache.png │ ├── https.png │ ├── insertcache.png │ ├── rabbitmq-val.png │ ├── rds-val.png │ ├── rds.png │ └── sys-des.png ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── visualpathit │ │ │ │ └── account │ │ │ │ ├── beans │ │ │ │ └── Components.java │ │ │ │ ├── controller │ │ │ │ ├── ElasticSearchController.java │ │ │ │ ├── FileUploadController.java │ │ │ │ └── UserController.java │ │ │ │ ├── model │ │ │ │ ├── Role.java │ │ │ │ └── User.java │ │ │ │ ├── repository │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── service │ │ │ │ ├── ConsumerService.java │ │ │ │ ├── ConsumerServiceImpl.java │ │ │ │ ├── ProducerService.java │ │ │ │ ├── ProducerServiceImpl.java │ │ │ │ ├── SecurityService.java │ │ │ │ ├── SecurityServiceImpl.java │ │ │ │ ├── UserDetailsServiceImpl.java │ │ │ │ ├── UserService.java │ │ │ │ └── UserServiceImpl.java │ │ │ │ ├── utils │ │ │ │ ├── ElasticsearchUtil.java │ │ │ │ ├── MemcachedUtils.java │ │ │ │ └── RabbitMqUtil.java │ │ │ │ └── validator │ │ │ │ └── UserValidator.java │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── db_backup.sql │ │ │ ├── logback.xml │ │ │ └── validation.properties │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── appconfig-data.xml │ │ │ ├── appconfig-mvc.xml │ │ │ ├── appconfig-rabbitmq.xml │ │ │ ├── appconfig-root.xml │ │ │ ├── appconfig-security.xml │ │ │ ├── views │ │ │ │ ├── elasticeSearchRes.jsp │ │ │ │ ├── index_home.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── rabbitmq.jsp │ │ │ │ ├── registration.jsp │ │ │ │ ├── upload.jsp │ │ │ │ ├── user.jsp │ │ │ │ ├── userList.jsp │ │ │ │ ├── userUpdate.jsp │ │ │ │ └── welcome.jsp │ │ │ └── web.xml │ │ │ └── resources │ │ │ ├── Images │ │ │ ├── background.png │ │ │ ├── header.jpg │ │ │ ├── technologies │ │ │ │ ├── Ansible_logo.png │ │ │ │ ├── Vagrant.png │ │ │ │ ├── aws.png │ │ │ │ ├── docker.png │ │ │ │ ├── git.jpg │ │ │ │ ├── jenkins.png │ │ │ │ ├── puppet.jpg │ │ │ │ └── python-logo.png │ │ │ ├── user │ │ │ │ ├── giphy.gif │ │ │ │ ├── logo.png │ │ │ │ ├── user.png │ │ │ │ ├── user2.png │ │ │ │ └── user3.png │ │ │ ├── visualpath.png │ │ │ ├── visualpathlogo2.png │ │ │ └── visualpathlogo3.png │ │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ ├── common.css │ │ │ ├── profile.css │ │ │ └── w3.css │ │ │ └── js │ │ │ └── bootstrap.min.js │ └── test │ │ └── java │ │ └── com │ │ └── visualpathit │ │ └── account │ │ ├── controllerTest │ │ ├── SampleTest.java │ │ └── UserControllerTest.java │ │ ├── modelTest │ │ ├── RoleTest.java │ │ └── UserTest.java │ │ └── setup │ │ └── StandaloneMvcTestViewResolver.java └── userdata │ ├── backend.sh │ ├── memcache.sh │ ├── mysql.sh │ ├── nginx.sh │ ├── rabbitmq.sh │ ├── tomcat.sh │ └── tomcat_ubuntu.sh ├── PROJECT_5 ├── README.md └── images │ ├── arti.png │ ├── artifact-upload.png │ ├── build1.png │ ├── ci-flow.png │ ├── finalslack.png │ ├── jenkins-ci.webp │ ├── jenkins-ui.png │ ├── jenkins-ui2.png │ ├── jenkinsci.png │ ├── nexus-login.png │ ├── qc.png │ ├── sonar-int.png │ ├── sonar-ui.png │ └── sonar-ui2.png ├── PROJECT_6 ├── README.md └── images │ ├── Project-6.png │ ├── artifact1.png │ ├── build2.png │ ├── build3.png │ ├── codepipeline-succesful.png │ ├── mvn-repo.png │ ├── perm2.png │ ├── reo-upload.png │ ├── sonar.png │ ├── ssh.png │ └── valid_sonar.png ├── PROJECT_7 ├── Data_Backup_of_CICD_Stack.md ├── README.md └── images │ ├── cicd.png │ ├── ecr_success.png │ ├── ecs.png │ ├── elb.png │ ├── pipeline3.png │ ├── slack2.png │ ├── success_docker.png │ ├── sys-des.png │ └── sys-des2.png ├── PROJECT_8 ├── README.md └── images │ ├── BuildandRelease-success.png │ ├── Project-6.png │ ├── Project-8.png │ ├── app-running-on-beanstalk.png │ ├── artifact1.png │ ├── build2.png │ ├── build3.png │ ├── cicd-pipeline-successful.png │ ├── codepipeline-succesful.png │ ├── mvn-repo.png │ ├── perm2.png │ ├── reo-upload.png │ ├── sonar.png │ ├── ssh.png │ └── valid_sonar.png ├── PROJECT_9 ├── README.md ├── bastion-instance.yml ├── images │ ├── ans.png │ ├── aws_igw.png │ ├── aws_sub.png │ ├── display_ans.png │ ├── igw.png │ ├── key1.png │ ├── project_9.png │ ├── rt.png │ ├── vpc-id.png │ ├── vpc1.png │ ├── vpc_aws.png │ ├── vpc_sub.png │ ├── warm-up.png │ ├── warm-up2.png │ └── warmup3.png ├── vars │ ├── bastion_setup │ └── vpc_setup └── vpc-setup.yml ├── Pipeline-As-A-Code ├── README.md └── images │ ├── build.png │ ├── jenkins-PAAC.png │ ├── jenkins-int.png │ └── jenkins-ui.png └── README.md /PROJECT_1/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/architecture.png -------------------------------------------------------------------------------- /PROJECT_1/images/db_verification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/db_verification.png -------------------------------------------------------------------------------- /PROJECT_1/images/des-vag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/des-vag.png -------------------------------------------------------------------------------- /PROJECT_1/images/ip_addr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/ip_addr.png -------------------------------------------------------------------------------- /PROJECT_1/images/mariadb_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/mariadb_setup.png -------------------------------------------------------------------------------- /PROJECT_1/images/memcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/memcache.png -------------------------------------------------------------------------------- /PROJECT_1/images/memcached.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/memcached.png -------------------------------------------------------------------------------- /PROJECT_1/images/memcached_valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/memcached_valid.png -------------------------------------------------------------------------------- /PROJECT_1/images/rabbit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/rabbit.png -------------------------------------------------------------------------------- /PROJECT_1/images/rabbitmq_validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/rabbitmq_validation.png -------------------------------------------------------------------------------- /PROJECT_1/images/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/setup.png -------------------------------------------------------------------------------- /PROJECT_1/images/vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/vagrant.png -------------------------------------------------------------------------------- /PROJECT_1/images/vagrant_validate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/vagrant_validate.png -------------------------------------------------------------------------------- /PROJECT_1/images/vprofile_web_arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/vprofile_web_arc.png -------------------------------------------------------------------------------- /PROJECT_1/images/web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/web.png -------------------------------------------------------------------------------- /PROJECT_1/images/welcome_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/images/welcome_page.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Set; 5 | /**{@author waheedk} !*/ 6 | @Entity 7 | @Table(name = "role") 8 | public class Role { 9 | /** the id field !*/ 10 | private Long id; 11 | /** the name field !*/ 12 | private String name; 13 | /** the user field !*/ 14 | private Set users; 15 | /** {@inheritDoc}} !*/ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | /** 19 | * {@link Role#id} 20 | !*/ 21 | public Long getId() { 22 | return id; 23 | } 24 | /** {@inheritDoc}} !*/ 25 | public void setId(final Long id) { 26 | this.id = id; 27 | } 28 | /** 29 | * {@link Role#name} 30 | !*/ 31 | public String getName() { 32 | return name; 33 | } 34 | /** {@inheritDoc}} !*/ 35 | public void setName(final String name) { 36 | this.name = name; 37 | } 38 | /** 39 | * {@inheritDoc}} 40 | !*/ 41 | @ManyToMany(fetch = FetchType.EAGER, mappedBy = "roles",cascade = CascadeType.ALL) 42 | /** 43 | * {@link Role#id} 44 | !*/ 45 | public Set getUsers() { 46 | return users; 47 | } 48 | /** 49 | * {@inheritDoc}} 50 | !*/ 51 | public final void setUsers(Set users) { 52 | this.users = users; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.visualpathit.account.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.visualpathit.account.model.User; 8 | 9 | public interface UserRepository extends JpaRepository { 10 | User findByUsername(String username); 11 | User findById(long id); 12 | /*public void updateUser(User user)*/; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ConsumerService { 4 | 5 | void consumerMessage(byte[] data); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/ConsumerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.springframework.amqp.core.ExchangeTypes; 4 | import org.springframework.amqp.rabbit.annotation.Exchange; 5 | import org.springframework.amqp.rabbit.annotation.Queue; 6 | import org.springframework.amqp.rabbit.annotation.QueueBinding; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ConsumerServiceImpl implements ConsumerService { 12 | 13 | /** 14 | The name of the exchange. 15 | */ 16 | private static final String EXCHANGE_NAME = "messages"; 17 | 18 | /** 19 | * The function that consumes messages from the broker(RabbitMQ) 20 | * @param data 21 | */ 22 | @Override 23 | @RabbitListener(bindings = @QueueBinding( value = @Queue(), 24 | exchange = @Exchange(value = EXCHANGE_NAME, type = ExchangeTypes.FANOUT))) 25 | public void consumerMessage(byte[] data) { 26 | String consumedMessage = new String(data); 27 | System.out.println(" [x] Consumed '" + consumedMessage + "'"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/ProducerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ProducerService { 4 | 5 | public String produceMessage(String message); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/SecurityService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | /** method for finding already added user !*/ 4 | public interface SecurityService { 5 | /** {@inheritDoc}} !*/ 6 | String findLoggedInUsername(); 7 | 8 | void autologin(String username, String password); 9 | } 10 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.authentication.AuthenticationManager; 7 | import org.springframework.security.authentication 8 | .UsernamePasswordAuthenticationToken; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.stereotype.Service; 13 | /** {@author waheedk} !*/ 14 | @Service 15 | public class SecurityServiceImpl implements SecurityService { 16 | /** authenticationManager !*/ 17 | @Autowired 18 | private AuthenticationManager authenticationManager; 19 | /** userDetailsService !*/ 20 | @Autowired 21 | private UserDetailsService userDetailsService; 22 | 23 | /** Logger creation !*/ 24 | private static final Logger logger = LoggerFactory 25 | .getLogger(SecurityServiceImpl.class); 26 | 27 | @Override 28 | public String findLoggedInUsername() { 29 | Object userDetails = SecurityContextHolder.getContext() 30 | .getAuthentication().getDetails(); 31 | if (userDetails instanceof UserDetails) { 32 | return ((UserDetails) userDetails).getUsername(); 33 | } 34 | 35 | return null; 36 | } 37 | 38 | @Override 39 | public void autologin(final String username, final String password) { 40 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 41 | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = 42 | new UsernamePasswordAuthenticationToken(userDetails, password, userDetails.getAuthorities()); 43 | 44 | authenticationManager.authenticate(usernamePasswordAuthenticationToken); 45 | 46 | if (usernamePasswordAuthenticationToken.isAuthenticated()) { 47 | SecurityContextHolder.getContext() 48 | .setAuthentication(usernamePasswordAuthenticationToken); 49 | logger.debug(String.format("Auto login %s successfully!", username)); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.Role; 4 | import com.visualpathit.account.model.User; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.GrantedAuthority; 9 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | /** {@author waheedk} !*/ 18 | public class UserDetailsServiceImpl implements UserDetailsService { 19 | @Autowired 20 | /** userRepository !*/ 21 | private UserRepository userRepository; 22 | 23 | @Override 24 | @Transactional(readOnly = true) 25 | public UserDetails loadUserByUsername(final String username) 26 | throws UsernameNotFoundException { 27 | User user = userRepository.findByUsername(username); 28 | 29 | Set grantedAuthorities = new HashSet<>(); 30 | for (Role role : user.getRoles()) { 31 | grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); 32 | } 33 | 34 | return new org.springframework.security.core 35 | .userdetails.User(user.getUsername(), user.getPassword(), grantedAuthorities); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import java.util.List; 4 | 5 | import com.visualpathit.account.model.User; 6 | 7 | /** {@author waheedk}!*/ 8 | public interface UserService { 9 | /** {@inheritDoc}} !*/ 10 | void save(User user); 11 | /** {@inheritDoc}} !*/ 12 | User findByUsername(String username); 13 | User findById(long id); 14 | /*public void updateUser(User user);*/ 15 | public List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.repository.RoleRepository; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.HashSet; 12 | import java.util.List; 13 | 14 | /** {@author waheedk}!*/ 15 | @Service 16 | public class UserServiceImpl implements UserService { 17 | @Autowired 18 | /** userRepository !*/ 19 | private UserRepository userRepository; 20 | @Autowired 21 | /** roleRepository !*/ 22 | private RoleRepository roleRepository; 23 | @Autowired 24 | /** bCryptPasswordEncoder !*/ 25 | private BCryptPasswordEncoder bCryptPasswordEncoder; 26 | 27 | @Override 28 | public void save(final User user) { 29 | user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); 30 | user.setRoles(new HashSet<>(roleRepository.findAll())); 31 | userRepository.save(user); 32 | } 33 | 34 | @Override 35 | public User findByUsername(final String username) { 36 | return userRepository.findByUsername(username); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return userRepository.findAll(); 42 | } 43 | @Override 44 | public User findById(long id){ 45 | return userRepository.findOne(id); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/utils/ElasticsearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | 5 | import org.elasticsearch.client.transport.TransportClient; 6 | import org.elasticsearch.common.settings.Settings; 7 | import org.elasticsearch.common.transport.InetSocketTransportAddress; 8 | import org.elasticsearch.transport.client.PreBuiltTransportClient; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.visualpathit.account.beans.Components; 13 | @Service 14 | public class ElasticsearchUtil { 15 | 16 | private static Components object; 17 | @Autowired 18 | public void setComponents(Components object){ 19 | ElasticsearchUtil.object = object; 20 | 21 | } 22 | public static TransportClient trannsportClient() { 23 | System.out.println(" elasticsearch client"); 24 | String elasticsearchHost =object.getElasticsearchHost(); 25 | String elasticsearchPort =object.getElasticsearchPort(); 26 | String elasticsearchCluster =object.getElasticsearchCluster(); 27 | String elasticsearchNode =object.getElasticsearchNode(); 28 | System.out.println(" elasticsearchHost ........"+ elasticsearchHost); 29 | System.out.println(" elasticsearchHost ........"+ elasticsearchPort); 30 | TransportClient client = null; 31 | try { 32 | Settings settings = Settings.builder() 33 | .put("cluster.name",elasticsearchCluster) 34 | .put("node.name",elasticsearchNode) 35 | .build(); 36 | client = new PreBuiltTransportClient(settings) 37 | .addTransportAddress( 38 | new InetSocketTransportAddress( 39 | new InetSocketAddress(elasticsearchHost, Integer.parseInt(elasticsearchPort)))); 40 | 41 | 42 | } 43 | catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | return client; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/utils/RabbitMqUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.visualpathit.account.beans.Components; 7 | 8 | @Service 9 | public class RabbitMqUtil { 10 | private static Components object; 11 | 12 | public RabbitMqUtil() {} 13 | 14 | @Autowired 15 | public void setComponents(Components object) { 16 | RabbitMqUtil.object = object; 17 | } 18 | 19 | public static String getRabbitMqHost() { return object.getRabbitMqHost(); } 20 | 21 | public static String getRabbitMqPort() { 22 | return object.getRabbitMqPort(); 23 | } 24 | 25 | public static String getRabbitMqUser() { return object.getRabbitMqUser(); } 26 | 27 | public static String getRabbitMqPassword() { 28 | return object.getRabbitMqPassword(); 29 | } 30 | } -------------------------------------------------------------------------------- /PROJECT_1/src/main/java/com/visualpathit/account/validator/UserValidator.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.validator; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.UserService; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.validation.Errors; 9 | import org.springframework.validation.ValidationUtils; 10 | import org.springframework.validation.Validator; 11 | 12 | @Component 13 | public class UserValidator implements Validator { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @Override 18 | public boolean supports(Class aClass) { 19 | return User.class.equals(aClass); 20 | } 21 | 22 | @Override 23 | public void validate(Object o, Errors errors) { 24 | User user = (User) o; 25 | 26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty"); 27 | if (user.getUsername().length() < 6 || user.getUsername().length() > 32) { 28 | errors.rejectValue("username", "Size.userForm.username"); 29 | } 30 | if (userService.findByUsername(user.getUsername()) != null) { 31 | errors.rejectValue("username", "Duplicate.userForm.username"); 32 | } 33 | 34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty"); 35 | if (user.getPassword().length() < 8 || user.getPassword().length() > 32) { 36 | errors.rejectValue("password", "Size.userForm.password"); 37 | } 38 | 39 | if (!user.getPasswordConfirm().equals(user.getPassword())) { 40 | errors.rejectValue("passwordConfirm", "Diff.userForm.passwordConfirm"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=mc01 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg\n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username= User has already taken this Username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/appconfig-mvc.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | classpath:validation 15 | 16 | 17 | 18 | 19 | 20 | /WEB-INF/views/ 21 | 22 | 23 | .jsp 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/appconfig-rabbitmq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/appconfig-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/appconfig-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/views/elasticeSearchRes.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | 8 | 9 | 10 | 11 | 12 | vp-elasticsearch 13 | 14 | 15 |

Data is ${result} into Elasticsearch

16 |

Please go to elastic search dash board and verify link ip:9200/users/user/id

17 | 18 | 19 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/views/rabbitmq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Rabbitmq 8 | 9 | 10 |

Rabbitmq initiated

11 |

Generated 2 Connections

12 |

6 Chanels 1 Exchage and 2 Que

13 | 14 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account Registration Web Application 4 | 5 | contextConfigLocation 6 | /WEB-INF/appconfig-root.xml 7 | 8 | 9 | springSecurityFilterChain 10 | org.springframework.web.filter.DelegatingFilterProxy 11 | 12 | 13 | springSecurityFilterChain 14 | /* 15 | 16 | 17 | dispatcher 18 | org.springframework.web.servlet.DispatcherServlet 19 | 20 | contextConfigLocation 21 | 22 | 23 | 1 24 | 25 | 26 | dispatcher 27 | / 28 | 29 | 30 | org.springframework.web.context.ContextLoaderListener 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/background.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/header.jpg -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/Ansible_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/Ansible_logo.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/Vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/Vagrant.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/aws.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/docker.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/git.jpg -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/jenkins.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/puppet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/puppet.jpg -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/technologies/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/technologies/python-logo.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/user/giphy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/user/giphy.gif -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/user/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/user/logo.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/user/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/user/user.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/user/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/user/user2.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/user/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/user/user3.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/visualpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/visualpath.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/visualpathlogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/visualpathlogo2.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/Images/visualpathlogo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_1/src/main/webapp/resources/Images/visualpathlogo3.png -------------------------------------------------------------------------------- /PROJECT_1/src/main/webapp/resources/css/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 100px; 3 | padding-bottom: 50px; 4 | background-color: #ffffff; 5 | 6 | } 7 | form { 8 | border: 3px solid #204a87; 9 | } 10 | 11 | img.logo { 12 | display: block; 13 | margin-left: auto; 14 | margin-right: auto; 15 | width: 300px; 16 | height: 70px; 17 | 18 | } 19 | .form-signin { 20 | max-width: 330px; 21 | padding: 15px; 22 | margin: 0 auto; 23 | } 24 | .btn-custom,.btn-custom:hover, .btn-custom:focus, .btn-custom:active { 25 | border-radius: 0; 26 | color: #ffffff; 27 | background-color: #ef2929; 28 | border-color: #ef2929; 29 | 30 | } 31 | .btn-custom-LOGIN { 32 | border-radius: 0; 33 | color: #ffffff; 34 | height:3em; 35 | background-color: #26C6DA; 36 | border-color: #ef2929; 37 | 38 | } 39 | 40 | .form-signin .form-signin-heading, 41 | .form-signin .checkbox { 42 | margin-bottom: 10px; 43 | } 44 | 45 | .form-signin .checkbox { 46 | font-weight: normal; 47 | } 48 | 49 | .form-signin .form-control { 50 | position: relative; 51 | height: auto; 52 | -webkit-box-sizing: border-box; 53 | -moz-box-sizing: border-box; 54 | box-sizing: border-box; 55 | padding: 10px; 56 | font-size: 16px; 57 | } 58 | 59 | .form-signin .form-control:focus { 60 | z-index: 2; 61 | } 62 | 63 | .form-signin input { 64 | margin-top: 10px; 65 | border-bottom-right-radius: 0; 66 | border-bottom-left-radius: 0; 67 | } 68 | 69 | .form-signin button { 70 | margin-top: 10px; 71 | } 72 | 73 | .has-error { 74 | color: red 75 | } -------------------------------------------------------------------------------- /PROJECT_1/src/test/java/com/visualpathit/account/controllerTest/SampleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class SampleTest { 8 | @Test 9 | public void SampleTestHappyFlow(){ 10 | assertEquals("Hello".length(), 5); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /PROJECT_1/src/test/java/com/visualpathit/account/modelTest/RoleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class RoleTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final String EXPECTED_ROLENAME = "Admin"; 20 | public static final int EXPECTED_SIZE = 1; 21 | private Role role; 22 | @Before 23 | public void setUp() throws Exception { 24 | User user = new User(); 25 | user.setId(1L); 26 | user.setUsername("Wahidkhan74"); 27 | user.setPassword("Wahidkhan74"); 28 | user.setUserEmail("XXXXX@gmail.com"); 29 | 30 | Set users = new HashSet(); 31 | users.add(user); 32 | role = new Role(); 33 | role.setId(1L); 34 | role.setName("Admin"); 35 | role.setUsers(users); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | System.out.println("Test Completed"); 41 | 42 | } 43 | 44 | @Test 45 | public void testUserDetailsHappyFlow() throws Exception { 46 | Assert.assertEquals(EXPECTED_ID, role.getId()); 47 | Assert.assertEquals(EXPECTED_ROLENAME, role.getName()); 48 | Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size()); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /PROJECT_1/src/test/java/com/visualpathit/account/modelTest/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class UserTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final int EXPECTED_SIZE = 1; 20 | public static final String EXPECTED_USERNAME = "Wahidkhan74"; 21 | public static final String EXPECTED_PASSWD = "Wahidkhan74"; 22 | public static final String EXPECTED_USEREMAIL = "XXXXX@gmail.com"; 23 | private User user; 24 | @Before 25 | public void setUp() throws Exception { 26 | 27 | Role role = new Role(); 28 | role.setId(1L); 29 | role.setName("Admin"); 30 | Set roles = new HashSet(); 31 | roles.add(role); 32 | 33 | user = new User(); 34 | user.setId(1L); 35 | user.setUsername("Wahidkhan74"); 36 | user.setPassword("Wahidkhan74"); 37 | user.setUserEmail("XXXXX@gmail.com"); 38 | user.setRoles(roles); 39 | } 40 | 41 | @After 42 | public void tearDown() throws Exception { 43 | System.out.println("Test Completed"); 44 | 45 | } 46 | 47 | @Test 48 | public void testUserDetailsHappyFlow() throws Exception { 49 | Assert.assertEquals(EXPECTED_ID, user.getId()); 50 | Assert.assertEquals(EXPECTED_USERNAME, user.getUsername()); 51 | Assert.assertEquals(EXPECTED_PASSWD, user.getPassword()); 52 | Assert.assertEquals(EXPECTED_USEREMAIL, user.getUserEmail()); 53 | Assert.assertEquals(EXPECTED_SIZE,user.getRoles().size()); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /PROJECT_1/src/test/java/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.setup; 2 | 3 | import org.springframework.web.servlet.view.AbstractUrlBasedView; 4 | import org.springframework.web.servlet.view.InternalResourceView; 5 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 6 | 7 | public class StandaloneMvcTestViewResolver extends InternalResourceViewResolver { 8 | 9 | public StandaloneMvcTestViewResolver() { 10 | super(); 11 | } 12 | 13 | @Override 14 | protected AbstractUrlBasedView buildView(final String viewName) throws Exception { 15 | final InternalResourceView view = (InternalResourceView) super.buildView(viewName); 16 | // prevent checking for circular view paths 17 | view.setPreventDispatchLoop(false); 18 | return view; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PROJECT_1/vagrant/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### Nginx VM ### 6 | config.vm.define "web01" do |web01| 7 | web01.vm.box = "ubuntu/bionic64" 8 | web01.vm.hostname = "web01" 9 | web01.vm.network "private_network", ip: "192.168.56.11" 10 | end 11 | 12 | ### tomcat vm ### 13 | config.vm.define "app01" do |app01| 14 | app01.vm.box = "geerlingguy/centos7" 15 | app01.vm.hostname = "app01" 16 | app01.vm.network "private_network", ip: "192.168.56.12" 17 | app01.vm.provider "virtualbox" do |vb| 18 | vb.memory = "1024" 19 | end 20 | end 21 | 22 | ### RabbitMQ vm #### 23 | config.vm.define "rmq01" do |rmq01| 24 | rmq01.vm.box = "geerlingguy/centos7" 25 | rmq01.vm.hostname = "rmq01" 26 | rmq01.vm.network "private_network", ip: "192.168.56.16" 27 | end 28 | 29 | ### Memcache vm #### 30 | config.vm.define "mc01" do |mc01| 31 | mc01.vm.box = "geerlingguy/centos7" 32 | mc01.vm.hostname = "mc01" 33 | mc01.vm.network "private_network", ip: "192.168.56.14" 34 | end 35 | 36 | ### DB vm #### 37 | config.vm.define "db01" do |db01| 38 | db01.vm.box = "geerlingguy/centos7" 39 | db01.vm.hostname = "db01" 40 | db01.vm.network "private_network", ip: "192.168.56.15" 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /PROJECT_10/images/DNS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/DNS.png -------------------------------------------------------------------------------- /PROJECT_10/images/Project-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/Project-10.png -------------------------------------------------------------------------------- /PROJECT_10/images/app-in-prod-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/app-in-prod-server.png -------------------------------------------------------------------------------- /PROJECT_10/images/ci-confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/ci-confirm.png -------------------------------------------------------------------------------- /PROJECT_10/images/cred_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/cred_details.png -------------------------------------------------------------------------------- /PROJECT_10/images/deploy-prod-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/deploy-prod-pipeline.png -------------------------------------------------------------------------------- /PROJECT_10/images/inventory_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/inventory_file.png -------------------------------------------------------------------------------- /PROJECT_10/images/stage_ans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/stage_ans.png -------------------------------------------------------------------------------- /PROJECT_10/images/stage_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_10/images/stage_view.png -------------------------------------------------------------------------------- /PROJECT_11/images/Project-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/Project-11.png -------------------------------------------------------------------------------- /PROJECT_11/images/bean_prod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/bean_prod.png -------------------------------------------------------------------------------- /PROJECT_11/images/beanstalk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/beanstalk1.png -------------------------------------------------------------------------------- /PROJECT_11/images/healthcheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/healthcheck.png -------------------------------------------------------------------------------- /PROJECT_11/images/pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/pro.png -------------------------------------------------------------------------------- /PROJECT_11/images/prod_approcal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/prod_approcal.png -------------------------------------------------------------------------------- /PROJECT_11/images/prod_bean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/prod_bean.png -------------------------------------------------------------------------------- /PROJECT_11/images/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/slack.png -------------------------------------------------------------------------------- /PROJECT_11/images/stage_cicd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/stage_cicd.png -------------------------------------------------------------------------------- /PROJECT_11/images/stage_s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/stage_s3.png -------------------------------------------------------------------------------- /PROJECT_11/images/stage_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/stage_version.png -------------------------------------------------------------------------------- /PROJECT_11/images/validate_ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_11/images/validate_ci.png -------------------------------------------------------------------------------- /PROJECT_12/images/composeup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/composeup.png -------------------------------------------------------------------------------- /PROJECT_12/images/docker_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/docker_install.png -------------------------------------------------------------------------------- /PROJECT_12/images/dockerhub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/dockerhub.png -------------------------------------------------------------------------------- /PROJECT_12/images/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/images.png -------------------------------------------------------------------------------- /PROJECT_12/images/lodin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/lodin.png -------------------------------------------------------------------------------- /PROJECT_12/images/sys_des.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/sys_des.png -------------------------------------------------------------------------------- /PROJECT_12/images/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_12/images/target.png -------------------------------------------------------------------------------- /PROJECT_13/images/app-secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/app-secret.png -------------------------------------------------------------------------------- /PROJECT_13/images/db_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/db_deploy.png -------------------------------------------------------------------------------- /PROJECT_13/images/dockerfiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/dockerfiles.png -------------------------------------------------------------------------------- /PROJECT_13/images/ebs_vo;ume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/ebs_vo;ume.png -------------------------------------------------------------------------------- /PROJECT_13/images/encoded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/encoded.png -------------------------------------------------------------------------------- /PROJECT_13/images/get-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/get-all.png -------------------------------------------------------------------------------- /PROJECT_13/images/kops_cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/kops_cluster.png -------------------------------------------------------------------------------- /PROJECT_13/images/kubectl_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/kubectl_nodes.png -------------------------------------------------------------------------------- /PROJECT_13/images/label_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/label_node.png -------------------------------------------------------------------------------- /PROJECT_13/images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/login.png -------------------------------------------------------------------------------- /PROJECT_13/images/memcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/memcache.png -------------------------------------------------------------------------------- /PROJECT_13/images/ns-lookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/ns-lookup.png -------------------------------------------------------------------------------- /PROJECT_13/images/ns-record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/ns-record.png -------------------------------------------------------------------------------- /PROJECT_13/images/rabbitmq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/rabbitmq.png -------------------------------------------------------------------------------- /PROJECT_13/images/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/record.png -------------------------------------------------------------------------------- /PROJECT_13/images/verify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_13/images/verify.png -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/backend-s3.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "s3" { 3 | bucket = "vprofile-terraform-state-rd" # replace with your s3 bucketname 4 | key = "backend" 5 | region = "us-east-1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/backend-services.tf: -------------------------------------------------------------------------------- 1 | resource "aws_db_subnet_group" "vprofile-rds-subgrp" { 2 | name = "vprofile-rds-subgrp" 3 | subnet_ids = [module.vpc.private_subnets[0], module.vpc.private_subnets[1], module.vpc.private_subnets[2]] 4 | tags = { 5 | Name = "Subnet groups for RDS" 6 | } 7 | } 8 | 9 | resource "aws_elasticache_subnet_group" "vprofile-ecache-subgrp" { 10 | name = "vprofile-ecache-subgrp" 11 | subnet_ids = [module.vpc.private_subnets[0], module.vpc.private_subnets[1], module.vpc.private_subnets[2]] 12 | tags = { 13 | Name = "Subnet groups for ECACHE" 14 | } 15 | 16 | } 17 | 18 | resource "aws_db_instance" "vprofile-rds" { 19 | allocated_storage = 20 20 | storage_type = "gp2" 21 | engine = "mysql" 22 | engine_version = "5.7.34" 23 | instance_class = "db.t2.micro" 24 | db_name = var.dbname 25 | username = var.dbuser 26 | password = var.dbpass 27 | parameter_group_name = "default.mysql5.7" 28 | skip_final_snapshot = true 29 | publicly_accessible = false 30 | multi_az = false 31 | db_subnet_group_name = aws_db_subnet_group.vprofile-rds-subgrp.name 32 | vpc_security_group_ids = [aws_security_group.vprofile-backend-sg.id] 33 | } 34 | 35 | resource "aws_elasticache_cluster" "vprofile-cache" { 36 | cluster_id = "vprofile-cache" 37 | engine = "memcached" 38 | node_type = "cache.t2.micro" 39 | num_cache_nodes = 1 40 | parameter_group_name = "default.memcached1.6" 41 | port = 11211 42 | subnet_group_name = aws_elasticache_subnet_group.vprofile-ecache-subgrp.name 43 | security_group_ids = [aws_security_group.vprofile-backend-sg.id] 44 | } 45 | 46 | resource "aws_mq_broker" "vprofile-rmq" { 47 | broker_name = "vprofile-rmq" 48 | engine_type = "ActiveMQ" 49 | engine_version = "5.15.0" 50 | host_instance_type = "mq.t2.micro" 51 | security_groups = [aws_security_group.vprofile-backend-sg.id] 52 | subnet_ids = [module.vpc.private_subnets[0]] 53 | 54 | user { 55 | username = var.rmquser 56 | password = var.rmqpass 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/bastion-host.tf: -------------------------------------------------------------------------------- 1 | resource "aws_instance" "vprofile-bastion" { 2 | ami = lookup(var.AMIS, var.AWS_REGION) 3 | instance_type = "t2.micro" 4 | key_name = aws_key_pair.vprofilekey.key_name 5 | subnet_id = module.vpc.public_subnets[0] 6 | count = var.instance_count 7 | vpc_security_group_ids = [aws_security_group.vprofile-bastion-sg.id] 8 | 9 | tags = { 10 | Name = "vprofile-bastion" 11 | PROJECT = "vprofile" 12 | } 13 | 14 | provisioner "file" { 15 | content = templatefile("templates/db-deploy.tftpls", { rds-endpoint = aws_db_instance.vprofile-rds.address, dbuser = var.dbuser, dbpass = var.dbpass }) 16 | destination = "/tmp/vprofile-dbdeploy.sh" 17 | } 18 | 19 | provisioner "remote-exec" { 20 | inline = [ 21 | "chmod +x /tmp/vprofile-dbdeploy.sh", 22 | "sudo /tmp/vprofile-dbdeploy.sh" 23 | ] 24 | } 25 | 26 | connection { 27 | user = var.USER 28 | private_key = file(var.PRIV_KEY_PATH) 29 | host = self.public_ip 30 | } 31 | 32 | depends_on = [aws_db_instance.vprofile-rds] 33 | } 34 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/bean-app.tf: -------------------------------------------------------------------------------- 1 | resource "aws_elastic_beanstalk_application" "vprofile-prod" { 2 | name = "vprofile-prod" 3 | } 4 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/keypairs.tf: -------------------------------------------------------------------------------- 1 | resource "aws_key_pair" "vprofilekey" { 2 | key_name = "vprofilekey" 3 | public_key = file(var.PUB_KEY_PATH) 4 | } -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/providers.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = var.AWS_REGION 3 | } 4 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/templates/db-deploy.tftpls: -------------------------------------------------------------------------------- 1 | sudo apt update 2 | sudo apt install git mysql-client -y 3 | git clone -b vp-rem https://github.com/devopshydclub/vprofile-project.git 4 | mysql -h ${rds-endpoint} -u ${dbuser} --password=${dbpass} accounts --ssl-mode=DISABLED < /home/ubuntu/vprofile-project/src/main/resources/db_backup.sql 5 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/vars.tf: -------------------------------------------------------------------------------- 1 | variable "AWS_REGION" { 2 | default = "us-east-1" 3 | } 4 | 5 | variable "AMIS" { 6 | type = map(any) 7 | default = { 8 | us-east-1 = "ami-09cd747c78a9add63" # ubuntu 20.04 AMI 9 | us-east-2 = "ami-0574da009dca65348" 10 | us-west-1 = "ami-0574da719dca65125" 11 | } 12 | } 13 | 14 | variable "PRIV_KEY_PATH" { 15 | default = "vprofilekey" 16 | } 17 | 18 | variable "PUB_KEY_PATH" { 19 | default = "vprofilekey.pub" 20 | } 21 | 22 | variable "USER" { 23 | default = "ubuntu" 24 | } 25 | 26 | variable "MyIP" { 27 | default = "73.161.253.221/32" 28 | } 29 | 30 | variable "rmquser" { 31 | default = "rabbit" 32 | } 33 | 34 | variable "rmqpass" { 35 | default = "S3nd3n@d4h4guz3l" 36 | } 37 | 38 | variable "dbuser" { 39 | default = "admin" 40 | } 41 | 42 | variable "dbpass" { 43 | default = "admin123" 44 | } 45 | 46 | variable "dbname" { 47 | default = "accounts" 48 | } 49 | 50 | variable "instance_count" { 51 | default = "1" 52 | } 53 | 54 | variable "VPC_NAME" { 55 | default = "vprofile-VPC" 56 | } 57 | 58 | variable "Zone1" { 59 | default = "us-east-1a" 60 | } 61 | 62 | variable "Zone2" { 63 | default = "us-east-1b" 64 | } 65 | 66 | variable "Zone3" { 67 | default = "us-east-1c" 68 | } 69 | 70 | variable "VpcCIDR" { 71 | default = "172.21.0.0/16" 72 | } 73 | 74 | variable "PubSub1CIDR" { 75 | default = "172.21.1.0/24" 76 | } 77 | 78 | variable "PubSub2CIDR" { 79 | default = "172.21.2.0/24" 80 | } 81 | 82 | variable "PubSub3CIDR" { 83 | default = "172.21.3.0/24" 84 | } 85 | 86 | variable "PrivSub1CIDR" { 87 | default = "172.21.4.0/24" 88 | } 89 | 90 | variable "PrivSub2CIDR" { 91 | default = "172.21.5.0/24" 92 | } 93 | 94 | variable "PrivSub3CIDR" { 95 | default = "172.21.6.0/24" 96 | } 97 | -------------------------------------------------------------------------------- /PROJECT_14/Terraform-files/vpc.tf: -------------------------------------------------------------------------------- 1 | module "vpc" { 2 | source = "terraform-aws-modules/vpc/aws" 3 | version = "3.18.1" 4 | 5 | name = var.VPC_NAME 6 | cidr = var.VpcCIDR 7 | azs = [var.Zone1, var.Zone2, var.Zone3] 8 | private_subnets = [var.PrivSub1CIDR, var.PrivSub2CIDR, var.PrivSub3CIDR] 9 | public_subnets = [var.PubSub1CIDR, var.PubSub2CIDR, var.PubSub3CIDR] 10 | 11 | enable_nat_gateway = true 12 | single_nat_gateway = true 13 | 14 | enable_dns_hostnames = true 15 | enable_dns_support = true 16 | 17 | tags = { 18 | Terraform = "true" 19 | Environment = "Prod" 20 | } 21 | 22 | vpc_tags = { 23 | Name = var.VPC_NAME 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /PROJECT_14/images/Project-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/Project-14.png -------------------------------------------------------------------------------- /PROJECT_14/images/app-deployed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/app-deployed.png -------------------------------------------------------------------------------- /PROJECT_14/images/aws_conf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/aws_conf.png -------------------------------------------------------------------------------- /PROJECT_14/images/aws_tf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/aws_tf.png -------------------------------------------------------------------------------- /PROJECT_14/images/first_init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/first_init.png -------------------------------------------------------------------------------- /PROJECT_14/images/repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/repo.png -------------------------------------------------------------------------------- /PROJECT_14/images/ssh-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/ssh-key.png -------------------------------------------------------------------------------- /PROJECT_14/images/ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/ssh.png -------------------------------------------------------------------------------- /PROJECT_14/images/subnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/subnet.png -------------------------------------------------------------------------------- /PROJECT_14/images/vpc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_14/images/vpc.png -------------------------------------------------------------------------------- /PROJECT_15/images/Project-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/Project-15.png -------------------------------------------------------------------------------- /PROJECT_15/images/app-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/app-page.png -------------------------------------------------------------------------------- /PROJECT_15/images/docker-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/docker-int.png -------------------------------------------------------------------------------- /PROJECT_15/images/docker_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/docker_install.png -------------------------------------------------------------------------------- /PROJECT_15/images/docker_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/docker_start.png -------------------------------------------------------------------------------- /PROJECT_15/images/error_docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/error_docker.png -------------------------------------------------------------------------------- /PROJECT_15/images/helm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/helm.png -------------------------------------------------------------------------------- /PROJECT_15/images/install_helm_init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/install_helm_init.png -------------------------------------------------------------------------------- /PROJECT_15/images/instances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/instances.png -------------------------------------------------------------------------------- /PROJECT_15/images/kops_sg_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/kops_sg_update.png -------------------------------------------------------------------------------- /PROJECT_15/images/modes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/modes.png -------------------------------------------------------------------------------- /PROJECT_15/images/ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/ns.png -------------------------------------------------------------------------------- /PROJECT_15/images/pipeline-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/pipeline-success.png -------------------------------------------------------------------------------- /PROJECT_15/images/sonar-tok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_15/images/sonar-tok.png -------------------------------------------------------------------------------- /PROJECT_2/.vagrant/bundler/global.sol: -------------------------------------------------------------------------------- 1 | {"dependencies":[["vagrant-hostmanager",["= 1.8.9"]],["log4r",[">= 0"]],["concurrent-ruby",["~> 1.0"]],["i18n",[">= 0"]],["micromachine",[">= 2","< 4"]],["vagrant-vbguest",["= 0.31.0"]]],"checksum":"79b247b029bed5cc032f9468e2e7fb4e8b8253d9aa7a948779208a6d065a4f02","vagrant_version":"2.3.3"} -------------------------------------------------------------------------------- /PROJECT_2/.vagrant/hostmanager/id: -------------------------------------------------------------------------------- 1 | 31a22fd9-838e-412d-93e2-07b1d6c51bcc -------------------------------------------------------------------------------- /PROJECT_2/.vagrant/rgloader/loader.rb: -------------------------------------------------------------------------------- 1 | # This file loads the proper rgloader/loader.rb file that comes packaged 2 | # with Vagrant so that encoded files can properly run with Vagrant. 3 | 4 | if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] 5 | require File.expand_path( 6 | "rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) 7 | else 8 | raise "Encoded files can't be read outside of the Vagrant installer." 9 | end 10 | -------------------------------------------------------------------------------- /PROJECT_2/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### DB vm #### 6 | config.vm.define "db01" do |db01| 7 | db01.vm.box = "geerlingguy/centos7" 8 | db01.vm.hostname = "db01" 9 | db01.vm.network "private_network", ip: "192.168.56.15" 10 | db01.vm.provision "shell", path: "mysql.sh" 11 | 12 | end 13 | 14 | ### Memcache vm #### 15 | config.vm.define "mc01" do |mc01| 16 | mc01.vm.box = "geerlingguy/centos7" 17 | mc01.vm.hostname = "mc01" 18 | mc01.vm.network "private_network", ip: "192.168.56.14" 19 | mc01.vm.provision "shell", path: "memcache.sh" 20 | end 21 | 22 | ### RabbitMQ vm #### 23 | config.vm.define "rmq01" do |rmq01| 24 | rmq01.vm.box = "geerlingguy/centos7" 25 | rmq01.vm.hostname = "rmq01" 26 | rmq01.vm.network "private_network", ip: "192.168.56.16" 27 | rmq01.vm.provision "shell", path: "rabbitmq.sh" 28 | end 29 | 30 | ### tomcat vm ### 31 | config.vm.define "app01" do |app01| 32 | app01.vm.box = "geerlingguy/centos7" 33 | app01.vm.hostname = "app01" 34 | app01.vm.network "private_network", ip: "192.168.56.12" 35 | app01.vm.provision "shell", path: "tomcat.sh" 36 | app01.vm.provider "virtualbox" do |vb| 37 | vb.memory = "1024" 38 | end 39 | end 40 | 41 | 42 | ### Nginx VM ### 43 | config.vm.define "web01" do |web01| 44 | web01.vm.box = "ubuntu/xenial64" 45 | web01.vm.hostname = "web01" 46 | web01.vm.network "private_network", ip: "192.168.56.11" 47 | web01.vm.provision "shell", path: "nginx.sh" 48 | end 49 | 50 | end 51 | -------------------------------------------------------------------------------- /PROJECT_2/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=mc01 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode -------------------------------------------------------------------------------- /PROJECT_2/backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | 4 | # MEmcache 5 | yum install epel-release -y 6 | yum install memcached -y 7 | systemctl start memcached 8 | systemctl enable memcached 9 | systemctl status memcached 10 | memcached -p 11211 -U 11111 -u memcached -d 11 | 12 | # Rabbit 13 | yum install socat -y 14 | yum install erlang -y 15 | yum install wget -y 16 | wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm 17 | rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 18 | yum update 19 | rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm 20 | systemctl start rabbitmq-server 21 | systemctl enable rabbitmq-server 22 | systemctl status rabbitmq-server 23 | echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config 24 | rabbitmqctl add_user rabbit bunny 25 | rabbitmqctl set_user_tags rabbit administrator 26 | systemctl restart rabbitmq-server 27 | 28 | # Mysql 29 | yum install mariadb-server -y 30 | 31 | #mysql_secure_installation 32 | sed -i 's/^127.0.0.1/0.0.0.0/' /etc/my.cnf 33 | 34 | # starting & enabling mariadb-server 35 | systemctl start mariadb 36 | systemctl enable mariadb 37 | 38 | #restore the dump file for the application 39 | mysqladmin -u root password "$DATABASE_PASS" 40 | mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 41 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 42 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 43 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 44 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 45 | mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 46 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 47 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'app01' identified by 'admin123'" 48 | mysql -u root -p"$DATABASE_PASS" accounts < /vagrant/vprofile-repo/src/main/resources/db_backup.sql 49 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 50 | 51 | # Restart mariadb-server 52 | systemctl restart mariadb -------------------------------------------------------------------------------- /PROJECT_2/images/cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/cache.png -------------------------------------------------------------------------------- /PROJECT_2/images/destro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/destro.png -------------------------------------------------------------------------------- /PROJECT_2/images/rabbitmq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/rabbitmq.png -------------------------------------------------------------------------------- /PROJECT_2/images/system-design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/system-design.png -------------------------------------------------------------------------------- /PROJECT_2/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/user.png -------------------------------------------------------------------------------- /PROJECT_2/images/vm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/vm.png -------------------------------------------------------------------------------- /PROJECT_2/images/welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_2/images/welcome.png -------------------------------------------------------------------------------- /PROJECT_2/memcache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum install memcached -y 4 | sudo systemctl start memcached 5 | sudo systemctl enable memcached 6 | sudo systemctl status memcached 7 | sudo memcached -p 11211 -U 11111 -u memcached -d -------------------------------------------------------------------------------- /PROJECT_2/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | sudo yum update -y 4 | sudo yum install epel-release -y 5 | sudo yum install git zip unzip -y 6 | sudo yum install mariadb-server -y 7 | 8 | 9 | # starting & enabling mariadb-server 10 | sudo systemctl start mariadb 11 | sudo systemctl enable mariadb 12 | cd /tmp/ 13 | git clone -b local-setup https://github.com/devopshydclub/vprofile-project.git 14 | #restore the dump file for the application 15 | sudo mysqladmin -u root password "$DATABASE_PASS" 16 | sudo mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 17 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 18 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 19 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 20 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 21 | sudo mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 22 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 23 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'%' identified by 'admin123'" 24 | sudo mysql -u root -p"$DATABASE_PASS" accounts < /tmp/vprofile-project/src/main/resources/db_backup.sql 25 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 26 | 27 | # Restart mariadb-server 28 | sudo systemctl restart mariadb 29 | 30 | 31 | #starting the firewall and allowing the mariadb to access from port no. 3306 32 | sudo systemctl start firewalld 33 | sudo systemctl enable firewalld 34 | sudo firewall-cmd --get-active-zones 35 | sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 36 | sudo firewall-cmd --reload 37 | sudo systemctl restart mariadb 38 | -------------------------------------------------------------------------------- /PROJECT_2/nginx.sh: -------------------------------------------------------------------------------- 1 | # adding repository and installing nginx 2 | apt update 3 | apt install nginx -y 4 | cat < vproapp 5 | upstream vproapp { 6 | 7 | server app01:8080; 8 | 9 | } 10 | 11 | server { 12 | 13 | listen 80; 14 | 15 | location / { 16 | 17 | proxy_pass http://vproapp; 18 | 19 | } 20 | 21 | } 22 | 23 | EOT 24 | 25 | mv vproapp /etc/nginx/sites-available/vproapp 26 | rm -rf /etc/nginx/sites-enabled/default 27 | ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp 28 | 29 | #starting nginx service and firewall 30 | systemctl start nginx 31 | systemctl enable nginx 32 | systemctl restart nginx 33 | -------------------------------------------------------------------------------- /PROJECT_2/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum update -y 4 | sudo yum install wget -y 5 | cd /tmp/ 6 | wget http://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm 7 | sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm 8 | sudo yum -y install erlang socat 9 | curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash 10 | sudo yum install rabbitmq-server -y 11 | sudo systemctl start rabbitmq-server 12 | sudo systemctl enable rabbitmq-server 13 | sudo systemctl status rabbitmq-server 14 | sudo sh -c 'echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config' 15 | sudo rabbitmqctl add_user test test 16 | sudo rabbitmqctl set_user_tags test administrator 17 | sudo systemctl restart rabbitmq-server 18 | -------------------------------------------------------------------------------- /PROJECT_2/tomcat.sh: -------------------------------------------------------------------------------- 1 | TOMURL="https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz" 2 | yum install java-1.8.0-openjdk -y 3 | yum install git maven wget -y 4 | cd /tmp/ 5 | wget $TOMURL -O tomcatbin.tar.gz 6 | EXTOUT=`tar xzvf tomcatbin.tar.gz` 7 | TOMDIR=`echo $EXTOUT | cut -d '/' -f1` 8 | useradd --shell /sbin/nologin tomcat 9 | rsync -avzh /tmp/$TOMDIR/ /usr/local/tomcat8/ 10 | chown -R tomcat.tomcat /usr/local/tomcat8 11 | 12 | rm -rf /etc/systemd/system/tomcat.service 13 | 14 | cat <> /etc/systemd/system/tomcat.service 15 | [Unit] 16 | Description=Tomcat 17 | After=network.target 18 | 19 | [Service] 20 | 21 | User=tomcat 22 | Group=tomcat 23 | 24 | WorkingDirectory=/usr/local/tomcat8 25 | 26 | #Environment=JRE_HOME=/usr/lib/jvm/jre 27 | Environment=JAVA_HOME=/usr/lib/jvm/jre 28 | 29 | Environment=CATALINA_PID=/var/tomcat/%i/run/tomcat.pid 30 | Environment=CATALINA_HOME=/usr/local/tomcat8 31 | Environment=CATALINE_BASE=/usr/local/tomcat8 32 | 33 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 34 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 35 | 36 | 37 | RestartSec=10 38 | Restart=always 39 | 40 | [Install] 41 | WantedBy=multi-user.target 42 | 43 | EOT 44 | 45 | systemctl daemon-reload 46 | systemctl start tomcat 47 | systemctl enable tomcat 48 | 49 | git clone -b local-setup https://github.com/devopshydclub/vprofile-project.git 50 | cd vprofile-project 51 | mvn install 52 | systemctl stop tomcat 53 | sleep 60 54 | rm -rf /usr/local/tomcat8/webapps/ROOT* 55 | cp target/vprofile-v2.war /usr/local/tomcat8/webapps/ROOT.war 56 | systemctl start tomcat 57 | sleep 120 58 | cp /vagrant/application.properties /usr/local/tomcat8/webapps/ROOT/WEB-INF/classes/application.properties 59 | systemctl restart tomcat 60 | -------------------------------------------------------------------------------- /PROJECT_2/tomcat_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt update 3 | sudo apt upgrade -y 4 | sudo apt install openjdk-8-jdk -y 5 | sudo apt install tomcat8 tomcat8-admin tomcat8-docs tomcat8-common git -y 6 | -------------------------------------------------------------------------------- /PROJECT_3/images/asg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/asg.png -------------------------------------------------------------------------------- /PROJECT_3/images/back_inst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/back_inst.png -------------------------------------------------------------------------------- /PROJECT_3/images/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/index.png -------------------------------------------------------------------------------- /PROJECT_3/images/instance_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/instance_final.png -------------------------------------------------------------------------------- /PROJECT_3/images/launch_conf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/launch_conf.png -------------------------------------------------------------------------------- /PROJECT_3/images/mem_valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/mem_valid.png -------------------------------------------------------------------------------- /PROJECT_3/images/mysql_valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/mysql_valid.png -------------------------------------------------------------------------------- /PROJECT_3/images/rabbitmq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/rabbitmq.png -------------------------------------------------------------------------------- /PROJECT_3/images/route53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/route53.png -------------------------------------------------------------------------------- /PROJECT_3/images/sys_adm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/sys_adm.png -------------------------------------------------------------------------------- /PROJECT_3/images/validate_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/images/validate_login.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Set; 5 | /**{@author waheedk} !*/ 6 | @Entity 7 | @Table(name = "role") 8 | public class Role { 9 | /** the id field !*/ 10 | private Long id; 11 | /** the name field !*/ 12 | private String name; 13 | /** the user field !*/ 14 | private Set users; 15 | /** {@inheritDoc}} !*/ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | /** 19 | * {@link Role#id} 20 | !*/ 21 | public Long getId() { 22 | return id; 23 | } 24 | /** {@inheritDoc}} !*/ 25 | public void setId(final Long id) { 26 | this.id = id; 27 | } 28 | /** 29 | * {@link Role#name} 30 | !*/ 31 | public String getName() { 32 | return name; 33 | } 34 | /** {@inheritDoc}} !*/ 35 | public void setName(final String name) { 36 | this.name = name; 37 | } 38 | /** 39 | * {@inheritDoc}} 40 | !*/ 41 | @ManyToMany(fetch = FetchType.EAGER, mappedBy = "roles",cascade = CascadeType.ALL) 42 | /** 43 | * {@link Role#id} 44 | !*/ 45 | public Set getUsers() { 46 | return users; 47 | } 48 | /** 49 | * {@inheritDoc}} 50 | !*/ 51 | public final void setUsers(Set users) { 52 | this.users = users; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.visualpathit.account.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.visualpathit.account.model.User; 8 | 9 | public interface UserRepository extends JpaRepository { 10 | User findByUsername(String username); 11 | User findById(long id); 12 | /*public void updateUser(User user)*/; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ConsumerService { 4 | 5 | void consumerMessage(byte[] data); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/ConsumerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.springframework.amqp.core.ExchangeTypes; 4 | import org.springframework.amqp.rabbit.annotation.Exchange; 5 | import org.springframework.amqp.rabbit.annotation.Queue; 6 | import org.springframework.amqp.rabbit.annotation.QueueBinding; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ConsumerServiceImpl implements ConsumerService { 12 | 13 | /** 14 | The name of the exchange. 15 | */ 16 | private static final String EXCHANGE_NAME = "messages"; 17 | 18 | /** 19 | * The function that consumes messages from the broker(RabbitMQ) 20 | * @param data 21 | */ 22 | @Override 23 | @RabbitListener(bindings = @QueueBinding( value = @Queue(), 24 | exchange = @Exchange(value = EXCHANGE_NAME, type = ExchangeTypes.FANOUT))) 25 | public void consumerMessage(byte[] data) { 26 | String consumedMessage = new String(data); 27 | System.out.println(" [x] Consumed '" + consumedMessage + "'"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/ProducerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ProducerService { 4 | 5 | public String produceMessage(String message); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/SecurityService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | /** method for finding already added user !*/ 4 | public interface SecurityService { 5 | /** {@inheritDoc}} !*/ 6 | String findLoggedInUsername(); 7 | 8 | void autologin(String username, String password); 9 | } 10 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.authentication.AuthenticationManager; 7 | import org.springframework.security.authentication 8 | .UsernamePasswordAuthenticationToken; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.stereotype.Service; 13 | /** {@author waheedk} !*/ 14 | @Service 15 | public class SecurityServiceImpl implements SecurityService { 16 | /** authenticationManager !*/ 17 | @Autowired 18 | private AuthenticationManager authenticationManager; 19 | /** userDetailsService !*/ 20 | @Autowired 21 | private UserDetailsService userDetailsService; 22 | 23 | /** Logger creation !*/ 24 | private static final Logger logger = LoggerFactory 25 | .getLogger(SecurityServiceImpl.class); 26 | 27 | @Override 28 | public String findLoggedInUsername() { 29 | Object userDetails = SecurityContextHolder.getContext() 30 | .getAuthentication().getDetails(); 31 | if (userDetails instanceof UserDetails) { 32 | return ((UserDetails) userDetails).getUsername(); 33 | } 34 | 35 | return null; 36 | } 37 | 38 | @Override 39 | public void autologin(final String username, final String password) { 40 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 41 | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = 42 | new UsernamePasswordAuthenticationToken(userDetails, password, userDetails.getAuthorities()); 43 | 44 | authenticationManager.authenticate(usernamePasswordAuthenticationToken); 45 | 46 | if (usernamePasswordAuthenticationToken.isAuthenticated()) { 47 | SecurityContextHolder.getContext() 48 | .setAuthentication(usernamePasswordAuthenticationToken); 49 | logger.debug(String.format("Auto login %s successfully!", username)); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.Role; 4 | import com.visualpathit.account.model.User; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.GrantedAuthority; 9 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | /** {@author waheedk} !*/ 18 | public class UserDetailsServiceImpl implements UserDetailsService { 19 | @Autowired 20 | /** userRepository !*/ 21 | private UserRepository userRepository; 22 | 23 | @Override 24 | @Transactional(readOnly = true) 25 | public UserDetails loadUserByUsername(final String username) 26 | throws UsernameNotFoundException { 27 | User user = userRepository.findByUsername(username); 28 | 29 | Set grantedAuthorities = new HashSet<>(); 30 | for (Role role : user.getRoles()) { 31 | grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); 32 | } 33 | 34 | return new org.springframework.security.core 35 | .userdetails.User(user.getUsername(), user.getPassword(), grantedAuthorities); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import java.util.List; 4 | 5 | import com.visualpathit.account.model.User; 6 | 7 | /** {@author waheedk}!*/ 8 | public interface UserService { 9 | /** {@inheritDoc}} !*/ 10 | void save(User user); 11 | /** {@inheritDoc}} !*/ 12 | User findByUsername(String username); 13 | User findById(long id); 14 | /*public void updateUser(User user);*/ 15 | public List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.repository.RoleRepository; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.HashSet; 12 | import java.util.List; 13 | 14 | /** {@author waheedk}!*/ 15 | @Service 16 | public class UserServiceImpl implements UserService { 17 | @Autowired 18 | /** userRepository !*/ 19 | private UserRepository userRepository; 20 | @Autowired 21 | /** roleRepository !*/ 22 | private RoleRepository roleRepository; 23 | @Autowired 24 | /** bCryptPasswordEncoder !*/ 25 | private BCryptPasswordEncoder bCryptPasswordEncoder; 26 | 27 | @Override 28 | public void save(final User user) { 29 | user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); 30 | user.setRoles(new HashSet<>(roleRepository.findAll())); 31 | userRepository.save(user); 32 | } 33 | 34 | @Override 35 | public User findByUsername(final String username) { 36 | return userRepository.findByUsername(username); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return userRepository.findAll(); 42 | } 43 | @Override 44 | public User findById(long id){ 45 | return userRepository.findOne(id); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/utils/ElasticsearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | 5 | import org.elasticsearch.client.transport.TransportClient; 6 | import org.elasticsearch.common.settings.Settings; 7 | import org.elasticsearch.common.transport.InetSocketTransportAddress; 8 | import org.elasticsearch.transport.client.PreBuiltTransportClient; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.visualpathit.account.beans.Components; 13 | @Service 14 | public class ElasticsearchUtil { 15 | 16 | private static Components object; 17 | @Autowired 18 | public void setComponents(Components object){ 19 | ElasticsearchUtil.object = object; 20 | 21 | } 22 | public static TransportClient trannsportClient() { 23 | System.out.println(" elasticsearch client"); 24 | String elasticsearchHost =object.getElasticsearchHost(); 25 | String elasticsearchPort =object.getElasticsearchPort(); 26 | String elasticsearchCluster =object.getElasticsearchCluster(); 27 | String elasticsearchNode =object.getElasticsearchNode(); 28 | System.out.println(" elasticsearchHost ........"+ elasticsearchHost); 29 | System.out.println(" elasticsearchHost ........"+ elasticsearchPort); 30 | TransportClient client = null; 31 | try { 32 | Settings settings = Settings.builder() 33 | .put("cluster.name",elasticsearchCluster) 34 | .put("node.name",elasticsearchNode) 35 | .build(); 36 | client = new PreBuiltTransportClient(settings) 37 | .addTransportAddress( 38 | new InetSocketTransportAddress( 39 | new InetSocketAddress(elasticsearchHost, Integer.parseInt(elasticsearchPort)))); 40 | 41 | 42 | } 43 | catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | return client; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/utils/RabbitMqUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.visualpathit.account.beans.Components; 7 | 8 | @Service 9 | public class RabbitMqUtil { 10 | private static Components object; 11 | 12 | public RabbitMqUtil() {} 13 | 14 | @Autowired 15 | public void setComponents(Components object) { 16 | RabbitMqUtil.object = object; 17 | } 18 | 19 | public static String getRabbitMqHost() { return object.getRabbitMqHost(); } 20 | 21 | public static String getRabbitMqPort() { 22 | return object.getRabbitMqPort(); 23 | } 24 | 25 | public static String getRabbitMqUser() { return object.getRabbitMqUser(); } 26 | 27 | public static String getRabbitMqPassword() { 28 | return object.getRabbitMqPassword(); 29 | } 30 | } -------------------------------------------------------------------------------- /PROJECT_3/src/main/java/com/visualpathit/account/validator/UserValidator.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.validator; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.UserService; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.validation.Errors; 9 | import org.springframework.validation.ValidationUtils; 10 | import org.springframework.validation.Validator; 11 | 12 | @Component 13 | public class UserValidator implements Validator { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @Override 18 | public boolean supports(Class aClass) { 19 | return User.class.equals(aClass); 20 | } 21 | 22 | @Override 23 | public void validate(Object o, Errors errors) { 24 | User user = (User) o; 25 | 26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty"); 27 | if (user.getUsername().length() < 6 || user.getUsername().length() > 32) { 28 | errors.rejectValue("username", "Size.userForm.username"); 29 | } 30 | if (userService.findByUsername(user.getUsername()) != null) { 31 | errors.rejectValue("username", "Duplicate.userForm.username"); 32 | } 33 | 34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty"); 35 | if (user.getPassword().length() < 8 || user.getPassword().length() > 32) { 36 | errors.rejectValue("password", "Size.userForm.password"); 37 | } 38 | 39 | if (!user.getPasswordConfirm().equals(user.getPassword())) { 40 | errors.rejectValue("passwordConfirm", "Diff.userForm.passwordConfirm"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01.vprofile.in:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=mc01.vprofile.in 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01.vprofile.in 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg\n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username= User has already taken this Username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/appconfig-mvc.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | classpath:validation 15 | 16 | 17 | 18 | 19 | 20 | /WEB-INF/views/ 21 | 22 | 23 | .jsp 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/appconfig-rabbitmq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/appconfig-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/appconfig-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/views/elasticeSearchRes.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | 8 | 9 | 10 | 11 | 12 | vp-elasticsearch 13 | 14 | 15 |

Data is ${result} into Elasticsearch

16 |

Please go to elastic search dash board and verify link ip:9200/users/user/id

17 | 18 | 19 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/views/rabbitmq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Rabbitmq 8 | 9 | 10 |

Rabbitmq initiated

11 |

Generated 2 Connections

12 |

6 Chanels 1 Exchage and 2 Que

13 | 14 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account Registration Web Application 4 | 5 | contextConfigLocation 6 | /WEB-INF/appconfig-root.xml 7 | 8 | 9 | springSecurityFilterChain 10 | org.springframework.web.filter.DelegatingFilterProxy 11 | 12 | 13 | springSecurityFilterChain 14 | /* 15 | 16 | 17 | dispatcher 18 | org.springframework.web.servlet.DispatcherServlet 19 | 20 | contextConfigLocation 21 | 22 | 23 | 1 24 | 25 | 26 | dispatcher 27 | / 28 | 29 | 30 | org.springframework.web.context.ContextLoaderListener 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/background.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/header.jpg -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/Ansible_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/Ansible_logo.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/Vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/Vagrant.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/aws.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/docker.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/git.jpg -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/jenkins.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/puppet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/puppet.jpg -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/technologies/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/technologies/python-logo.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/user/giphy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/user/giphy.gif -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/user/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/user/logo.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/user/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/user/user.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/user/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/user/user2.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/user/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/user/user3.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/visualpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/visualpath.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/visualpathlogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/visualpathlogo2.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/Images/visualpathlogo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_3/src/main/webapp/resources/Images/visualpathlogo3.png -------------------------------------------------------------------------------- /PROJECT_3/src/main/webapp/resources/css/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 100px; 3 | padding-bottom: 50px; 4 | background-color: #ffffff; 5 | 6 | } 7 | form { 8 | border: 3px solid #204a87; 9 | } 10 | 11 | img.logo { 12 | display: block; 13 | margin-left: auto; 14 | margin-right: auto; 15 | width: 300px; 16 | height: 70px; 17 | 18 | } 19 | .form-signin { 20 | max-width: 330px; 21 | padding: 15px; 22 | margin: 0 auto; 23 | } 24 | .btn-custom,.btn-custom:hover, .btn-custom:focus, .btn-custom:active { 25 | border-radius: 0; 26 | color: #ffffff; 27 | background-color: #ef2929; 28 | border-color: #ef2929; 29 | 30 | } 31 | .btn-custom-LOGIN { 32 | border-radius: 0; 33 | color: #ffffff; 34 | height:3em; 35 | background-color: #26C6DA; 36 | border-color: #ef2929; 37 | 38 | } 39 | 40 | .form-signin .form-signin-heading, 41 | .form-signin .checkbox { 42 | margin-bottom: 10px; 43 | } 44 | 45 | .form-signin .checkbox { 46 | font-weight: normal; 47 | } 48 | 49 | .form-signin .form-control { 50 | position: relative; 51 | height: auto; 52 | -webkit-box-sizing: border-box; 53 | -moz-box-sizing: border-box; 54 | box-sizing: border-box; 55 | padding: 10px; 56 | font-size: 16px; 57 | } 58 | 59 | .form-signin .form-control:focus { 60 | z-index: 2; 61 | } 62 | 63 | .form-signin input { 64 | margin-top: 10px; 65 | border-bottom-right-radius: 0; 66 | border-bottom-left-radius: 0; 67 | } 68 | 69 | .form-signin button { 70 | margin-top: 10px; 71 | } 72 | 73 | .has-error { 74 | color: red 75 | } -------------------------------------------------------------------------------- /PROJECT_3/src/test/java/com/visualpathit/account/controllerTest/SampleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class SampleTest { 8 | @Test 9 | public void SampleTestHappyFlow(){ 10 | assertEquals("Hello".length(), 5); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /PROJECT_3/src/test/java/com/visualpathit/account/modelTest/RoleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class RoleTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final String EXPECTED_ROLENAME = "Admin"; 20 | public static final int EXPECTED_SIZE = 1; 21 | private Role role; 22 | @Before 23 | public void setUp() throws Exception { 24 | User user = new User(); 25 | user.setId(1L); 26 | user.setUsername("Wahidkhan74"); 27 | user.setPassword("Wahidkhan74"); 28 | user.setUserEmail("XXXXX@gmail.com"); 29 | 30 | Set users = new HashSet(); 31 | users.add(user); 32 | role = new Role(); 33 | role.setId(1L); 34 | role.setName("Admin"); 35 | role.setUsers(users); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | System.out.println("Test Completed"); 41 | 42 | } 43 | 44 | @Test 45 | public void testUserDetailsHappyFlow() throws Exception { 46 | Assert.assertEquals(EXPECTED_ID, role.getId()); 47 | Assert.assertEquals(EXPECTED_ROLENAME, role.getName()); 48 | Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size()); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /PROJECT_3/src/test/java/com/visualpathit/account/modelTest/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class UserTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final int EXPECTED_SIZE = 1; 20 | public static final String EXPECTED_USERNAME = "Wahidkhan74"; 21 | public static final String EXPECTED_PASSWD = "Wahidkhan74"; 22 | public static final String EXPECTED_USEREMAIL = "XXXXX@gmail.com"; 23 | private User user; 24 | @Before 25 | public void setUp() throws Exception { 26 | 27 | Role role = new Role(); 28 | role.setId(1L); 29 | role.setName("Admin"); 30 | Set roles = new HashSet(); 31 | roles.add(role); 32 | 33 | user = new User(); 34 | user.setId(1L); 35 | user.setUsername("Wahidkhan74"); 36 | user.setPassword("Wahidkhan74"); 37 | user.setUserEmail("XXXXX@gmail.com"); 38 | user.setRoles(roles); 39 | } 40 | 41 | @After 42 | public void tearDown() throws Exception { 43 | System.out.println("Test Completed"); 44 | 45 | } 46 | 47 | @Test 48 | public void testUserDetailsHappyFlow() throws Exception { 49 | Assert.assertEquals(EXPECTED_ID, user.getId()); 50 | Assert.assertEquals(EXPECTED_USERNAME, user.getUsername()); 51 | Assert.assertEquals(EXPECTED_PASSWD, user.getPassword()); 52 | Assert.assertEquals(EXPECTED_USEREMAIL, user.getUserEmail()); 53 | Assert.assertEquals(EXPECTED_SIZE,user.getRoles().size()); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /PROJECT_3/src/test/java/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.setup; 2 | 3 | import org.springframework.web.servlet.view.AbstractUrlBasedView; 4 | import org.springframework.web.servlet.view.InternalResourceView; 5 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 6 | 7 | public class StandaloneMvcTestViewResolver extends InternalResourceViewResolver { 8 | 9 | public StandaloneMvcTestViewResolver() { 10 | super(); 11 | } 12 | 13 | @Override 14 | protected AbstractUrlBasedView buildView(final String viewName) throws Exception { 15 | final InternalResourceView view = (InternalResourceView) super.buildView(viewName); 16 | // prevent checking for circular view paths 17 | view.setPreventDispatchLoop(false); 18 | return view; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PROJECT_3/userdata/backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | 4 | # MEmcache 5 | yum install epel-release -y 6 | yum install memcached -y 7 | systemctl start memcached 8 | systemctl enable memcached 9 | systemctl status memcached 10 | memcached -p 11211 -U 11111 -u memcached -d 11 | 12 | # Rabbit 13 | yum install socat -y 14 | yum install erlang -y 15 | yum install wget -y 16 | wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm 17 | rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 18 | yum update 19 | rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm 20 | systemctl start rabbitmq-server 21 | systemctl enable rabbitmq-server 22 | systemctl status rabbitmq-server 23 | echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config 24 | rabbitmqctl add_user rabbit bunny 25 | rabbitmqctl set_user_tags rabbit administrator 26 | systemctl restart rabbitmq-server 27 | 28 | # Mysql 29 | yum install mariadb-server -y 30 | 31 | #mysql_secure_installation 32 | sed -i 's/^127.0.0.1/0.0.0.0/' /etc/my.cnf 33 | 34 | # starting & enabling mariadb-server 35 | systemctl start mariadb 36 | systemctl enable mariadb 37 | 38 | #restore the dump file for the application 39 | mysqladmin -u root password "$DATABASE_PASS" 40 | mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 41 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 42 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 43 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 44 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 45 | mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 46 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 47 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'app01' identified by 'admin123'" 48 | mysql -u root -p"$DATABASE_PASS" accounts < /vagrant/vprofile-repo/src/main/resources/db_backup.sql 49 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 50 | 51 | # Restart mariadb-server 52 | systemctl restart mariadb -------------------------------------------------------------------------------- /PROJECT_3/userdata/memcache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum install memcached -y 4 | sudo systemctl start memcached 5 | sudo systemctl enable memcached 6 | sudo systemctl status memcached 7 | sudo memcached -p 11211 -U 11111 -u memcached -d -------------------------------------------------------------------------------- /PROJECT_3/userdata/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | sudo yum update -y 4 | sudo yum install epel-release -y 5 | sudo yum install git zip unzip -y 6 | sudo yum install mariadb-server -y 7 | 8 | 9 | # starting & enabling mariadb-server 10 | sudo systemctl start mariadb 11 | sudo systemctl enable mariadb 12 | cd /tmp/ 13 | git clone -b vp-rem https://github.com/devopshydclub/vprofile-repo.git 14 | #restore the dump file for the application 15 | sudo mysqladmin -u root password "$DATABASE_PASS" 16 | sudo mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 17 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 18 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 19 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 20 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 21 | sudo mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 22 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 23 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'%' identified by 'admin123'" 24 | sudo mysql -u root -p"$DATABASE_PASS" accounts < /tmp/vprofile-repo/src/main/resources/db_backup.sql 25 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 26 | 27 | # Restart mariadb-server 28 | sudo systemctl restart mariadb 29 | 30 | 31 | #starting the firewall and allowing the mariadb to access from port no. 3306 32 | sudo systemctl start firewalld 33 | sudo systemctl enable firewalld 34 | sudo firewall-cmd --get-active-zones 35 | sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 36 | sudo firewall-cmd --reload 37 | sudo systemctl restart mariadb 38 | -------------------------------------------------------------------------------- /PROJECT_3/userdata/nginx.sh: -------------------------------------------------------------------------------- 1 | # adding repository and installing nginx 2 | apt update 3 | apt install nginx -y 4 | cat < vproapp 5 | upstream vproapp { 6 | 7 | server appserver.com:8080; 8 | 9 | } 10 | 11 | server { 12 | 13 | listen 80; 14 | 15 | location / { 16 | 17 | proxy_pass http://vproapp; 18 | 19 | } 20 | 21 | } 22 | 23 | EOT 24 | 25 | mv vproapp /etc/nginx/sites-available/vproapp 26 | rm -rf /etc/nginx/sites-enabled/default 27 | ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp 28 | 29 | #starting nginx service and firewall 30 | systemctl start nginx 31 | systemctl enable nginx 32 | systemctl restart nginx 33 | -------------------------------------------------------------------------------- /PROJECT_3/userdata/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum update -y 4 | sudo yum install wget -y 5 | cd /tmp/ 6 | wget http://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm 7 | sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm 8 | sudo yum -y install erlang socat 9 | curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash 10 | sudo yum install rabbitmq-server -y 11 | sudo systemctl start rabbitmq-server 12 | sudo systemctl enable rabbitmq-server 13 | sudo systemctl status rabbitmq-server 14 | sudo sh -c 'echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config' 15 | sudo rabbitmqctl add_user test test 16 | sudo rabbitmqctl set_user_tags test administrator 17 | sudo systemctl restart rabbitmq-server 18 | -------------------------------------------------------------------------------- /PROJECT_3/userdata/tomcat.sh: -------------------------------------------------------------------------------- 1 | TOMURL="https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz" 2 | yum install java-1.8.0-openjdk -y 3 | yum install git maven wget -y 4 | cd /tmp/ 5 | wget $TOMURL -O tomcatbin.tar.gz 6 | EXTOUT=`tar xzvf tomcatbin.tar.gz` 7 | TOMDIR=`echo $EXTOUT | cut -d '/' -f1` 8 | useradd --shell /sbin/nologin tomcat 9 | rsync -avzh /tmp/$TOMDIR/ /usr/local/tomcat8/ 10 | chown -R tomcat.tomcat /usr/local/tomcat8 11 | 12 | rm -rf /etc/systemd/system/tomcat.service 13 | 14 | cat <> /etc/systemd/system/tomcat.service 15 | [Unit] 16 | Description=Tomcat 17 | After=network.target 18 | 19 | [Service] 20 | User=tomcat 21 | WorkingDirectory=/usr/local/tomcat8 22 | Environment=JRE_HOME=/usr/lib/jvm/jre 23 | Environment=JAVA_HOME=/usr/lib/jvm/jre 24 | Environment=CATALINA_HOME=/usr/local/tomcat8 25 | Environment=CATALINE_BASE=/usr/local/tomcat8 26 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 27 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 28 | SyslogIdentifier=tomcat-%i 29 | 30 | [Install] 31 | WantedBy=multi-user.target 32 | EOT 33 | 34 | systemctl daemon-reload 35 | systemctl start tomcat 36 | systemctl enable tomcat 37 | 38 | git clone -b vp-rem https://github.com/devopshydclub/vprofile-repo.git 39 | cd vprofile-repo 40 | mvn install 41 | systemctl stop tomcat 42 | sleep 120 43 | rm -rf /usr/local/tomcat8/webapps/ROOT* 44 | cp target/vprofile-v2.war /usr/local/tomcat8/webapps/ROOT.war 45 | systemctl start tomcat 46 | sleep 300 47 | cp /vprofile-vm-data/application.properties /usr/local/tomcat8/webapps/ROOT/WEB-INF/classes/application.properties 48 | systemctl restart tomcat8 49 | -------------------------------------------------------------------------------- /PROJECT_3/userdata/tomcat_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt update 3 | sudo apt upgrade -y 4 | sudo apt install openjdk-8-jdk -y 5 | sudo apt install tomcat8 tomcat8-admin tomcat8-docs tomcat8-common git -y 6 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | timeout = 30 4 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - import_playbook: tomcat_setup.yml 3 | - import_playbook: vpro-app-setup.yml 4 | 5 | #### 6 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/templates/application.j2: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://dbhost:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=db_user 5 | jdbc.password=db_password 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=127.0.0.1 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=18.220.62.126 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/templates/epel6-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/templates/epel7-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/templates/ubuntu14_15-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /PROJECT_4/ansible/templates/ubuntu16-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /PROJECT_4/images/Screenshot 2023-01-18 at 09.25.35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/Screenshot 2023-01-18 at 09.25.35.png -------------------------------------------------------------------------------- /PROJECT_4/images/bean-ver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/bean-ver.png -------------------------------------------------------------------------------- /PROJECT_4/images/beanstalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/beanstalk.png -------------------------------------------------------------------------------- /PROJECT_4/images/cloudfront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/cloudfront.png -------------------------------------------------------------------------------- /PROJECT_4/images/elastic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/elastic.png -------------------------------------------------------------------------------- /PROJECT_4/images/elasticache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/elasticache.png -------------------------------------------------------------------------------- /PROJECT_4/images/fromcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/fromcache.png -------------------------------------------------------------------------------- /PROJECT_4/images/https.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/https.png -------------------------------------------------------------------------------- /PROJECT_4/images/insertcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/insertcache.png -------------------------------------------------------------------------------- /PROJECT_4/images/rabbitmq-val.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/rabbitmq-val.png -------------------------------------------------------------------------------- /PROJECT_4/images/rds-val.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/rds-val.png -------------------------------------------------------------------------------- /PROJECT_4/images/rds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/rds.png -------------------------------------------------------------------------------- /PROJECT_4/images/sys-des.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/images/sys-des.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Set; 5 | /**{@author waheedk} !*/ 6 | @Entity 7 | @Table(name = "role") 8 | public class Role { 9 | /** the id field !*/ 10 | private Long id; 11 | /** the name field !*/ 12 | private String name; 13 | /** the user field !*/ 14 | private Set users; 15 | /** {@inheritDoc}} !*/ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | /** 19 | * {@link Role#id} 20 | !*/ 21 | public Long getId() { 22 | return id; 23 | } 24 | /** {@inheritDoc}} !*/ 25 | public void setId(final Long id) { 26 | this.id = id; 27 | } 28 | /** 29 | * {@link Role#name} 30 | !*/ 31 | public String getName() { 32 | return name; 33 | } 34 | /** {@inheritDoc}} !*/ 35 | public void setName(final String name) { 36 | this.name = name; 37 | } 38 | /** 39 | * {@inheritDoc}} 40 | !*/ 41 | @ManyToMany(fetch = FetchType.EAGER, mappedBy = "roles",cascade = CascadeType.ALL) 42 | /** 43 | * {@link Role#id} 44 | !*/ 45 | public Set getUsers() { 46 | return users; 47 | } 48 | /** 49 | * {@inheritDoc}} 50 | !*/ 51 | public final void setUsers(Set users) { 52 | this.users = users; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.visualpathit.account.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.visualpathit.account.model.User; 8 | 9 | public interface UserRepository extends JpaRepository { 10 | User findByUsername(String username); 11 | User findById(long id); 12 | /*public void updateUser(User user)*/; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ConsumerService { 4 | 5 | void consumerMessage(byte[] data); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/ConsumerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.springframework.amqp.core.ExchangeTypes; 4 | import org.springframework.amqp.rabbit.annotation.Exchange; 5 | import org.springframework.amqp.rabbit.annotation.Queue; 6 | import org.springframework.amqp.rabbit.annotation.QueueBinding; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ConsumerServiceImpl implements ConsumerService { 12 | 13 | /** 14 | The name of the exchange. 15 | */ 16 | private static final String EXCHANGE_NAME = "messages"; 17 | 18 | /** 19 | * The function that consumes messages from the broker(RabbitMQ) 20 | * @param data 21 | */ 22 | @Override 23 | @RabbitListener(bindings = @QueueBinding( value = @Queue(), 24 | exchange = @Exchange(value = EXCHANGE_NAME, type = ExchangeTypes.FANOUT))) 25 | public void consumerMessage(byte[] data) { 26 | String consumedMessage = new String(data); 27 | System.out.println(" [x] Consumed '" + consumedMessage + "'"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/ProducerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ProducerService { 4 | 5 | public String produceMessage(String message); 6 | } 7 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/SecurityService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | /** method for finding already added user !*/ 4 | public interface SecurityService { 5 | /** {@inheritDoc}} !*/ 6 | String findLoggedInUsername(); 7 | 8 | void autologin(String username, String password); 9 | } 10 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.authentication.AuthenticationManager; 7 | import org.springframework.security.authentication 8 | .UsernamePasswordAuthenticationToken; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.stereotype.Service; 13 | /** {@author waheedk} !*/ 14 | @Service 15 | public class SecurityServiceImpl implements SecurityService { 16 | /** authenticationManager !*/ 17 | @Autowired 18 | private AuthenticationManager authenticationManager; 19 | /** userDetailsService !*/ 20 | @Autowired 21 | private UserDetailsService userDetailsService; 22 | 23 | /** Logger creation !*/ 24 | private static final Logger logger = LoggerFactory 25 | .getLogger(SecurityServiceImpl.class); 26 | 27 | @Override 28 | public String findLoggedInUsername() { 29 | Object userDetails = SecurityContextHolder.getContext() 30 | .getAuthentication().getDetails(); 31 | if (userDetails instanceof UserDetails) { 32 | return ((UserDetails) userDetails).getUsername(); 33 | } 34 | 35 | return null; 36 | } 37 | 38 | @Override 39 | public void autologin(final String username, final String password) { 40 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 41 | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = 42 | new UsernamePasswordAuthenticationToken(userDetails, password, userDetails.getAuthorities()); 43 | 44 | authenticationManager.authenticate(usernamePasswordAuthenticationToken); 45 | 46 | if (usernamePasswordAuthenticationToken.isAuthenticated()) { 47 | SecurityContextHolder.getContext() 48 | .setAuthentication(usernamePasswordAuthenticationToken); 49 | logger.debug(String.format("Auto login %s successfully!", username)); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.Role; 4 | import com.visualpathit.account.model.User; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.GrantedAuthority; 9 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | /** {@author waheedk} !*/ 18 | public class UserDetailsServiceImpl implements UserDetailsService { 19 | @Autowired 20 | /** userRepository !*/ 21 | private UserRepository userRepository; 22 | 23 | @Override 24 | @Transactional(readOnly = true) 25 | public UserDetails loadUserByUsername(final String username) 26 | throws UsernameNotFoundException { 27 | User user = userRepository.findByUsername(username); 28 | 29 | Set grantedAuthorities = new HashSet<>(); 30 | for (Role role : user.getRoles()) { 31 | grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); 32 | } 33 | 34 | return new org.springframework.security.core 35 | .userdetails.User(user.getUsername(), user.getPassword(), grantedAuthorities); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import java.util.List; 4 | 5 | import com.visualpathit.account.model.User; 6 | 7 | /** {@author waheedk}!*/ 8 | public interface UserService { 9 | /** {@inheritDoc}} !*/ 10 | void save(User user); 11 | /** {@inheritDoc}} !*/ 12 | User findByUsername(String username); 13 | User findById(long id); 14 | /*public void updateUser(User user);*/ 15 | public List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.repository.RoleRepository; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.HashSet; 12 | import java.util.List; 13 | 14 | /** {@author waheedk}!*/ 15 | @Service 16 | public class UserServiceImpl implements UserService { 17 | @Autowired 18 | /** userRepository !*/ 19 | private UserRepository userRepository; 20 | @Autowired 21 | /** roleRepository !*/ 22 | private RoleRepository roleRepository; 23 | @Autowired 24 | /** bCryptPasswordEncoder !*/ 25 | private BCryptPasswordEncoder bCryptPasswordEncoder; 26 | 27 | @Override 28 | public void save(final User user) { 29 | user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); 30 | user.setRoles(new HashSet<>(roleRepository.findAll())); 31 | userRepository.save(user); 32 | } 33 | 34 | @Override 35 | public User findByUsername(final String username) { 36 | return userRepository.findByUsername(username); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return userRepository.findAll(); 42 | } 43 | @Override 44 | public User findById(long id){ 45 | return userRepository.findOne(id); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/utils/ElasticsearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | 5 | import org.elasticsearch.client.transport.TransportClient; 6 | import org.elasticsearch.common.settings.Settings; 7 | import org.elasticsearch.common.transport.InetSocketTransportAddress; 8 | import org.elasticsearch.transport.client.PreBuiltTransportClient; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.visualpathit.account.beans.Components; 13 | @Service 14 | public class ElasticsearchUtil { 15 | 16 | private static Components object; 17 | @Autowired 18 | public void setComponents(Components object){ 19 | ElasticsearchUtil.object = object; 20 | 21 | } 22 | public static TransportClient trannsportClient() { 23 | System.out.println(" elasticsearch client"); 24 | String elasticsearchHost =object.getElasticsearchHost(); 25 | String elasticsearchPort =object.getElasticsearchPort(); 26 | String elasticsearchCluster =object.getElasticsearchCluster(); 27 | String elasticsearchNode =object.getElasticsearchNode(); 28 | System.out.println(" elasticsearchHost ........"+ elasticsearchHost); 29 | System.out.println(" elasticsearchHost ........"+ elasticsearchPort); 30 | TransportClient client = null; 31 | try { 32 | Settings settings = Settings.builder() 33 | .put("cluster.name",elasticsearchCluster) 34 | .put("node.name",elasticsearchNode) 35 | .build(); 36 | client = new PreBuiltTransportClient(settings) 37 | .addTransportAddress( 38 | new InetSocketTransportAddress( 39 | new InetSocketAddress(elasticsearchHost, Integer.parseInt(elasticsearchPort)))); 40 | 41 | 42 | } 43 | catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | return client; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/utils/RabbitMqUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.visualpathit.account.beans.Components; 7 | 8 | @Service 9 | public class RabbitMqUtil { 10 | private static Components object; 11 | 12 | public RabbitMqUtil() {} 13 | 14 | @Autowired 15 | public void setComponents(Components object) { 16 | RabbitMqUtil.object = object; 17 | } 18 | 19 | public static String getRabbitMqHost() { return object.getRabbitMqHost(); } 20 | 21 | public static String getRabbitMqPort() { 22 | return object.getRabbitMqPort(); 23 | } 24 | 25 | public static String getRabbitMqUser() { return object.getRabbitMqUser(); } 26 | 27 | public static String getRabbitMqPassword() { 28 | return object.getRabbitMqPassword(); 29 | } 30 | } -------------------------------------------------------------------------------- /PROJECT_4/src/main/java/com/visualpathit/account/validator/UserValidator.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.validator; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.UserService; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.validation.Errors; 9 | import org.springframework.validation.ValidationUtils; 10 | import org.springframework.validation.Validator; 11 | 12 | @Component 13 | public class UserValidator implements Validator { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @Override 18 | public boolean supports(Class aClass) { 19 | return User.class.equals(aClass); 20 | } 21 | 22 | @Override 23 | public void validate(Object o, Errors errors) { 24 | User user = (User) o; 25 | 26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty"); 27 | if (user.getUsername().length() < 6 || user.getUsername().length() > 32) { 28 | errors.rejectValue("username", "Size.userForm.username"); 29 | } 30 | if (userService.findByUsername(user.getUsername()) != null) { 31 | errors.rejectValue("username", "Duplicate.userForm.username"); 32 | } 33 | 34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty"); 35 | if (user.getPassword().length() < 8 || user.getPassword().length() > 32) { 36 | errors.rejectValue("password", "Size.userForm.password"); 37 | } 38 | 39 | if (!user.getPasswordConfirm().equals(user.getPassword())) { 40 | errors.rejectValue("passwordConfirm", "Diff.userForm.passwordConfirm"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://vprofile-rds-mysql.cluster-cgewbecqwona.us-east-1.rds.amazonaws.com:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=UCVzS4PUetBfFBkMNmEt 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=vprofile-elastic-cache-svc.vzk3ho.cfg.use1.cache.amazonaws.com 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=amqps://b-bd4983f1-d475-4754-bf31-6a9a312f3b6d.mq.us-east-1.amazonaws.com 17 | rabbitmq.port=5671 18 | rabbitmq.username=rabbit 19 | rabbitmq.password=hardeybarey12 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg\n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username= User has already taken this Username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/appconfig-mvc.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | classpath:validation 15 | 16 | 17 | 18 | 19 | 20 | /WEB-INF/views/ 21 | 22 | 23 | .jsp 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/appconfig-rabbitmq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/appconfig-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/appconfig-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/views/elasticeSearchRes.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | 8 | 9 | 10 | 11 | 12 | vp-elasticsearch 13 | 14 | 15 |

Data is ${result} into Elasticsearch

16 |

Please go to elastic search dash board and verify link ip:9200/users/user/id

17 | 18 | 19 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/views/rabbitmq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Rabbitmq 8 | 9 | 10 |

Rabbitmq initiated

11 |

Generated 2 Connections

12 |

6 Chanels 1 Exchage and 2 Que

13 | 14 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account Registration Web Application 4 | 5 | contextConfigLocation 6 | /WEB-INF/appconfig-root.xml 7 | 8 | 9 | springSecurityFilterChain 10 | org.springframework.web.filter.DelegatingFilterProxy 11 | 12 | 13 | springSecurityFilterChain 14 | /* 15 | 16 | 17 | dispatcher 18 | org.springframework.web.servlet.DispatcherServlet 19 | 20 | contextConfigLocation 21 | 22 | 23 | 1 24 | 25 | 26 | dispatcher 27 | / 28 | 29 | 30 | org.springframework.web.context.ContextLoaderListener 31 | 32 | -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/background.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/header.jpg -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/Ansible_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/Ansible_logo.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/Vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/Vagrant.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/aws.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/docker.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/git.jpg -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/jenkins.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/puppet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/puppet.jpg -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/technologies/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/technologies/python-logo.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/user/giphy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/user/giphy.gif -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/user/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/user/logo.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/user/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/user/user.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/user/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/user/user2.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/user/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/user/user3.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/visualpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/visualpath.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/visualpathlogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/visualpathlogo2.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/Images/visualpathlogo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_4/src/main/webapp/resources/Images/visualpathlogo3.png -------------------------------------------------------------------------------- /PROJECT_4/src/main/webapp/resources/css/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 100px; 3 | padding-bottom: 50px; 4 | background-color: #ffffff; 5 | 6 | } 7 | form { 8 | border: 3px solid #204a87; 9 | } 10 | 11 | img.logo { 12 | display: block; 13 | margin-left: auto; 14 | margin-right: auto; 15 | width: 300px; 16 | height: 70px; 17 | 18 | } 19 | .form-signin { 20 | max-width: 330px; 21 | padding: 15px; 22 | margin: 0 auto; 23 | } 24 | .btn-custom,.btn-custom:hover, .btn-custom:focus, .btn-custom:active { 25 | border-radius: 0; 26 | color: #ffffff; 27 | background-color: #ef2929; 28 | border-color: #ef2929; 29 | 30 | } 31 | .btn-custom-LOGIN { 32 | border-radius: 0; 33 | color: #ffffff; 34 | height:3em; 35 | background-color: #26C6DA; 36 | border-color: #ef2929; 37 | 38 | } 39 | 40 | .form-signin .form-signin-heading, 41 | .form-signin .checkbox { 42 | margin-bottom: 10px; 43 | } 44 | 45 | .form-signin .checkbox { 46 | font-weight: normal; 47 | } 48 | 49 | .form-signin .form-control { 50 | position: relative; 51 | height: auto; 52 | -webkit-box-sizing: border-box; 53 | -moz-box-sizing: border-box; 54 | box-sizing: border-box; 55 | padding: 10px; 56 | font-size: 16px; 57 | } 58 | 59 | .form-signin .form-control:focus { 60 | z-index: 2; 61 | } 62 | 63 | .form-signin input { 64 | margin-top: 10px; 65 | border-bottom-right-radius: 0; 66 | border-bottom-left-radius: 0; 67 | } 68 | 69 | .form-signin button { 70 | margin-top: 10px; 71 | } 72 | 73 | .has-error { 74 | color: red 75 | } -------------------------------------------------------------------------------- /PROJECT_4/src/test/java/com/visualpathit/account/controllerTest/SampleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class SampleTest { 8 | @Test 9 | public void SampleTestHappyFlow(){ 10 | assertEquals("Hello".length(), 5); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /PROJECT_4/src/test/java/com/visualpathit/account/modelTest/RoleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class RoleTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final String EXPECTED_ROLENAME = "Admin"; 20 | public static final int EXPECTED_SIZE = 1; 21 | private Role role; 22 | @Before 23 | public void setUp() throws Exception { 24 | User user = new User(); 25 | user.setId(1L); 26 | user.setUsername("Wahidkhan74"); 27 | user.setPassword("Wahidkhan74"); 28 | user.setUserEmail("XXXXX@gmail.com"); 29 | 30 | Set users = new HashSet(); 31 | users.add(user); 32 | role = new Role(); 33 | role.setId(1L); 34 | role.setName("Admin"); 35 | role.setUsers(users); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | System.out.println("Test Completed"); 41 | 42 | } 43 | 44 | @Test 45 | public void testUserDetailsHappyFlow() throws Exception { 46 | Assert.assertEquals(EXPECTED_ID, role.getId()); 47 | Assert.assertEquals(EXPECTED_ROLENAME, role.getName()); 48 | Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size()); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /PROJECT_4/src/test/java/com/visualpathit/account/modelTest/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class UserTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final int EXPECTED_SIZE = 1; 20 | public static final String EXPECTED_USERNAME = "Wahidkhan74"; 21 | public static final String EXPECTED_PASSWD = "Wahidkhan74"; 22 | public static final String EXPECTED_USEREMAIL = "XXXXX@gmail.com"; 23 | private User user; 24 | @Before 25 | public void setUp() throws Exception { 26 | 27 | Role role = new Role(); 28 | role.setId(1L); 29 | role.setName("Admin"); 30 | Set roles = new HashSet(); 31 | roles.add(role); 32 | 33 | user = new User(); 34 | user.setId(1L); 35 | user.setUsername("Wahidkhan74"); 36 | user.setPassword("Wahidkhan74"); 37 | user.setUserEmail("XXXXX@gmail.com"); 38 | user.setRoles(roles); 39 | } 40 | 41 | @After 42 | public void tearDown() throws Exception { 43 | System.out.println("Test Completed"); 44 | 45 | } 46 | 47 | @Test 48 | public void testUserDetailsHappyFlow() throws Exception { 49 | Assert.assertEquals(EXPECTED_ID, user.getId()); 50 | Assert.assertEquals(EXPECTED_USERNAME, user.getUsername()); 51 | Assert.assertEquals(EXPECTED_PASSWD, user.getPassword()); 52 | Assert.assertEquals(EXPECTED_USEREMAIL, user.getUserEmail()); 53 | Assert.assertEquals(EXPECTED_SIZE,user.getRoles().size()); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /PROJECT_4/src/test/java/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.setup; 2 | 3 | import org.springframework.web.servlet.view.AbstractUrlBasedView; 4 | import org.springframework.web.servlet.view.InternalResourceView; 5 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 6 | 7 | public class StandaloneMvcTestViewResolver extends InternalResourceViewResolver { 8 | 9 | public StandaloneMvcTestViewResolver() { 10 | super(); 11 | } 12 | 13 | @Override 14 | protected AbstractUrlBasedView buildView(final String viewName) throws Exception { 15 | final InternalResourceView view = (InternalResourceView) super.buildView(viewName); 16 | // prevent checking for circular view paths 17 | view.setPreventDispatchLoop(false); 18 | return view; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PROJECT_4/userdata/backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | 4 | # MEmcache 5 | yum install epel-release -y 6 | yum install memcached -y 7 | systemctl start memcached 8 | systemctl enable memcached 9 | systemctl status memcached 10 | memcached -p 11211 -U 11111 -u memcached -d 11 | 12 | # Rabbit 13 | yum install socat -y 14 | yum install erlang -y 15 | yum install wget -y 16 | wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm 17 | rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 18 | yum update 19 | rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm 20 | systemctl start rabbitmq-server 21 | systemctl enable rabbitmq-server 22 | systemctl status rabbitmq-server 23 | echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config 24 | rabbitmqctl add_user rabbit bunny 25 | rabbitmqctl set_user_tags rabbit administrator 26 | systemctl restart rabbitmq-server 27 | 28 | # Mysql 29 | yum install mariadb-server -y 30 | 31 | #mysql_secure_installation 32 | sed -i 's/^127.0.0.1/0.0.0.0/' /etc/my.cnf 33 | 34 | # starting & enabling mariadb-server 35 | systemctl start mariadb 36 | systemctl enable mariadb 37 | 38 | #restore the dump file for the application 39 | mysqladmin -u root password "$DATABASE_PASS" 40 | mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 41 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 42 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 43 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 44 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 45 | mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 46 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 47 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'app01' identified by 'admin123'" 48 | mysql -u root -p"$DATABASE_PASS" accounts < /vagrant/vprofile-repo/src/main/resources/db_backup.sql 49 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 50 | 51 | # Restart mariadb-server 52 | systemctl restart mariadb -------------------------------------------------------------------------------- /PROJECT_4/userdata/memcache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum install memcached -y 4 | sudo systemctl start memcached 5 | sudo systemctl enable memcached 6 | sudo systemctl status memcached 7 | sudo memcached -p 11211 -U 11111 -u memcached -d -------------------------------------------------------------------------------- /PROJECT_4/userdata/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | sudo yum update -y 4 | sudo yum install epel-release -y 5 | sudo yum install git zip unzip -y 6 | sudo yum install mariadb-server -y 7 | 8 | 9 | # starting & enabling mariadb-server 10 | sudo systemctl start mariadb 11 | sudo systemctl enable mariadb 12 | cd /tmp/ 13 | git clone -b vp-rem https://github.com/devopshydclub/vprofile-repo.git 14 | #restore the dump file for the application 15 | sudo mysqladmin -u root password "$DATABASE_PASS" 16 | sudo mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 17 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 18 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 19 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 20 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 21 | sudo mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 22 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 23 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'%' identified by 'admin123'" 24 | sudo mysql -u root -p"$DATABASE_PASS" accounts < /tmp/vprofile-repo/src/main/resources/db_backup.sql 25 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 26 | 27 | # Restart mariadb-server 28 | sudo systemctl restart mariadb 29 | 30 | 31 | #starting the firewall and allowing the mariadb to access from port no. 3306 32 | sudo systemctl start firewalld 33 | sudo systemctl enable firewalld 34 | sudo firewall-cmd --get-active-zones 35 | sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 36 | sudo firewall-cmd --reload 37 | sudo systemctl restart mariadb 38 | -------------------------------------------------------------------------------- /PROJECT_4/userdata/nginx.sh: -------------------------------------------------------------------------------- 1 | # adding repository and installing nginx 2 | apt update 3 | apt install nginx -y 4 | cat < vproapp 5 | upstream vproapp { 6 | 7 | server appserver.com:8080; 8 | 9 | } 10 | 11 | server { 12 | 13 | listen 80; 14 | 15 | location / { 16 | 17 | proxy_pass http://vproapp; 18 | 19 | } 20 | 21 | } 22 | 23 | EOT 24 | 25 | mv vproapp /etc/nginx/sites-available/vproapp 26 | rm -rf /etc/nginx/sites-enabled/default 27 | ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp 28 | 29 | #starting nginx service and firewall 30 | systemctl start nginx 31 | systemctl enable nginx 32 | systemctl restart nginx 33 | -------------------------------------------------------------------------------- /PROJECT_4/userdata/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum update -y 4 | sudo yum install wget -y 5 | cd /tmp/ 6 | wget http://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm 7 | sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm 8 | sudo yum -y install erlang socat 9 | curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash 10 | sudo yum install rabbitmq-server -y 11 | sudo systemctl start rabbitmq-server 12 | sudo systemctl enable rabbitmq-server 13 | sudo systemctl status rabbitmq-server 14 | sudo sh -c 'echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config' 15 | sudo rabbitmqctl add_user test test 16 | sudo rabbitmqctl set_user_tags test administrator 17 | sudo systemctl restart rabbitmq-server 18 | -------------------------------------------------------------------------------- /PROJECT_4/userdata/tomcat.sh: -------------------------------------------------------------------------------- 1 | TOMURL="https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz" 2 | yum install java-1.8.0-openjdk -y 3 | yum install git maven wget -y 4 | cd /tmp/ 5 | wget $TOMURL -O tomcatbin.tar.gz 6 | EXTOUT=`tar xzvf tomcatbin.tar.gz` 7 | TOMDIR=`echo $EXTOUT | cut -d '/' -f1` 8 | useradd --shell /sbin/nologin tomcat 9 | rsync -avzh /tmp/$TOMDIR/ /usr/local/tomcat8/ 10 | chown -R tomcat.tomcat /usr/local/tomcat8 11 | 12 | rm -rf /etc/systemd/system/tomcat.service 13 | 14 | cat <> /etc/systemd/system/tomcat.service 15 | [Unit] 16 | Description=Tomcat 17 | After=network.target 18 | 19 | [Service] 20 | User=tomcat 21 | WorkingDirectory=/usr/local/tomcat8 22 | Environment=JRE_HOME=/usr/lib/jvm/jre 23 | Environment=JAVA_HOME=/usr/lib/jvm/jre 24 | Environment=CATALINA_HOME=/usr/local/tomcat8 25 | Environment=CATALINE_BASE=/usr/local/tomcat8 26 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 27 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 28 | SyslogIdentifier=tomcat-%i 29 | 30 | [Install] 31 | WantedBy=multi-user.target 32 | EOT 33 | 34 | systemctl daemon-reload 35 | systemctl start tomcat 36 | systemctl enable tomcat 37 | 38 | git clone -b vp-rem https://github.com/devopshydclub/vprofile-repo.git 39 | cd vprofile-repo 40 | mvn install 41 | systemctl stop tomcat 42 | sleep 120 43 | rm -rf /usr/local/tomcat8/webapps/ROOT* 44 | cp target/vprofile-v2.war /usr/local/tomcat8/webapps/ROOT.war 45 | systemctl start tomcat 46 | sleep 300 47 | cp /vprofile-vm-data/application.properties /usr/local/tomcat8/webapps/ROOT/WEB-INF/classes/application.properties 48 | systemctl restart tomcat8 49 | -------------------------------------------------------------------------------- /PROJECT_4/userdata/tomcat_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt update 3 | sudo apt upgrade -y 4 | sudo apt install openjdk-8-jdk -y 5 | sudo apt install tomcat8 tomcat8-admin tomcat8-docs tomcat8-common git -y 6 | -------------------------------------------------------------------------------- /PROJECT_5/images/arti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/arti.png -------------------------------------------------------------------------------- /PROJECT_5/images/artifact-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/artifact-upload.png -------------------------------------------------------------------------------- /PROJECT_5/images/build1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/build1.png -------------------------------------------------------------------------------- /PROJECT_5/images/ci-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/ci-flow.png -------------------------------------------------------------------------------- /PROJECT_5/images/finalslack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/finalslack.png -------------------------------------------------------------------------------- /PROJECT_5/images/jenkins-ci.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/jenkins-ci.webp -------------------------------------------------------------------------------- /PROJECT_5/images/jenkins-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/jenkins-ui.png -------------------------------------------------------------------------------- /PROJECT_5/images/jenkins-ui2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/jenkins-ui2.png -------------------------------------------------------------------------------- /PROJECT_5/images/jenkinsci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/jenkinsci.png -------------------------------------------------------------------------------- /PROJECT_5/images/nexus-login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/nexus-login.png -------------------------------------------------------------------------------- /PROJECT_5/images/qc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/qc.png -------------------------------------------------------------------------------- /PROJECT_5/images/sonar-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/sonar-int.png -------------------------------------------------------------------------------- /PROJECT_5/images/sonar-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/sonar-ui.png -------------------------------------------------------------------------------- /PROJECT_5/images/sonar-ui2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_5/images/sonar-ui2.png -------------------------------------------------------------------------------- /PROJECT_6/images/Project-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/Project-6.png -------------------------------------------------------------------------------- /PROJECT_6/images/artifact1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/artifact1.png -------------------------------------------------------------------------------- /PROJECT_6/images/build2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/build2.png -------------------------------------------------------------------------------- /PROJECT_6/images/build3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/build3.png -------------------------------------------------------------------------------- /PROJECT_6/images/codepipeline-succesful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/codepipeline-succesful.png -------------------------------------------------------------------------------- /PROJECT_6/images/mvn-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/mvn-repo.png -------------------------------------------------------------------------------- /PROJECT_6/images/perm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/perm2.png -------------------------------------------------------------------------------- /PROJECT_6/images/reo-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/reo-upload.png -------------------------------------------------------------------------------- /PROJECT_6/images/sonar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/sonar.png -------------------------------------------------------------------------------- /PROJECT_6/images/ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/ssh.png -------------------------------------------------------------------------------- /PROJECT_6/images/valid_sonar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_6/images/valid_sonar.png -------------------------------------------------------------------------------- /PROJECT_7/Data_Backup_of_CICD_Stack.md: -------------------------------------------------------------------------------- 1 | ## Data BackUp of CI/CD Stack 2 | 3 | ### Jenkins BackUp 4 | 5 | Create an S3 bucket with a unique name. 6 | ```sh 7 | Name: vprofile-cicd-stack-backup-rd 8 | ``` 9 | 10 | Create an IAM role for EC2 with policy `AmazonS3FullAccess` name as `vprofile-cicd-s3fullaccess`. We will attach this role to Jenkins, Nexus and Sonar server. 11 | 12 | Login to Jenkins server. 13 | ```sh 14 | sudo -i 15 | systemctl stop jenkins 16 | cd /var/lib 17 | du -sh jenkins 18 | cd jenkins 19 | cd .m2/repository 20 | rm -rf * 21 | cd ../.. 22 | cd workspace 23 | rm -rf * 24 | cd .. 25 | cd jobs 26 | cd /builds 27 | rm -rf : rm -rf 1 2 3 4 5 28 | cd ../.. 29 | du -sh * find the directory which takes most space delete build #s 30 | cd .sonar/cache 31 | rm -rf * 32 | cd .. # go back to /var/lib 33 | tar -czvf jenkins_cicdjobs.tar.gz jenkins 34 | aws s3 cp jenkins_cicdjobs.tar.gz s3://vprofile-cicd-stack-backup-rd 35 | aws s3 ls vprofile-cicd-stack-backup-rd 36 | ``` 37 | 38 | ### Nexus BackUp 39 | 40 | ```sh 41 | sudo -i 42 | systemctl stop nexus 43 | cd /opt 44 | tar -czvf nexus-cicd-vpro-pr.tgz nexus 45 | aws s3 cp nexus-cicd-vpro-pr.tgz s3://vprofile-cicd-stack-backup-rd 46 | aws s3 ls vprofile-cicd-stack-backup-rd 47 | ``` 48 | 49 | ### SonarQube BackUp 50 | 51 | We need to backup sonarqube directory and postgresql here. 52 | 53 | ```sh 54 | sudo -i 55 | systemctl stop sonarqube 56 | cd /opt 57 | tar -czvf sonarqube-vpro-pro-data.tgz sonarqube 58 | aws s3 cp sonarqube-vpro-pro-data.tgz s3://vprofile-cicd-stack-backup-rd 59 | aws s3 ls vprofile-cicd-stack-backup-rd 60 | ``` 61 | 62 | ### App Server BackUp 63 | 64 | ```sh 65 | sudo -i 66 | cd /usr/local/tomcat8/ 67 | ls 68 | cd conf/ 69 | ls 70 | aws s3 tomcat-users.xml s3://vprofile-cicd-stack-backup-rd 71 | cd .. 72 | cd webapps/manager/META-INF/ 73 | aws s3 cp contect.xml s3://vprofile-cicd-stack-backup-rd 74 | ``` -------------------------------------------------------------------------------- /PROJECT_7/images/cicd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/cicd.png -------------------------------------------------------------------------------- /PROJECT_7/images/ecr_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/ecr_success.png -------------------------------------------------------------------------------- /PROJECT_7/images/ecs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/ecs.png -------------------------------------------------------------------------------- /PROJECT_7/images/elb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/elb.png -------------------------------------------------------------------------------- /PROJECT_7/images/pipeline3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/pipeline3.png -------------------------------------------------------------------------------- /PROJECT_7/images/slack2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/slack2.png -------------------------------------------------------------------------------- /PROJECT_7/images/success_docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/success_docker.png -------------------------------------------------------------------------------- /PROJECT_7/images/sys-des.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/sys-des.png -------------------------------------------------------------------------------- /PROJECT_7/images/sys-des2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_7/images/sys-des2.png -------------------------------------------------------------------------------- /PROJECT_8/images/BuildandRelease-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/BuildandRelease-success.png -------------------------------------------------------------------------------- /PROJECT_8/images/Project-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/Project-6.png -------------------------------------------------------------------------------- /PROJECT_8/images/Project-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/Project-8.png -------------------------------------------------------------------------------- /PROJECT_8/images/app-running-on-beanstalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/app-running-on-beanstalk.png -------------------------------------------------------------------------------- /PROJECT_8/images/artifact1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/artifact1.png -------------------------------------------------------------------------------- /PROJECT_8/images/build2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/build2.png -------------------------------------------------------------------------------- /PROJECT_8/images/build3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/build3.png -------------------------------------------------------------------------------- /PROJECT_8/images/cicd-pipeline-successful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/cicd-pipeline-successful.png -------------------------------------------------------------------------------- /PROJECT_8/images/codepipeline-succesful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/codepipeline-succesful.png -------------------------------------------------------------------------------- /PROJECT_8/images/mvn-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/mvn-repo.png -------------------------------------------------------------------------------- /PROJECT_8/images/perm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/perm2.png -------------------------------------------------------------------------------- /PROJECT_8/images/reo-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/reo-upload.png -------------------------------------------------------------------------------- /PROJECT_8/images/sonar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/sonar.png -------------------------------------------------------------------------------- /PROJECT_8/images/ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/ssh.png -------------------------------------------------------------------------------- /PROJECT_8/images/valid_sonar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_8/images/valid_sonar.png -------------------------------------------------------------------------------- /PROJECT_9/images/ans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/ans.png -------------------------------------------------------------------------------- /PROJECT_9/images/aws_igw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/aws_igw.png -------------------------------------------------------------------------------- /PROJECT_9/images/aws_sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/aws_sub.png -------------------------------------------------------------------------------- /PROJECT_9/images/display_ans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/display_ans.png -------------------------------------------------------------------------------- /PROJECT_9/images/igw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/igw.png -------------------------------------------------------------------------------- /PROJECT_9/images/key1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/key1.png -------------------------------------------------------------------------------- /PROJECT_9/images/project_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/project_9.png -------------------------------------------------------------------------------- /PROJECT_9/images/rt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/rt.png -------------------------------------------------------------------------------- /PROJECT_9/images/vpc-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/vpc-id.png -------------------------------------------------------------------------------- /PROJECT_9/images/vpc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/vpc1.png -------------------------------------------------------------------------------- /PROJECT_9/images/vpc_aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/vpc_aws.png -------------------------------------------------------------------------------- /PROJECT_9/images/vpc_sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/vpc_sub.png -------------------------------------------------------------------------------- /PROJECT_9/images/warm-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/warm-up.png -------------------------------------------------------------------------------- /PROJECT_9/images/warm-up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/warm-up2.png -------------------------------------------------------------------------------- /PROJECT_9/images/warmup3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/PROJECT_9/images/warmup3.png -------------------------------------------------------------------------------- /PROJECT_9/vars/bastion_setup: -------------------------------------------------------------------------------- 1 | bastion_ami: ami-05bfbece1ed5beb54 # Amazon Linux-2 AMI-ID from us-east-2 region 2 | region: us-east-2 3 | MYIP: 102.89.44.62/32 #change to your IP 4 | keyName: vprofile-key 5 | instanceType: t2.micro 6 | -------------------------------------------------------------------------------- /PROJECT_9/vars/vpc_setup: -------------------------------------------------------------------------------- 1 | vpc_name: "Vprofile-vpc" 2 | 3 | #VPC Range 4 | vpcCidr: '172.20.0.0./16' 5 | 6 | #Subnets Range 7 | PubSub1Cidr: 172.20.1.0/24 8 | PubSub2Cidr: 172.20.2.0/24 9 | PubSub3Cidr: 172.20.3.0/24 10 | PrivSub1Cidr: 172.20.4.0/24 11 | PrivSub2Cidr: 172.20.5.0/24 12 | PrivSub3Cidr: 172.20.6.0/24 13 | 14 | #Region Name 15 | region: "us-east-2" 16 | 17 | #Zone Names 18 | zone1: us-east-2a 19 | zone2: us-east-2b 20 | zone3: us-east-2c 21 | 22 | state: present 23 | -------------------------------------------------------------------------------- /Pipeline-As-A-Code/images/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/Pipeline-As-A-Code/images/build.png -------------------------------------------------------------------------------- /Pipeline-As-A-Code/images/jenkins-PAAC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/Pipeline-As-A-Code/images/jenkins-PAAC.png -------------------------------------------------------------------------------- /Pipeline-As-A-Code/images/jenkins-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/Pipeline-As-A-Code/images/jenkins-int.png -------------------------------------------------------------------------------- /Pipeline-As-A-Code/images/jenkins-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sadebare/AWS_DEVOPS_PROJECTS/e17788d580025ee1df6272f061ee9088aa28fbd2/Pipeline-As-A-Code/images/jenkins-ui.png --------------------------------------------------------------------------------