From 0d477619a38f581ecff5709a77d9efae3b614ea2 Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 17:07:43 +0100 Subject: [PATCH 1/8] feat: add correct dashboard config to helm chart --- Cargo.toml | 2 +- charts/feedback-fusion/Chart.yaml | 4 ++-- .../templates/dashboard-deployment.yaml | 19 +++---------------- charts/feedback-fusion/values.yaml | 4 ++++ 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 15528e3b..ad4edbe1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "feedback-fusion" -version = "0.2.0" +version = "0.3.0" edition = "2021" license = "MIT" diff --git a/charts/feedback-fusion/Chart.yaml b/charts/feedback-fusion/Chart.yaml index 3fd6dc7c..da042c16 100644 --- a/charts/feedback-fusion/Chart.yaml +++ b/charts/feedback-fusion/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.2.0" +appVersion: "0.3.0" diff --git a/charts/feedback-fusion/templates/dashboard-deployment.yaml b/charts/feedback-fusion/templates/dashboard-deployment.yaml index 86793cf0..6dad1182 100644 --- a/charts/feedback-fusion/templates/dashboard-deployment.yaml +++ b/charts/feedback-fusion/templates/dashboard-deployment.yaml @@ -39,32 +39,19 @@ spec: - name: grpc containerPort: 8000 protocol: TCP - env: - - name: RUST_LOG - value: {{ .Values.feedbackFusion.log }} - - name: FEEDBACK_FUSION_CONFIG - value: /etc/config/config.yaml livenessProbe: {{- toYaml .Values.dashboard.livenessProbe | nindent 12 }} startupProbe: {{- toYaml .Values.dashboard.startupProbe | nindent 12 }} resources: {{- toYaml .Values.dashboard.resources | nindent 12 }} - volumeMounts: - {{- with .Values.dashboard.volumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - - - name: {{ .Values.feedbackFusion.config.secret }} - mountPath: /etc/config + envFrom: + - secretRef: + name: {{ .Values.feedbackFusion.dashboard.config.secret }} volumes: {{- with .Values.dashboard.volumes }} {{- toYaml . | nindent 8 }} {{- end }} - - - name: {{ .Values.feedbackFusion.config.secret }} - secret: - secretName: {{ .Values.feedbackFusion.config.secret }} {{- with .Values.dashboard.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/feedback-fusion/values.yaml b/charts/feedback-fusion/values.yaml index 12b5b0c6..52888b95 100644 --- a/charts/feedback-fusion/values.yaml +++ b/charts/feedback-fusion/values.yaml @@ -234,3 +234,7 @@ feedbackFusion: # -- the secret containing the config.yaml # For all configuration options see https://onelitefeathernet.github.io/feedback-fusion/nightly/docs/configuration.html secret: feedback-fusion-config + + dashboard: + config: + secret: feedback-fusion-dashboard-config From 3e54e4ffc8feec54c37f6a36d7dcc49ad10eef8c Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:07:59 +0100 Subject: [PATCH 2/8] fix: app names --- charts/feedback-fusion/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/feedback-fusion/templates/_helpers.tpl b/charts/feedback-fusion/templates/_helpers.tpl index 764249a5..1403f2c8 100644 --- a/charts/feedback-fusion/templates/_helpers.tpl +++ b/charts/feedback-fusion/templates/_helpers.tpl @@ -69,11 +69,11 @@ Create the name of the service account to use {{- if .Values.dashboard.fullnameOverride }} {{- .Values.dashboard.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} -{{- $name := default .Chart.Name .Values.dashboard.nameOverride }} +{{- $name := default (.Chart.Name | cat "-dashboard") .Values.dashboard.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- printf "%s-%s-%s" .Release.Name $name "dashboard" | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} From 352b7ed8216a522e3809fb4bbd583e246bdea0d3 Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:22:18 +0100 Subject: [PATCH 3/8] fix: idents --- charts/feedback-fusion/templates/_helpers.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/feedback-fusion/templates/_helpers.tpl b/charts/feedback-fusion/templates/_helpers.tpl index 1403f2c8..595804d2 100644 --- a/charts/feedback-fusion/templates/_helpers.tpl +++ b/charts/feedback-fusion/templates/_helpers.tpl @@ -69,11 +69,11 @@ Create the name of the service account to use {{- if .Values.dashboard.fullnameOverride }} {{- .Values.dashboard.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} -{{- $name := default (.Chart.Name | cat "-dashboard") .Values.dashboard.nameOverride }} +{{- $name := default (printf "%s-%s" .Chart.Name "dashboard") .Values.dashboard.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} -{{- printf "%s-%s-%s" .Release.Name $name "dashboard" | trunc 63 | trimSuffix "-" }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} From 828199fd5dc1ede1ca1da7e5dba817165d745feb Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:29:20 +0100 Subject: [PATCH 4/8] fix: names --- charts/feedback-fusion/templates/_helpers.tpl | 4 ++-- charts/feedback-fusion/templates/dashboard-deployment.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/feedback-fusion/templates/_helpers.tpl b/charts/feedback-fusion/templates/_helpers.tpl index 595804d2..df9c466b 100644 --- a/charts/feedback-fusion/templates/_helpers.tpl +++ b/charts/feedback-fusion/templates/_helpers.tpl @@ -70,8 +70,8 @@ Create the name of the service account to use {{- .Values.dashboard.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default (printf "%s-%s" .Chart.Name "dashboard") .Values.dashboard.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- if contains $name (printf "%s-%s" .Release.Name "dashboard") }} +{{- printf "%s-%s" .Release.Name "dashboard" | trunc 63 | trimSuffix "-" }} {{- else }} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} diff --git a/charts/feedback-fusion/templates/dashboard-deployment.yaml b/charts/feedback-fusion/templates/dashboard-deployment.yaml index 6dad1182..31626711 100644 --- a/charts/feedback-fusion/templates/dashboard-deployment.yaml +++ b/charts/feedback-fusion/templates/dashboard-deployment.yaml @@ -30,7 +30,7 @@ spec: securityContext: {{- toYaml .Values.dashboard.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Chart.Name }}-dashboard securityContext: {{- toYaml .Values.dashboard.securityContext | nindent 12 }} image: "{{ .Values.dashboard.image.repository }}:{{ .Values.dashboard.image.tag | default .Chart.AppVersion }}" From 40d501c49a39099932a5384d2fc290008b018c3a Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:45:02 +0100 Subject: [PATCH 5/8] fix: ingress --- charts/feedback-fusion/templates/api-ingress.yaml | 2 +- charts/feedback-fusion/templates/dashboard-ingress.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/feedback-fusion/templates/api-ingress.yaml b/charts/feedback-fusion/templates/api-ingress.yaml index 46019db3..b6acf66c 100644 --- a/charts/feedback-fusion/templates/api-ingress.yaml +++ b/charts/feedback-fusion/templates/api-ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.api.ingress.enabled -}} {{- $fullName := include "feedback-fusion.fullname" . -}} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} diff --git a/charts/feedback-fusion/templates/dashboard-ingress.yaml b/charts/feedback-fusion/templates/dashboard-ingress.yaml index 0772b5d0..c39c5c65 100644 --- a/charts/feedback-fusion/templates/dashboard-ingress.yaml +++ b/charts/feedback-fusion/templates/dashboard-ingress.yaml @@ -1,6 +1,6 @@ {{- if and .Values.dashboard.ingress.enabled .Values.dashboard.enabled -}} {{- $fullName := include "feedback-fusion-dashboard.fullname" . -}} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} From 77a9f5d4701331ee81efeb08a6b5c785919858df Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:51:01 +0100 Subject: [PATCH 6/8] fix: service --- charts/feedback-fusion/templates/dashboard-deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/feedback-fusion/templates/dashboard-deployment.yaml b/charts/feedback-fusion/templates/dashboard-deployment.yaml index 31626711..4e1f9640 100644 --- a/charts/feedback-fusion/templates/dashboard-deployment.yaml +++ b/charts/feedback-fusion/templates/dashboard-deployment.yaml @@ -36,8 +36,8 @@ spec: image: "{{ .Values.dashboard.image.repository }}:{{ .Values.dashboard.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.dashboard.image.pullPolicy }} ports: - - name: grpc - containerPort: 8000 + - name: http + containerPort: 3000 protocol: TCP livenessProbe: {{- toYaml .Values.dashboard.livenessProbe | nindent 12 }} From a4c5e75ad19b6d9c93e46f7dee076bef7ecaf198 Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:37:43 +0100 Subject: [PATCH 7/8] fix: scopes --- Cargo.lock | 2 +- dashboard/nuxt.config.ts | 1 - src/services/oidc.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ce3902d..63113eaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1204,7 +1204,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "feedback-fusion" -version = "0.2.0" +version = "0.3.0" dependencies = [ "aliri", "aliri_clock", diff --git a/dashboard/nuxt.config.ts b/dashboard/nuxt.config.ts index a6756d5d..b8acaa57 100644 --- a/dashboard/nuxt.config.ts +++ b/dashboard/nuxt.config.ts @@ -80,4 +80,3 @@ export default defineNuxtConfig({ bundledThemes: ["github-dark", "github-light"], }, }); - diff --git a/src/services/oidc.rs b/src/services/oidc.rs index c8f94786..e88a0d64 100644 --- a/src/services/oidc.rs +++ b/src/services/oidc.rs @@ -176,9 +176,9 @@ impl<'de> Visitor<'de> for OIDCClaimsVisitor { let iss = iss.ok_or_else(|| serde::de::Error::missing_field("iss"))?; let iat = iat.ok_or_else(|| serde::de::Error::missing_field("iat"))?; - let aud = aud.or_else(|| Some(jwt::Audiences::default())).unwrap(); + let aud = aud.or(Some(jwt::Audiences::default())).unwrap(); let exp = exp.ok_or_else(|| serde::de::Error::missing_field("exp"))?; - let scope = scope.ok_or_else(|| serde::de::Error::missing_field("scope"))?; + let scope = scope.or(Some(Scope::empty())).unwrap(); let groups = groups .ok_or_else(|| serde::de::Error::missing_field(CONFIG.oidc().group_claim().as_str()))?; From cce90c925282f809195374634c767cf49ff4e00a Mon Sep 17 00:00:00 2001 From: Randoooom <53190645+Randoooom@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:40:15 +0100 Subject: [PATCH 8/8] fix: clippy --- src/services/oidc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/oidc.rs b/src/services/oidc.rs index e88a0d64..19f86ee4 100644 --- a/src/services/oidc.rs +++ b/src/services/oidc.rs @@ -176,9 +176,9 @@ impl<'de> Visitor<'de> for OIDCClaimsVisitor { let iss = iss.ok_or_else(|| serde::de::Error::missing_field("iss"))?; let iat = iat.ok_or_else(|| serde::de::Error::missing_field("iat"))?; - let aud = aud.or(Some(jwt::Audiences::default())).unwrap(); + let aud = aud.unwrap_or(jwt::Audiences::default()); let exp = exp.ok_or_else(|| serde::de::Error::missing_field("exp"))?; - let scope = scope.or(Some(Scope::empty())).unwrap(); + let scope = scope.unwrap_or(Scope::empty()); let groups = groups .ok_or_else(|| serde::de::Error::missing_field(CONFIG.oidc().group_claim().as_str()))?;