From bc15af7aa4a673b4dc36c88ffef6cbe5c0270308 Mon Sep 17 00:00:00 2001 From: MoeexT Date: Mon, 24 Aug 2026 15:05:14 +0800 Subject: [PATCH 1/2] fix: @not supported in password --- runtime/datamate-python/app/core/config.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/runtime/datamate-python/app/core/config.py b/runtime/datamate-python/app/core/config.py index 4bc15bfa9..97e2348f7 100644 --- a/runtime/datamate-python/app/core/config.py +++ b/runtime/datamate-python/app/core/config.py @@ -1,5 +1,6 @@ from pydantic_settings import BaseSettings from pydantic import model_validator +from sqlalchemy import URL from typing import Optional class Settings(BaseSettings): @@ -55,15 +56,29 @@ class Config: @model_validator(mode='after') def build_database_url(self): - """如果没有提供 database_url,则根据 MySQL 配置构建""" + """如果没有提供 database_url,则根据数据库配置构建。""" if not self.database_url: if self.pgsql_host: if self.pgsql_password and self.pgsql_user: - self.database_url = f"postgresql+asyncpg://{self.pgsql_user}:{self.pgsql_password}@{self.pgsql_host}:{self.pgsql_port}/{self.pgsql_database}" + self.database_url = URL.create( + "postgresql+asyncpg", + username=self.pgsql_user, + password=self.pgsql_password, + host=self.pgsql_host, + port=self.pgsql_port, + database=self.pgsql_database, + ).render_as_string(hide_password=False) else: self.database_url = f"postgresql+asyncpg://{self.pgsql_host}:{self.pgsql_port}/{self.pgsql_database}" elif self.mysql_password and self.mysql_user: - self.database_url = f"mysql+aiomysql://{self.mysql_user}:{self.mysql_password}@{self.mysql_host}:{self.mysql_port}/{self.mysql_database}" + self.database_url = URL.create( + "mysql+aiomysql", + username=self.mysql_user, + password=self.mysql_password, + host=self.mysql_host, + port=self.mysql_port, + database=self.mysql_database, + ).render_as_string(hide_password=False) else: self.database_url = f"mysql+aiomysql://{self.mysql_host}:{self.mysql_port}/{self.mysql_database}" return self From b056f3c3c8818ad4764a728b2513f8ef979e0f3d Mon Sep 17 00:00:00 2001 From: MoeexT Date: Mon, 24 Aug 2026 17:19:41 +0800 Subject: [PATCH 2/2] fix: enable chart-created datamate-conf Secret for sed-based injection Remove sealed-secrets dependency: set public.secrets.create=true so the chart's secret.yaml template generates the datamate-conf Secret from values.yaml. The install script now writes secrets into secrets.data via sed before helm install (cert-pass via kmc, db-password user input, tokens auto-random), matching the original non-sealed delivery path. --- deployment/helm/datamate/values.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deployment/helm/datamate/values.yaml b/deployment/helm/datamate/values.yaml index 2011e39cd..3144ed533 100644 --- a/deployment/helm/datamate/values.yaml +++ b/deployment/helm/datamate/values.yaml @@ -50,8 +50,9 @@ public: database: 1Gi operator: 1Gi secrets: - # Set to false when using Sealed Secrets (managed by install script) - create: false + # Set to true so the chart creates the datamate-conf Secret. + # The install script writes secrets into this block via sed before helm install. + create: true data: DB_PASSWORD: "" # Set via install script or --set CERT_PASS: "" # Set via install script for encrypted SSL keys