diff --git a/charts/invoiceninja/Chart.yaml b/charts/invoiceninja/Chart.yaml index 965b06b..9610703 100644 --- a/charts/invoiceninja/Chart.yaml +++ b/charts/invoiceninja/Chart.yaml @@ -13,11 +13,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.2 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 5.1.61 +appVersion: 5.1.64 keywords: - invoiceninja home: https://invoiceninja.github.io/dockerfiles diff --git a/charts/invoiceninja/README.md b/charts/invoiceninja/README.md index f55cf70..d9031a6 100644 --- a/charts/invoiceninja/README.md +++ b/charts/invoiceninja/README.md @@ -1,6 +1,6 @@ # Invoice Ninja Helm Chart -This helm chart installs a Invoice Ninja and its dependencies into a running +This helm chart installs Invoice Ninja (IN) and its dependencies into a running Kubernetes cluster. The chart installs the [Invoice Ninja](https://hub.docker.com/r/invoiceninja/invoiceninja) docker image. @@ -81,12 +81,16 @@ The following table shows the configuration options for the Invoice Ninja helm c | `serviceAccountName` | Name of a service account for the Invoice Ninja pods | `default` | | `debug` | Turn on debug mode on Invoice Ninja | `false` | | `appKey` | Laravel Application Key | _random 32 character alphanumeric string_ | +| `userEmail` | Initial user email address | `admin@example.com` | +| `userPassword` | Initial user password | `changeme!` | | `logChannel` | Name of log channel to use | `nil` | | `broadcastDriver` | Name of broadcast driver to use | `nil` | | `cacheDriver` | Name of cache driver to use | `nil` | | `sessionDriver` | Name of session driver to use | `nil` | | `queueConnection` | Name of queue connection to use | `nil` | | `snappdf` | Use snappdf instead of Phantom JS PDF generation | `true` | +| `mailer` | Name of the mailer to use (log, smtp, etc.) | `log` | +| `requireHttps` | Force HTTPS for internal connections to Invoice Ninja (see #349) | `false` | | `extraEnvVars` | Extra environment variables to be set on Invoice Ninja container | `{}` | | `extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars | `nil` | | `extraEnvVarsSecret` | Name of existing Secret containing extra env vars | `nil` | @@ -258,20 +262,20 @@ helm install invoiceninja -f values.yaml invoiceninja/invoiceninja ## Setting Environment Variables -Should you need to inject any environment variables into the `invoiceninja` container, you can use the `extraEnvVars` option: +Should you need to inject any environment variables such as those in [here](https://github.com/invoiceninja/dockerfiles/blob/master/env) into the `invoiceninja` container, you can use the `extraEnvVars` option: ```yaml # ... values.yaml file -# In this example, we are forcing REQUIRE_HTTPS to be false +# In this example, we are setting the SMTP MAIL_HOST to be 'smtp.mailtrap.io' extraEnvVars: - - name: REQUIRE_HTTPS - value: 'false' # all values must be strings, so other types must be surrounded in quotes + - name: MAIL_HOST + value: 'smtp.mailtrap.io' # all values must be strings, so other types must be surrounded in quotes ``` Alternatively you can provide the name of an existing `configmap` or `secret` object: ```bash -kubectl create configmap examplemap --from-literal=REQUIRE_HTTPS='false' +kubectl create configmap examplemap --from-literal=MAIL_HOST='smtp.mailtrap.io' ``` ```yaml diff --git a/charts/invoiceninja/templates/configmap.yaml b/charts/invoiceninja/templates/configmap.yaml index bdbc7a2..776388b 100644 --- a/charts/invoiceninja/templates/configmap.yaml +++ b/charts/invoiceninja/templates/configmap.yaml @@ -22,15 +22,16 @@ data: APP_URL: "http://{{ include "common.names.fullname" . }}" {{- end }} APP_DEBUG: {{ .Values.debug | quote }} - DB_HOST1: {{ include "invoiceninja.databaseHost" . | quote }} - DB_PORT1: {{ include "invoiceninja.databasePort" . | quote }} - DB_USERNAME1: {{ include "invoiceninja.databaseUser" . | quote }} - DB_DATABASE1: {{ include "invoiceninja.databaseName" . | quote }} + DB_HOST: {{ include "invoiceninja.databaseHost" . | quote }} + DB_PORT: {{ include "invoiceninja.databasePort" . | quote }} + DB_USERNAME: {{ include "invoiceninja.databaseUser" . | quote }} + DB_DATABASE: {{ include "invoiceninja.databaseName" . | quote }} {{- if .Values.logChannel }} LOG_CHANNEL: {{ .Values.logChannel | quote }} {{- else }} LOG_CHANNEL: stderr {{- end }} + MAIL_MAILER: {{ .Values.mailer | quote }} {{- if .Values.broadcastDriver }} BROADCAST_DRIVER: {{ .Values.broadcastDriver | quote }} {{- else if or .Values.redis.enabled .Values.externalRedis.host }} @@ -60,3 +61,4 @@ data: REDIS_CACHE_CONNECTION: {{ include "invoiceninja.redisCacheConnection" . | quote }} REDIS_QUEUE_CONNECTION: {{ include "invoiceninja.redisQueueConnection" . | quote }} SESSION_CONNECTION: {{ include "invoiceninja.redisSessionConnection" . | quote }} + REQUIRE_HTTPS: {{ .Values.requireHttps | quote }} diff --git a/charts/invoiceninja/templates/deployment.yaml b/charts/invoiceninja/templates/deployment.yaml index 1f795b7..8292d47 100644 --- a/charts/invoiceninja/templates/deployment.yaml +++ b/charts/invoiceninja/templates/deployment.yaml @@ -63,12 +63,14 @@ spec: - -cx - | COUNTER=0; - while [ $COUNTER -lt 120 ]; do - if mysqladmin ping -h "$DB_HOST1" -P $DB_PORT1 --silent; then + [[ -z "${DB_HOST1}" ]] || DB_HOST="${DB_HOST1}"; + [[ -z "${DB_PORT1}" ]] || DB_PORT="${DB_PORT1}"; + while [ $COUNTER -lt 120 ]; do + if mysqladmin ping -h "$DB_HOST" -P $DB_PORT --silent; then exit 0; fi; let COUNTER=COUNTER+1; - echo "Waiting for DB ($DB_HOST1:$DB_PORT1)" + echo "Waiting for DB... Trying again in 2s"; sleep 2; done; echo "Did NOT see a database after 240 secs!"; @@ -81,6 +83,18 @@ spec: envFrom: - configMapRef: name: {{ include "common.names.fullname" . }} + {{- if .Values.extraEnvVarsCM }} + - configMapRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }} + {{- end }} + {{- if .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + {{- end }} + env: + {{- if .Values.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- end }} {{- if and .Values.podSecurityContext .Values.volumePermissions.enabled (or .Values.persistence.public.enabled .Values.persistence.storage.enabled) }} - name: volume-permissions image: {{ include "invoiceninja.volumePermissions.image" . }} @@ -148,7 +162,7 @@ spec: name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} {{- end }} env: - - name: DB_PASSWORD1 + - name: DB_PASSWORD valueFrom: secretKeyRef: name: {{ include "invoiceninja.databaseSecretName" . }} @@ -160,6 +174,10 @@ spec: name: {{ include "invoiceninja.redisSecretName" . }} key: redis-password {{- end }} + {{- if .Values.userEmail }} + - name: IN_USER_EMAIL + value: {{ .Values.userEmail | quote }} + {{- end }} {{- if .Values.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} {{- end }} diff --git a/charts/invoiceninja/templates/secret.yaml b/charts/invoiceninja/templates/secret.yaml index d170719..06c1f6b 100644 --- a/charts/invoiceninja/templates/secret.yaml +++ b/charts/invoiceninja/templates/secret.yaml @@ -57,4 +57,7 @@ data: APP_KEY: {{ .Values.appKey | b64enc | quote }} {{- else }} APP_KEY: {{ randAlphaNum 32 | b64enc | quote }} - {{- end }} \ No newline at end of file + {{- end }} + {{- if .Values.userPassword }} + IN_PASSWORD: {{ .Values.userPassword | b64enc | quote }} + {{- end }} diff --git a/charts/invoiceninja/values.yaml b/charts/invoiceninja/values.yaml index 62ef187..c867a94 100644 --- a/charts/invoiceninja/values.yaml +++ b/charts/invoiceninja/values.yaml @@ -18,7 +18,7 @@ image: registry: docker.io repository: invoiceninja/invoiceninja - tag: 5.1.61 + tag: 5.1.64 ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## @@ -38,6 +38,16 @@ debug: false ## appKey: "" +## Email of user to create first run +## If not specified, default user email will be "admin@example.com" +## +userEmail: "" + +## Password of user to create on first run +## If not specified, default user password will be "changeme!" +## +userPassword: "" + ## Name of log channel to use ## logChannel: "" @@ -62,6 +72,16 @@ queueConnection: "" ## snappdf: true +## Name of queue connection to use (use "log" for debug) +## Please check the ref below for any other env you may need to define +## ref: https://github.com/invoiceninja/invoiceninja/blob/v5-stable/config/mail.php +## +mailer: log + +## Force HTTPS for all connections to Invoice Ninja +## +requireHttps: false + ## String to partially override fullname template (will maintain the release name) ## # nameOverride: