From 670ce59c1d5637214bc2829e7261c4941d79f20d Mon Sep 17 00:00:00 2001 From: "J.D. Stone" Date: Wed, 1 Sep 2021 14:38:50 -0700 Subject: [PATCH] Fix OTS chart to use correct host port (#15) * Fix OTS chart to use correct host port * Fixed OTS typos and missing comments for params --- charts/onetimesecret/Chart.yaml | 2 +- charts/onetimesecret/README.md | 72 +++++++++---------- charts/onetimesecret/templates/configmap.yaml | 8 ++- charts/onetimesecret/values.yaml | 12 ++-- 4 files changed, 51 insertions(+), 43 deletions(-) diff --git a/charts/onetimesecret/Chart.yaml b/charts/onetimesecret/Chart.yaml index 493bc7e..512b5b2 100644 --- a/charts/onetimesecret/Chart.yaml +++ b/charts/onetimesecret/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: onetimesecret -version: 0.12.1 +version: 0.12.2 description: A Helm chart for One-Time Secret server type: application keywords: diff --git a/charts/onetimesecret/README.md b/charts/onetimesecret/README.md index abe2e68..edeca51 100644 --- a/charts/onetimesecret/README.md +++ b/charts/onetimesecret/README.md @@ -51,42 +51,42 @@ The command removes all the Kubernetes components associated with the chart and ### Common parameters -| Name | Type | Description | Default | -| ------------------- | ------ | ------------------------------------------------------------------------- | ------- | -| `kubeVersion` | string | Override Kubernetes version | `nil` | -| `nameOverride` | string | Partially override names.fullname | `nil` | -| `fullnameOverride` | string | Fully override names.fullname | `nil` | -| `commonLabels` | object | Labels to add to all deployed objects | `{}` | -| `commonAnnotations` | object | Annotations to add to all deployed objects | `{}` | -| `networkPort` | int | Deployment container, Deployment livenessProbe, Ingress, and Service port | `3000` | +| Name | Type | Description | Default | +| ------------------ | ------ | ------------------------------------------------------------------------- | ------- | +| `kubeVersion` | string | Override Kubernetes version | `nil` | +| `nameOverride` | string | Partially override names.fullname | `nil` | +| `fullnameOverride` | string | Fully override names.fullname | `nil` | +| `commonLabels` | object | Labels to add to all deployed objects | `{}` | +| `networkPort` | int | Deployment container, Deployment livenessProbe, Ingress, and Service port | `3000` | ### One-Time Secret configuration parameters -| Name | Type | Description | Default | -| ---------------------------------------- | ------- | ----------------------------------------------------------------------------------- | --------------------------- | -| `configuration.host` | string | OTS host (the domain you will access OTS at) | `"localhost"` | -| `configuration.ssl` | boolean | Enable SSL (HTTPS) support | `false` | -| `configuration.baseRedisUrl` | string | Base Redis URL (see values.yaml for more info) | `""` | -| `configuration.colonels` | string | OTS account created with this email is automatically considered admin of the system | `""` | -| `configuration.secret` | string | Used to encrypt OTS secrets - don't forget this, save it somewhere safe | `"CHANGEME"` | -| `configuration.emailer.sendgridEnabled` | boolean | Use SendGrid to allow OTS the ability to send emails | `false` | -| `configuration.emailer.smtpEnabled` | boolean | Use SMTP to allow OTS the ability to send emails | `false` | -| `configuration.emailer.from` | string | SendGrid/SMTP email sender "from" email address | `""` | -| `configuration.emailer.sendgridAccount` | string | SendGrid account login | `"CHANGEME"` | -| `configuration.emailer.sendgridPassword` | string | SendGrid account password | `"CHANGEME"` | -| `configuration.emailer.sendgridFromName` | string | SendGrid email sender "From" name | `"CHANGEME"` | -| `configuration.emailer.sendgridBcc` | string | SendGrid email BCC field | `nil` | -| `configuration.emailer.smtpHost` | string | SMTP hostname | `"localhost"` | -| `configuration.emailer.smtpPort` | int | SMTP port | `587` | -| `configuration.emailer.smtpTls` | boolean | Enable/Disable TLS for SMTP | `false` | -| `configuration.emailer.smtpUser` | string | SMTP username | `nil` | -| `configuration.emailer.smtpPass` | string | SMTP password | `nil` | -| `configuration.emailer.smtpAuth` | string | SMTP authentication type. Allowed values: `plain` or `login` | `nil` | -| `configuration.incoming.enabled` | boolean | Intended for use by IT support teams who need someone to send them sensitive info | `false` | -| `configuration.incoming.email` | string | Where the secret link is sent | `"CHANGEME@example.com"` | -| `configuration.incoming.passphrase` | string | Used to protect the "secret" | `"CHANGEME"` | -| `configuration.incoming.regex` | string | Used to ensure the ticket number is valid | `'\A[a-zA-Z0-9]{6}\z'` | +| Name | Type | Description | Default | +| ---------------------------------------- | ------- | ----------------------------------------------------------------------------------- | ------------------------ | +| `configuration.host` | string | OTS host (the domain you will access OTS at) | `"localhost"` | +| `configuration.hostPort` | int | OTS host port (the HTTP port used to access OTS) | `nil` | +| `configuration.ssl` | boolean | Enable SSL (HTTPS) support | `false` | +| `configuration.baseRedisUrl` | string | Base Redis URL (see values.yaml for more info) | `""` | +| `configuration.colonels` | string | OTS account created with this email is automatically considered admin of the system | `""` | +| `configuration.secret` | string | Used to encrypt OTS secrets - don't forget this, save it somewhere safe | `"CHANGEME"` | +| `configuration.emailer.sendgridEnabled` | boolean | Use SendGrid to allow OTS the ability to send emails | `false` | +| `configuration.emailer.smtpEnabled` | boolean | Use SMTP to allow OTS the ability to send emails | `false` | +| `configuration.emailer.from` | string | SendGrid/SMTP email sender "from" email address | `""` | +| `configuration.emailer.sendgridAccount` | string | SendGrid account login | `"CHANGEME"` | +| `configuration.emailer.sendgridPassword` | string | SendGrid account password | `"CHANGEME"` | +| `configuration.emailer.sendgridFromName` | string | SendGrid email sender "From" name | `"CHANGEME"` | +| `configuration.emailer.sendgridBcc` | string | SendGrid email BCC field | `nil` | +| `configuration.emailer.smtpHost` | string | SMTP hostname | `"localhost"` | +| `configuration.emailer.smtpPort` | int | SMTP port | `587` | +| `configuration.emailer.smtpTls` | boolean | Enable/Disable TLS for SMTP | `false` | +| `configuration.emailer.smtpUser` | string | SMTP username | `nil` | +| `configuration.emailer.smtpPass` | string | SMTP password | `nil` | +| `configuration.emailer.smtpAuth` | string | SMTP authentication type. Allowed values: `plain` or `login` | `nil` | +| `configuration.incoming.enabled` | boolean | Intended for use by IT support teams who need someone to send them sensitive info | `false` | +| `configuration.incoming.email` | string | Where the secret link is sent | `"CHANGEME@example.com"` | +| `configuration.incoming.passphrase` | string | Used to protect the "secret" | `"CHANGEME"` | +| `configuration.incoming.regex` | string | Used to ensure the ticket number is valid | `'\A[a-zA-Z0-9]{6}\z'` | ### Deployment parameters @@ -116,10 +116,10 @@ The command removes all the Kubernetes components associated with the chart and ### Service parameters -| Name | Type | Description | Default | -| ---------------| ------- | ------------------------------------------- | ------------ | -| `service.port` | int | OTS Service port (overrides `networkPort`) | `nil` | -| `service.type` | string | OTS Service Type | `"NodePort"` | +| Name | Type | Description | Default | +| ---------------| ------ | ------------------------------------------ | ------------ | +| `service.port` | int | OTS Service port (overrides `networkPort`) | `nil` | +| `service.type` | string | OTS Service Type | `"NodePort"` | ### Ingress parameters diff --git a/charts/onetimesecret/templates/configmap.yaml b/charts/onetimesecret/templates/configmap.yaml index f894d26..b426532 100644 --- a/charts/onetimesecret/templates/configmap.yaml +++ b/charts/onetimesecret/templates/configmap.yaml @@ -10,8 +10,12 @@ metadata: data: config: | :site: - :host: {{ print .Values.configuration.host ":" .Values.networkPort | squote }} - :domain: {{ required "'configuration.host' is required!" .Values.configuration.host }} + {{- if .Values.configuration.hostPort }} + :host: {{ print .Values.configuration.host ":" .Values.configuration.hostPort | squote }} + {{- else }} + :host: {{ .Values.configuration.host | squote }} + {{- end }} + :domain: {{ required "'configuration.host' is required!" .Values.configuration.host | squote }} :ssl: <%= {{ .Values.configuration.ssl | squote }} == 'true' %> :secret: <%= ENV['ONETIMESECRET_SECRET'] || 'CHANGEME' %> :redis: diff --git a/charts/onetimesecret/values.yaml b/charts/onetimesecret/values.yaml index 6e589a9..2699d86 100644 --- a/charts/onetimesecret/values.yaml +++ b/charts/onetimesecret/values.yaml @@ -1,15 +1,15 @@ ## @section Common parameters -## @param kubeVersion Override Kubernetes version +## @param {string} kubeVersion - Override Kubernetes version ## kubeVersion: -## @param nameOverride String to partially override names.fullname +## @param {string} nameOverride - Partially override `names.fullname` ## nameOverride: -## @param fullnameOverride String to fully override names.fullname +## @param {string} fullnameOverride - Fully override `names.fullname` ## fullnameOverride: -## @param commonLabels Labels to add to all deployed objects +## @param {object} commonLabels - Labels to add to all deployed objects ## commonLabels: {} @@ -20,6 +20,10 @@ configuration: ## @param {string} configuration.host - Host/domain for accessing the website ## host: "localhost" + ## @param {int} configuration.hostPort - Host/domain port for accessing the website + ## Set a port if using something other than port 80 + ## + hostPort: ## @param {boolean} configuration.ssl - Enable/disable SSL support ## ssl: false