Skip to content

Commit

Permalink
Merge pull request #61 from ConductionNL/staging
Browse files Browse the repository at this point in the history
Fix on conflicting certificate secretes
  • Loading branch information
rubenvdlinde authored Dec 11, 2019
2 parents 4e1bffa + ed9f8a5 commit 1739340
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ORGANIZATION_UNIT_NAME=Common-Ground
##################################################

APP_DOMAIN=conduction.nl
APP_DOMAINS=["conduction.nl","zaakonline.nl","larping.eu","common-ground.dev","trouwplanner.online","huwelijksplanner.online"]
APP_DEMO=pc.zaakonline.nl
APP_REPRO=https://github.com/ConductionNL/Proto-component-commonground

Expand Down
11 changes: 11 additions & 0 deletions api/config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
parameters:
env(APP_DOMAINS): '[]'
# Organisation stuff
env(ORGANIZATION_NAME): ''
env(ORGANIZATION_EMAIL_ADDRESS): ''
env(ORGANIZATION_COUNTRY_NAME): ''
env(ORGANIZATION_STATE): ''
env(ORGANIZATION_LOCALITY): ''
env(ORGANIZATION_UNIT_NAME): ''

twig:
default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
Expand All @@ -22,6 +32,7 @@ twig:
app_env: '%env(APP_ENV)%'
app_debug: '%env(APP_DEBUG)%'
app_domain: '%env(APP_DOMAIN)%'
app_domains: '%env(json:APP_DOMAINS)%'
app_demo: '%env(APP_DEMO)%'
app_repro: '%env(APP_REPRO)%'
app_description: '%env(APP_DESCRIPTION)%'
Expand Down
9 changes: 2 additions & 7 deletions api/helm/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: {{ include "name" . }}-acme-cert
name: {{ include "name" . }}-{{ .Values.settings.env }}-cert
spec:
secretName: {{ include "name" . }}-tls-cert
secretName: {{ include "name" . }}-{{ .Values.settings.env }}-cert
duration: 24h
renewBefore: 12h
{{- if eq .Values.settings.env "prod" }}
commonName: {{ .Values.settings.name }}.{{ .Values.settings.domain }}
{{- else }}
commonName: {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
{{- end }}
dnsNames:
{{- if eq .Values.settings.env "prod" }}
- {{ .Values.settings.name }}.{{ .Values.settings.domain }}
Expand Down
5 changes: 4 additions & 1 deletion api/helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ metadata:
spec:
tls:
- hosts:
# {{- range .Values.settings.domains }}
# - {{ .domain | quote }}
# {{- end }}
- {{ .Values.settings.domain }}
secretName: {{ include "name" . }}-tls-cert
secretName: {{ include "name" . }}-{{ .Values.settings.env }}-cert
rules:
# - host: {{ .Values.settings.name }}.{{ .Values.settings.env }}.{{ .Values.settings.domain }}
# http:
Expand Down
7 changes: 7 additions & 0 deletions api/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ settings:
description: ''Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.''
repro: 'https://github.com/ConductionNL/Proto-component-commonground'
domain: conduction.nl
domains:
- conduction.nl
- zaakonline.nl
- larping.eu
- common-ground.dev
- trouwplanner.online
- huwelijksplanner.online
organisationName: Conduction
email: [email protected]
country: Netherlands
Expand Down
4 changes: 4 additions & 0 deletions api/templates/helm/Values.yaml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ settings:
description: '{{ app_description }}'
repro: '{{ app_repro }}'
domain: {{ app_domain }}
domains:
{% for domain in app_domains %}
- domain: {{ domain }}
{% endfor %}
organisationName: {{ organization_name }}
email: {{ organization_email }}
country: {{ organization_country }}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- APP_NAME=${APP_NAME}
- APP_TITLE=${APP_TITLE}
- APP_DOMAIN=${APP_DOMAIN}
- APP_DOMAINS=${APP_DOMAINS}
- APP_DEMO=${APP_DEMO}
- APP_REPRO=${APP_REPRO}
- APP_DESCRIPTION=${APP_DESCRIPTION}
Expand Down

0 comments on commit 1739340

Please sign in to comment.