chore(backend): Fix the configmap generation for databases. (#39)

It shouldn't require dialect and driver_class and instead default to using them but allow customization.
This commit is contained in:
Skyler Mäntysaari 2023-07-21 05:19:44 +03:00 committed by GitHub
parent 6355d40bbd
commit 42e5d8f110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 23 additions and 21 deletions

View File

@ -3,17 +3,18 @@ apiVersion: v2
description: Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. description: Piped is an alternative privacy-friendly YouTube frontend which is efficient by design.
name: piped name: piped
home: https://github.com/TeamPiped/Piped-Kubernetes home: https://github.com/TeamPiped/Piped-Kubernetes
icon: https://raw.githubusercontent.com/TeamPiped/Piped/master/public/img/icons/logo.svg
sources: sources:
- https://github.com/TeamPiped/Piped - https://github.com/TeamPiped/Piped
- https://github.com/TeamPiped/Piped-Backend - https://github.com/TeamPiped/Piped-Backend
- https://github.com/TeamPiped/piped-proxy - https://github.com/TeamPiped/piped-proxy
keywords: keywords:
- streaming - streaming
version: 2.7.1 version: 2.8.0
appVersion: latest appVersion: latest
kubeVersion: ">=1.22.0-0" kubeVersion: ">=1.22.0-0"
maintainers: maintainers:
- name: Skyler Mäntysaari - name: samip5 # Skyler Mäntysaari
email: samip5@users.noreply.github.com email: samip5@users.noreply.github.com
url: https://github.com/samip5 url: https://github.com/samip5
dependencies: dependencies:
@ -26,5 +27,7 @@ dependencies:
condition: postgresql.enabled condition: postgresql.enabled
annotations: annotations:
artifacthub.io/changes: |- artifacthub.io/changes: |-
- kind: changed
description: Backend configmap was changed to not require driver_class nor dialect but rather specify them by default.
- kind: fixed - kind: fixed
description: Made frontend nginx entrypoint run docker-entrypoint.d scripts description: Backend configmap wasn't getting feed retention correctly passed.

View File

@ -1,6 +1,6 @@
# piped # piped
![Version: 2.6.2](https://img.shields.io/badge/Version-2.6.2-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) ![Version: 2.8.0](https://img.shields.io/badge/Version-2.8.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. Piped is an alternative privacy-friendly YouTube frontend which is efficient by design.
@ -21,7 +21,7 @@ Kubernetes: `>=1.22.0-0`
| Repository | Name | Version | | Repository | Name | Version |
|------------|------|---------| |------------|------|---------|
| https://bjw-s.github.io/helm-charts | common | 1.5.1 | | https://bjw-s.github.io/helm-charts | common | 1.5.1 |
| https://charts.bitnami.com/bitnami | postgresql | 12.5.6 | | https://charts.bitnami.com/bitnami | postgresql | 12.6.0 |
## TL;DR ## TL;DR
@ -91,7 +91,7 @@ helm install piped TeamPiped/piped -f values.yaml
| backend.service.main.type | string | `"ClusterIP"` | | | backend.service.main.type | string | `"ClusterIP"` | |
| controller.enabled | bool | `false` | enable the controller. | | controller.enabled | bool | `false` | enable the controller. |
| frontend.args[0] | string | `"-c"` | | | frontend.args[0] | string | `"-c"` | |
| frontend.args[1] | string | `"sed -i s/pipedapi.kavin.rocks/$BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g 'daemon off;'"` | | | frontend.args[1] | string | `"sed -i s/pipedapi.kavin.rocks/$BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh nginx -g 'daemon off;'"` | |
| frontend.command | string | `"/bin/ash"` | BACKEND_HOSTNAME: pipedapi.example.org | | frontend.command | string | `"/bin/ash"` | BACKEND_HOSTNAME: pipedapi.example.org |
| frontend.enabled | bool | `true` | | | frontend.enabled | bool | `true` | |
| frontend.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | frontend.image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
@ -160,7 +160,7 @@ helm install piped TeamPiped/piped -f values.yaml
## Changelog ## Changelog
### Version 2.6.2 ### Version 2.8.0
#### Added #### Added
@ -168,11 +168,11 @@ N/A
#### Changed #### Changed
N/A * Backend configmap was changed to not require driver_class nor dialect but rather specify them by default.
#### Fixed #### Fixed
* ytproxy ingress, GH issue 29 * Backend configmap wasn't getting feed retention correctly passed.
## Support ## Support

View File

@ -1,4 +1,3 @@
---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -53,13 +52,19 @@ data:
{{ end }} {{ end }}
COMPROMISED_PASSWORD_CHECK: {{ .Values.backend.config.COMPROMISED_PASSWORD_CHECK | default true }} COMPROMISED_PASSWORD_CHECK: {{ .Values.backend.config.COMPROMISED_PASSWORD_CHECK | default true }}
DISABLE_REGISTRATION: {{ .Values.backend.config.DISABLE_REGISTRATION | default false }} DISABLE_REGISTRATION: {{ .Values.backend.config.DISABLE_REGISTRATION | default false }}
FEED_RETENTION: {{ .Values.backend.config.DISABLE_REGISTRATION | int | default 30 }} FEED_RETENTION: {{ .Values.backend.config.FEED_RETENTION | default 30 | int }}
{{- if and (.Values.backend.config.database) (not .Values.postgresql.enabled) }} {{- if and (.Values.backend.config.database) (not .Values.postgresql.enabled) }}
hibernate.connection.url: {{.Values.backend.config.database.connection_url }} hibernate.connection.url: {{.Values.backend.config.database.connection_url }}
{{- if and (not .Values.backend.config.database.driver_class) (not .Values.backend.config.database.dialect) }}
hibernate.connection.driver_class: org.postgresql.Driver
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
{{ end }}
{{- if and (.Values.backend.config.database) (.Values.backend.config.database.driver_class) (.Values.backend.config.database.dialect) (not .Values.postgresql.enabled)}}
hibernate.connection.driver_class: {{.Values.backend.config.database.driver_class }} hibernate.connection.driver_class: {{.Values.backend.config.database.driver_class }}
hibernate.dialect: {{.Values.backend.config.database.dialect }} hibernate.dialect: {{.Values.backend.config.database.dialect }}
hibernate.connection.username: {{.Values.backend.config.database.username }} hibernate.connection.username: {{.Values.backend.config.database.username }}
hibernate.connection.password: {{.Values.backend.config.database.password }} hibernate.connection.password: {{.Values.backend.config.database.password }}
{{ end }}
{{- if .Values.backend.config.database.secret }} {{- if .Values.backend.config.database.secret }}
hibernate.connection.username: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.username" ) -}} hibernate.connection.username: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.username" ) -}}
hibernate.connection.password: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.password") -}} hibernate.connection.password: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.password") -}}
@ -73,4 +78,8 @@ data:
{{- else }} {{- else }}
{{- fail "Unable to figure out database configuration for backend configmap."}} {{- fail "Unable to figure out database configuration for backend configmap."}}
{{- end }} {{- end }}
{{- if .Values.backend.config.SENTRY_DNS }}
SENTRY_DSN: {{.Values.backend.SENTRY_DNS }}
{{- else }}
SENTRY_DSN: SENTRY_DSN:
{{- end }}

