Skip to content

Commit

Permalink
config server authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
sqshq committed Mar 5, 2016
1 parent fb64a0e commit fbe4e01
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 19 deletions.
4 changes: 4 additions & 0 deletions config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
6 changes: 5 additions & 1 deletion config/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ spring:
active: native

server:
port: 8888
port: 8888

security:
user:
password: ${CONFIG_SERVICE_PASSWORD}
9 changes: 9 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
version: '2'
services:
config:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
build: config
ports:
- 8888:8888

registry:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
build: registry
ports:
- 8761:8761

gateway:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
build: gateway


Expand All @@ -34,6 +40,7 @@ services:

account-service:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
MONGODB_PASSWORD: dev-password
ACCOUNT_SERVICE_PASSWORD: dev-password
build: account-service
Expand All @@ -49,6 +56,7 @@ services:

statistics-service:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
MONGODB_PASSWORD: dev-password
STATISTICS_SERVICE_PASSWORD: dev-password
build: statistics-service
Expand All @@ -64,6 +72,7 @@ services:

notification-service:
environment:
CONFIG_SERVICE_PASSWORD: dev-password
MONGODB_PASSWORD: dev-password
NOTIFICATION_SERVICE_PASSWORD: dev-password
build: notification-service
Expand Down
40 changes: 25 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: '2'
services:
config:
environment:
CONFIG_SERVICE_PASSWORD:
image: sqshq/piggymetrics-config
restart: always
logging:
Expand All @@ -9,6 +11,8 @@ services:
max-file: "10"

registry:
environment:
CONFIG_SERVICE_PASSWORD:
image: sqshq/piggymetrics-registry
restart: always
logging:
Expand All @@ -17,6 +21,8 @@ services:
max-file: "10"

gateway:
environment:
CONFIG_SERVICE_PASSWORD:
image: sqshq/piggymetrics-gateway
restart: always
ports:
Expand All @@ -28,83 +34,87 @@ services:


auth-service:
image: sqshq/piggymetrics-auth-service
restart: always
environment:
CONFIG_SERVICE_PASSWORD:
NOTIFICATION_SERVICE_PASSWORD:
STATISTICS_SERVICE_PASSWORD:
ACCOUNT_SERVICE_PASSWORD:
MONGODB_PASSWORD:
image: sqshq/piggymetrics-auth-service
restart: always
logging:
options:
max-size: "10m"
max-file: "10"

auth-mongodb:
environment:
MONGODB_PASSWORD:
build: mongodb
image: sqshq/piggymetrics-auth-mongodb
restart: always
environment:
MONGODB_PASSWORD:
logging:
options:
max-size: "10m"
max-file: "10"


account-service:
image: sqshq/piggymetrics-account-service
restart: always
environment:
CONFIG_SERVICE_PASSWORD:
ACCOUNT_SERVICE_PASSWORD:
MONGODB_PASSWORD:
image: sqshq/piggymetrics-account-service
restart: always
logging:
options:
max-size: "10m"
max-file: "10"

account-mongodb:
build: mongodb
image: sqshq/piggymetrics-account-mongodb
restart: always
environment:
INIT_DUMP: account-service-dump.js
MONGODB_PASSWORD:
build: mongodb
image: sqshq/piggymetrics-account-mongodb
restart: always
logging:
options:
max-size: "10m"
max-file: "10"


statistics-service:
image: sqshq/piggymetrics-statistics-service
restart: always
environment:
CONFIG_SERVICE_PASSWORD:
STATISTICS_SERVICE_PASSWORD:
MONGODB_PASSWORD:
image: sqshq/piggymetrics-statistics-mongodb
restart: always
logging:
options:
max-size: "10m"
max-file: "10"

statistics-mongodb:
build: mongodb
image: sqshq/piggymetrics-statistics-mongodb
restart: always
environment:
MONGODB_PASSWORD:
image: sqshq/piggymetrics-statistics-mongodb
restart: always
logging:
options:
max-size: "10m"
max-file: "10"


notification-service:
image: sqshq/piggymetrics-notification-service
restart: always
environment:
CONFIG_SERVICE_PASSWORD:
STATISTICS_SERVICE_PASSWORD:
MONGODB_PASSWORD:
image: sqshq/piggymetrics-notification-service
restart: always
logging:
options:
max-size: "10m"
Expand Down
2 changes: 0 additions & 2 deletions notification-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ FROM java:8-jre
ADD ./target/notification-service.jar /app/
CMD ["java", "-jar", "/app/notification-service.jar"]

RUN java -jar /app/notification-service.jar

EXPOSE 8888
5 changes: 4 additions & 1 deletion notification-service/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ spring:
name: notification-service
cloud:
config:
uri: http://config:8888
uri: http://config:8888
fail-fast: true
password: ${CONFIG_SERVICE_PASSWORD}
username: user

0 comments on commit fbe4e01

Please sign in to comment.