Skip to content

Commit 09fd20c

Browse files
authored
Merge pull request #214 from OWASP/develop
v1.1.3
2 parents f8dedff + d8b6ba9 commit 09fd20c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+5391
-7751
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,7 @@ jobs:
246246
cache-from: type=gha,scope=mailhog-service
247247
cache-to: type=gha,mode=max,scope=mailhog-service
248248

249+
- name: Dump docker logs on failure
250+
if: failure()
251+
uses: jwalton/gh-docker-logs@v2
252+

deploy/docker/docker-compose.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,20 @@ services:
4040
- SMTP_AUTH=true
4141
- SMTP_STARTTLS=true
4242
- ENABLE_LOG4J=${ENABLE_LOG4J:-false}
43-
- API_GATEWAY_URL=https://api.crapi.io
43+
- API_GATEWAY_URL=https://api.mypremiumdealership.com
44+
- TLS_ENABLED=${TLS_ENABLED:-false}
45+
- TLS_KEYSTORE_TYPE=PKCS12
46+
- TLS_KEYSTORE=classpath:certs/server.p12
47+
- TLS_KEYSTORE_PASSWORD=passw0rd
48+
- TLS_KEY_PASSWORD=passw0rd
49+
- TLS_KEY_ALIAS=identity
4450
depends_on:
4551
postgresdb:
4652
condition: service_healthy
4753
mongodb:
4854
condition: service_healthy
4955
healthcheck:
50-
test: curl 0.0.0.0:${IDENTITY_SERVER_PORT:-8080}/identity/health_check
56+
test: /app/health.sh
5157
interval: 15s
5258
timeout: 15s
5359
retries: 15
@@ -75,6 +81,9 @@ services:
7581
- MONGO_DB_USER=admin
7682
- MONGO_DB_PASSWORD=crapisecretpassword
7783
- MONGO_DB_NAME=crapi
84+
- TLS_ENABLED=${TLS_ENABLED:-false}
85+
- TLS_CERTIFICATE=certs/server.crt
86+
- TLS_KEY=certs/server.key
7887
depends_on:
7988
postgresdb:
8089
condition: service_healthy
@@ -83,7 +92,7 @@ services:
8392
crapi-identity:
8493
condition: service_healthy
8594
healthcheck:
86-
test: curl 0.0.0.0:${COMMUNITY_SERVER_PORT:-8087}/community/home
95+
test: /app/health.sh
8796
interval: 15s
8897
timeout: 15s
8998
retries: 15
@@ -112,7 +121,10 @@ services:
112121
- MONGO_DB_PASSWORD=crapisecretpassword
113122
- MONGO_DB_NAME=crapi
114123
- SECRET_KEY=crapi
115-
- API_GATEWAY_URL=https://api.crapi.io
124+
- API_GATEWAY_URL=https://api.mypremiumdealership.com
125+
- TLS_ENABLED=${TLS_ENABLED:-false}
126+
- TLS_CERTIFICATE=certs/server.crt
127+
- TLS_KEY=certs/server.key
116128
depends_on:
117129
postgresdb:
118130
condition: service_healthy
@@ -123,7 +135,7 @@ services:
123135
crapi-community:
124136
condition: service_healthy
125137
healthcheck:
126-
test: curl 0.0.0.0:${WORKSHOP_SERVER_PORT:-8000}/workshop/health_check/
138+
test: /app/health.sh
127139
interval: 15s
128140
timeout: 15s
129141
retries: 15
@@ -138,10 +150,12 @@ services:
138150
image: crapi/crapi-web:${VERSION:-latest}
139151
ports:
140152
- "${LISTEN_IP:-127.0.0.1}:8888:80"
153+
- "${LISTEN_IP:-127.0.0.1}:8443:443"
141154
environment:
142155
- COMMUNITY_SERVICE=crapi-community:${COMMUNITY_SERVER_PORT:-8087}
143156
- IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080}
144157
- WORKSHOP_SERVICE=crapi-workshop:${WORKSHOP_SERVER_PORT:-8000}
158+
- TLS_ENABLED=${TLS_ENABLED:-false}
145159
depends_on:
146160
crapi-community:
147161
condition: service_healthy
@@ -225,8 +239,8 @@ services:
225239
cpus: '0.3'
226240
memory: 128M
227241

228-
api.crapi.io:
229-
container_name: api.crapi.io
242+
api.mypremiumdealership.com:
243+
container_name: api.mypremiumdealership.com
230244
image: crapi/gateway-service:${VERSION:-latest}
231245
#ports:
232246
# - "${LISTEN_IP:-127.0.0.1}:8443:443" # https
@@ -235,6 +249,7 @@ services:
235249
interval: 15s
236250
timeout: 15s
237251
retries: 15
252+
start_period: 15s
238253
deploy:
239254
resources:
240255
limits:

deploy/helm/templates/community/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ data:
2222
MONGO_DB_PASSWORD: {{ .Values.mongodb.config.mongoPassword }}
2323
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName }}
2424
SERVER_PORT: {{ .Values.community.port | quote }}
25+
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}

