Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce best practices #132

Merged
merged 2 commits into from
Mar 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 59 additions & 14 deletions charts/ocis/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{{- $idm := and (not .Values.features.externalUserManagement.enabled) (not .Values.services.idm.persistence.enabled) -}}
{{- $nats := and (not .Values.messagingSystem.external.enabled) (not .Values.services.nats.persistence.enabled) -}}
{{- $search := not .Values.services.search.persistence.enabled -}}
{{- $storageSystem := not .Values.services.storageSystem.persistence.enabled -}}
{{- $storageUsers := not .Values.services.storageUsers.persistence.enabled -}}
{{- $store := not .Values.services.store.persistence.enabled -}}

You're now running
,----.. ,---, .--.--.
/ / \ ,`--.' | / / '.
Expand All @@ -25,28 +18,80 @@ You can get the initial "admin" administrator user password by running:

kubectl -n <namespace> get secrets/admin-user --template='{{"{{"}}.data.password | base64decode{{"}}"}}'

{{ if or $storageSystem $storageUsers $store $idm $search $nats }}
{{ $noExternalUserManagement := not .Values.features.externalUserManagement.enabled -}}
{{- $noopCache := eq .Values.cache.type "noop" -}}
{{- $basicAuth := .Values.features.basicAuthentication -}}
{{- $demoUsers := .Values.features.demoUsers -}}
{{- $oidcIdpInsecure := .Values.insecure.oidcIdpInsecure -}}
{{- $ocisHttpApiInsecure := .Values.insecure.ocisHttpApiInsecure -}}
{{- $externalLDAPinsecure := and .Values.features.externalUserManagement.enabled .Values.features.externalUserManagement.ldap.insecure -}}
{{- $noSMTPencryption := and .Values.features.emailNotifications.enabled (eq .Values.cache.type "noop") -}}

{{ if or $noExternalUserManagement $noopCache $basicAuth $demoUsers $oidcIdpInsecure $ocisHttpApiInsecure $externalLDAPinsecure $noSMTPencryption }}
#################################################################################
###### WARNING: Your deployment of oCIS does not follow all best #####
###### practices for production deployments of oCIS. #####
###### #####
###### Following best practices are not applied: #####
{{- if $noExternalUserManagement}}
###### - `features.externalUserManagement.enabled` should be #####
###### set to `true`. #####
{{- end }}
{{- if $noopCache}}
###### - `cache.type` should not be set to `noop` #####
{{- end }}
{{- if $basicAuth}}
###### - `features.basicAuthentication` should be set to `false` #####
{{- end }}
{{- if $demoUsers}}
###### - `features.demoUsers` should be set to `false` #####
{{- end }}
{{- if $oidcIdpInsecure}}
###### - `insecure.oidcIdpInsecure` should be set to `false` #####
{{- end }}
{{- if $ocisHttpApiInsecure}}
###### - `insecure.ocisHttpApiInsecure` should be set to `false` #####
{{- end }}
{{- if $externalLDAPinsecure}}
###### - `features.externalUserManagement.ldap.insecure` should #####
###### be set to `false` #####
{{- end }}
{{- if $noSMTPencryption}}
d7oc marked this conversation as resolved.
Show resolved Hide resolved
###### - `features.emailNotifications.enabled` should be set to `false` #####
{{- end }}
#################################################################################
{{ end }}


{{- $idmUnpersisted := and (not .Values.features.externalUserManagement.enabled) (not .Values.services.idm.persistence.enabled) -}}
{{- $natsUnpersisted := and (not .Values.messagingSystem.external.enabled) (not .Values.services.nats.persistence.enabled) -}}
{{- $searchUnpersisted := not .Values.services.search.persistence.enabled -}}
{{- $storageSystemUnpersisted := not .Values.services.storageSystem.persistence.enabled -}}
{{- $storageUsersUnpersisted := not .Values.services.storageUsers.persistence.enabled -}}
{{- $storeUnpersisted := not .Values.services.store.persistence.enabled -}}

{{ if or $storageSystemUnpersisted $storageUsersUnpersisted $storeUnpersisted $idmUnpersisted $searchUnpersisted $natsUnpersisted }}
#################################################################################
###### WARNING: Persistence is disabled for some services. #####
###### You will lose your data when a service's pod is terminated. #####
###### #####
###### Following services don't use persistence: #####
{{- if $storageUsers }}
{{- if $storageUsersUnpersisted }}
###### - storage-users #####
{{- end }}
{{- if $storageSystem }}
{{- if $storageSystemUnpersisted }}
###### - storage-system #####
{{- end }}
{{- if $idm }}
{{- if $idmUnpersisted }}
###### - idm #####
{{- end }}
{{- if $store }}
{{- if $storeUnpersisted }}
###### - store #####
{{- end }}
{{- if $search }}
{{- if $searchUnpersisted }}
###### - search #####
{{- end }}
{{- if $nats }}
{{- if $natsUnpersisted }}
###### - nats #####
{{- end }}
#################################################################################
Expand Down