diff --git a/config b/config index 6a4ab46..cd84d77 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 6a4ab461b1a268817b4ba0683707e22e5c941ac8 +Subproject commit cd84d77e5aa3d21c7bb360a35d3de960faffc537 diff --git a/config_server/build.gradle b/config_server/build.gradle index 88a9356..82b19ab 100644 --- a/config_server/build.gradle +++ b/config_server/build.gradle @@ -29,6 +29,8 @@ dependencies { compile('org.springframework.boot:spring-boot-starter') testCompile('org.springframework.boot:spring-boot-starter-test') compile('org.springframework.cloud:spring-cloud-config-server') + compile('org.springframework.boot:spring-boot-starter-security') + compile('org.springframework.boot:spring-boot-starter-web') } diff --git a/config_server/gradle/wrapper/gradle-wrapper.properties b/config_server/gradle/wrapper/gradle-wrapper.properties index 293fd09..136d0a4 100644 --- a/config_server/gradle/wrapper/gradle-wrapper.properties +++ b/config_server/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Tue Mar 28 22:05:15 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/config_server/src/main/resources/application.properties b/config_server/src/main/resources/application.properties index 20eca9a..06f6b60 100644 --- a/config_server/src/main/resources/application.properties +++ b/config_server/src/main/resources/application.properties @@ -1,3 +1,9 @@ server.port=8888 - -spring.cloud.config.server.git.uri=${HOME}/NWT/steleks_web_app/config \ No newline at end of file +spring.cloud.config.server.git.uri=https://github.com/esensar/steleks_config +spring.cloud.config.server.git.clone-on-start=true +security.user.name=root +security.user.password=skorpion +encrypt.key-store.location=classpath:config-server.jks +encrypt.key-store.password=my-s70r3-s3cr3t +encrypt.key-store.alias=config-server-key +encrypt.key-store.secret=my-k34-s3cr3t \ No newline at end of file diff --git a/config_server/src/main/resources/config-server.jks b/config_server/src/main/resources/config-server.jks new file mode 100644 index 0000000..6985682 Binary files /dev/null and b/config_server/src/main/resources/config-server.jks differ diff --git a/events/build.gradle b/events/build.gradle index a41d23c..426e80e 100644 --- a/events/build.gradle +++ b/events/build.gradle @@ -31,6 +31,7 @@ dependencies { compile('org.springframework.cloud:spring-cloud-starter-config') compile('org.springframework.boot:spring-boot-starter-actuator') compile('org.springframework.boot:spring-boot-starter-web') + compile('mysql:mysql-connector-java') } dependencyManagement { diff --git a/events/src/main/java/ba/steleks/EventsApplication.java b/events/src/main/java/ba/steleks/EventsApplication.java index e6c1f36..a7a81f6 100644 --- a/events/src/main/java/ba/steleks/EventsApplication.java +++ b/events/src/main/java/ba/steleks/EventsApplication.java @@ -4,7 +4,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @@ -22,8 +24,24 @@ class MessageRestController { @Value("${message:Hello default}") private String message; + @Value("${user.password}") + private String password; + @RequestMapping("/message") String getMessage() { return this.message; } -} \ No newline at end of file + + //@RequestMapping(path ="/temp", value = "/{id}", method = RequestMethod.GET) + //String getTemp(@PathVariable("id") Long id){ + // return "temp " + Long.toString(id); + //} + + @RequestMapping(value = "/whoami/{user}", method = RequestMethod.GET) + public String whoami(@PathVariable("username") String username) { + return String.format("Hello! You're %s and you'll become a(n) root, " + + "but only if your password is '%s'!\n", + username, password); + } +} + diff --git a/events/src/main/java/ba/steleks/repository/config-client-development.properties b/events/src/main/java/ba/steleks/repository/config-client-development.properties new file mode 100644 index 0000000..e83e8c0 --- /dev/null +++ b/events/src/main/java/ba/steleks/repository/config-client-development.properties @@ -0,0 +1 @@ +user.password={"description":"No key was installed for encryption service","status":"NO_KEY"} diff --git a/events/src/main/resources/application.properties b/events/src/main/resources/application.properties index eade546..f6be723 100644 --- a/events/src/main/resources/application.properties +++ b/events/src/main/resources/application.properties @@ -1,4 +1,9 @@ server.port = 9020 +spring.datasource.url = jdbc:mysql://localhost:3306/events +spring.datasource.username = root +spring.datasource.password = skorpion +spring.jpa.generate-ddl=true + # #spring.datasource.url = jdbc:mysql://localhost:3306/events #spring.datasource.username = root diff --git a/events/src/main/resources/bootstrap.properties b/events/src/main/resources/bootstrap.properties index 6a10cbe..8a74bcf 100644 --- a/events/src/main/resources/bootstrap.properties +++ b/events/src/main/resources/bootstrap.properties @@ -1,4 +1,5 @@ -spring.application.name=a-bootiful-client +spring.application.name=steleks # N.B. this is the default: spring.cloud.config.uri=http://localhost:8888 -management.security.enabled=false \ No newline at end of file +spring.cloud.config.username=root +spring.cloud.config.password=skorpion \ No newline at end of file diff --git a/teams/build.gradle b/teams/build.gradle index 7581b53..7558c1a 100644 --- a/teams/build.gradle +++ b/teams/build.gradle @@ -27,4 +27,5 @@ dependencies { compile('org.springframework.boot:spring-boot-starter-data-rest') runtime('com.h2database:h2') testCompile('org.springframework.boot:spring-boot-starter-test') + compile('mysql:mysql-connector-java') } diff --git a/teams/src/main/resources/application.properties b/teams/src/main/resources/application.properties index 943d197..2e9716f 100644 --- a/teams/src/main/resources/application.properties +++ b/teams/src/main/resources/application.properties @@ -1 +1,5 @@ -server.port=9010 \ No newline at end of file +server.port=9010 +spring.datasource.url = jdbc:mysql://localhost:3306/teams +spring.datasource.username = root +spring.datasource.password = skorpion +spring.jpa.generate-ddl=true \ No newline at end of file diff --git a/users/build.gradle b/users/build.gradle index 7581b53..7558c1a 100644 --- a/users/build.gradle +++ b/users/build.gradle @@ -27,4 +27,5 @@ dependencies { compile('org.springframework.boot:spring-boot-starter-data-rest') runtime('com.h2database:h2') testCompile('org.springframework.boot:spring-boot-starter-test') + compile('mysql:mysql-connector-java') } diff --git a/users/src/main/resources/application.properties b/users/src/main/resources/application.properties index 91f7491..a96fb20 100644 --- a/users/src/main/resources/application.properties +++ b/users/src/main/resources/application.properties @@ -1 +1,5 @@ -server.port = 8090 \ No newline at end of file +server.port = 8090 +spring.datasource.url = jdbc:mysql://localhost:3306/users +spring.datasource.username = root +spring.datasource.password = skorpion +spring.jpa.generate-ddl=true \ No newline at end of file