From e9478d55f3b1be10ed42df163cbe8a9f0240cd99 Mon Sep 17 00:00:00 2001 From: christianhuth Date: Thu, 30 Jan 2025 11:49:39 +0000 Subject: [PATCH 01/12] bump app version and all dependencies, add different values for ci --- charts/shlink-backend/Chart.yaml | 38 ++++++++++++------- .../shlink-backend/ci/01-mariadb-values.yaml | 3 ++ charts/shlink-backend/ci/02-mysql-values.yaml | 3 ++ .../ci/03-postgresql-values.yaml | 3 ++ .../shlink-backend/ci/04-rabbitmq-values.yaml | 3 ++ charts/shlink-backend/ci/05-redis-values.yaml | 3 ++ charts/shlink-backend/values.yaml | 2 +- 7 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 charts/shlink-backend/ci/01-mariadb-values.yaml create mode 100644 charts/shlink-backend/ci/02-mysql-values.yaml create mode 100644 charts/shlink-backend/ci/03-postgresql-values.yaml create mode 100644 charts/shlink-backend/ci/04-rabbitmq-values.yaml create mode 100644 charts/shlink-backend/ci/05-redis-values.yaml diff --git a/charts/shlink-backend/Chart.yaml b/charts/shlink-backend/Chart.yaml index 3a4c1b639..8bd36b2b8 100644 --- a/charts/shlink-backend/Chart.yaml +++ b/charts/shlink-backend/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: shlink-backend description: A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain. type: application -version: 4.5.5 -appVersion: "3.7.4" +version: 5.0.0 +appVersion: "4.4.0" home: https://github.com/christianhuth/helm-charts icon: https://shlink.io/images/shlink-logo-blue.svg maintainers: @@ -14,29 +14,39 @@ sources: - https://shlink.io dependencies: - name: mariadb - repository: https://charts.bitnami.com/bitnami - version: 16.5.0 + repository: oci://registry-1.docker.io/bitnamicharts + version: 20.2.1 condition: mariadb.enabled - name: mysql - repository: https://charts.bitnami.com/bitnami - version: 9.23.0 + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.2.2 condition: mysql.enabled - name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 14.3.3 + repository: oci://registry-1.docker.io/bitnamicharts + version: 16.4.5 condition: postgresql.enabled - name: rabbitmq - repository: https://charts.bitnami.com/bitnami - version: 12.15.0 + repository: oci://registry-1.docker.io/bitnamicharts + version: 15.2.3 condition: rabbitmq.enabled - name: redis - repository: https://charts.bitnami.com/bitnami - version: 18.19.4 + repository: oci://registry-1.docker.io/bitnamicharts + version: 20.6.3 condition: redis.enabled annotations: artifacthub.io/changes: | - - kind: added - description: Changelog + - kind: changed + description: app version to 4.4.0 + - kind: changed + description: dependency to mariadb to 20.2.1 + - kind: changed + description: dependency to mysql to 12.2.2 + - kind: changed + description: dependency to postgresql to 16.4.5 + - kind: changed + description: dependency to rabbitmq to 15.2.3 + - kind: changed + description: dependency to redis to 20.6.3 artifacthub.io/signKey: | fingerprint: EE24F8BB6D099E78FD704F83B5ECDBCDDD485D0E url: https://charts.christianhuth.de/public.key diff --git a/charts/shlink-backend/ci/01-mariadb-values.yaml b/charts/shlink-backend/ci/01-mariadb-values.yaml new file mode 100644 index 000000000..a4c88595d --- /dev/null +++ b/charts/shlink-backend/ci/01-mariadb-values.yaml @@ -0,0 +1,3 @@ +--- +mariadb: + enabled: true diff --git a/charts/shlink-backend/ci/02-mysql-values.yaml b/charts/shlink-backend/ci/02-mysql-values.yaml new file mode 100644 index 000000000..ab4187ef2 --- /dev/null +++ b/charts/shlink-backend/ci/02-mysql-values.yaml @@ -0,0 +1,3 @@ +--- +mysql: + enabled: true diff --git a/charts/shlink-backend/ci/03-postgresql-values.yaml b/charts/shlink-backend/ci/03-postgresql-values.yaml new file mode 100644 index 000000000..334482a3d --- /dev/null +++ b/charts/shlink-backend/ci/03-postgresql-values.yaml @@ -0,0 +1,3 @@ +--- +postgresql: + enabled: true diff --git a/charts/shlink-backend/ci/04-rabbitmq-values.yaml b/charts/shlink-backend/ci/04-rabbitmq-values.yaml new file mode 100644 index 000000000..2d238129e --- /dev/null +++ b/charts/shlink-backend/ci/04-rabbitmq-values.yaml @@ -0,0 +1,3 @@ +--- +rabbitmq: + enabled: true diff --git a/charts/shlink-backend/ci/05-redis-values.yaml b/charts/shlink-backend/ci/05-redis-values.yaml new file mode 100644 index 000000000..f94feb642 --- /dev/null +++ b/charts/shlink-backend/ci/05-redis-values.yaml @@ -0,0 +1,3 @@ +--- +redis: + enabled: true diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index fd1a9e48b..6d93e0add 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -9,7 +9,7 @@ image: # -- image pull policy pullPolicy: Always # -- Overrides the image tag - tag: "3.7.4" + tag: "4.4.0" # -- If defined, uses a Secret to pull an image from a private Docker registry or repository. imagePullSecrets: [] From bcacade79a28e4020a925f2c038a0a4320318025 Mon Sep 17 00:00:00 2001 From: christianhuth Date: Thu, 30 Jan 2025 11:50:09 +0000 Subject: [PATCH 02/12] chore: auto-upgrade schema and readme --- charts/shlink-backend/README.md | 2 +- charts/shlink-backend/values.schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/shlink-backend/README.md b/charts/shlink-backend/README.md index dcb156e8a..850db579f 100644 --- a/charts/shlink-backend/README.md +++ b/charts/shlink-backend/README.md @@ -58,7 +58,7 @@ The command removes all the Kubernetes components associated with the chart and | fullnameOverride | string | `""` | String to fully override `"shlink-backend.fullname"` | | image.pullPolicy | string | `"Always"` | image pull policy | | image.repository | string | `"shlinkio/shlink"` | image repository | -| image.tag | string | `"3.7.4"` | Overrides the image tag | +| image.tag | string | `"4.4.0"` | Overrides the image tag | | imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json index f33f13af2..43426fdc4 100644 --- a/charts/shlink-backend/values.schema.json +++ b/charts/shlink-backend/values.schema.json @@ -126,7 +126,7 @@ "type": "string" }, "tag": { - "default": "3.7.4", + "default": "4.4.0", "description": "Overrides the image tag", "required": [], "title": "tag", From 363f6a579b4c21add2ee937fab9f03d606b16099 Mon Sep 17 00:00:00 2001 From: christianhuth Date: Thu, 30 Jan 2025 12:29:09 +0000 Subject: [PATCH 03/12] chore: auto-upgrade schema and readme --- charts/shlink-backend/CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/charts/shlink-backend/CHANGELOG.md b/charts/shlink-backend/CHANGELOG.md index 6432816e5..aaa2da77b 100644 --- a/charts/shlink-backend/CHANGELOG.md +++ b/charts/shlink-backend/CHANGELOG.md @@ -1,7 +1,12 @@ # shlink-backend -## 4.5.5 +## 5.0.0 -### Added +### Changed -- Changelog +- app version to 4.4.0 +- dependency to mariadb to 20.2.1 +- dependency to mysql to 12.2.2 +- dependency to postgresql to 16.4.5 +- dependency to rabbitmq to 15.2.3 +- dependency to redis to 20.6.3 From a484735843092a19a5a8f34c862679a3fd165635 Mon Sep 17 00:00:00 2001 From: christianhuth Date: Thu, 30 Jan 2025 16:02:33 +0000 Subject: [PATCH 04/12] wip --- charts/shlink-backend/Chart.yaml | 6 + .../templates/database/_database.tpl | 144 +++++ .../templates/database/secret.yaml | 9 + .../shlink-backend/templates/deployment.yaml | 220 +++++-- .../templates/matomo/_matomo.tpl | 12 + .../templates/matomo/secret.yaml | 9 + .../templates/mercure/_mercure.tpl | 12 + .../templates/mercure/secret.yaml | 9 + .../shlink-backend/templates/redis/_redis.tpl | 28 + charts/shlink-backend/values-dev.yaml | 27 + charts/shlink-backend/values.schema.json | 578 ------------------ charts/shlink-backend/values.yaml | 144 ++++- 12 files changed, 567 insertions(+), 631 deletions(-) create mode 100644 charts/shlink-backend/templates/database/_database.tpl create mode 100644 charts/shlink-backend/templates/database/secret.yaml create mode 100644 charts/shlink-backend/templates/matomo/_matomo.tpl create mode 100644 charts/shlink-backend/templates/matomo/secret.yaml create mode 100644 charts/shlink-backend/templates/mercure/_mercure.tpl create mode 100644 charts/shlink-backend/templates/mercure/secret.yaml create mode 100644 charts/shlink-backend/templates/redis/_redis.tpl create mode 100644 charts/shlink-backend/values-dev.yaml delete mode 100644 charts/shlink-backend/values.schema.json diff --git a/charts/shlink-backend/Chart.yaml b/charts/shlink-backend/Chart.yaml index 8bd36b2b8..459f2ec95 100644 --- a/charts/shlink-backend/Chart.yaml +++ b/charts/shlink-backend/Chart.yaml @@ -47,6 +47,12 @@ annotations: description: dependency to rabbitmq to 15.2.3 - kind: changed description: dependency to redis to 20.6.3 + - kind: changed + description: option to define additional environment variables (extraEnv) + - kind: added + description: option to define image registry (image.registry) + - kind: added + description: options to define the configuration (config.*) artifacthub.io/signKey: | fingerprint: EE24F8BB6D099E78FD704F83B5ECDBCDDD485D0E url: https://charts.christianhuth.de/public.key diff --git a/charts/shlink-backend/templates/database/_database.tpl b/charts/shlink-backend/templates/database/_database.tpl new file mode 100644 index 000000000..81509cfc3 --- /dev/null +++ b/charts/shlink-backend/templates/database/_database.tpl @@ -0,0 +1,144 @@ +{{/* +Define the database driver +*/}} +{{- define "shlink-backend.database.driver" -}} +{{- $driver := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $driver = "maria" -}} +{{- else if .Values.mysql.enabled -}} + {{- $driver = "mysql" -}} +{{- else if .Values.postgresql.enabled -}} + {{- $driver = "postgres" -}} +{{- else -}} + {{- $driver = .Values.config.database.driver -}} +{{- end -}} +{{- if not $driver -}} + {{- fail "Unable to determine the database driver. Use config.database.driver or activate one of the integrated databases" -}} +{{- end -}} +{{- $driver -}} +{{- end }} + +{{/* +Define the database host +*/}} +{{- define "shlink-backend.database.host" -}} +{{- $host := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $host = (include "mariadb.primary.fullname" .Subcharts.mariadb) -}} +{{- else if .Values.mysql.enabled -}} + {{- $host = (include "mysql.primary.fullname" .Subcharts.mysql) -}} +{{- else if .Values.postgresql.enabled -}} + {{- $host = (include "postgresql.v1.primary.fullname" .Subcharts.postgresql) -}} +{{- else -}} + {{- $host = .Values.config.database.host -}} +{{- end -}} +{{- if not $host -}} + {{- fail "Unable to determine the database host. Use config.database.host or activate one of the integrated databases" -}} +{{- end -}} +{{- $host -}} +{{- end }} + +{{/* +Define the database port +*/}} +{{- define "shlink-backend.database.port" -}} +{{- $port := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $port = .Values.mariadb.primary.service.ports.mysql -}} +{{- else if .Values.mysql.enabled -}} + {{- $port = .Values.mysql.primary.service.ports.mysql -}} +{{- else if .Values.postgresql.enabled -}} + {{- $port = (include "postgresql.v1.service.port" .Subcharts.postgresql) -}} +{{- else -}} + {{- $port = .Values.config.database.port -}} +{{- end -}} +{{- if not $port -}} + {{- $driver := (include "shlink-backend.database.driver" .) -}} + {{- if (eq $driver "maria") -}} + {{- $port = 3306 -}} + {{- else if (eq $driver "mysql") -}} + {{- $port = 3306 -}} + {{- else if (eq $driver "postgres") -}} + {{- $port = 5432 -}} + {{- else if (eq $driver "sqlite") -}} + {{- $port = 0 -}} + {{- end -}} +{{- end -}} +{{- $port -}} +{{- end }} + +{{/* +Define the database username +*/}} +{{- define "shlink-backend.database.auth.username" -}} +{{- $username := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $username = .Values.mariadb.auth.username -}} +{{- else if .Values.mysql.enabled -}} + {{- $username = .Values.mysql.auth.username -}} +{{- else if .Values.postgresql.enabled -}} + {{- $username = (include "postgresql.v1.username" .Subcharts.postgresql) -}} +{{- else -}} + {{- $username = .Values.config.database.auth.username -}} +{{- end -}} +{{- if not $username -}} + {{- fail "Unable to determine the database username. Use config.database.auth.username or activate one of the integrated databases" -}} +{{- end -}} +{{- $username -}} +{{- end }} + +{{/* +Define the name of the database +*/}} +{{- define "shlink-backend.database.auth.database" -}} +{{- $database := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $database = .Values.mariadb.auth.database -}} +{{- else if .Values.mysql.enabled -}} + {{- $database = .Values.mysql.auth.database -}} +{{- else if .Values.postgresql.enabled -}} + {{- $database = (include "postgresql.v1.database" .Subcharts.postgresql) -}} +{{- else -}} + {{- $database = .Values.config.database.auth.database -}} +{{- end -}} +{{- if not $database -}} + {{- fail "Unable to determine the database name. Use config.database.auth.database or activate one of the integrated databases" -}} +{{- end -}} +{{- $database -}} +{{- end }} + +{{/* +Get the name of the secret containing the database password +*/}} +{{- define "shlink-backend.database.auth.secretName" -}} +{{- $secretName := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $secretName = (include "mariadb.secretName" .Subcharts.mariadb) -}} +{{- else if .Values.mysql.enabled -}} + {{- $secretName = (include "mysql.secretName" .Subcharts.mysql) -}} +{{- else if .Values.postgresql.enabled -}} + {{- $secretName = (include "postgresql.v1.secretName" .Subcharts.postgresql) -}} +{{- else if .Values.config.database.auth.existingSecret -}} + {{- $secretName = .Values.config.database.auth.existingSecret -}} +{{- else -}} + {{- $secretName = printf "%s-database" (include "shlink-backend.fullname" .) -}} +{{- end -}} +{{- $secretName -}} +{{- end -}} + +{{/* +Get the key of the secret containing the database password +*/}} +{{- define "shlink-backend.database.auth.secretKey" -}} +{{- $secretKey := "" -}} +{{- if .Values.mariadb.enabled -}} + {{- $secretKey = "mariadb-password" -}} +{{- else if .Values.mysql.enabled -}} + {{- $secretKey = "mysql-password" -}} +{{- else if .Values.postgresql.enabled -}} + {{- $secretKey = (include "postgresql.v1.userPasswordKey" .Subcharts.postgresql) -}} +{{- else -}} + {{- $secretKey = "database-password" -}} +{{- end -}} +{{- $secretKey -}} +{{- end -}} diff --git a/charts/shlink-backend/templates/database/secret.yaml b/charts/shlink-backend/templates/database/secret.yaml new file mode 100644 index 000000000..477b894d7 --- /dev/null +++ b/charts/shlink-backend/templates/database/secret.yaml @@ -0,0 +1,9 @@ +{{- if and (not .Values.config.database.auth.existingSecret) (not .Values.mariadb.enabled) (not .Values.mysql.enabled) (not .Values.postgresql.enabled) -}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "shlink-backend.database.auth.secretName" . }} +data: + {{- include "shlink-backend.database.auth.secretKey" . | nindent 2 }}: {{ .Values.config.database.auth.password | b64enc }} +{{- end }} diff --git a/charts/shlink-backend/templates/deployment.yaml b/charts/shlink-backend/templates/deployment.yaml index 9f4133ee6..4cf80d47d 100644 --- a/charts/shlink-backend/templates/deployment.yaml +++ b/charts/shlink-backend/templates/deployment.yaml @@ -36,66 +36,136 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - {{- toYaml .Values.env | nindent 12 }} - # MariaDB Settings - {{- if and .Values.mariadb.enabled (not .Values.mysql.enabled) (not .Values.postgresql.enabled) }} + # Database Settings - name: DB_DRIVER - value: mariadb + value: {{ include "shlink-backend.database.driver" . | quote }} - name: DB_HOST - value: {{ include "mariadb.primary.fullname" .Subcharts.mariadb }} - - name: DB_PORT - value: {{ coalesce .Values.mariadb.primary.service.ports.mysql .Values.mariadb.primary.service.port | quote }} + value: {{ include "shlink-backend.database.host" . | quote }} - name: DB_NAME - value: {{ .Values.mariadb.auth.database | quote }} - - name: DB_USER - value: {{ .Values.mariadb.auth.username | quote }} + value: {{ include "shlink-backend.database.auth.database" . | quote }} - name: DB_PASSWORD valueFrom: secretKeyRef: - name: {{ template "mariadb.secretName" .Subcharts.mariadb }} - key: mariadb-password - {{- end }} - # MySQL Settings - {{- if and (not .Values.mariadb.enabled) .Values.mysql.enabled (not .Values.postgresql.enabled) }} - - name: DB_DRIVER - value: mysql - - name: DB_HOST - value: {{ include "mysql.primary.fullname" .Subcharts.mysql }} + name: {{ include "shlink-backend.database.auth.secretName" . | quote }} + key: {{ include "shlink-backend.database.auth.secretKey" . | quote }} - name: DB_PORT - value: {{ .Values.mysql.primary.service.ports.mysql | quote }} - - name: DB_NAME - value: {{ .Values.mysql.auth.database | quote }} + value: {{ include "shlink-backend.database.port" . | quote }} + - name: DB_USE_ENCRYPTION + value: {{ .Values.config.database.useEncryption | quote }} - name: DB_USER - value: {{ .Values.mysql.auth.username | quote }} - - name: DB_PASSWORD + value: {{ include "shlink-backend.database.auth.username" . | quote }} + + # Docker Settings + - name: PORT + value: {{ .Values.service.port | int }} + + # General Settings + {{- if .Values.config.general.basePath }} + - name: BASE_PATH + value: {{ .Values.config.general.basePath | quote }} + {{- end }} + {{- if .Values.config.general.cacheNamespace }} + - name: CACHE_NAMESPACE + value: {{ .Values.config.general.cacheNamespace | quote }} + {{- end }} + {{- if .Values.config.general.defaultDomain }} + - name: DEFAULT_DOMAIN + value: {{ .Values.config.general.defaultDomain | quote }} + {{- end }} + {{- if .Values.config.general.initialApiKey }} + - name: INITIAL_API_KEY + value: {{ .Values.config.general.initialApiKey | quote }} + {{- end }} + - name: IS_HTTPS_ENABLED + value: {{ .Values.config.general.isHttpsEnabled | quote }} + {{- if .Values.config.general.memoryLimit }} + - name: MEMORY_LIMIT + value: {{ .Values.config.general.memoryLimit | quote }} + {{- end }} + {{- if .Values.config.general.timezone }} + - name: TIMEZONE + value: {{ .Values.config.general.timezone | quote }} + {{- end }} + + # Geolite Settings + {{- if .Values.config.geolite.licenseKey }} + - name: GEOLITE_LICENSE_KEY + value: {{ .Values.config.geolite.licenseKey | quote }} + {{- end }} + - name: SKIP_INITIAL_GEOLITE_DOWNLOAD + value: {{ .Values.config.geolite.skipInitialDownload | quote }} + + {{- if .Values.config.matomo.enabled }} + # Matomo Settings + - name: MATOMO_ENABLED + value: {{ .Values.config.matomo.enabled | quote }} + {{- if or (.Values.config.matomo.auth.apiToken) (.Values.config.matomo.auth.existingSecret) }} + - name: MATOMO_API_TOKEN valueFrom: secretKeyRef: - name: {{ template "mysql.secretName" .Subcharts.mysql }} - key: mysql-password + name: {{ include "shlink-backend.matomo.auth.secretName" . }} + key: api-token {{- end }} - # PostgreSQL Settings - {{- if and (not .Values.mariadb.enabled) (not .Values.mysql.enabled) .Values.postgresql.enabled }} - - name: DB_DRIVER - value: postgres - - name: DB_HOST - value: {{ include "postgresql.v1.primary.fullname" .Subcharts.postgresql }} - - name: DB_PORT - value: {{ include "postgresql.v1.service.port" .Subcharts.postgresql | quote }} - - name: DB_NAME - value: {{ include "postgresql.v1.database" .Subcharts.postgresql }} - - name: DB_USER - value: {{ include "postgresql.v1.username" .Subcharts.postgresql }} - - name: DB_PASSWORD + {{- if .Values.config.matomo.baseUrl }} + - name: MATOMO_BASE_URL + value: {{ .Values.config.matomo.baseUrl | quote }} + {{- end }} + {{- if .Values.config.matomo.siteId }} + - name: MATOMO_SITE_ID + value: {{ .Values.config.matomo.siteId | quote }} + {{- end }} + {{- end }} + + {{- if .Values.config.mercure.enabled }} + # Mercure Hub Settings + {{- if .Values.config.mercure.internalHubUrl }} + - name: MERCURE_INTERNAL_HUB_URL + value: {{ .Values.config.mercure.internalHubUrl | quote }} + {{- end }} + {{- if or (.Values.config.mercure.auth.jwtSecret) (.Values.config.mercure.auth.existingSecret) }} + - name: MERCURE_JWT_SECRET valueFrom: secretKeyRef: - name: {{ template "postgresql.v1.secretName" .Subcharts.postgresql }} - key: {{ template "postgresql.v1.userPasswordKey" .Subcharts.postgresql }} + name: {{ include "shlink-backend.mercure.auth.secretName" . }} + key: jwt-secret {{- end }} - # RabbitMQ Settings + {{- if .Values.config.mercure.publicHubUrl }} + - name: MERCURE_PUBLIC_HUB_URL + value: {{ .Values.config.mercure.publicHubUrl | quote }} + {{- end }} + {{- end }} + + # Redirects Settings + {{- if .Values.config.redirects.defaultBaseUrlRedirect }} + - name: DEFAULT_BASE_URL_REDIRECT + value: {{ .Values.config.redirects.defaultBaseUrlRedirect | quote }} + {{- end }} + {{- if .Values.config.redirects.defaultInvalidShortUrlRedirect }} + - name: DEFAULT_INVALID_SHORT_URL_REDIRECT + value: {{ .Values.config.redirects.defaultInvalidShortUrlRedirect | quote }} + {{- end }} + {{- if .Values.config.redirects.defaultRegular404Redirect }} + - name: DEFAULT_REGULAR_404_REDIRECT + value: {{ .Values.config.redirects.defaultRegular404Redirect | quote }} + {{- end }} + {{- if .Values.config.redirects.cacheLifetime }} + - name: REDIRECT_CACHE_LIFETIME + value: {{ .Values.config.redirects.cacheLifetime | quote }} + {{- end }} + {{- if .Values.config.redirects.extraPathMode }} + - name: REDIRECT_EXTRA_PATH_MODE + value: {{ .Values.config.redirects.extraPathMode | quote }} + {{- end }} + {{- if .Values.config.redirects.statusCode }} + - name: REDIRECT_STATUS_CODE + value: {{ .Values.config.redirects.statusCode | quote }} + {{- end }} + {{- if .Values.rabbitmq.enabled }} + # RabbitMQ Settings - name: RABBITMQ_ENABLED value: "true" - name: RABBITMQ_HOST @@ -114,14 +184,72 @@ spec: name: {{ template "rabbitmq.secretPasswordName" .Subcharts.rabbitmq }} key: rabbitmq-password {{- end }} + + {{- if (include "shlink-backend.redis.enabled" .) }} # Redis Settings - {{- if .Values.redis.enabled }} + - name: REDIS_PUB_SUB_ENABLED + value: {{ .Values.config.redis.pubSubEnabled | quote }} - name: REDIS_SERVERS - value: {{ printf "%s-master" (include "common.names.fullname" .Subcharts.redis) }}:{{ .Values.redis.master.service.ports.redis }} + value: {{ include "shlink-backend.redis.enabled" . | quote }} + {{- end }} + + # Robot.txt Settings + - name: ROBOTS_ALLOW_ALL_SHORT_URLS + value: {{ .Values.config.robots.allowAllShortUrls | quote }} + {{- if .Values.config.robots.userAgents }} + - name: ROBOTS_USER_AGENTS + value: {{ .Values.config.robots.userAgents | quote }} + {{- end }} + + # URL Shortening Settings + - name: AUTO_RESOLVE_TITLES + value: {{ .Values.config.urlShortening.autoResolveTitles | quote }} + {{- if .Values.config.urlShortening.defaultShortCodesLength }} + - name: DEFAULT_SHORT_CODES_LENGTH + value: {{ .Values.config.urlShortening.defaultShortCodesLength | int }} + {{- end }} + {{- if .Values.config.urlShortening.deleteShortUrlThreshold }} + - name: DELETE_SHORT_URL_THRESHOLD + value: {{ .Values.config.urlShortening.deleteShortUrlThreshold | quote }} + {{- end }} + - name: MULTI_SEGMENT_SLUGS_ENABLED + value: {{ .Values.config.urlShortening.multiSegmentSlugsEnabled | quote }} + {{- if .Values.config.urlShortening.shortUrlMode }} + - name: SHORT_URL_MODE + value: {{ .Values.config.urlShortening.shortUrlMode | quote }} + {{- end }} + - name: SHORT_URL_TRAILING_SLASH + value: {{ .Values.config.urlShortening.shortUrlTrailingSlash | quote }} + + # Visits Tracking Settings + - name: ANONYMIZE_REMOTE_ADDR + value: {{ .Values.config.trackingVisits.anonymizeRemoteAddr | quote }} + - name: DISABLE_IP_TRACKING + value: {{ .Values.config.trackingVisits.disableIpTracking | quote }} + - name: DISABLE_REFERRER_TRACKING + value: {{ .Values.config.trackingVisits.disableReferrerTracking | quote }} + - name: DISABLE_TRACKING + value: {{ .Values.config.trackingVisits.disabled | quote }} + {{- if .Values.config.trackingVisits.disableTrackingFrom }} + - name: DISABLE_TRACKING_FROM + value: {{ .Values.config.trackingVisits.disableTrackingFrom | quote }} + {{- end }} + {{- if .Values.config.trackingVisits.disableTrackingParam }} + - name: DISABLE_TRACK_PARAM + value: {{ .Values.config.trackingVisits.disableTrackingParam | quote }} + {{- end }} + - name: DISABLE_UA_TRACKING + value: {{ .Values.config.trackingVisits.disableUaTracking | quote }} + - name: TRACK_ORPHAN_VISITS + value: {{ .Values.config.trackingVisits.trackOrphanVisits | quote }} + + {{- if .Values.extraEnv }} + # Extra Environment Variables + {{- .Values.extraEnv | toYaml | nindent 12 }} {{- end }} ports: - name: http - containerPort: 8080 + containerPort: {{ .Values.service.port | int }} protocol: TCP livenessProbe: httpGet: diff --git a/charts/shlink-backend/templates/matomo/_matomo.tpl b/charts/shlink-backend/templates/matomo/_matomo.tpl new file mode 100644 index 000000000..8734dbdeb --- /dev/null +++ b/charts/shlink-backend/templates/matomo/_matomo.tpl @@ -0,0 +1,12 @@ +{{/* +Get the name of the secret containing the API token +*/}} +{{- define "shlink-backend.matomo.auth.secretName" -}} +{{- $secretName := "" -}} +{{- if .Values.config.matomo.auth.existingSecret -}} + {{- $secretName = .Values.config.matomo.auth.existingSecret -}} +{{- else -}} + {{- $secretName = printf "%s-matomo" (include "shlink-backend.fullname" .) -}} +{{- end -}} +{{- $secretName -}} +{{- end -}} diff --git a/charts/shlink-backend/templates/matomo/secret.yaml b/charts/shlink-backend/templates/matomo/secret.yaml new file mode 100644 index 000000000..29295dbf2 --- /dev/null +++ b/charts/shlink-backend/templates/matomo/secret.yaml @@ -0,0 +1,9 @@ +{{- if and (.Values.config.matomo.enabled) (not .Values.config.matomo.auth.existingSecret) -}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "shlink-backend.matomo.auth.secretName" . }} +data: + api-token: {{ .Values.config.matomo.auth.apiToken | b64enc }} +{{- end }} diff --git a/charts/shlink-backend/templates/mercure/_mercure.tpl b/charts/shlink-backend/templates/mercure/_mercure.tpl new file mode 100644 index 000000000..5e28e8d80 --- /dev/null +++ b/charts/shlink-backend/templates/mercure/_mercure.tpl @@ -0,0 +1,12 @@ +{{/* +Get the name of the secret containing the API token +*/}} +{{- define "shlink-backend.mercure.auth.secretName" -}} +{{- $secretName := "" -}} +{{- if .Values.config.mercure.auth.existingSecret -}} + {{- $secretName = .Values.config.mercure.auth.existingSecret -}} +{{- else -}} + {{- $secretName = printf "%s-mercure" (include "shlink-backend.fullname" .) -}} +{{- end -}} +{{- $secretName -}} +{{- end -}} diff --git a/charts/shlink-backend/templates/mercure/secret.yaml b/charts/shlink-backend/templates/mercure/secret.yaml new file mode 100644 index 000000000..2afda35b9 --- /dev/null +++ b/charts/shlink-backend/templates/mercure/secret.yaml @@ -0,0 +1,9 @@ +{{- if and (.Values.config.mercure.enabled) (not .Values.config.mercure.auth.existingSecret) -}} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "shlink-backend.mercure.auth.secretName" . }} +data: + jwt-secret: {{ .Values.config.mercure.auth.jwtSecret | b64enc }} +{{- end }} diff --git a/charts/shlink-backend/templates/redis/_redis.tpl b/charts/shlink-backend/templates/redis/_redis.tpl new file mode 100644 index 000000000..ce969b051 --- /dev/null +++ b/charts/shlink-backend/templates/redis/_redis.tpl @@ -0,0 +1,28 @@ +{{/* +Define if the Redis integration is enabled +*/}} +{{- define "shlink-backend.redis.enabled" -}} +{{- $enabled := "" -}} +{{- if or (.Values.redis.enabled) (.Values.config.redis.servers) -}} + {{- $enabled = "true" -}} +{{- end }} +{{- $enabled -}} +{{- end }} + +{{/* +Define the redis servers +*/}} +{{- define "shlink-backend.redis.servers" -}} +{{- $servers := "" -}} +{{- if .Values.redis.enabled -}} + {{- $host := (include "common.names.fullname" .Subcharts.redis) -}} + {{- $port := (.Values.redis.master.service.ports.redis | toString) -}} + {{- $servers = (printf "%s-master:%s" $host $port) -}} +{{- else -}} + {{- $servers = .Values.config.redis.servers -}} +{{- end -}} +{{- if not $servers -}} + {{- fail "Unable to determine the list of redis server. Use config.redis.servers or activate one of the integrated Redis subchart." -}} +{{- end -}} +{{- $servers -}} +{{- end }} diff --git a/charts/shlink-backend/values-dev.yaml b/charts/shlink-backend/values-dev.yaml new file mode 100644 index 000000000..d235d791b --- /dev/null +++ b/charts/shlink-backend/values-dev.yaml @@ -0,0 +1,27 @@ +extraEnv: + - name: test + value: yeah + +config: + database: + driver: sqlite + host: my-sqlite + port: 20 + +mariadb: + enabled: false + auth: + user: mariadb + +mysql: + enabled: false + auth: + user: mysql + +postgresql: + enabled: false + auth: + user: postgresql + +redis: + enabled: true diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json deleted file mode 100644 index f33f13af2..000000000 --- a/charts/shlink-backend/values.schema.json +++ /dev/null @@ -1,578 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "affinity": { - "description": "Affinity settings for pod assignment", - "required": [], - "title": "affinity", - "type": "object" - }, - "autoscaling": { - "properties": { - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - }, - "maxReplicas": { - "default": 100, - "required": [], - "title": "maxReplicas", - "type": "integer" - }, - "minReplicas": { - "default": 1, - "required": [], - "title": "minReplicas", - "type": "integer" - }, - "targetCPUUtilizationPercentage": { - "default": 80, - "required": [], - "title": "targetCPUUtilizationPercentage", - "type": "integer" - } - }, - "required": [ - "enabled", - "minReplicas", - "maxReplicas", - "targetCPUUtilizationPercentage" - ], - "title": "autoscaling", - "type": "object" - }, - "env": { - "description": "see https://shlink.io/documentation/environment-variables/ for a complete list", - "items": { - "anyOf": [ - { - "properties": { - "name": { - "default": "DEFAULT_DOMAIN", - "required": [], - "title": "name", - "type": "string" - }, - "value": { - "default": "doma.in", - "required": [], - "title": "value", - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "type": "object" - }, - { - "properties": { - "name": { - "default": "IS_HTTPS_ENABLED", - "required": [], - "title": "name", - "type": "string" - }, - "value": { - "default": "false", - "required": [], - "title": "value", - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "type": "object" - } - ], - "required": [] - }, - "required": [], - "title": "env", - "type": "array" - }, - "fullnameOverride": { - "default": "", - "description": "String to fully override `\"shlink-backend.fullname\"`", - "required": [], - "title": "fullnameOverride", - "type": "string" - }, - "global": { - "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", - "required": [], - "title": "global", - "type": "object" - }, - "image": { - "properties": { - "pullPolicy": { - "default": "Always", - "description": "image pull policy", - "required": [], - "title": "pullPolicy", - "type": "string" - }, - "repository": { - "default": "shlinkio/shlink", - "description": "image repository", - "required": [], - "title": "repository", - "type": "string" - }, - "tag": { - "default": "3.7.4", - "description": "Overrides the image tag", - "required": [], - "title": "tag", - "type": "string" - } - }, - "required": [ - "repository", - "pullPolicy", - "tag" - ], - "title": "image", - "type": "object" - }, - "imagePullSecrets": { - "description": "If defined, uses a Secret to pull an image from a private Docker registry or repository.", - "items": { - "required": [] - }, - "required": [], - "title": "imagePullSecrets", - "type": "array" - }, - "ingress": { - "properties": { - "annotations": { - "required": [], - "title": "annotations", - "type": "object" - }, - "className": { - "default": "", - "required": [], - "title": "className", - "type": "string" - }, - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - }, - "hosts": { - "description": "kubernetes.io/ingress.class: nginx\nkubernetes.io/tls-acme: \"true\"", - "items": { - "anyOf": [ - { - "properties": { - "host": { - "default": "chart-example.local", - "required": [], - "title": "host", - "type": "string" - }, - "paths": { - "items": { - "anyOf": [ - { - "properties": { - "path": { - "default": "/", - "required": [], - "title": "path", - "type": "string" - }, - "pathType": { - "default": "ImplementationSpecific", - "required": [], - "title": "pathType", - "type": "string" - } - }, - "required": [ - "path", - "pathType" - ], - "type": "object" - } - ], - "required": [] - }, - "required": [], - "title": "paths", - "type": "array" - } - }, - "required": [ - "host", - "paths" - ], - "type": "object" - } - ], - "required": [] - }, - "required": [], - "title": "hosts", - "type": "array" - }, - "tls": { - "items": { - "required": [] - }, - "required": [], - "title": "tls", - "type": "array" - } - }, - "required": [ - "enabled", - "className", - "annotations", - "hosts", - "tls" - ], - "title": "ingress", - "type": "object" - }, - "mariadb": { - "properties": { - "auth": { - "properties": { - "database": { - "default": "shlink", - "required": [], - "title": "database", - "type": "string" - }, - "password": { - "default": "shlink", - "required": [], - "title": "password", - "type": "string" - }, - "username": { - "default": "shlink", - "required": [], - "title": "username", - "type": "string" - } - }, - "required": [ - "database", - "password", - "username" - ], - "title": "auth", - "type": "object" - }, - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled", - "auth" - ], - "title": "mariadb", - "type": "object" - }, - "mysql": { - "properties": { - "auth": { - "properties": { - "database": { - "default": "shlink", - "required": [], - "title": "database", - "type": "string" - }, - "password": { - "default": "shlink", - "required": [], - "title": "password", - "type": "string" - }, - "username": { - "default": "shlink", - "required": [], - "title": "username", - "type": "string" - } - }, - "required": [ - "database", - "password", - "username" - ], - "title": "auth", - "type": "object" - }, - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled", - "auth" - ], - "title": "mysql", - "type": "object" - }, - "nameOverride": { - "default": "", - "description": "Provide a name in place of `shlink-backend`", - "required": [], - "title": "nameOverride", - "type": "string" - }, - "nodeSelector": { - "description": "Node labels for pod assignment", - "required": [], - "title": "nodeSelector", - "type": "object" - }, - "podAnnotations": { - "description": "Annotations to be added to pods", - "required": [], - "title": "podAnnotations", - "type": "object" - }, - "podLabels": { - "description": "Labels to be added to pods", - "required": [], - "title": "podLabels", - "type": "object" - }, - "podSecurityContext": { - "description": "pod-level security context", - "required": [], - "title": "podSecurityContext", - "type": "object" - }, - "postgresql": { - "properties": { - "auth": { - "properties": { - "database": { - "default": "shlink", - "required": [], - "title": "database", - "type": "string" - }, - "password": { - "default": "shlink", - "required": [], - "title": "password", - "type": "string" - }, - "username": { - "default": "shlink", - "required": [], - "title": "username", - "type": "string" - } - }, - "required": [ - "database", - "password", - "username" - ], - "title": "auth", - "type": "object" - }, - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled", - "auth" - ], - "title": "postgresql", - "type": "object" - }, - "rabbitmq": { - "properties": { - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "rabbitmq", - "type": "object" - }, - "redis": { - "properties": { - "auth": { - "properties": { - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "auth", - "type": "object" - }, - "enabled": { - "default": false, - "required": [], - "title": "enabled", - "type": "boolean" - } - }, - "required": [ - "enabled", - "auth" - ], - "title": "redis", - "type": "object" - }, - "replicaCount": { - "default": 1, - "description": "Number of replicas", - "required": [], - "title": "replicaCount", - "type": "integer" - }, - "resources": { - "description": "Resource limits and requests for the headwind pods.", - "required": [], - "title": "resources", - "type": "object" - }, - "revisionHistoryLimit": { - "default": 10, - "description": "The number of old ReplicaSets to retain", - "required": [], - "title": "revisionHistoryLimit", - "type": "integer" - }, - "securityContext": { - "description": "container-level security context", - "required": [], - "title": "securityContext", - "type": "object" - }, - "service": { - "properties": { - "port": { - "default": 80, - "description": "Kubernetes port where service is exposed", - "required": [], - "title": "port", - "type": "integer" - }, - "type": { - "default": "ClusterIP", - "description": "Kubernetes service type", - "required": [], - "title": "type", - "type": "string" - } - }, - "required": [ - "type", - "port" - ], - "title": "service", - "type": "object" - }, - "serviceAccount": { - "properties": { - "annotations": { - "description": "Annotations to add to the service account", - "required": [], - "title": "annotations", - "type": "object" - }, - "create": { - "default": true, - "description": "Specifies whether a service account should be created", - "required": [], - "title": "create", - "type": "boolean" - }, - "name": { - "default": "", - "description": "The name of the service account to use.\nIf not set and create is true, a name is generated using the fullname template", - "required": [], - "title": "name", - "type": "string" - } - }, - "required": [ - "create", - "annotations", - "name" - ], - "title": "serviceAccount", - "type": "object" - }, - "tolerations": { - "description": "Toleration labels for pod assignment", - "items": { - "required": [] - }, - "required": [], - "title": "tolerations", - "type": "array" - } - }, - "required": [ - "nameOverride", - "fullnameOverride", - "image", - "imagePullSecrets", - "replicaCount", - "revisionHistoryLimit", - "serviceAccount", - "podAnnotations", - "podLabels", - "podSecurityContext", - "securityContext", - "service", - "ingress", - "resources", - "autoscaling", - "nodeSelector", - "tolerations", - "affinity", - "env", - "mariadb", - "mysql", - "postgresql", - "rabbitmq", - "redis" - ], - "type": "object" -} diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index 6d93e0add..10f0977a8 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -4,6 +4,8 @@ nameOverride: "" fullnameOverride: "" image: + # -- image registry + registry: docker.io # -- image repository repository: shlinkio/shlink # -- image pull policy @@ -52,7 +54,7 @@ service: # -- Kubernetes service type type: ClusterIP # -- Kubernetes port where service is exposed - port: 80 + port: 8080 ingress: enabled: false @@ -99,38 +101,166 @@ tolerations: [] # -- Affinity settings for pod assignment affinity: {} -# see https://shlink.io/documentation/environment-variables/ for a complete list -env: - - name: DEFAULT_DOMAIN - value: doma.in - - name: IS_HTTPS_ENABLED - value: "false" +# -- additional environment variables to be added to the pods. See https://shlink.io/documentation/environment-variables for a complete list. +extraEnv: [] + +config: + database: + auth: + # -- The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled + database: shlink + # -- Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`. + existingSecret: "" + # -- The password credential to be used when using an external database driver. + password: shlink + # -- The username credential to be used when using an external database driver. + username: shlink + # -- mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled + driver: sqlite + # -- The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled + host: "" + # -- The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled + port: 0 + # -- Whether it is desired to use an encrypted connection with the database or not + useEncryption: false + general: + # -- The base path from which you plan to serve Shlink, in case you don’t want to serve it from the root of the domain. It has to start with a bar, like /shlink. Defaults to ''. + basePath: "" + # -- A prefix used for all cache keys generated by Shlink. It’s important to set a unique value here if you have multiple Shlink instances sharing the same cache store (same server when not using redis, or same redis cluster), otherwise there could be collisions. Defaults to Shlink. + cacheNamespace: "" + # -- The default short domain used for this Shlink instance. For example s.test. + defaultDomain: "" + # -- An API key that will be created once during container start-up, with admin permissions. + initialApiKey: "" + # -- Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS. + isHttpsEnabled: false + # -- The maximum amount of memory that every Shlink process can use. You can provide a number, which will be the amount of memory in bytes, or a number followed by K for kilobytes, M for megabytes or G for gigabytes. You can also provide -1 to set no memory limit. Defaults to 512M. + memoryLimit: "" + # -- A timezone code as defined [in this list](https://www.php.net/manual/en/timezones.php). All dates stored by Shlink (visits, short URL creation, etc) will be considered to be on this timezone. By default, the default timezone set in PHP config will be used, which is UTC in the case of the docker image. + timezone: "" + geolite: + # -- The license key used to download new GeoLite2 database files. Go to GeoLite2 license key to know how to generate it. Not providing a license key will completely disable visits geolocation. + licenseKey: "" + # -- If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. + skipInitialDownload: false + matomo: + # -- Tells if visits should be sent to a Matomo instance. + enabled: false + auth: + # -- The API token so that Shlink can call Matomo’s API + apiToken: "" + # -- Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`. + existingSecret: "" + # -- The external Matomo server URL. + baseUrl: "" + # -- The site ID to be used for Shlink visits. + siteId: "" + mercure: + # -- Enable the Mercure Hub integration. + enabled: false + auth: + # -- The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server. + jwtSecret: "" + # -- Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`. + existingSecret: "" + # -- The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates. + publicHubUrl: "" + # -- An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. + internalHubUrl: "" + redirects: + # -- Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308. + cacheLifetime: 30 + # -- If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. + defaultBaseUrlRedirect: "" + # -- If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. + defaultInvalidShortUrlRedirect: "" + # -- If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. + defaultRegular404Redirect: "" + # -- Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info). + extraPathMode: default + # -- 301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method. + statusCode: 302 + redis: + # -- Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub. + pubSubEnabled: false + # -- The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled + servers: "" + robots: + # -- Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored. + allowAllShortUrls: false + # -- A comma-separated list of allowed user agents via robots.txt. + userAgents: "*" + trackingVisits: + # -- Tells if IP addresses from visitors should be obfuscated before storing them in the database. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + anonymizeRemoteAddr: true + # -- Tells if visits tracking should be completely disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + disable: false + # -- Tells if tracking of the IP address (and therefore visitors location) should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + disableIpTracking: false + # -- Tells if tracking of the referrer should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + disableReferrerTracking: false + # -- The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + disableTrackingParam: "" + # -- A comma-separated list of IP address patterns from which all tracking should be disabled. It allows providing fixed IP addresses (100.200.80.40), CIDR blocks (192.168.10.0/24) or wildcard patterns (11.22.*.*) + disableTrackingFrom: "" + # -- Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + disableUaTracking: false + # -- Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. + trackOrphanVisits: true + urlShortening: + # -- Used to automatically resolve the short URL’s title based on the tag in the long URL + autoResolveTitles: true + # -- The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4. + defaultShortCodesLength: 5 + # -- The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled. + deleteShortUrlThreshold: "" + # -- Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information. + multiSegmentSlugsEnabled: false + # -- Determines how to match short URLs. Valid values are strict or loose. See [short URLs mode](https://shlink.io/documentation/some-features/#short-urls-mode) for more information. + shortUrlMode: strict + # -- Allows to enable support for trailing slashes in short URLs when true is provided. See [short URLs trailing slash](https://shlink.io/documentation/some-features/#short-urls-trailing-slash) for more information. + shortUrlTrailingSlash: false mariadb: + # -- enable integrated MariaDB™ subchart from Bitnami enabled: false auth: + # -- The database name to be used when using the integrated MariaDB database. database: shlink + # -- The password credential to be used when using the integrated MariaDB database. password: shlink + # -- The username credential to be used when using the integrated MariaDB database. username: shlink mysql: + # -- enable integrated MySQL™ subchart from Bitnami enabled: false auth: + # -- The database name to be used when using the integrated MySQL database. database: shlink + # -- The password credential to be used when using the integrated MySQL database. password: shlink + # -- The username credential to be used when using the integrated MySQL database. username: shlink postgresql: + # -- enable integrated PostgreSQL™ subchart from Bitnami enabled: false auth: + # -- The database name to be used when using the integrated PostgreSQL database. database: shlink + # -- The password credential to be used when using the integrated PostgreSQL database. password: shlink + # -- The username credential to be used when using the integrated PostgreSQL database. username: shlink rabbitmq: + # -- enable integrated RabbitMQ™ subchart from Bitnami enabled: false redis: + # -- enable integrated Redis™ subchart from Bitnami enabled: false auth: + # -- Enable password authentication enabled: false From 2f04c2f170e75fab189a53a112f998daa3b72e3c Mon Sep 17 00:00:00 2001 From: christianhuth <christianhuth@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:09:50 +0000 Subject: [PATCH 05/12] chore: auto-upgrade schema and readme --- charts/shlink-backend/README.md | 192 +++ .../shlink-backend/templates/deployment.yaml | 6 +- charts/shlink-backend/values.schema.json | 1091 +++++++++++++++++ charts/shlink-backend/values.yaml | 4 +- 4 files changed, 1288 insertions(+), 5 deletions(-) create mode 100644 charts/shlink-backend/README.md create mode 100644 charts/shlink-backend/values.schema.json diff --git a/charts/shlink-backend/README.md b/charts/shlink-backend/README.md new file mode 100644 index 000000000..4df319289 --- /dev/null +++ b/charts/shlink-backend/README.md @@ -0,0 +1,192 @@ +# shlink-backend + +A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain. + +## TL;DR; + +```console +helm repo add christianhuth https://charts.christianhuth.de +helm repo update +helm install my-release christianhuth/shlink-backend +``` + +## Introduction + +This chart bootstraps a self-hosted URL shortener called [Shlink](https://shlink.io) using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes 1.19+ + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +helm repo add christianhuth https://charts.christianhuth.de +helm repo update +helm install my-release christianhuth/shlink-backend +``` + +These commands deploy Shlink on the Kubernetes cluster in the default configuration. The [Values](#values) section lists the values that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall the `my-release` deployment: + +```console +helm uninstall my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | Affinity settings for pod assignment | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| config.database.auth.database | string | `"shlink"` | The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.auth.existingSecret | string | `""` | Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`. | +| config.database.auth.password | string | `"shlink"` | The password credential to be used when using an external database driver. | +| config.database.auth.username | string | `"shlink"` | The username credential to be used when using an external database driver. | +| config.database.driver | string | `"sqlite"` | mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.host | string | `""` | The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.port | int | `0` | The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.useEncryption | bool | `false` | Whether it is desired to use an encrypted connection with the database or not | +| config.general.basePath | string | `""` | The base path from which you plan to serve Shlink, in case you don’t want to serve it from the root of the domain. It has to start with a bar, like /shlink. Defaults to ''. | +| config.general.cacheNamespace | string | `""` | A prefix used for all cache keys generated by Shlink. It’s important to set a unique value here if you have multiple Shlink instances sharing the same cache store (same server when not using redis, or same redis cluster), otherwise there could be collisions. Defaults to Shlink. | +| config.general.defaultDomain | string | `""` | The default short domain used for this Shlink instance. For example s.test. | +| config.general.initialApiKey | string | `""` | An API key that will be created once during container start-up, with admin permissions. | +| config.general.isHttpsEnabled | bool | `false` | Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS. | +| config.general.memoryLimit | string | `""` | The maximum amount of memory that every Shlink process can use. You can provide a number, which will be the amount of memory in bytes, or a number followed by K for kilobytes, M for megabytes or G for gigabytes. You can also provide -1 to set no memory limit. Defaults to 512M. | +| config.general.timezone | string | `""` | A timezone code as defined [in this list](https://www.php.net/manual/en/timezones.php). All dates stored by Shlink (visits, short URL creation, etc) will be considered to be on this timezone. By default, the default timezone set in PHP config will be used, which is UTC in the case of the docker image. | +| config.geolite.licenseKey | string | `""` | The license key used to download new GeoLite2 database files. Go to GeoLite2 license key to know how to generate it. Not providing a license key will completely disable visits geolocation. | +| config.geolite.skipInitialDownload | bool | `false` | If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. | +| config.matomo.auth.apiToken | string | `""` | The API token so that Shlink can call Matomo’s API | +| config.matomo.auth.existingSecret | string | `""` | Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`. | +| config.matomo.baseUrl | string | `""` | The external Matomo server URL. | +| config.matomo.enabled | bool | `false` | Tells if visits should be sent to a Matomo instance. | +| config.matomo.siteId | string | `""` | The site ID to be used for Shlink visits. | +| config.mercure.auth.existingSecret | string | `""` | Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`. | +| config.mercure.auth.jwtSecret | string | `""` | The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server. | +| config.mercure.enabled | bool | `false` | Enable the Mercure Hub integration. | +| config.mercure.internalHubUrl | string | `""` | An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. | +| config.mercure.publicHubUrl | string | `""` | The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates. | +| config.redirects.cacheLifetime | int | `30` | Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308. | +| config.redirects.defaultBaseUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.defaultInvalidShortUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.defaultRegular404Redirect | string | `""` | If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.extraPathMode | string | `"default"` | Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info). | +| config.redirects.statusCode | int | `302` | 301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method. | +| config.redis.pubSubEnabled | bool | `false` | Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub. | +| config.redis.servers | string | `""` | The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled | +| config.robots.allowAllShortUrls | bool | `false` | Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored. | +| config.robots.userAgents | string | `"*"` | A comma-separated list of allowed user agents via robots.txt. | +| config.trackingVisits.anonymizeRemoteAddr | bool | `true` | Tells if IP addresses from visitors should be obfuscated before storing them in the database. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disable | bool | `false` | Tells if visits tracking should be completely disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableIpTracking | bool | `false` | Tells if tracking of the IP address (and therefore visitors location) should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableReferrerTracking | bool | `false` | Tells if tracking of the referrer should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableTrackingFrom | string | `""` | A comma-separated list of IP address patterns from which all tracking should be disabled. It allows providing fixed IP addresses (100.200.80.40), CIDR blocks (192.168.10.0/24) or wildcard patterns (11.22.*.*) | +| config.trackingVisits.disableTrackingParam | string | `""` | The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableUaTracking | bool | `false` | Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.trackOrphanVisits | bool | `true` | Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.urlShortening.autoResolveTitles | bool | `true` | Used to automatically resolve the short URL’s title based on the <title /> tag in the long URL | +| config.urlShortening.defaultShortCodesLength | int | `5` | The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4. | +| config.urlShortening.deleteShortUrlThreshold | string | `""` | The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled. | +| config.urlShortening.multiSegmentSlugsEnabled | bool | `false` | Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information. | +| config.urlShortening.shortUrlMode | string | `"strict"` | Determines how to match short URLs. Valid values are strict or loose. See [short URLs mode](https://shlink.io/documentation/some-features/#short-urls-mode) for more information. | +| config.urlShortening.shortUrlTrailingSlash | bool | `false` | Allows to enable support for trailing slashes in short URLs when true is provided. See [short URLs trailing slash](https://shlink.io/documentation/some-features/#short-urls-trailing-slash) for more information. | +| extraEnv | list | `[]` | additional environment variables to be added to the pods. See https://shlink.io/documentation/environment-variables for a complete list. | +| fullnameOverride | string | `""` | String to fully override `"shlink-backend.fullname"` | +| image.pullPolicy | string | `"Always"` | image pull policy | +| image.registry | string | `"docker.io"` | image registry | +| image.repository | string | `"shlinkio/shlink"` | image repository | +| image.tag | string | `"4.4.0"` | Overrides the image tag | +| imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| mariadb.auth.database | string | `"shlink"` | The database name to be used when using the integrated MariaDB database. | +| mariadb.auth.password | string | `"shlink"` | The password credential to be used when using the integrated MariaDB database. | +| mariadb.auth.username | string | `"shlink"` | The username credential to be used when using the integrated MariaDB database. | +| mariadb.enabled | bool | `false` | enable integrated MariaDB™ subchart from Bitnami | +| mysql.auth.database | string | `"shlink"` | The database name to be used when using the integrated MySQL database. | +| mysql.auth.password | string | `"shlink"` | The password credential to be used when using the integrated MySQL database. | +| mysql.auth.username | string | `"shlink"` | The username credential to be used when using the integrated MySQL database. | +| mysql.enabled | bool | `false` | enable integrated MySQL™ subchart from Bitnami | +| nameOverride | string | `""` | Provide a name in place of `shlink-backend` | +| nodeSelector | object | `{}` | Node labels for pod assignment | +| podAnnotations | object | `{}` | Annotations to be added to pods | +| podLabels | object | `{}` | Labels to be added to pods | +| podSecurityContext | object | `{}` | pod-level security context | +| postgresql.auth.database | string | `"shlink"` | The database name to be used when using the integrated PostgreSQL database. | +| postgresql.auth.password | string | `"shlink"` | The password credential to be used when using the integrated PostgreSQL database. | +| postgresql.auth.username | string | `"shlink"` | The username credential to be used when using the integrated PostgreSQL database. | +| postgresql.enabled | bool | `false` | enable integrated PostgreSQL™ subchart from Bitnami | +| rabbitmq.enabled | bool | `false` | enable integrated RabbitMQ™ subchart from Bitnami | +| redis.auth.enabled | bool | `false` | Enable password authentication | +| redis.enabled | bool | `false` | enable integrated Redis™ subchart from Bitnami | +| replicaCount | int | `1` | Number of replicas | +| resources | object | `{}` | Resource limits and requests for the headwind pods. | +| revisionHistoryLimit | int | `10` | The number of old ReplicaSets to retain | +| securityContext | object | `{}` | container-level security context | +| service.port | int | `8080` | Kubernetes port where service is exposed | +| service.type | string | `"ClusterIP"` | Kubernetes service type | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | Toleration labels for pod assignment | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```console +helm install my-release -f values.yaml christianhuth/shlink-backend +``` + +## Upgrading the Chart + +### To 5.0.0 + +This major updates the following dependencies: + +- MariaDB to its newest major, 20.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/mariadb#to-2020) you can find more information about the changes introduced in that version. +- MySQL to its newest major, 12.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/mysql#to-1220) you can find more information about the changes introduced in that version. +- PostgreSQL to its newest major, 16.3.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/postgresql#to-1630) you can find more information about the changes introduced in that version. +- RabbitMQ to its newest major, 15.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#to-1520) you can find more information about the changes introduced in that version. +- Redis to its newest major, 20.5.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/redis#to-2050) you can find more information about the changes introduced in that version. + +It also upgrades the Shlink Backend to its newest major, 4.4.0 and introduces a new way to define the configuration using the `config.*` Values. +If you have been using the `env` attribute so far to configure Shlink it is strongly recommended to migrate to the corresponding `config.*` Value. +The `env` attribute further has been replaced by an `extraEnv` attribute. + +### To 4.0.0 + +This major updates the PostgreSQL subchart to its newest major, 14.0.0. [Here](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#to-1400) you can find more information about the changes introduced in that version. + +### To 3.0.0 + +This major updates the Redis subchart to its newest major, 18.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/redis#upgrading) and [here](https://raw.githubusercontent.com/redis/redis/7.2/00-RELEASENOTES) you can find more information about the changes introduced in that version. + +Additionally it updates the MariaDB subchart to its newest major, 16.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/mariadb#to-1600) you can find more information about the changes introduced in that version. + +### To 2.0.0 + +This major updates the RabbitMQ subchart to its newest major, 12.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#upgrading) and [here](https://www.rabbitmq.com/upgrade.html) you can find more information about the changes introduced in that version. + +### To 1.0.0 + +This major updates the PostgreSQL subchart to its newest major, 12.0.0. [Here](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#to-1200) you can find more information about the changes introduced in that version. + +Additionally it updates the RabbitMQ subchart to its newest major, 11.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#to-1100) you can find more information about the changes introduced in that version. diff --git a/charts/shlink-backend/templates/deployment.yaml b/charts/shlink-backend/templates/deployment.yaml index 4cf80d47d..9de35235c 100644 --- a/charts/shlink-backend/templates/deployment.yaml +++ b/charts/shlink-backend/templates/deployment.yaml @@ -89,7 +89,7 @@ spec: - name: TIMEZONE value: {{ .Values.config.general.timezone | quote }} {{- end }} - + # Geolite Settings {{- if .Values.config.geolite.licenseKey }} - name: GEOLITE_LICENSE_KEY @@ -187,7 +187,7 @@ spec: {{- if (include "shlink-backend.redis.enabled" .) }} # Redis Settings - - name: REDIS_PUB_SUB_ENABLED + - name: REDIS_PUB_SUB_ENABLED value: {{ .Values.config.redis.pubSubEnabled | quote }} - name: REDIS_SERVERS value: {{ include "shlink-backend.redis.enabled" . | quote }} @@ -220,7 +220,7 @@ spec: {{- end }} - name: SHORT_URL_TRAILING_SLASH value: {{ .Values.config.urlShortening.shortUrlTrailingSlash | quote }} - + # Visits Tracking Settings - name: ANONYMIZE_REMOTE_ADDR value: {{ .Values.config.trackingVisits.anonymizeRemoteAddr | quote }} diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json new file mode 100644 index 000000000..c1e21910c --- /dev/null +++ b/charts/shlink-backend/values.schema.json @@ -0,0 +1,1091 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affinity": { + "description": "Affinity settings for pod assignment", + "required": [], + "title": "affinity", + "type": "object" + }, + "autoscaling": { + "properties": { + "enabled": { + "default": false, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "maxReplicas": { + "default": 100, + "required": [], + "title": "maxReplicas", + "type": "integer" + }, + "minReplicas": { + "default": 1, + "required": [], + "title": "minReplicas", + "type": "integer" + }, + "targetCPUUtilizationPercentage": { + "default": 80, + "required": [], + "title": "targetCPUUtilizationPercentage", + "type": "integer" + } + }, + "required": [ + "enabled", + "minReplicas", + "maxReplicas", + "targetCPUUtilizationPercentage" + ], + "title": "autoscaling", + "type": "object" + }, + "config": { + "properties": { + "database": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "database", + "type": "string" + }, + "existingSecret": { + "default": "", + "description": "Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`.", + "required": [], + "title": "existingSecret", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using an external database driver.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using an external database driver.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "existingSecret", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "driver": { + "default": "sqlite", + "description": "mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "driver", + "type": "string" + }, + "host": { + "default": "", + "description": "The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "host", + "type": "string" + }, + "port": { + "default": 0, + "description": "The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "port", + "type": "integer" + }, + "useEncryption": { + "default": false, + "description": "Whether it is desired to use an encrypted connection with the database or not", + "required": [], + "title": "useEncryption", + "type": "boolean" + } + }, + "required": [ + "auth", + "driver", + "host", + "port", + "useEncryption" + ], + "title": "database", + "type": "object" + }, + "general": { + "properties": { + "basePath": { + "default": "", + "description": "The base path from which you plan to serve Shlink, in case you don’t want to serve it from the root of the domain. It has to start with a bar, like /shlink. Defaults to ''.", + "required": [], + "title": "basePath", + "type": "string" + }, + "cacheNamespace": { + "default": "", + "description": "A prefix used for all cache keys generated by Shlink. It’s important to set a unique value here if you have multiple Shlink instances sharing the same cache store (same server when not using redis, or same redis cluster), otherwise there could be collisions. Defaults to Shlink.", + "required": [], + "title": "cacheNamespace", + "type": "string" + }, + "defaultDomain": { + "default": "", + "description": "The default short domain used for this Shlink instance. For example s.test.", + "required": [], + "title": "defaultDomain", + "type": "string" + }, + "initialApiKey": { + "default": "", + "description": "An API key that will be created once during container start-up, with admin permissions.", + "required": [], + "title": "initialApiKey", + "type": "string" + }, + "isHttpsEnabled": { + "default": false, + "description": "Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS.", + "required": [], + "title": "isHttpsEnabled", + "type": "boolean" + }, + "memoryLimit": { + "default": "", + "description": "The maximum amount of memory that every Shlink process can use. You can provide a number, which will be the amount of memory in bytes, or a number followed by K for kilobytes, M for megabytes or G for gigabytes. You can also provide -1 to set no memory limit. Defaults to 512M.", + "required": [], + "title": "memoryLimit", + "type": "string" + }, + "timezone": { + "default": "", + "description": "A timezone code as defined [in this list](https://www.php.net/manual/en/timezones.php). All dates stored by Shlink (visits, short URL creation, etc) will be considered to be on this timezone. By default, the default timezone set in PHP config will be used, which is UTC in the case of the docker image.", + "required": [], + "title": "timezone", + "type": "string" + } + }, + "required": [ + "basePath", + "cacheNamespace", + "defaultDomain", + "initialApiKey", + "isHttpsEnabled", + "memoryLimit", + "timezone" + ], + "title": "general", + "type": "object" + }, + "geolite": { + "properties": { + "licenseKey": { + "default": "", + "description": "The license key used to download new GeoLite2 database files. Go to GeoLite2 license key to know how to generate it. Not providing a license key will completely disable visits geolocation.", + "required": [], + "title": "licenseKey", + "type": "string" + }, + "skipInitialDownload": { + "default": false, + "description": "If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background.", + "required": [], + "title": "skipInitialDownload", + "type": "boolean" + } + }, + "required": [ + "licenseKey", + "skipInitialDownload" + ], + "title": "geolite", + "type": "object" + }, + "matomo": { + "properties": { + "auth": { + "properties": { + "apiToken": { + "default": "", + "description": "The API token so that Shlink can call Matomo’s API", + "required": [], + "title": "apiToken", + "type": "string" + }, + "existingSecret": { + "default": "", + "description": "Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`.", + "required": [], + "title": "existingSecret", + "type": "string" + } + }, + "required": [ + "apiToken", + "existingSecret" + ], + "title": "auth", + "type": "object" + }, + "baseUrl": { + "default": "", + "description": "The external Matomo server URL.", + "required": [], + "title": "baseUrl", + "type": "string" + }, + "enabled": { + "default": false, + "description": "Tells if visits should be sent to a Matomo instance.", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "siteId": { + "default": "", + "description": "The site ID to be used for Shlink visits.", + "required": [], + "title": "siteId", + "type": "string" + } + }, + "required": [ + "enabled", + "auth", + "baseUrl", + "siteId" + ], + "title": "matomo", + "type": "object" + }, + "mercure": { + "properties": { + "auth": { + "properties": { + "existingSecret": { + "default": "", + "description": "Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`.", + "required": [], + "title": "existingSecret", + "type": "string" + }, + "jwtSecret": { + "default": "", + "description": "The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server.", + "required": [], + "title": "jwtSecret", + "type": "string" + } + }, + "required": [ + "jwtSecret", + "existingSecret" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "Enable the Mercure Hub integration.", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "internalHubUrl": { + "default": "", + "description": "An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public.", + "required": [], + "title": "internalHubUrl", + "type": "string" + }, + "publicHubUrl": { + "default": "", + "description": "The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates.", + "required": [], + "title": "publicHubUrl", + "type": "string" + } + }, + "required": [ + "enabled", + "auth", + "publicHubUrl", + "internalHubUrl" + ], + "title": "mercure", + "type": "object" + }, + "redirects": { + "properties": { + "cacheLifetime": { + "default": 30, + "description": "Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308.", + "required": [], + "title": "cacheLifetime", + "type": "integer" + }, + "defaultBaseUrlRedirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultBaseUrlRedirect", + "type": "string" + }, + "defaultInvalidShortUrlRedirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultInvalidShortUrlRedirect", + "type": "string" + }, + "defaultRegular404Redirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultRegular404Redirect", + "type": "string" + }, + "extraPathMode": { + "default": "default", + "description": "Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info).", + "required": [], + "title": "extraPathMode", + "type": "string" + }, + "statusCode": { + "default": 302, + "description": "301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method.", + "required": [], + "title": "statusCode", + "type": "integer" + } + }, + "required": [ + "cacheLifetime", + "defaultBaseUrlRedirect", + "defaultInvalidShortUrlRedirect", + "defaultRegular404Redirect", + "extraPathMode", + "statusCode" + ], + "title": "redirects", + "type": "object" + }, + "redis": { + "properties": { + "pubSubEnabled": { + "default": false, + "description": "Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub.", + "required": [], + "title": "pubSubEnabled", + "type": "boolean" + }, + "servers": { + "default": "", + "description": "The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled", + "required": [], + "title": "servers", + "type": "string" + } + }, + "required": [ + "pubSubEnabled", + "servers" + ], + "title": "redis", + "type": "object" + }, + "robots": { + "properties": { + "allowAllShortUrls": { + "default": false, + "description": "Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored.", + "required": [], + "title": "allowAllShortUrls", + "type": "boolean" + }, + "userAgents": { + "default": "*", + "description": "A comma-separated list of allowed user agents via robots.txt.", + "required": [], + "title": "userAgents", + "type": "string" + } + }, + "required": [ + "allowAllShortUrls", + "userAgents" + ], + "title": "robots", + "type": "object" + }, + "trackingVisits": { + "properties": { + "anonymizeRemoteAddr": { + "default": true, + "description": "Tells if IP addresses from visitors should be obfuscated before storing them in the database. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "anonymizeRemoteAddr", + "type": "boolean" + }, + "disable": { + "default": false, + "description": "Tells if visits tracking should be completely disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disable", + "type": "boolean" + }, + "disableIpTracking": { + "default": false, + "description": "Tells if tracking of the IP address (and therefore visitors location) should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableIpTracking", + "type": "boolean" + }, + "disableReferrerTracking": { + "default": false, + "description": "Tells if tracking of the referrer should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableReferrerTracking", + "type": "boolean" + }, + "disableTrackingFrom": { + "default": "", + "description": "A comma-separated list of IP address patterns from which all tracking should be disabled. It allows providing fixed IP addresses (100.200.80.40), CIDR blocks (192.168.10.0/24) or wildcard patterns (11.22.*.*)", + "required": [], + "title": "disableTrackingFrom", + "type": "string" + }, + "disableTrackingParam": { + "default": "", + "description": "The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableTrackingParam", + "type": "string" + }, + "disableUaTracking": { + "default": false, + "description": "Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableUaTracking", + "type": "boolean" + }, + "trackOrphanVisits": { + "default": true, + "description": "Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "trackOrphanVisits", + "type": "boolean" + } + }, + "required": [ + "anonymizeRemoteAddr", + "disable", + "disableIpTracking", + "disableReferrerTracking", + "disableTrackingParam", + "disableTrackingFrom", + "disableUaTracking", + "trackOrphanVisits" + ], + "title": "trackingVisits", + "type": "object" + }, + "urlShortening": { + "properties": { + "autoResolveTitles": { + "default": true, + "description": "Used to automatically resolve the short URL’s title based on the \u003ctitle /\u003e tag in the long URL", + "required": [], + "title": "autoResolveTitles", + "type": "boolean" + }, + "defaultShortCodesLength": { + "default": 5, + "description": "The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4.", + "required": [], + "title": "defaultShortCodesLength", + "type": "integer" + }, + "deleteShortUrlThreshold": { + "default": "", + "description": "The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled.", + "required": [], + "title": "deleteShortUrlThreshold", + "type": "string" + }, + "multiSegmentSlugsEnabled": { + "default": false, + "description": "Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information.", + "required": [], + "title": "multiSegmentSlugsEnabled", + "type": "boolean" + }, + "shortUrlMode": { + "default": "strict", + "description": "Determines how to match short URLs. Valid values are strict or loose. See [short URLs mode](https://shlink.io/documentation/some-features/#short-urls-mode) for more information.", + "required": [], + "title": "shortUrlMode", + "type": "string" + }, + "shortUrlTrailingSlash": { + "default": false, + "description": "Allows to enable support for trailing slashes in short URLs when true is provided. See [short URLs trailing slash](https://shlink.io/documentation/some-features/#short-urls-trailing-slash) for more information.", + "required": [], + "title": "shortUrlTrailingSlash", + "type": "boolean" + } + }, + "required": [ + "autoResolveTitles", + "defaultShortCodesLength", + "deleteShortUrlThreshold", + "multiSegmentSlugsEnabled", + "shortUrlMode", + "shortUrlTrailingSlash" + ], + "title": "urlShortening", + "type": "object" + } + }, + "required": [ + "database", + "general", + "geolite", + "matomo", + "mercure", + "redirects", + "redis", + "robots", + "trackingVisits", + "urlShortening" + ], + "title": "config", + "type": "object" + }, + "extraEnv": { + "description": "additional environment variables to be added to the pods. See https://shlink.io/documentation/environment-variables for a complete list.", + "items": { + "required": [] + }, + "required": [], + "title": "extraEnv", + "type": "array" + }, + "fullnameOverride": { + "default": "", + "description": "String to fully override `\"shlink-backend.fullname\"`", + "required": [], + "title": "fullnameOverride", + "type": "string" + }, + "global": { + "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", + "required": [], + "title": "global", + "type": "object" + }, + "image": { + "properties": { + "pullPolicy": { + "default": "Always", + "description": "image pull policy", + "required": [], + "title": "pullPolicy", + "type": "string" + }, + "registry": { + "default": "docker.io", + "description": "image registry", + "required": [], + "title": "registry", + "type": "string" + }, + "repository": { + "default": "shlinkio/shlink", + "description": "image repository", + "required": [], + "title": "repository", + "type": "string" + }, + "tag": { + "default": "4.4.0", + "description": "Overrides the image tag", + "required": [], + "title": "tag", + "type": "string" + } + }, + "required": [ + "registry", + "repository", + "pullPolicy", + "tag" + ], + "title": "image", + "type": "object" + }, + "imagePullSecrets": { + "description": "If defined, uses a Secret to pull an image from a private Docker registry or repository.", + "items": { + "required": [] + }, + "required": [], + "title": "imagePullSecrets", + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "required": [], + "title": "annotations", + "type": "object" + }, + "className": { + "default": "", + "required": [], + "title": "className", + "type": "string" + }, + "enabled": { + "default": false, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "hosts": { + "description": "kubernetes.io/ingress.class: nginx\nkubernetes.io/tls-acme: \"true\"", + "items": { + "anyOf": [ + { + "properties": { + "host": { + "default": "chart-example.local", + "required": [], + "title": "host", + "type": "string" + }, + "paths": { + "items": { + "anyOf": [ + { + "properties": { + "path": { + "default": "/", + "required": [], + "title": "path", + "type": "string" + }, + "pathType": { + "default": "ImplementationSpecific", + "required": [], + "title": "pathType", + "type": "string" + } + }, + "required": [ + "path", + "pathType" + ], + "type": "object" + } + ], + "required": [] + }, + "required": [], + "title": "paths", + "type": "array" + } + }, + "required": [ + "host", + "paths" + ], + "type": "object" + } + ], + "required": [] + }, + "required": [], + "title": "hosts", + "type": "array" + }, + "tls": { + "items": { + "required": [] + }, + "required": [], + "title": "tls", + "type": "array" + } + }, + "required": [ + "enabled", + "className", + "annotations", + "hosts", + "tls" + ], + "title": "ingress", + "type": "object" + }, + "mariadb": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated MariaDB database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated MariaDB database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated MariaDB database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated MariaDB™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "mariadb", + "type": "object" + }, + "mysql": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated MySQL database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated MySQL database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated MySQL database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated MySQL™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "mysql", + "type": "object" + }, + "nameOverride": { + "default": "", + "description": "Provide a name in place of `shlink-backend`", + "required": [], + "title": "nameOverride", + "type": "string" + }, + "nodeSelector": { + "description": "Node labels for pod assignment", + "required": [], + "title": "nodeSelector", + "type": "object" + }, + "podAnnotations": { + "description": "Annotations to be added to pods", + "required": [], + "title": "podAnnotations", + "type": "object" + }, + "podLabels": { + "description": "Labels to be added to pods", + "required": [], + "title": "podLabels", + "type": "object" + }, + "podSecurityContext": { + "description": "pod-level security context", + "required": [], + "title": "podSecurityContext", + "type": "object" + }, + "postgresql": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated PostgreSQL™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "postgresql", + "type": "object" + }, + "rabbitmq": { + "properties": { + "enabled": { + "default": false, + "description": "enable integrated RabbitMQ™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "rabbitmq", + "type": "object" + }, + "redis": { + "properties": { + "auth": { + "properties": { + "enabled": { + "default": false, + "description": "Enable password authentication", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated Redis™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "redis", + "type": "object" + }, + "replicaCount": { + "default": 1, + "description": "Number of replicas", + "required": [], + "title": "replicaCount", + "type": "integer" + }, + "resources": { + "description": "Resource limits and requests for the headwind pods.", + "required": [], + "title": "resources", + "type": "object" + }, + "revisionHistoryLimit": { + "default": 10, + "description": "The number of old ReplicaSets to retain", + "required": [], + "title": "revisionHistoryLimit", + "type": "integer" + }, + "securityContext": { + "description": "container-level security context", + "required": [], + "title": "securityContext", + "type": "object" + }, + "service": { + "properties": { + "port": { + "default": 8080, + "description": "Kubernetes port where service is exposed", + "required": [], + "title": "port", + "type": "integer" + }, + "type": { + "default": "ClusterIP", + "description": "Kubernetes service type", + "required": [], + "title": "type", + "type": "string" + } + }, + "required": [ + "type", + "port" + ], + "title": "service", + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "description": "Annotations to add to the service account", + "required": [], + "title": "annotations", + "type": "object" + }, + "create": { + "default": true, + "description": "Specifies whether a service account should be created", + "required": [], + "title": "create", + "type": "boolean" + }, + "name": { + "default": "", + "description": "The name of the service account to use.\nIf not set and create is true, a name is generated using the fullname template", + "required": [], + "title": "name", + "type": "string" + } + }, + "required": [ + "create", + "annotations", + "name" + ], + "title": "serviceAccount", + "type": "object" + }, + "tolerations": { + "description": "Toleration labels for pod assignment", + "items": { + "required": [] + }, + "required": [], + "title": "tolerations", + "type": "array" + } + }, + "required": [ + "nameOverride", + "fullnameOverride", + "image", + "imagePullSecrets", + "replicaCount", + "revisionHistoryLimit", + "serviceAccount", + "podAnnotations", + "podLabels", + "podSecurityContext", + "securityContext", + "service", + "ingress", + "resources", + "autoscaling", + "nodeSelector", + "tolerations", + "affinity", + "extraEnv", + "config", + "mariadb", + "mysql", + "postgresql", + "rabbitmq", + "redis" + ], + "type": "object" +} diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index 10f0977a8..b238bd849 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -130,7 +130,7 @@ config: cacheNamespace: "" # -- The default short domain used for this Shlink instance. For example s.test. defaultDomain: "" - # -- An API key that will be created once during container start-up, with admin permissions. + # -- An API key that will be created once during container start-up, with admin permissions. initialApiKey: "" # -- Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS. isHttpsEnabled: false @@ -144,7 +144,7 @@ config: # -- If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. skipInitialDownload: false matomo: - # -- Tells if visits should be sent to a Matomo instance. + # -- Tells if visits should be sent to a Matomo instance. enabled: false auth: # -- The API token so that Shlink can call Matomo’s API From d821b6df2b4c6bda1dc7ee9a1369e4aab42ed8d4 Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Thu, 30 Jan 2025 16:09:54 +0000 Subject: [PATCH 06/12] add readme and values schema --- charts/shlink-backend/README.md | 192 +++ .../shlink-backend/templates/deployment.yaml | 6 +- charts/shlink-backend/values.schema.json | 1091 +++++++++++++++++ charts/shlink-backend/values.yaml | 4 +- 4 files changed, 1288 insertions(+), 5 deletions(-) create mode 100644 charts/shlink-backend/README.md create mode 100644 charts/shlink-backend/values.schema.json diff --git a/charts/shlink-backend/README.md b/charts/shlink-backend/README.md new file mode 100644 index 000000000..4df319289 --- /dev/null +++ b/charts/shlink-backend/README.md @@ -0,0 +1,192 @@ +# shlink-backend + +A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain. + +## TL;DR; + +```console +helm repo add christianhuth https://charts.christianhuth.de +helm repo update +helm install my-release christianhuth/shlink-backend +``` + +## Introduction + +This chart bootstraps a self-hosted URL shortener called [Shlink](https://shlink.io) using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes 1.19+ + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +helm repo add christianhuth https://charts.christianhuth.de +helm repo update +helm install my-release christianhuth/shlink-backend +``` + +These commands deploy Shlink on the Kubernetes cluster in the default configuration. The [Values](#values) section lists the values that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall the `my-release` deployment: + +```console +helm uninstall my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | Affinity settings for pod assignment | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| config.database.auth.database | string | `"shlink"` | The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.auth.existingSecret | string | `""` | Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`. | +| config.database.auth.password | string | `"shlink"` | The password credential to be used when using an external database driver. | +| config.database.auth.username | string | `"shlink"` | The username credential to be used when using an external database driver. | +| config.database.driver | string | `"sqlite"` | mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.host | string | `""` | The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.port | int | `0` | The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.useEncryption | bool | `false` | Whether it is desired to use an encrypted connection with the database or not | +| config.general.basePath | string | `""` | The base path from which you plan to serve Shlink, in case you don’t want to serve it from the root of the domain. It has to start with a bar, like /shlink. Defaults to ''. | +| config.general.cacheNamespace | string | `""` | A prefix used for all cache keys generated by Shlink. It’s important to set a unique value here if you have multiple Shlink instances sharing the same cache store (same server when not using redis, or same redis cluster), otherwise there could be collisions. Defaults to Shlink. | +| config.general.defaultDomain | string | `""` | The default short domain used for this Shlink instance. For example s.test. | +| config.general.initialApiKey | string | `""` | An API key that will be created once during container start-up, with admin permissions. | +| config.general.isHttpsEnabled | bool | `false` | Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS. | +| config.general.memoryLimit | string | `""` | The maximum amount of memory that every Shlink process can use. You can provide a number, which will be the amount of memory in bytes, or a number followed by K for kilobytes, M for megabytes or G for gigabytes. You can also provide -1 to set no memory limit. Defaults to 512M. | +| config.general.timezone | string | `""` | A timezone code as defined [in this list](https://www.php.net/manual/en/timezones.php). All dates stored by Shlink (visits, short URL creation, etc) will be considered to be on this timezone. By default, the default timezone set in PHP config will be used, which is UTC in the case of the docker image. | +| config.geolite.licenseKey | string | `""` | The license key used to download new GeoLite2 database files. Go to GeoLite2 license key to know how to generate it. Not providing a license key will completely disable visits geolocation. | +| config.geolite.skipInitialDownload | bool | `false` | If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. | +| config.matomo.auth.apiToken | string | `""` | The API token so that Shlink can call Matomo’s API | +| config.matomo.auth.existingSecret | string | `""` | Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`. | +| config.matomo.baseUrl | string | `""` | The external Matomo server URL. | +| config.matomo.enabled | bool | `false` | Tells if visits should be sent to a Matomo instance. | +| config.matomo.siteId | string | `""` | The site ID to be used for Shlink visits. | +| config.mercure.auth.existingSecret | string | `""` | Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`. | +| config.mercure.auth.jwtSecret | string | `""` | The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server. | +| config.mercure.enabled | bool | `false` | Enable the Mercure Hub integration. | +| config.mercure.internalHubUrl | string | `""` | An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. | +| config.mercure.publicHubUrl | string | `""` | The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates. | +| config.redirects.cacheLifetime | int | `30` | Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308. | +| config.redirects.defaultBaseUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.defaultInvalidShortUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.defaultRegular404Redirect | string | `""` | If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | +| config.redirects.extraPathMode | string | `"default"` | Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info). | +| config.redirects.statusCode | int | `302` | 301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method. | +| config.redis.pubSubEnabled | bool | `false` | Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub. | +| config.redis.servers | string | `""` | The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled | +| config.robots.allowAllShortUrls | bool | `false` | Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored. | +| config.robots.userAgents | string | `"*"` | A comma-separated list of allowed user agents via robots.txt. | +| config.trackingVisits.anonymizeRemoteAddr | bool | `true` | Tells if IP addresses from visitors should be obfuscated before storing them in the database. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disable | bool | `false` | Tells if visits tracking should be completely disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableIpTracking | bool | `false` | Tells if tracking of the IP address (and therefore visitors location) should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableReferrerTracking | bool | `false` | Tells if tracking of the referrer should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableTrackingFrom | string | `""` | A comma-separated list of IP address patterns from which all tracking should be disabled. It allows providing fixed IP addresses (100.200.80.40), CIDR blocks (192.168.10.0/24) or wildcard patterns (11.22.*.*) | +| config.trackingVisits.disableTrackingParam | string | `""` | The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.disableUaTracking | bool | `false` | Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.trackingVisits.trackOrphanVisits | bool | `true` | Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | +| config.urlShortening.autoResolveTitles | bool | `true` | Used to automatically resolve the short URL’s title based on the <title /> tag in the long URL | +| config.urlShortening.defaultShortCodesLength | int | `5` | The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4. | +| config.urlShortening.deleteShortUrlThreshold | string | `""` | The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled. | +| config.urlShortening.multiSegmentSlugsEnabled | bool | `false` | Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information. | +| config.urlShortening.shortUrlMode | string | `"strict"` | Determines how to match short URLs. Valid values are strict or loose. See [short URLs mode](https://shlink.io/documentation/some-features/#short-urls-mode) for more information. | +| config.urlShortening.shortUrlTrailingSlash | bool | `false` | Allows to enable support for trailing slashes in short URLs when true is provided. See [short URLs trailing slash](https://shlink.io/documentation/some-features/#short-urls-trailing-slash) for more information. | +| extraEnv | list | `[]` | additional environment variables to be added to the pods. See https://shlink.io/documentation/environment-variables for a complete list. | +| fullnameOverride | string | `""` | String to fully override `"shlink-backend.fullname"` | +| image.pullPolicy | string | `"Always"` | image pull policy | +| image.registry | string | `"docker.io"` | image registry | +| image.repository | string | `"shlinkio/shlink"` | image repository | +| image.tag | string | `"4.4.0"` | Overrides the image tag | +| imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| mariadb.auth.database | string | `"shlink"` | The database name to be used when using the integrated MariaDB database. | +| mariadb.auth.password | string | `"shlink"` | The password credential to be used when using the integrated MariaDB database. | +| mariadb.auth.username | string | `"shlink"` | The username credential to be used when using the integrated MariaDB database. | +| mariadb.enabled | bool | `false` | enable integrated MariaDB™ subchart from Bitnami | +| mysql.auth.database | string | `"shlink"` | The database name to be used when using the integrated MySQL database. | +| mysql.auth.password | string | `"shlink"` | The password credential to be used when using the integrated MySQL database. | +| mysql.auth.username | string | `"shlink"` | The username credential to be used when using the integrated MySQL database. | +| mysql.enabled | bool | `false` | enable integrated MySQL™ subchart from Bitnami | +| nameOverride | string | `""` | Provide a name in place of `shlink-backend` | +| nodeSelector | object | `{}` | Node labels for pod assignment | +| podAnnotations | object | `{}` | Annotations to be added to pods | +| podLabels | object | `{}` | Labels to be added to pods | +| podSecurityContext | object | `{}` | pod-level security context | +| postgresql.auth.database | string | `"shlink"` | The database name to be used when using the integrated PostgreSQL database. | +| postgresql.auth.password | string | `"shlink"` | The password credential to be used when using the integrated PostgreSQL database. | +| postgresql.auth.username | string | `"shlink"` | The username credential to be used when using the integrated PostgreSQL database. | +| postgresql.enabled | bool | `false` | enable integrated PostgreSQL™ subchart from Bitnami | +| rabbitmq.enabled | bool | `false` | enable integrated RabbitMQ™ subchart from Bitnami | +| redis.auth.enabled | bool | `false` | Enable password authentication | +| redis.enabled | bool | `false` | enable integrated Redis™ subchart from Bitnami | +| replicaCount | int | `1` | Number of replicas | +| resources | object | `{}` | Resource limits and requests for the headwind pods. | +| revisionHistoryLimit | int | `10` | The number of old ReplicaSets to retain | +| securityContext | object | `{}` | container-level security context | +| service.port | int | `8080` | Kubernetes port where service is exposed | +| service.type | string | `"ClusterIP"` | Kubernetes service type | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | Toleration labels for pod assignment | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```console +helm install my-release -f values.yaml christianhuth/shlink-backend +``` + +## Upgrading the Chart + +### To 5.0.0 + +This major updates the following dependencies: + +- MariaDB to its newest major, 20.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/mariadb#to-2020) you can find more information about the changes introduced in that version. +- MySQL to its newest major, 12.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/mysql#to-1220) you can find more information about the changes introduced in that version. +- PostgreSQL to its newest major, 16.3.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/postgresql#to-1630) you can find more information about the changes introduced in that version. +- RabbitMQ to its newest major, 15.2.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#to-1520) you can find more information about the changes introduced in that version. +- Redis to its newest major, 20.5.0: [Here](https://github.com/bitnami/charts/tree/main/bitnami/redis#to-2050) you can find more information about the changes introduced in that version. + +It also upgrades the Shlink Backend to its newest major, 4.4.0 and introduces a new way to define the configuration using the `config.*` Values. +If you have been using the `env` attribute so far to configure Shlink it is strongly recommended to migrate to the corresponding `config.*` Value. +The `env` attribute further has been replaced by an `extraEnv` attribute. + +### To 4.0.0 + +This major updates the PostgreSQL subchart to its newest major, 14.0.0. [Here](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#to-1400) you can find more information about the changes introduced in that version. + +### To 3.0.0 + +This major updates the Redis subchart to its newest major, 18.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/redis#upgrading) and [here](https://raw.githubusercontent.com/redis/redis/7.2/00-RELEASENOTES) you can find more information about the changes introduced in that version. + +Additionally it updates the MariaDB subchart to its newest major, 16.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/mariadb#to-1600) you can find more information about the changes introduced in that version. + +### To 2.0.0 + +This major updates the RabbitMQ subchart to its newest major, 12.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#upgrading) and [here](https://www.rabbitmq.com/upgrade.html) you can find more information about the changes introduced in that version. + +### To 1.0.0 + +This major updates the PostgreSQL subchart to its newest major, 12.0.0. [Here](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#to-1200) you can find more information about the changes introduced in that version. + +Additionally it updates the RabbitMQ subchart to its newest major, 11.0.0. [Here](https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq#to-1100) you can find more information about the changes introduced in that version. diff --git a/charts/shlink-backend/templates/deployment.yaml b/charts/shlink-backend/templates/deployment.yaml index 4cf80d47d..9de35235c 100644 --- a/charts/shlink-backend/templates/deployment.yaml +++ b/charts/shlink-backend/templates/deployment.yaml @@ -89,7 +89,7 @@ spec: - name: TIMEZONE value: {{ .Values.config.general.timezone | quote }} {{- end }} - + # Geolite Settings {{- if .Values.config.geolite.licenseKey }} - name: GEOLITE_LICENSE_KEY @@ -187,7 +187,7 @@ spec: {{- if (include "shlink-backend.redis.enabled" .) }} # Redis Settings - - name: REDIS_PUB_SUB_ENABLED + - name: REDIS_PUB_SUB_ENABLED value: {{ .Values.config.redis.pubSubEnabled | quote }} - name: REDIS_SERVERS value: {{ include "shlink-backend.redis.enabled" . | quote }} @@ -220,7 +220,7 @@ spec: {{- end }} - name: SHORT_URL_TRAILING_SLASH value: {{ .Values.config.urlShortening.shortUrlTrailingSlash | quote }} - + # Visits Tracking Settings - name: ANONYMIZE_REMOTE_ADDR value: {{ .Values.config.trackingVisits.anonymizeRemoteAddr | quote }} diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json new file mode 100644 index 000000000..c1e21910c --- /dev/null +++ b/charts/shlink-backend/values.schema.json @@ -0,0 +1,1091 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "affinity": { + "description": "Affinity settings for pod assignment", + "required": [], + "title": "affinity", + "type": "object" + }, + "autoscaling": { + "properties": { + "enabled": { + "default": false, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "maxReplicas": { + "default": 100, + "required": [], + "title": "maxReplicas", + "type": "integer" + }, + "minReplicas": { + "default": 1, + "required": [], + "title": "minReplicas", + "type": "integer" + }, + "targetCPUUtilizationPercentage": { + "default": 80, + "required": [], + "title": "targetCPUUtilizationPercentage", + "type": "integer" + } + }, + "required": [ + "enabled", + "minReplicas", + "maxReplicas", + "targetCPUUtilizationPercentage" + ], + "title": "autoscaling", + "type": "object" + }, + "config": { + "properties": { + "database": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "database", + "type": "string" + }, + "existingSecret": { + "default": "", + "description": "Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`.", + "required": [], + "title": "existingSecret", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using an external database driver.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using an external database driver.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "existingSecret", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "driver": { + "default": "sqlite", + "description": "mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "driver", + "type": "string" + }, + "host": { + "default": "", + "description": "The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "host", + "type": "string" + }, + "port": { + "default": 0, + "description": "The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", + "required": [], + "title": "port", + "type": "integer" + }, + "useEncryption": { + "default": false, + "description": "Whether it is desired to use an encrypted connection with the database or not", + "required": [], + "title": "useEncryption", + "type": "boolean" + } + }, + "required": [ + "auth", + "driver", + "host", + "port", + "useEncryption" + ], + "title": "database", + "type": "object" + }, + "general": { + "properties": { + "basePath": { + "default": "", + "description": "The base path from which you plan to serve Shlink, in case you don’t want to serve it from the root of the domain. It has to start with a bar, like /shlink. Defaults to ''.", + "required": [], + "title": "basePath", + "type": "string" + }, + "cacheNamespace": { + "default": "", + "description": "A prefix used for all cache keys generated by Shlink. It’s important to set a unique value here if you have multiple Shlink instances sharing the same cache store (same server when not using redis, or same redis cluster), otherwise there could be collisions. Defaults to Shlink.", + "required": [], + "title": "cacheNamespace", + "type": "string" + }, + "defaultDomain": { + "default": "", + "description": "The default short domain used for this Shlink instance. For example s.test.", + "required": [], + "title": "defaultDomain", + "type": "string" + }, + "initialApiKey": { + "default": "", + "description": "An API key that will be created once during container start-up, with admin permissions.", + "required": [], + "title": "initialApiKey", + "type": "string" + }, + "isHttpsEnabled": { + "default": false, + "description": "Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS.", + "required": [], + "title": "isHttpsEnabled", + "type": "boolean" + }, + "memoryLimit": { + "default": "", + "description": "The maximum amount of memory that every Shlink process can use. You can provide a number, which will be the amount of memory in bytes, or a number followed by K for kilobytes, M for megabytes or G for gigabytes. You can also provide -1 to set no memory limit. Defaults to 512M.", + "required": [], + "title": "memoryLimit", + "type": "string" + }, + "timezone": { + "default": "", + "description": "A timezone code as defined [in this list](https://www.php.net/manual/en/timezones.php). All dates stored by Shlink (visits, short URL creation, etc) will be considered to be on this timezone. By default, the default timezone set in PHP config will be used, which is UTC in the case of the docker image.", + "required": [], + "title": "timezone", + "type": "string" + } + }, + "required": [ + "basePath", + "cacheNamespace", + "defaultDomain", + "initialApiKey", + "isHttpsEnabled", + "memoryLimit", + "timezone" + ], + "title": "general", + "type": "object" + }, + "geolite": { + "properties": { + "licenseKey": { + "default": "", + "description": "The license key used to download new GeoLite2 database files. Go to GeoLite2 license key to know how to generate it. Not providing a license key will completely disable visits geolocation.", + "required": [], + "title": "licenseKey", + "type": "string" + }, + "skipInitialDownload": { + "default": false, + "description": "If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background.", + "required": [], + "title": "skipInitialDownload", + "type": "boolean" + } + }, + "required": [ + "licenseKey", + "skipInitialDownload" + ], + "title": "geolite", + "type": "object" + }, + "matomo": { + "properties": { + "auth": { + "properties": { + "apiToken": { + "default": "", + "description": "The API token so that Shlink can call Matomo’s API", + "required": [], + "title": "apiToken", + "type": "string" + }, + "existingSecret": { + "default": "", + "description": "Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`.", + "required": [], + "title": "existingSecret", + "type": "string" + } + }, + "required": [ + "apiToken", + "existingSecret" + ], + "title": "auth", + "type": "object" + }, + "baseUrl": { + "default": "", + "description": "The external Matomo server URL.", + "required": [], + "title": "baseUrl", + "type": "string" + }, + "enabled": { + "default": false, + "description": "Tells if visits should be sent to a Matomo instance.", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "siteId": { + "default": "", + "description": "The site ID to be used for Shlink visits.", + "required": [], + "title": "siteId", + "type": "string" + } + }, + "required": [ + "enabled", + "auth", + "baseUrl", + "siteId" + ], + "title": "matomo", + "type": "object" + }, + "mercure": { + "properties": { + "auth": { + "properties": { + "existingSecret": { + "default": "", + "description": "Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`.", + "required": [], + "title": "existingSecret", + "type": "string" + }, + "jwtSecret": { + "default": "", + "description": "The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server.", + "required": [], + "title": "jwtSecret", + "type": "string" + } + }, + "required": [ + "jwtSecret", + "existingSecret" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "Enable the Mercure Hub integration.", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "internalHubUrl": { + "default": "", + "description": "An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public.", + "required": [], + "title": "internalHubUrl", + "type": "string" + }, + "publicHubUrl": { + "default": "", + "description": "The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates.", + "required": [], + "title": "publicHubUrl", + "type": "string" + } + }, + "required": [ + "enabled", + "auth", + "publicHubUrl", + "internalHubUrl" + ], + "title": "mercure", + "type": "object" + }, + "redirects": { + "properties": { + "cacheLifetime": { + "default": 30, + "description": "Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308.", + "required": [], + "title": "cacheLifetime", + "type": "integer" + }, + "defaultBaseUrlRedirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultBaseUrlRedirect", + "type": "string" + }, + "defaultInvalidShortUrlRedirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultInvalidShortUrlRedirect", + "type": "string" + }, + "defaultRegular404Redirect": { + "default": "", + "description": "If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page.", + "required": [], + "title": "defaultRegular404Redirect", + "type": "string" + }, + "extraPathMode": { + "default": "default", + "description": "Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info).", + "required": [], + "title": "extraPathMode", + "type": "string" + }, + "statusCode": { + "default": 302, + "description": "301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method.", + "required": [], + "title": "statusCode", + "type": "integer" + } + }, + "required": [ + "cacheLifetime", + "defaultBaseUrlRedirect", + "defaultInvalidShortUrlRedirect", + "defaultRegular404Redirect", + "extraPathMode", + "statusCode" + ], + "title": "redirects", + "type": "object" + }, + "redis": { + "properties": { + "pubSubEnabled": { + "default": false, + "description": "Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub.", + "required": [], + "title": "pubSubEnabled", + "type": "boolean" + }, + "servers": { + "default": "", + "description": "The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled", + "required": [], + "title": "servers", + "type": "string" + } + }, + "required": [ + "pubSubEnabled", + "servers" + ], + "title": "redis", + "type": "object" + }, + "robots": { + "properties": { + "allowAllShortUrls": { + "default": false, + "description": "Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored.", + "required": [], + "title": "allowAllShortUrls", + "type": "boolean" + }, + "userAgents": { + "default": "*", + "description": "A comma-separated list of allowed user agents via robots.txt.", + "required": [], + "title": "userAgents", + "type": "string" + } + }, + "required": [ + "allowAllShortUrls", + "userAgents" + ], + "title": "robots", + "type": "object" + }, + "trackingVisits": { + "properties": { + "anonymizeRemoteAddr": { + "default": true, + "description": "Tells if IP addresses from visitors should be obfuscated before storing them in the database. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "anonymizeRemoteAddr", + "type": "boolean" + }, + "disable": { + "default": false, + "description": "Tells if visits tracking should be completely disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disable", + "type": "boolean" + }, + "disableIpTracking": { + "default": false, + "description": "Tells if tracking of the IP address (and therefore visitors location) should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableIpTracking", + "type": "boolean" + }, + "disableReferrerTracking": { + "default": false, + "description": "Tells if tracking of the referrer should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableReferrerTracking", + "type": "boolean" + }, + "disableTrackingFrom": { + "default": "", + "description": "A comma-separated list of IP address patterns from which all tracking should be disabled. It allows providing fixed IP addresses (100.200.80.40), CIDR blocks (192.168.10.0/24) or wildcard patterns (11.22.*.*)", + "required": [], + "title": "disableTrackingFrom", + "type": "string" + }, + "disableTrackingParam": { + "default": "", + "description": "The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableTrackingParam", + "type": "string" + }, + "disableUaTracking": { + "default": false, + "description": "Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "disableUaTracking", + "type": "boolean" + }, + "trackOrphanVisits": { + "default": true, + "description": "Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info.", + "required": [], + "title": "trackOrphanVisits", + "type": "boolean" + } + }, + "required": [ + "anonymizeRemoteAddr", + "disable", + "disableIpTracking", + "disableReferrerTracking", + "disableTrackingParam", + "disableTrackingFrom", + "disableUaTracking", + "trackOrphanVisits" + ], + "title": "trackingVisits", + "type": "object" + }, + "urlShortening": { + "properties": { + "autoResolveTitles": { + "default": true, + "description": "Used to automatically resolve the short URL’s title based on the \u003ctitle /\u003e tag in the long URL", + "required": [], + "title": "autoResolveTitles", + "type": "boolean" + }, + "defaultShortCodesLength": { + "default": 5, + "description": "The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4.", + "required": [], + "title": "defaultShortCodesLength", + "type": "integer" + }, + "deleteShortUrlThreshold": { + "default": "", + "description": "The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled.", + "required": [], + "title": "deleteShortUrlThreshold", + "type": "string" + }, + "multiSegmentSlugsEnabled": { + "default": false, + "description": "Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information.", + "required": [], + "title": "multiSegmentSlugsEnabled", + "type": "boolean" + }, + "shortUrlMode": { + "default": "strict", + "description": "Determines how to match short URLs. Valid values are strict or loose. See [short URLs mode](https://shlink.io/documentation/some-features/#short-urls-mode) for more information.", + "required": [], + "title": "shortUrlMode", + "type": "string" + }, + "shortUrlTrailingSlash": { + "default": false, + "description": "Allows to enable support for trailing slashes in short URLs when true is provided. See [short URLs trailing slash](https://shlink.io/documentation/some-features/#short-urls-trailing-slash) for more information.", + "required": [], + "title": "shortUrlTrailingSlash", + "type": "boolean" + } + }, + "required": [ + "autoResolveTitles", + "defaultShortCodesLength", + "deleteShortUrlThreshold", + "multiSegmentSlugsEnabled", + "shortUrlMode", + "shortUrlTrailingSlash" + ], + "title": "urlShortening", + "type": "object" + } + }, + "required": [ + "database", + "general", + "geolite", + "matomo", + "mercure", + "redirects", + "redis", + "robots", + "trackingVisits", + "urlShortening" + ], + "title": "config", + "type": "object" + }, + "extraEnv": { + "description": "additional environment variables to be added to the pods. See https://shlink.io/documentation/environment-variables for a complete list.", + "items": { + "required": [] + }, + "required": [], + "title": "extraEnv", + "type": "array" + }, + "fullnameOverride": { + "default": "", + "description": "String to fully override `\"shlink-backend.fullname\"`", + "required": [], + "title": "fullnameOverride", + "type": "string" + }, + "global": { + "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", + "required": [], + "title": "global", + "type": "object" + }, + "image": { + "properties": { + "pullPolicy": { + "default": "Always", + "description": "image pull policy", + "required": [], + "title": "pullPolicy", + "type": "string" + }, + "registry": { + "default": "docker.io", + "description": "image registry", + "required": [], + "title": "registry", + "type": "string" + }, + "repository": { + "default": "shlinkio/shlink", + "description": "image repository", + "required": [], + "title": "repository", + "type": "string" + }, + "tag": { + "default": "4.4.0", + "description": "Overrides the image tag", + "required": [], + "title": "tag", + "type": "string" + } + }, + "required": [ + "registry", + "repository", + "pullPolicy", + "tag" + ], + "title": "image", + "type": "object" + }, + "imagePullSecrets": { + "description": "If defined, uses a Secret to pull an image from a private Docker registry or repository.", + "items": { + "required": [] + }, + "required": [], + "title": "imagePullSecrets", + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "required": [], + "title": "annotations", + "type": "object" + }, + "className": { + "default": "", + "required": [], + "title": "className", + "type": "string" + }, + "enabled": { + "default": false, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "hosts": { + "description": "kubernetes.io/ingress.class: nginx\nkubernetes.io/tls-acme: \"true\"", + "items": { + "anyOf": [ + { + "properties": { + "host": { + "default": "chart-example.local", + "required": [], + "title": "host", + "type": "string" + }, + "paths": { + "items": { + "anyOf": [ + { + "properties": { + "path": { + "default": "/", + "required": [], + "title": "path", + "type": "string" + }, + "pathType": { + "default": "ImplementationSpecific", + "required": [], + "title": "pathType", + "type": "string" + } + }, + "required": [ + "path", + "pathType" + ], + "type": "object" + } + ], + "required": [] + }, + "required": [], + "title": "paths", + "type": "array" + } + }, + "required": [ + "host", + "paths" + ], + "type": "object" + } + ], + "required": [] + }, + "required": [], + "title": "hosts", + "type": "array" + }, + "tls": { + "items": { + "required": [] + }, + "required": [], + "title": "tls", + "type": "array" + } + }, + "required": [ + "enabled", + "className", + "annotations", + "hosts", + "tls" + ], + "title": "ingress", + "type": "object" + }, + "mariadb": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated MariaDB database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated MariaDB database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated MariaDB database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated MariaDB™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "mariadb", + "type": "object" + }, + "mysql": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated MySQL database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated MySQL database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated MySQL database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated MySQL™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "mysql", + "type": "object" + }, + "nameOverride": { + "default": "", + "description": "Provide a name in place of `shlink-backend`", + "required": [], + "title": "nameOverride", + "type": "string" + }, + "nodeSelector": { + "description": "Node labels for pod assignment", + "required": [], + "title": "nodeSelector", + "type": "object" + }, + "podAnnotations": { + "description": "Annotations to be added to pods", + "required": [], + "title": "podAnnotations", + "type": "object" + }, + "podLabels": { + "description": "Labels to be added to pods", + "required": [], + "title": "podLabels", + "type": "object" + }, + "podSecurityContext": { + "description": "pod-level security context", + "required": [], + "title": "podSecurityContext", + "type": "object" + }, + "postgresql": { + "properties": { + "auth": { + "properties": { + "database": { + "default": "shlink", + "description": "The database name to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "database", + "type": "string" + }, + "password": { + "default": "shlink", + "description": "The password credential to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "shlink", + "description": "The username credential to be used when using the integrated PostgreSQL database.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "database", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated PostgreSQL™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "postgresql", + "type": "object" + }, + "rabbitmq": { + "properties": { + "enabled": { + "default": false, + "description": "enable integrated RabbitMQ™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "rabbitmq", + "type": "object" + }, + "redis": { + "properties": { + "auth": { + "properties": { + "enabled": { + "default": false, + "description": "Enable password authentication", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable integrated Redis™ subchart from Bitnami", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled", + "auth" + ], + "title": "redis", + "type": "object" + }, + "replicaCount": { + "default": 1, + "description": "Number of replicas", + "required": [], + "title": "replicaCount", + "type": "integer" + }, + "resources": { + "description": "Resource limits and requests for the headwind pods.", + "required": [], + "title": "resources", + "type": "object" + }, + "revisionHistoryLimit": { + "default": 10, + "description": "The number of old ReplicaSets to retain", + "required": [], + "title": "revisionHistoryLimit", + "type": "integer" + }, + "securityContext": { + "description": "container-level security context", + "required": [], + "title": "securityContext", + "type": "object" + }, + "service": { + "properties": { + "port": { + "default": 8080, + "description": "Kubernetes port where service is exposed", + "required": [], + "title": "port", + "type": "integer" + }, + "type": { + "default": "ClusterIP", + "description": "Kubernetes service type", + "required": [], + "title": "type", + "type": "string" + } + }, + "required": [ + "type", + "port" + ], + "title": "service", + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "description": "Annotations to add to the service account", + "required": [], + "title": "annotations", + "type": "object" + }, + "create": { + "default": true, + "description": "Specifies whether a service account should be created", + "required": [], + "title": "create", + "type": "boolean" + }, + "name": { + "default": "", + "description": "The name of the service account to use.\nIf not set and create is true, a name is generated using the fullname template", + "required": [], + "title": "name", + "type": "string" + } + }, + "required": [ + "create", + "annotations", + "name" + ], + "title": "serviceAccount", + "type": "object" + }, + "tolerations": { + "description": "Toleration labels for pod assignment", + "items": { + "required": [] + }, + "required": [], + "title": "tolerations", + "type": "array" + } + }, + "required": [ + "nameOverride", + "fullnameOverride", + "image", + "imagePullSecrets", + "replicaCount", + "revisionHistoryLimit", + "serviceAccount", + "podAnnotations", + "podLabels", + "podSecurityContext", + "securityContext", + "service", + "ingress", + "resources", + "autoscaling", + "nodeSelector", + "tolerations", + "affinity", + "extraEnv", + "config", + "mariadb", + "mysql", + "postgresql", + "rabbitmq", + "redis" + ], + "type": "object" +} diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index 10f0977a8..b238bd849 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -130,7 +130,7 @@ config: cacheNamespace: "" # -- The default short domain used for this Shlink instance. For example s.test. defaultDomain: "" - # -- An API key that will be created once during container start-up, with admin permissions. + # -- An API key that will be created once during container start-up, with admin permissions. initialApiKey: "" # -- Tells if Shlink is served with https or not (true or false). It’s still up to you to actually serve it with HTTPS. isHttpsEnabled: false @@ -144,7 +144,7 @@ config: # -- If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. skipInitialDownload: false matomo: - # -- Tells if visits should be sent to a Matomo instance. + # -- Tells if visits should be sent to a Matomo instance. enabled: false auth: # -- The API token so that Shlink can call Matomo’s API From cf5d5c06dc0b1481dafd6711b97db227310bc0ed Mon Sep 17 00:00:00 2001 From: christianhuth <christianhuth@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:13:33 +0000 Subject: [PATCH 07/12] chore: auto-upgrade schema and readme --- charts/shlink-backend/CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 charts/shlink-backend/CHANGELOG.md diff --git a/charts/shlink-backend/CHANGELOG.md b/charts/shlink-backend/CHANGELOG.md new file mode 100644 index 000000000..01986dc33 --- /dev/null +++ b/charts/shlink-backend/CHANGELOG.md @@ -0,0 +1,18 @@ +# shlink-backend + +## 5.0.0 + +### Added + +- option to define image registry (image.registry) +- options to define the configuration (config.*) + +### Changed + +- app version to 4.4.0 +- dependency to mariadb to 20.2.1 +- dependency to mysql to 12.2.2 +- dependency to postgresql to 16.4.5 +- dependency to rabbitmq to 15.2.3 +- dependency to redis to 20.6.3 +- option to define additional environment variables (extraEnv) From 41d7f5732c65cfdbe42df992755cb8027729692c Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Thu, 30 Jan 2025 16:16:21 +0000 Subject: [PATCH 08/12] remove fail function from database host --- charts/shlink-backend/templates/database/_database.tpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/charts/shlink-backend/templates/database/_database.tpl b/charts/shlink-backend/templates/database/_database.tpl index 81509cfc3..7fb1fc30a 100644 --- a/charts/shlink-backend/templates/database/_database.tpl +++ b/charts/shlink-backend/templates/database/_database.tpl @@ -32,9 +32,6 @@ Define the database host {{- else -}} {{- $host = .Values.config.database.host -}} {{- end -}} -{{- if not $host -}} - {{- fail "Unable to determine the database host. Use config.database.host or activate one of the integrated databases" -}} -{{- end -}} {{- $host -}} {{- end }} From 701f8aae315d062bad0d4e3928a1dbf21c168ab9 Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Thu, 30 Jan 2025 16:23:23 +0000 Subject: [PATCH 09/12] add new fail function for database host --- charts/shlink-backend/templates/database/_database.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/shlink-backend/templates/database/_database.tpl b/charts/shlink-backend/templates/database/_database.tpl index 7fb1fc30a..45a7fd2be 100644 --- a/charts/shlink-backend/templates/database/_database.tpl +++ b/charts/shlink-backend/templates/database/_database.tpl @@ -32,6 +32,9 @@ Define the database host {{- else -}} {{- $host = .Values.config.database.host -}} {{- end -}} +{{- if and (not $host) (not (eq (include "shlink-backend.database.driver" .) "sqlite")) -}} + {{- fail "Unable to determine the database host. Use config.database.host or activate one of the integrated databases" -}} +{{- end -}} {{- $host -}} {{- end }} From 5d5a5ff0cb5609f0c5e18c2bb87e150fc6d62648 Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Thu, 30 Jan 2025 16:30:40 +0000 Subject: [PATCH 10/12] reworked readme and schema --- charts/shlink-backend/README.md | 2 +- charts/shlink-backend/values.schema.json | 2 +- charts/shlink-backend/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/shlink-backend/README.md b/charts/shlink-backend/README.md index 4df319289..0adb60319 100644 --- a/charts/shlink-backend/README.md +++ b/charts/shlink-backend/README.md @@ -96,7 +96,7 @@ The command removes all the Kubernetes components associated with the chart and | config.trackingVisits.disableTrackingParam | string | `""` | The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won’t be available if no value is provided. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | | config.trackingVisits.disableUaTracking | bool | `false` | Tells if tracking of the user agent should be disabled. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | | config.trackingVisits.trackOrphanVisits | bool | `true` | Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. | -| config.urlShortening.autoResolveTitles | bool | `true` | Used to automatically resolve the short URL’s title based on the <title /> tag in the long URL | +| config.urlShortening.autoResolveTitles | bool | `true` | Used to automatically resolve the short URL’s title based on the title-tag in the long URL | | config.urlShortening.defaultShortCodesLength | int | `5` | The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4. | | config.urlShortening.deleteShortUrlThreshold | string | `""` | The amount of visits on short URLs which will not allow them to be deleted. If not provided, this restriction will be disabled. | | config.urlShortening.multiSegmentSlugsEnabled | bool | `false` | Allows to create and handle multi-segment custom slugs when true is provided. See [multi-segment custom slugs](https://shlink.io/documentation/some-features/#multi-segment-custom-slugs) for more information. | diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json index c1e21910c..504a9c487 100644 --- a/charts/shlink-backend/values.schema.json +++ b/charts/shlink-backend/values.schema.json @@ -508,7 +508,7 @@ "properties": { "autoResolveTitles": { "default": true, - "description": "Used to automatically resolve the short URL’s title based on the \u003ctitle /\u003e tag in the long URL", + "description": "Used to automatically resolve the short URL’s title based on the title-tag in the long URL", "required": [], "title": "autoResolveTitles", "type": "boolean" diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index b238bd849..33950d2b0 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -208,7 +208,7 @@ config: # -- Tells if orphan visits should be tracked or not. See [Tracking visits](https://shlink.io/documentation/tracking-visits/) for more info. trackOrphanVisits: true urlShortening: - # -- Used to automatically resolve the short URL’s title based on the <title /> tag in the long URL + # -- Used to automatically resolve the short URL’s title based on the title-tag in the long URL autoResolveTitles: true # -- The length you want generated short codes to have. It defaults to 5 and has to be at least 4, so any value smaller than that will fall back to 4. defaultShortCodesLength: 5 From 29e76e794a578caa25d10c0e492ce16fa1c4e5a2 Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Thu, 30 Jan 2025 17:20:37 +0000 Subject: [PATCH 11/12] quote all env variables --- charts/shlink-backend/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/shlink-backend/templates/deployment.yaml b/charts/shlink-backend/templates/deployment.yaml index 9de35235c..1c1c3c458 100644 --- a/charts/shlink-backend/templates/deployment.yaml +++ b/charts/shlink-backend/templates/deployment.yaml @@ -60,7 +60,7 @@ spec: # Docker Settings - name: PORT - value: {{ .Values.service.port | int }} + value: {{ .Values.service.port | quote }} # General Settings {{- if .Values.config.general.basePath }} @@ -206,7 +206,7 @@ spec: value: {{ .Values.config.urlShortening.autoResolveTitles | quote }} {{- if .Values.config.urlShortening.defaultShortCodesLength }} - name: DEFAULT_SHORT_CODES_LENGTH - value: {{ .Values.config.urlShortening.defaultShortCodesLength | int }} + value: {{ .Values.config.urlShortening.defaultShortCodesLength | quote }} {{- end }} {{- if .Values.config.urlShortening.deleteShortUrlThreshold }} - name: DELETE_SHORT_URL_THRESHOLD From 6ece306405834aae538d89c2f31cd0ef8c005f3d Mon Sep 17 00:00:00 2001 From: christianhuth <christian@knell.it> Date: Fri, 31 Jan 2025 09:11:08 +0000 Subject: [PATCH 12/12] rework rabbitmq, add qr code variables, update readme and schema --- charts/shlink-backend/README.md | 30 ++- .../shlink-backend/ci/00-sqlite-values.yaml | 1 + .../ci/04-integrations-values.yaml | 14 + .../shlink-backend/ci/04-rabbitmq-values.yaml | 3 - .../shlink-backend/ci/05-rabbitmq-values.yaml | 5 + ...redis-values.yaml => 06-redis-values.yaml} | 0 .../templates/database/secret.yaml | 4 +- .../templates/matomo/_matomo.tpl | 11 + .../templates/matomo/secret.yaml | 4 +- .../templates/mercure/_mercure.tpl | 11 + .../templates/mercure/secret.yaml | 4 +- .../templates/rabbitmq/_rabbitmq.tpl | 77 ++++++ .../templates/rabbitmq/secret.yaml | 11 + .../shlink-backend/templates/redis/_redis.tpl | 39 ++- .../{ => shlink-backend}/deployment.yaml | 95 +++++-- .../templates/{ => shlink-backend}/hpa.yaml | 2 +- .../{ => shlink-backend}/ingress.yaml | 6 +- .../{ => shlink-backend}/service.yaml | 3 +- .../{ => shlink-backend}/serviceaccount.yaml | 6 +- charts/shlink-backend/values.schema.json | 241 +++++++++++++++++- charts/shlink-backend/values.yaml | 57 ++++- 21 files changed, 567 insertions(+), 57 deletions(-) create mode 100644 charts/shlink-backend/ci/00-sqlite-values.yaml create mode 100644 charts/shlink-backend/ci/04-integrations-values.yaml delete mode 100644 charts/shlink-backend/ci/04-rabbitmq-values.yaml create mode 100644 charts/shlink-backend/ci/05-rabbitmq-values.yaml rename charts/shlink-backend/ci/{05-redis-values.yaml => 06-redis-values.yaml} (100%) create mode 100644 charts/shlink-backend/templates/rabbitmq/_rabbitmq.tpl create mode 100644 charts/shlink-backend/templates/rabbitmq/secret.yaml rename charts/shlink-backend/templates/{ => shlink-backend}/deployment.yaml (78%) rename charts/shlink-backend/templates/{ => shlink-backend}/hpa.yaml (100%) rename charts/shlink-backend/templates/{ => shlink-backend}/ingress.yaml (100%) rename charts/shlink-backend/templates/{ => shlink-backend}/service.yaml (98%) rename charts/shlink-backend/templates/{ => shlink-backend}/serviceaccount.yaml (100%) diff --git a/charts/shlink-backend/README.md b/charts/shlink-backend/README.md index 0adb60319..b400fae53 100644 --- a/charts/shlink-backend/README.md +++ b/charts/shlink-backend/README.md @@ -51,10 +51,10 @@ The command removes all the Kubernetes components associated with the chart and | autoscaling.maxReplicas | int | `100` | | | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | -| config.database.auth.database | string | `"shlink"` | The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | +| config.database.auth.database | string | `""` | The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | | config.database.auth.existingSecret | string | `""` | Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`. | -| config.database.auth.password | string | `"shlink"` | The password credential to be used when using an external database driver. | -| config.database.auth.username | string | `"shlink"` | The username credential to be used when using an external database driver. | +| config.database.auth.password | string | `""` | The password credential to be used when using an external database driver. | +| config.database.auth.username | string | `""` | The username credential to be used when using an external database driver. | | config.database.driver | string | `"sqlite"` | mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | | config.database.host | string | `""` | The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | | config.database.port | int | `0` | The port in which the database service is running when using an external database driver. Default value is based on the value provided for DB_DRIVER. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled | @@ -71,20 +71,39 @@ The command removes all the Kubernetes components associated with the chart and | config.matomo.auth.apiToken | string | `""` | The API token so that Shlink can call Matomo’s API | | config.matomo.auth.existingSecret | string | `""` | Use existing secret for the API token details (`config.matomo.auth.apiToken` will be ignored and picked up from this secret). The secret has to contain the key `api-token`. | | config.matomo.baseUrl | string | `""` | The external Matomo server URL. | -| config.matomo.enabled | bool | `false` | Tells if visits should be sent to a Matomo instance. | +| config.matomo.enabled | bool | `false` | Enable the Matomo integration to sent visits | | config.matomo.siteId | string | `""` | The site ID to be used for Shlink visits. | | config.mercure.auth.existingSecret | string | `""` | Use existing secret for the JWT secret details (`config.mercure.auth.jwtSecret` will be ignored and picked up from this secret). The secret has to contain the key `jwt-secret`. | | config.mercure.auth.jwtSecret | string | `""` | The secret key that was provided to the mercure hub server, in order to be able to generate valid JWTs for publishing/subscribing to that server. | | config.mercure.enabled | bool | `false` | Enable the Mercure Hub integration. | | config.mercure.internalHubUrl | string | `""` | An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. | | config.mercure.publicHubUrl | string | `""` | The public URL of a mercure hub server to which Shlink will sent updates. This URL will also be served to consumers that want to subscribe to those updates. | +| config.qrCodes.codeForDisabledShortUrls | bool | `true` | Whether generating QR codes should work for disabled short URLs. Disabled short URLs are those which reached the maximum amount of visits, have a validSince date in the future, or a validUntil date in the past. | +| config.qrCodes.defaultColors.background | string | `"#FFFFFF"` | The QR code background color. | +| config.qrCodes.defaultColors.foreground | string | `"#000000"` | The QR code foreground color. | +| config.qrCodes.defaultErrorCorrection | string | `"l"` | One of L (Low), M (Medium), Q (Quartile) or H (High), to determine the default error correction of generated QR codes when the errorCorrection query param is not provided. | +| config.qrCodes.defaultFormat | string | `"png"` | One of png or svg, to determine the default format of generated QR codes when the format query param is not provided. | +| config.qrCodes.defaultLogoUrl | string | `""` | A URL pointing to a logo that will be placed in the middle of the QR code. This one is experimental, as some images might break the QR code. | +| config.qrCodes.defaultMargin | int | `0` | A value greater than 0 to determine the default margin of generated QR codes when the margin query param is not provided. | +| config.qrCodes.defaultRoundBlockSize | bool | `true` | Tells if the block size should be round on QR codes, making it more readable, but potentially adding some extra margin as a side effect. | +| config.qrCodes.defaultSize | int | `300` | A value between 50 and 1000 to determine the default size of generated QR codes when the size query param is not provided. | +| config.rabbitmq.auth.existingSecret | string | `""` | Use existing secret for password details (`config.rabbitmq.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `rabbitmq-password`. | +| config.rabbitmq.auth.password | string | `""` | The password credential to be used when using an external database driver. | +| config.rabbitmq.auth.username | string | `""` | The username credential to be used when using an external database driver. | +| config.rabbitmq.enabled | bool | `false` | enable RabbitMQ™ Integration | +| config.rabbitmq.host | string | `""` | The RabbitMQ server host name | +| config.rabbitmq.useSsl | bool | `false` | Whether connection is encrypted with SSL/TLS or not. | +| config.rabbitmq.vhost | string | `"/"` | The RabbitMQ server VHost | | config.redirects.cacheLifetime | int | `30` | Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308. | | config.redirects.defaultBaseUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access Shlink’s base URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | | config.redirects.defaultInvalidShortUrlRedirect | string | `""` | If a URL is provided here, when a user tries to access an invalid short URL, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | | config.redirects.defaultRegular404Redirect | string | `""` | If a URL is provided here, when a user tries to access a URL not matching any supported by the router, and the visited domain does not have a redirect URL of its own, he/she will be redirected to this value. If this env var is not provided, the user will see a generic 404 - not found page. | | config.redirects.extraPathMode | string | `"default"` | Determines how Shlink should match short URLs when they start with a known short code. Valid values are default, append and ignore. (See [Extra path forwarding](https://shlink.io/documentation/some-features/#extra-path-forwarding) for more info). | | config.redirects.statusCode | int | `302` | 301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method. | +| config.redis.enabled | bool | `false` | enable Redis™ Integration | | config.redis.pubSubEnabled | bool | `false` | Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub. | +| config.redis.sentinal.enabled | bool | `false` | | +| config.redis.sentinal.service | string | `""` | The name of the sentinel service if you want to use redis sentinel. If this value is provided, the servers provided in config.redis.servers will be considered sentinel instances. | | config.redis.servers | string | `""` | The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled | | config.robots.allowAllShortUrls | bool | `false` | Whether all short URLs should be allowed via robots.txt or not. If set to true, the crawlable option set in individual short URLs will be ignored. | | config.robots.userAgents | string | `"*"` | A comma-separated list of allowed user agents via robots.txt. | @@ -134,8 +153,11 @@ The command removes all the Kubernetes components associated with the chart and | postgresql.auth.username | string | `"shlink"` | The username credential to be used when using the integrated PostgreSQL database. | | postgresql.enabled | bool | `false` | enable integrated PostgreSQL™ subchart from Bitnami | | rabbitmq.enabled | bool | `false` | enable integrated RabbitMQ™ subchart from Bitnami | +| redis.architecture | string | `"standalone"` | Redis™ architecture. Allowed values: `standalone` or `replication` | | redis.auth.enabled | bool | `false` | Enable password authentication | +| redis.auth.sentinel | bool | `false` | Enable password authentication on Redis™ Sentinels | | redis.enabled | bool | `false` | enable integrated Redis™ subchart from Bitnami | +| redis.sentinel.enabled | bool | `false` | Use Redis™ Sentinel on Redis™ pods | | replicaCount | int | `1` | Number of replicas | | resources | object | `{}` | Resource limits and requests for the headwind pods. | | revisionHistoryLimit | int | `10` | The number of old ReplicaSets to retain | diff --git a/charts/shlink-backend/ci/00-sqlite-values.yaml b/charts/shlink-backend/ci/00-sqlite-values.yaml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/charts/shlink-backend/ci/00-sqlite-values.yaml @@ -0,0 +1 @@ +--- diff --git a/charts/shlink-backend/ci/04-integrations-values.yaml b/charts/shlink-backend/ci/04-integrations-values.yaml new file mode 100644 index 000000000..7945767a4 --- /dev/null +++ b/charts/shlink-backend/ci/04-integrations-values.yaml @@ -0,0 +1,14 @@ +--- +config: + matomo: + enabled: true + auth: + apiToken: "a-test-api-tokeen" + baseUrl: "my-matomo.com" + siteId: "SMj6N3zV5eK0Y8dO7TXG41I9LvfDoRl2" + mercure: + enabled: true + auth: + jwtSecret: "a-test-jwt-secret" + publicHubUrl: "my-public-mercure-hub.com" + internalHubUrl: "my-internal-mercure-hub.com" diff --git a/charts/shlink-backend/ci/04-rabbitmq-values.yaml b/charts/shlink-backend/ci/04-rabbitmq-values.yaml deleted file mode 100644 index 2d238129e..000000000 --- a/charts/shlink-backend/ci/04-rabbitmq-values.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rabbitmq: - enabled: true diff --git a/charts/shlink-backend/ci/05-rabbitmq-values.yaml b/charts/shlink-backend/ci/05-rabbitmq-values.yaml new file mode 100644 index 000000000..bc7c7f197 --- /dev/null +++ b/charts/shlink-backend/ci/05-rabbitmq-values.yaml @@ -0,0 +1,5 @@ +--- +rabbitmq: + enabled: true + auth: + password: my-test-password diff --git a/charts/shlink-backend/ci/05-redis-values.yaml b/charts/shlink-backend/ci/06-redis-values.yaml similarity index 100% rename from charts/shlink-backend/ci/05-redis-values.yaml rename to charts/shlink-backend/ci/06-redis-values.yaml diff --git a/charts/shlink-backend/templates/database/secret.yaml b/charts/shlink-backend/templates/database/secret.yaml index 477b894d7..0092cbd75 100644 --- a/charts/shlink-backend/templates/database/secret.yaml +++ b/charts/shlink-backend/templates/database/secret.yaml @@ -1,8 +1,10 @@ -{{- if and (not .Values.config.database.auth.existingSecret) (not .Values.mariadb.enabled) (not .Values.mysql.enabled) (not .Values.postgresql.enabled) -}} +{{- if and (not .Values.mariadb.enabled) (not .Values.mysql.enabled) (not .Values.postgresql.enabled) (not .Values.config.database.auth.existingSecret) -}} --- apiVersion: v1 kind: Secret metadata: + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} name: {{ include "shlink-backend.database.auth.secretName" . }} data: {{- include "shlink-backend.database.auth.secretKey" . | nindent 2 }}: {{ .Values.config.database.auth.password | b64enc }} diff --git a/charts/shlink-backend/templates/matomo/_matomo.tpl b/charts/shlink-backend/templates/matomo/_matomo.tpl index 8734dbdeb..f9d0fd6a5 100644 --- a/charts/shlink-backend/templates/matomo/_matomo.tpl +++ b/charts/shlink-backend/templates/matomo/_matomo.tpl @@ -1,3 +1,14 @@ +{{/* +Define if the Matomo integration is enabled +*/}} +{{- define "shlink-backend.matomo.enabled" -}} +{{- $enabled := "" -}} +{{- if .Values.config.matomo.enabled -}} + {{- $enabled = "true" -}} +{{- end }} +{{- $enabled -}} +{{- end }} + {{/* Get the name of the secret containing the API token */}} diff --git a/charts/shlink-backend/templates/matomo/secret.yaml b/charts/shlink-backend/templates/matomo/secret.yaml index 29295dbf2..37d48edc4 100644 --- a/charts/shlink-backend/templates/matomo/secret.yaml +++ b/charts/shlink-backend/templates/matomo/secret.yaml @@ -1,8 +1,10 @@ -{{- if and (.Values.config.matomo.enabled) (not .Values.config.matomo.auth.existingSecret) -}} +{{- if and (include "shlink-backend.matomo.enabled" .) (not .Values.config.matomo.auth.existingSecret) -}} --- apiVersion: v1 kind: Secret metadata: + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} name: {{ include "shlink-backend.matomo.auth.secretName" . }} data: api-token: {{ .Values.config.matomo.auth.apiToken | b64enc }} diff --git a/charts/shlink-backend/templates/mercure/_mercure.tpl b/charts/shlink-backend/templates/mercure/_mercure.tpl index 5e28e8d80..270fe9743 100644 --- a/charts/shlink-backend/templates/mercure/_mercure.tpl +++ b/charts/shlink-backend/templates/mercure/_mercure.tpl @@ -1,3 +1,14 @@ +{{/* +Define if the Mercure integration is enabled +*/}} +{{- define "shlink-backend.mercure.enabled" -}} +{{- $enabled := "" -}} +{{- if .Values.config.mercure.enabled -}} + {{- $enabled = "true" -}} +{{- end }} +{{- $enabled -}} +{{- end }} + {{/* Get the name of the secret containing the API token */}} diff --git a/charts/shlink-backend/templates/mercure/secret.yaml b/charts/shlink-backend/templates/mercure/secret.yaml index 2afda35b9..d9677e9f0 100644 --- a/charts/shlink-backend/templates/mercure/secret.yaml +++ b/charts/shlink-backend/templates/mercure/secret.yaml @@ -1,8 +1,10 @@ -{{- if and (.Values.config.mercure.enabled) (not .Values.config.mercure.auth.existingSecret) -}} +{{- if and (include "shlink-backend.mercure.enabled" .) (not .Values.config.mercure.auth.existingSecret) -}} --- apiVersion: v1 kind: Secret metadata: + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} name: {{ include "shlink-backend.mercure.auth.secretName" . }} data: jwt-secret: {{ .Values.config.mercure.auth.jwtSecret | b64enc }} diff --git a/charts/shlink-backend/templates/rabbitmq/_rabbitmq.tpl b/charts/shlink-backend/templates/rabbitmq/_rabbitmq.tpl new file mode 100644 index 000000000..df9987ce6 --- /dev/null +++ b/charts/shlink-backend/templates/rabbitmq/_rabbitmq.tpl @@ -0,0 +1,77 @@ +{{/* +Define if the RabbitMQ integration is enabled +*/}} +{{- define "shlink-backend.rabbitmq.enabled" -}} +{{- $enabled := "" -}} +{{- if or (.Values.rabbitmq.enabled) (.Values.config.rabbitmq.enabled) -}} + {{- $enabled = "true" -}} +{{- end }} +{{- $enabled -}} +{{- end }} + +{{/* +Get the name of the secret containing the RabbitMQ password +*/}} +{{- define "shlink-backend.rabbitmq.auth.secretName" -}} +{{- $secretName := "" -}} +{{- if .Values.rabbitmq.enabled -}} + {{- $secretName = (include "rabbitmq.secretPasswordName" .Subcharts.rabbitmq) -}} +{{- else if .Values.config.rabbitmq.auth.existingSecret -}} + {{- $secretName = .Values.config.rabbitmq.auth.existingSecret -}} +{{- else -}} + {{- $secretName = printf "%s-rabbitmq" (include "shlink-backend.fullname" .) -}} +{{- end -}} +{{- $secretName -}} +{{- end -}} + +{{/* +Define the RabbitMQ username +*/}} +{{- define "shlink-backend.rabbitmq.auth.username" -}} +{{- $username := "" -}} +{{- if .Values.rabbitmq.enabled -}} + {{- $username = .Values.rabbitmq.auth.username -}} +{{- else -}} + {{- $username = .Values.config.rabbitmq.auth.username -}} +{{- end -}} +{{- if not $username -}} + {{- fail "Unable to determine the RabbitMQ username. Use config.rabbitmq.auth.username or activate the integrated RabbitMQ subchart." -}} +{{- end -}} +{{- $username -}} +{{- end }} + +{{/* +Define the RabbitMQ host +*/}} +{{- define "shlink-backend.rabbitmq.host" -}} +{{- $host := "" -}} +{{- if .Values.rabbitmq.enabled -}} + {{- $host = (include "common.names.fullname" .Subcharts.rabbitmq) -}} +{{- else -}} + {{- $host = .Values.config.rabbitmq.host -}} +{{- end -}} +{{- if not $host -}} + {{- fail "Unable to determine the RabbitMQ host. Use config.rabbitmq.host or activate the integrated RabbitMQ subchart." -}} +{{- end -}} +{{- $host -}} +{{- end }} + +{{/* +Define the RabbitMQ port +*/}} +{{- define "shlink-backend.rabbitmq.port" -}} +{{- $port := "" -}} +{{- if .Values.rabbitmq.enabled -}} + {{- if or (.Values.rabbitmq.service.portEnabled) (not .Values.rabbitmq.auth.tls.enabled) }} + {{ $port = .Values.rabbitmq.service.ports.amqp }} + {{- else if .Values.rabbitmq.auth.tls.enabled }} + {{ $port = .Values.rabbitmq.service.ports.amqpTls }} + {{- end }} +{{- else -}} + {{- $port = .Values.config.rabbitmq.port -}} +{{- end -}} +{{- if not $port -}} + {{- fail "Unable to determine the RabbitMQ port. Use config.rabbitmq.port or activate the integrated RabbitMQ subchart." -}} +{{- end -}} +{{- $port -}} +{{- end }} diff --git a/charts/shlink-backend/templates/rabbitmq/secret.yaml b/charts/shlink-backend/templates/rabbitmq/secret.yaml new file mode 100644 index 000000000..7b2095e6a --- /dev/null +++ b/charts/shlink-backend/templates/rabbitmq/secret.yaml @@ -0,0 +1,11 @@ +{{- if and (not .Values.rabbitmq.enabled) (.Values.config.rabbitmq.auth.existingSecret) -}} +--- +apiVersion: v1 +kind: Secret +metadata: + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ include "shlink-backend.rabbitmq.auth.secretName" . }} +data: + rabbitmq-password: {{ .Values.config.rabbitmq.auth.password | b64enc }} +{{- end }} diff --git a/charts/shlink-backend/templates/redis/_redis.tpl b/charts/shlink-backend/templates/redis/_redis.tpl index ce969b051..dc673bb17 100644 --- a/charts/shlink-backend/templates/redis/_redis.tpl +++ b/charts/shlink-backend/templates/redis/_redis.tpl @@ -3,7 +3,7 @@ Define if the Redis integration is enabled */}} {{- define "shlink-backend.redis.enabled" -}} {{- $enabled := "" -}} -{{- if or (.Values.redis.enabled) (.Values.config.redis.servers) -}} +{{- if or (.Values.redis.enabled) (.Values.config.redis.enabled) -}} {{- $enabled = "true" -}} {{- end }} {{- $enabled -}} @@ -17,12 +17,45 @@ Define the redis servers {{- if .Values.redis.enabled -}} {{- $host := (include "common.names.fullname" .Subcharts.redis) -}} {{- $port := (.Values.redis.master.service.ports.redis | toString) -}} - {{- $servers = (printf "%s-master:%s" $host $port) -}} + {{- if (include "shlink-backend.redis.sentinal.enabled" .) -}} + {{- $servers = (printf "%s:%s" $host $port) -}} + {{- else -}} + {{- $servers = (printf "%s-master:%s" $host $port) -}} + {{- end -}} {{- else -}} {{- $servers = .Values.config.redis.servers -}} {{- end -}} {{- if not $servers -}} - {{- fail "Unable to determine the list of redis server. Use config.redis.servers or activate one of the integrated Redis subchart." -}} + {{- fail "Unable to determine the list of redis server. Use config.redis.servers or activate the integrated Redis subchart." -}} {{- end -}} {{- $servers -}} {{- end }} + +{{/* +Define the redis sentinal service is enabled +*/}} +{{- define "shlink-backend.redis.sentinal.enabled" -}} +{{- $enabled := "" -}} +{{- if or (.Values.redis.sentinel.enabled) (.Values.config.redis.sentinal.enabled) -}} + {{- $enabled = "true" -}} +{{- end }} +{{- $enabled -}} +{{- end }} + +{{/* +Define the redis sentinal service +*/}} +{{- define "shlink-backend.redis.sentinal.service" -}} +{{- $sentinalService := "" -}} +{{- if .Values.redis.enabled -}} + {{- $host := (include "common.names.fullname" .Subcharts.redis) -}} + {{- $port := (.Values.redis.sentinel.containerPorts.sentinel | toString) -}} + {{- $sentinalService = (printf "%s:%s" $host $port) -}} +{{- else -}} + {{- $sentinalService = .Values.config.redis.sentinalService -}} +{{- end -}} +{{- if not $sentinalService -}} + {{- fail "Unable to determine the name of the redis sentinal service. Use config.redis.sentinal.service or activate the integrated Redis subchart." -}} +{{- end -}} +{{- $sentinalService -}} +{{- end }} diff --git a/charts/shlink-backend/templates/deployment.yaml b/charts/shlink-backend/templates/shlink-backend/deployment.yaml similarity index 78% rename from charts/shlink-backend/templates/deployment.yaml rename to charts/shlink-backend/templates/shlink-backend/deployment.yaml index 1c1c3c458..48b0a06e0 100644 --- a/charts/shlink-backend/templates/deployment.yaml +++ b/charts/shlink-backend/templates/shlink-backend/deployment.yaml @@ -1,9 +1,10 @@ +--- apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "shlink-backend.fullname" . }} labels: {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ include "shlink-backend.fullname" . }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} @@ -42,6 +43,7 @@ spec: # Database Settings - name: DB_DRIVER value: {{ include "shlink-backend.database.driver" . | quote }} + {{- if not (eq (include "shlink-backend.database.driver" .) "sqlite") }} - name: DB_HOST value: {{ include "shlink-backend.database.host" . | quote }} - name: DB_NAME @@ -57,6 +59,7 @@ spec: value: {{ .Values.config.database.useEncryption | quote }} - name: DB_USER value: {{ include "shlink-backend.database.auth.username" . | quote }} + {{- end }} # Docker Settings - name: PORT @@ -98,10 +101,10 @@ spec: - name: SKIP_INITIAL_GEOLITE_DOWNLOAD value: {{ .Values.config.geolite.skipInitialDownload | quote }} - {{- if .Values.config.matomo.enabled }} + {{- if (include "shlink-backend.matomo.enabled" .) }} # Matomo Settings - name: MATOMO_ENABLED - value: {{ .Values.config.matomo.enabled | quote }} + value: {{ (include "shlink-backend.matomo.enabled" .) | quote }} {{- if or (.Values.config.matomo.auth.apiToken) (.Values.config.matomo.auth.existingSecret) }} - name: MATOMO_API_TOKEN valueFrom: @@ -119,7 +122,7 @@ spec: {{- end }} {{- end }} - {{- if .Values.config.mercure.enabled }} + {{- if (include "shlink-backend.mercure.enabled" .) }} # Mercure Hub Settings {{- if .Values.config.mercure.internalHubUrl }} - name: MERCURE_INTERNAL_HUB_URL @@ -138,6 +141,63 @@ spec: {{- end }} {{- end }} + # QR Codes Settings + {{- if .Values.config.qrCodes.defaultColors.background }} + - name: DEFAULT_QR_CODE_BG_COLOR + value: {{ .Values.config.qrCodes.defaultColors.background | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultColors.foreground }} + - name: DEFAULT_QR_CODE_COLOR + value: {{ .Values.config.qrCodes.defaultColors.foreground | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultErrorCorrection }} + - name: DEFAULT_QR_CODE_ERROR_CORRECTION + value: {{ .Values.config.qrCodes.defaultErrorCorrection | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultFormat }} + - name: DEFAULT_QR_CODE_FORMAT + value: {{ .Values.config.qrCodes.defaultFormat | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultLogoUrl }} + - name: DEFAULT_QR_CODE_LOGO_URL + value: {{ .Values.config.qrCodes.defaultLogoUrl | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultMargin }} + - name: DEFAULT_QR_CODE_MARGIN + value: {{ .Values.config.qrCodes.defaultMargin | quote }} + {{- end }} + {{- if .Values.config.qrCodes.defaultSize }} + - name: DEFAULT_QR_CODE_SIZE + value: {{ .Values.config.qrCodes.defaultSize | quote }} + {{- end }} + - name: DEFAULT_QR_CODE_ROUND_BLOCK_SIZE + value: {{ .Values.config.qrCodes.defaultRoundBlockSize | quote }} + - name: QR_CODE_FOR_DISABLED_SHORT_URLS + value: {{ .Values.config.qrCodes.codeForDisabledShortUrls | quote }} + + {{- if (include "shlink-backend.rabbitmq.enabled" .) }} + # RabbitMQ Settings + - name: RABBITMQ_ENABLED + value: {{ (include "shlink-backend.rabbitmq.enabled" .) | quote }} + - name: RABBITMQ_HOST + value: {{ (include "shlink-backend.rabbitmq.host" .) | quote }} + - name: RABBITMQ_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "shlink-backend.rabbitmq.auth.secretName" . }} + key: rabbitmq-password + - name: RABBITMQ_PORT + value: {{ (include "shlink-backend.rabbitmq.port" .) | quote }} + - name: RABBITMQ_USER + value: {{ (include "shlink-backend.rabbitmq.auth.username" .) | quote }} + - name: RABBITMQ_USE_SSL + value: {{ .Values.config.rabbitmq.useSsl | quote }} + {{- if .Values.config.rabbitmq.vhost }} + - name: RABBITMQ_VHOST + value: {{ .Values.config.rabbitmq.vhost | quote }} + {{- end }} + {{- end }} + # Redirects Settings {{- if .Values.config.redirects.defaultBaseUrlRedirect }} - name: DEFAULT_BASE_URL_REDIRECT @@ -164,33 +224,16 @@ spec: value: {{ .Values.config.redirects.statusCode | quote }} {{- end }} - {{- if .Values.rabbitmq.enabled }} - # RabbitMQ Settings - - name: RABBITMQ_ENABLED - value: "true" - - name: RABBITMQ_HOST - value: {{ include "common.names.fullname" .Subcharts.rabbitmq | quote }} - - name: RABBITMQ_PORT - {{- if or (.Values.rabbitmq.service.portEnabled) (not .Values.rabbitmq.auth.tls.enabled) }} - value: {{ .Values.rabbitmq.service.ports.amqp | quote }} - {{- else if .Values.rabbitmq.auth.tls.enabled }} - value: {{ .Values.rabbitmq.service.ports.amqpTls | quote }} - {{- end }} - - name: RABBITMQ_USER - value: {{ .Values.rabbitmq.auth.username | quote }} - - name: RABBITMQ_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "rabbitmq.secretPasswordName" .Subcharts.rabbitmq }} - key: rabbitmq-password - {{- end }} - {{- if (include "shlink-backend.redis.enabled" .) }} # Redis Settings - name: REDIS_PUB_SUB_ENABLED value: {{ .Values.config.redis.pubSubEnabled | quote }} + {{- if (include "shlink-backend.redis.sentinal.enabled" .) }} + - name: REDIS_SENTINEL_SERVICE + value: {{ include "shlink-backend.redis.sentinal.service" . | quote }} + {{- end }} - name: REDIS_SERVERS - value: {{ include "shlink-backend.redis.enabled" . | quote }} + value: {{ include "shlink-backend.redis.servers" . | quote }} {{- end }} # Robot.txt Settings diff --git a/charts/shlink-backend/templates/hpa.yaml b/charts/shlink-backend/templates/shlink-backend/hpa.yaml similarity index 100% rename from charts/shlink-backend/templates/hpa.yaml rename to charts/shlink-backend/templates/shlink-backend/hpa.yaml index 30d8b3c9a..428c3abc0 100644 --- a/charts/shlink-backend/templates/hpa.yaml +++ b/charts/shlink-backend/templates/shlink-backend/hpa.yaml @@ -6,9 +6,9 @@ apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: - name: {{ include "shlink-backend.fullname" . }} labels: {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ include "shlink-backend.fullname" . }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/charts/shlink-backend/templates/ingress.yaml b/charts/shlink-backend/templates/shlink-backend/ingress.yaml similarity index 100% rename from charts/shlink-backend/templates/ingress.yaml rename to charts/shlink-backend/templates/shlink-backend/ingress.yaml index 34e075307..09d6b4e9c 100644 --- a/charts/shlink-backend/templates/ingress.yaml +++ b/charts/shlink-backend/templates/shlink-backend/ingress.yaml @@ -15,13 +15,13 @@ apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: - name: {{ $fullName }} - labels: - {{- include "shlink-backend.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ $fullName }} spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.className }} diff --git a/charts/shlink-backend/templates/service.yaml b/charts/shlink-backend/templates/shlink-backend/service.yaml similarity index 98% rename from charts/shlink-backend/templates/service.yaml rename to charts/shlink-backend/templates/shlink-backend/service.yaml index f310c9a4d..4705938f0 100644 --- a/charts/shlink-backend/templates/service.yaml +++ b/charts/shlink-backend/templates/shlink-backend/service.yaml @@ -1,9 +1,10 @@ +--- apiVersion: v1 kind: Service metadata: - name: {{ include "shlink-backend.fullname" . }} labels: {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ include "shlink-backend.fullname" . }} spec: type: {{ .Values.service.type }} ports: diff --git a/charts/shlink-backend/templates/serviceaccount.yaml b/charts/shlink-backend/templates/shlink-backend/serviceaccount.yaml similarity index 100% rename from charts/shlink-backend/templates/serviceaccount.yaml rename to charts/shlink-backend/templates/shlink-backend/serviceaccount.yaml index 2534050cf..8cc9ff080 100644 --- a/charts/shlink-backend/templates/serviceaccount.yaml +++ b/charts/shlink-backend/templates/shlink-backend/serviceaccount.yaml @@ -2,11 +2,11 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "shlink-backend.serviceAccountName" . }} - labels: - {{- include "shlink-backend.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} + labels: + {{- include "shlink-backend.labels" . | nindent 4 }} + name: {{ include "shlink-backend.serviceAccountName" . }} {{- end }} diff --git a/charts/shlink-backend/values.schema.json b/charts/shlink-backend/values.schema.json index 504a9c487..6dd6a2f67 100644 --- a/charts/shlink-backend/values.schema.json +++ b/charts/shlink-backend/values.schema.json @@ -50,7 +50,7 @@ "auth": { "properties": { "database": { - "default": "shlink", + "default": "", "description": "The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled", "required": [], "title": "database", @@ -64,14 +64,14 @@ "type": "string" }, "password": { - "default": "shlink", + "default": "", "description": "The password credential to be used when using an external database driver.", "required": [], "title": "password", "type": "string" }, "username": { - "default": "shlink", + "default": "", "description": "The username credential to be used when using an external database driver.", "required": [], "title": "username", @@ -249,7 +249,7 @@ }, "enabled": { "default": false, - "description": "Tells if visits should be sent to a Matomo instance.", + "description": "Enable the Matomo integration to sent visits", "required": [], "title": "enabled", "type": "boolean" @@ -328,6 +328,168 @@ "title": "mercure", "type": "object" }, + "qrCodes": { + "properties": { + "codeForDisabledShortUrls": { + "default": true, + "description": "Whether generating QR codes should work for disabled short URLs. Disabled short URLs are those which reached the maximum amount of visits, have a validSince date in the future, or a validUntil date in the past.", + "required": [], + "title": "codeForDisabledShortUrls", + "type": "boolean" + }, + "defaultColors": { + "properties": { + "background": { + "default": "#FFFFFF", + "description": "The QR code background color.", + "required": [], + "title": "background", + "type": "string" + }, + "foreground": { + "default": "#000000", + "description": "The QR code foreground color.", + "required": [], + "title": "foreground", + "type": "string" + } + }, + "required": [ + "background", + "foreground" + ], + "title": "defaultColors", + "type": "object" + }, + "defaultErrorCorrection": { + "default": "l", + "description": "One of L (Low), M (Medium), Q (Quartile) or H (High), to determine the default error correction of generated QR codes when the errorCorrection query param is not provided.", + "required": [], + "title": "defaultErrorCorrection", + "type": "string" + }, + "defaultFormat": { + "default": "png", + "description": "One of png or svg, to determine the default format of generated QR codes when the format query param is not provided.", + "required": [], + "title": "defaultFormat", + "type": "string" + }, + "defaultLogoUrl": { + "default": "", + "description": "A URL pointing to a logo that will be placed in the middle of the QR code. This one is experimental, as some images might break the QR code.", + "required": [], + "title": "defaultLogoUrl", + "type": "string" + }, + "defaultMargin": { + "default": 0, + "description": "A value greater than 0 to determine the default margin of generated QR codes when the margin query param is not provided.", + "required": [], + "title": "defaultMargin", + "type": "integer" + }, + "defaultRoundBlockSize": { + "default": true, + "description": "Tells if the block size should be round on QR codes, making it more readable, but potentially adding some extra margin as a side effect.", + "required": [], + "title": "defaultRoundBlockSize", + "type": "boolean" + }, + "defaultSize": { + "default": 300, + "description": "A value between 50 and 1000 to determine the default size of generated QR codes when the size query param is not provided.", + "required": [], + "title": "defaultSize", + "type": "integer" + } + }, + "required": [ + "codeForDisabledShortUrls", + "defaultColors", + "defaultErrorCorrection", + "defaultFormat", + "defaultLogoUrl", + "defaultMargin", + "defaultRoundBlockSize", + "defaultSize" + ], + "title": "qrCodes", + "type": "object" + }, + "rabbitmq": { + "properties": { + "auth": { + "properties": { + "existingSecret": { + "default": "", + "description": "Use existing secret for password details (`config.rabbitmq.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `rabbitmq-password`.", + "required": [], + "title": "existingSecret", + "type": "string" + }, + "password": { + "default": "", + "description": "The password credential to be used when using an external database driver.", + "required": [], + "title": "password", + "type": "string" + }, + "username": { + "default": "", + "description": "The username credential to be used when using an external database driver.", + "required": [], + "title": "username", + "type": "string" + } + }, + "required": [ + "existingSecret", + "password", + "username" + ], + "title": "auth", + "type": "object" + }, + "enabled": { + "default": false, + "description": "enable RabbitMQ™ Integration", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "host": { + "default": "", + "description": "The RabbitMQ server host name", + "required": [], + "title": "host", + "type": "string" + }, + "useSsl": { + "default": false, + "description": "Whether connection is encrypted with SSL/TLS or not.", + "required": [], + "title": "useSsl", + "type": "boolean" + }, + "vhost": { + "default": "/", + "description": "The RabbitMQ server VHost", + "required": [], + "title": "vhost", + "type": "string" + } + }, + "required": [ + "enabled", + "auth", + "host", + "useSsl", + "vhost" + ], + "title": "rabbitmq", + "type": "object" + }, "redirects": { "properties": { "cacheLifetime": { @@ -386,6 +548,13 @@ }, "redis": { "properties": { + "enabled": { + "default": false, + "description": "enable Redis™ Integration", + "required": [], + "title": "enabled", + "type": "boolean" + }, "pubSubEnabled": { "default": false, "description": "Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub.", @@ -393,6 +562,29 @@ "title": "pubSubEnabled", "type": "boolean" }, + "sentinal": { + "properties": { + "enabled": { + "default": false, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "service": { + "default": "", + "description": "The name of the sentinel service if you want to use redis sentinel. If this value is provided, the servers provided in config.redis.servers will be considered sentinel instances.", + "required": [], + "title": "service", + "type": "string" + } + }, + "required": [ + "enabled", + "service" + ], + "title": "sentinal", + "type": "object" + }, "servers": { "default": "", "description": "The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled", @@ -402,7 +594,9 @@ } }, "required": [ + "enabled", "pubSubEnabled", + "sentinal", "servers" ], "title": "redis", @@ -567,6 +761,8 @@ "geolite", "matomo", "mercure", + "qrCodes", + "rabbitmq", "redirects", "redis", "robots", @@ -938,6 +1134,13 @@ }, "redis": { "properties": { + "architecture": { + "default": "standalone", + "description": "Redis™ architecture. Allowed values: `standalone` or `replication`", + "required": [], + "title": "architecture", + "type": "string" + }, "auth": { "properties": { "enabled": { @@ -946,10 +1149,18 @@ "required": [], "title": "enabled", "type": "boolean" + }, + "sentinel": { + "default": false, + "description": "Enable password authentication on Redis™ Sentinels", + "required": [], + "title": "sentinel", + "type": "boolean" } }, "required": [ - "enabled" + "enabled", + "sentinel" ], "title": "auth", "type": "object" @@ -960,11 +1171,29 @@ "required": [], "title": "enabled", "type": "boolean" + }, + "sentinel": { + "properties": { + "enabled": { + "default": false, + "description": "Use Redis™ Sentinel on Redis™ pods", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "sentinel", + "type": "object" } }, "required": [ "enabled", - "auth" + "architecture", + "auth", + "sentinel" ], "title": "redis", "type": "object" diff --git a/charts/shlink-backend/values.yaml b/charts/shlink-backend/values.yaml index 33950d2b0..7b536370d 100644 --- a/charts/shlink-backend/values.yaml +++ b/charts/shlink-backend/values.yaml @@ -108,13 +108,13 @@ config: database: auth: # -- The database name to be used when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled - database: shlink + database: "" # -- Use existing secret for password details (`config.database.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `database-password`. existingSecret: "" # -- The password credential to be used when using an external database driver. - password: shlink + password: "" # -- The username credential to be used when using an external database driver. - username: shlink + username: "" # -- mysql, maria, postgres or sqlite. Will be set automatically when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled driver: sqlite # -- The host name of the database server when using an external database driver. Will be ignored when you activate one of the integrated databases with mariadb.enabled, mysql.enabled or postgresql.enabled @@ -144,7 +144,7 @@ config: # -- If provided with value true, it will skip the initial GeoLite2 db file download, speeding-up the container start-up. As a side effect, first visits on this container will remain un-located until the file finishes downloading in background. skipInitialDownload: false matomo: - # -- Tells if visits should be sent to a Matomo instance. + # -- Enable the Matomo integration to sent visits enabled: false auth: # -- The API token so that Shlink can call Matomo’s API @@ -167,6 +167,42 @@ config: publicHubUrl: "" # -- An internal URL for a mercure hub. Will be used only when publishing updates to mercure, and does not need to be public. internalHubUrl: "" + qrCodes: + # -- Whether generating QR codes should work for disabled short URLs. Disabled short URLs are those which reached the maximum amount of visits, have a validSince date in the future, or a validUntil date in the past. + codeForDisabledShortUrls: true + defaultColors: + # -- The QR code background color. + background: "#FFFFFF" + # -- The QR code foreground color. + foreground: "#000000" + # -- One of L (Low), M (Medium), Q (Quartile) or H (High), to determine the default error correction of generated QR codes when the errorCorrection query param is not provided. + defaultErrorCorrection: l + # -- One of png or svg, to determine the default format of generated QR codes when the format query param is not provided. + defaultFormat: png + # -- A URL pointing to a logo that will be placed in the middle of the QR code. This one is experimental, as some images might break the QR code. + defaultLogoUrl: "" + # -- A value greater than 0 to determine the default margin of generated QR codes when the margin query param is not provided. + defaultMargin: 0 + # -- Tells if the block size should be round on QR codes, making it more readable, but potentially adding some extra margin as a side effect. + defaultRoundBlockSize: true + # -- A value between 50 and 1000 to determine the default size of generated QR codes when the size query param is not provided. + defaultSize: 300 + rabbitmq: + # -- enable RabbitMQ™ Integration + enabled: false + auth: + # -- Use existing secret for password details (`config.rabbitmq.auth.password` will be ignored and picked up from this secret). The secret has to contain the key `rabbitmq-password`. + existingSecret: "" + # -- The password credential to be used when using an external database driver. + password: "" + # -- The username credential to be used when using an external database driver. + username: "" + # -- The RabbitMQ server host name + host: "" + # -- Whether connection is encrypted with SSL/TLS or not. + useSsl: false + # -- The RabbitMQ server VHost + vhost: "/" redirects: # -- Allows to set the amount of seconds that redirects should be cached when redirect status is 301 or 308. cacheLifetime: 30 @@ -181,8 +217,14 @@ config: # -- 301, 302, 308 or 307 (last two since v3.5.0). Determines the status code that should be used on redirects from short to long URLs. Setting 308 or 307 implicitly makes requests to short URLs work regardless the HTTP method. statusCode: 302 redis: + # -- enable Redis™ Integration + enabled: false # -- Tells if the configured redis instance/cluster should also be used to publish real-time updates via redis pub/sub. pubSubEnabled: false + sentinal: + enabled: false + # -- The name of the sentinel service if you want to use redis sentinel. If this value is provided, the servers provided in config.redis.servers will be considered sentinel instances. + service: "" # -- The comma-separated list of Redis servers when using external Redis servers. Will be ignored when you activate one of the integrated Redis subchart with redis.enabled servers: "" robots: @@ -261,6 +303,13 @@ rabbitmq: redis: # -- enable integrated Redis™ subchart from Bitnami enabled: false + # -- Redis™ architecture. Allowed values: `standalone` or `replication` + architecture: standalone auth: # -- Enable password authentication enabled: false + # -- Enable password authentication on Redis™ Sentinels + sentinel: false + sentinel: + # -- Use Redis™ Sentinel on Redis™ pods + enabled: false