deploy/helm/templates/identity/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ data:
3030
SMTP_STARTTLS: {{ .Values.identity.config.smtpStartTLS | quote }}
3131
SERVER_PORT: {{ .Values.identity.port | quote }}
3232
API_GATEWAY_URL: {{ if .Values.apiGatewayServiceInstall }}"https://{{ .Values.apiGatewayService.service.name }}"{{ else }}{{ .Values.apiGatewayServiceUrl }}{{ end }}
33+
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}
34+
TLS_KEYSTORE_TYPE: {{ .Values.identity.config.keyStoreType }}
35+
TLS_KEYSTORE: {{ .Values.identity.config.keyStore }}
36+
TLS_KEYSTORE_PASSWORD: {{ .Values.identity.config.keyStorePassword }}
37+
TLS_KEY_PASSWORD: {{ .Values.identity.config.keyPassword }}
38+
TLS_KEY_ALIAS: {{ .Values.identity.config.keyAlias }}

deploy/helm/templates/web/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ data:
99
COMMUNITY_SERVICE: {{ .Values.community.service.name }}:{{ .Values.community.port }}
1010
IDENTITY_SERVICE: {{ .Values.identity.service.name }}:{{ .Values.identity.port }}
1111
WORKSHOP_SERVICE: {{ .Values.workshop.service.name }}:{{ .Values.workshop.port }}
12+
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}

deploy/helm/templates/web/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ spec:
2323
image: {{ .Values.web.image }}:{{ .Chart.AppVersion }}
2424
imagePullPolicy: {{ .Values.imagePullPolicy }}
2525
ports:
26+
- containerPort: 443
2627
- containerPort: 80
2728
{{- if .Values.web.resources }}
2829
resources:

deploy/helm/templates/web/ingress.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ spec:
1111
targetPort: 80
1212
nodePort: {{ .Values.web.service.nodePort }}
1313
name: nginx
14+
- port: {{ .Values.web.sslPort }}
15+
targetPort: 443
16+
nodePort: {{ .Values.web.service.sslNodePort }}
17+
name: nginx-ssl
1418
type: LoadBalancer
1519
selector:
1620
{{- toYaml .Values.web.serviceSelectorLabels | nindent 4 }}

deploy/helm/templates/workshop/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ data:
2222
MONGO_DB_NAME: {{ .Values.mongodb.config.mongoDbName }}
2323
SERVER_PORT: {{ .Values.workshop.port | quote }}
2424
API_GATEWAY_URL: {{ if .Values.apiGatewayServiceInstall }}"https://{{ .Values.apiGatewayService.service.name }}"{{ else }}{{ .Values.apiGatewayServiceUrl }}{{ end }}
25+
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}

deploy/helm/values-tls.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Default values for crapi.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
replicaCount: 1
5+
imagePullPolicy: Always
6+
apiGatewayServiceUrl: https://api.mypremiumdealership.com
7+
apiGatewayServiceInstall: false
8+
enableLog4j: true
9+
enableShellInjection: true
10+
tlsEnabled: true
11+
12+
web:
13+
image: crapi/crapi-web
14+
port: 80
15+
sslPort: 443
16+
identity:
17+
image: crapi/crapi-identity
18+
port: 8080
19+
community:
20+
image: crapi/crapi-community
21+
port: 8087
22+
workshop:
23+
image: crapi/crapi-workshop
24+
port: 8000
25+
mailhog:
26+
image: crapi/mailhog
27+
mongodb:
28+
image: mongo
29+
version: 5.0
30+
postgresdb:
31+
image: postgres
32+
version: 14

deploy/helm/values.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ jwtSecret: crapi
66
enableLog4j: false
77
enableShellInjection: true
88
imagePullPolicy: Always
9-
apiGatewayServiceUrl: https://api.crapi.io
9+
apiGatewayServiceUrl: https://api.mypremiumdealership.com
1010
apiGatewayServiceInstall: true
1111
apiGatewayPassword:
12+
tlsEnabled: false
1213

1314
waitForK8sResources:
1415
image: groundnuty/k8s-wait-for:v1.3
@@ -19,11 +20,13 @@ web:
1920
image: crapi/crapi-web
2021
replicaCount: 1
2122
port: 80
23+
sslPort: 443
2224
service:
2325
name: crapi-web
2426
labels:
2527
app: crapi-web
2628
nodePort: 30080
29+
sslNodePort: 30443
2730
config:
2831
name: crapi-web-configmap
2932
labels:
@@ -70,6 +73,11 @@ identity:
7073
smtpFrom: "[email protected]"
7174
smtpAuth: true
7275
smtpStartTLS: true
76+
keyStoreType: PKCS12
77+
keyStore: classpath:certs/server.p12
78+
keyStorePassword: passw0rd
79+
keyPassword: passw0rd
80+
keyAlias: identity
7381
resources:
7482
limits:
7583
cpu: "500m"
@@ -278,4 +286,4 @@ apiGatewayService:
278286
deploymentSelectorMatchLabels:
279287
app: gateway-service
280288
serviceSelectorLabels:
281-
app: gateway-service
289+
app: gateway-service

0 commit comments

Comments
 (0)