View File

@ -1,4 +1,3 @@
---
{{- if .Values.backend.enabled -}} {{- if .Values.backend.enabled -}}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment

View File

@ -1,4 +1,3 @@
---
{{- if .Values.ingress.backend.enabled }} {{- if .Values.ingress.backend.enabled }}
{{- $fullName := include "common.names.fullname" . -}} {{- $fullName := include "common.names.fullname" . -}}
{{- $ingressName := $fullName -}} {{- $ingressName := $fullName -}}
@ -17,7 +16,6 @@
{{- $primaryService := .Values.backend.service.main -}} {{- $primaryService := .Values.backend.service.main -}}
{{- $defaultServiceName := "piped-backend" -}} {{- $defaultServiceName := "piped-backend" -}}
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:

View File

@ -1,4 +1,3 @@
---
{{- include "bjw-s.common.values.init" . }} {{- include "bjw-s.common.values.init" . }}
{{- define "common.getValueFromSecret" }} {{- define "common.getValueFromSecret" }}

View File

@ -1,4 +1,3 @@
---
{{- if .Values.frontend.enabled -}} {{- if .Values.frontend.enabled -}}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment

View File

@ -1,4 +1,3 @@
---
{{- if .Values.ingress.main.enabled }} {{- if .Values.ingress.main.enabled }}
{{- $fullName := include "common.names.fullname" . -}} {{- $fullName := include "common.names.fullname" . -}}
{{- $ingressName := $fullName -}} {{- $ingressName := $fullName -}}
@ -17,7 +16,6 @@
{{- $primaryService := .Values.frontend.service.main -}} {{- $primaryService := .Values.frontend.service.main -}}
{{- $defaultServiceName := "piped-frontend" -}} {{- $defaultServiceName := "piped-frontend" -}}
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:

View File

@ -1,4 +1,3 @@
---
{{- if .Values.ytproxy.enabled -}} {{- if .Values.ytproxy.enabled -}}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment

View File

@ -1,4 +1,3 @@
---
{{- if .Values.ingress.ytproxy.enabled }} {{- if .Values.ingress.ytproxy.enabled }}
{{- $fullName := include "common.names.fullname" . -}} {{- $fullName := include "common.names.fullname" . -}}
{{- $ingressName := $fullName -}} {{- $ingressName := $fullName -}}
@ -17,7 +16,6 @@
{{- $primaryService := .Values.ytproxy.service.main -}} {{- $primaryService := .Values.ytproxy.service.main -}}
{{- $defaultServiceName := "piped-ytproxy" -}} {{- $defaultServiceName := "piped-ytproxy" -}}
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata: