diff --git a/press/agent.py b/press/agent.py index d3d3f02bfeb..f42d629ad89 100644 --- a/press/agent.py +++ b/press/agent.py @@ -106,11 +106,13 @@ def _get_mariadb_root_password(self, site): if database_server: doctype = "Database Server" name = database_server + field = "mariadb_root_password" else: doctype = "Managed Database Service" name = managed_database_service + field = "root_user_password" - return get_decrypted_password(doctype, name, "mariadb_root_password") + return get_decrypted_password(doctype, name, field) def _get_managed_db_config(self, site): managed_database_service = frappe.get_cached_value( @@ -123,7 +125,7 @@ def _get_managed_db_config(self, site): return frappe.get_cached_value( "Managed Database Service", managed_database_service, - ["database_host", "database_user", "port"], + ["database_host", "database_root_user", "port"], as_dict=1, ) diff --git a/press/press/doctype/managed_database_service/managed_database_service.json b/press/press/doctype/managed_database_service/managed_database_service.json index 3a9f3f56e8d..11669e6cbd9 100644 --- a/press/press/doctype/managed_database_service/managed_database_service.json +++ b/press/press/doctype/managed_database_service/managed_database_service.json @@ -9,9 +9,9 @@ "database_section", "service_provider", "database_host", - "database_user", + "database_root_user", "column_break_dboe", - "database_password", + "root_user_password", "port", "team_section", "team" @@ -33,24 +33,10 @@ "reqd": 1, "unique": 1 }, - { - "fieldname": "database_user", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Database User", - "reqd": 1 - }, { "fieldname": "column_break_dboe", "fieldtype": "Column Break" }, - { - "fieldname": "database_password", - "fieldtype": "Password", - "in_list_view": 1, - "label": "Database Password", - "reqd": 1 - }, { "default": "3306", "fieldname": "port", @@ -73,11 +59,25 @@ "label": "Team", "options": "Team", "reqd": 1 + }, + { + "fieldname": "database_root_user", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Database Root User", + "reqd": 1 + }, + { + "fieldname": "root_user_password", + "fieldtype": "Password", + "in_list_view": 1, + "label": "Root User Password", + "reqd": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-05-29 17:17:13.481696", + "modified": "2024-05-29 19:11:14.644480", "modified_by": "Administrator", "module": "Press", "name": "Managed Database Service", diff --git a/press/press/doctype/managed_database_service/managed_database_service.py b/press/press/doctype/managed_database_service/managed_database_service.py index 3ba810b6370..578e2787fe0 100644 --- a/press/press/doctype/managed_database_service/managed_database_service.py +++ b/press/press/doctype/managed_database_service/managed_database_service.py @@ -15,9 +15,9 @@ class ManagedDatabaseService(Document): from frappe.types import DF database_host: DF.Data - database_password: DF.Password - database_user: DF.Data + database_root_user: DF.Data port: DF.Data | None + root_user_password: DF.Password service_provider: DF.Literal["AWS RDS"] team: DF.Link # end: auto-generated types diff --git a/press/press/doctype/site/site.py b/press/press/doctype/site/site.py index 52712121438..06da8529571 100644 --- a/press/press/doctype/site/site.py +++ b/press/press/doctype/site/site.py @@ -390,8 +390,6 @@ def update_config_preview(self): """Regenerates site.config on each site.validate from the site.configuration child table data""" new_config = {} - new_config.update(self._get_managed_db_config()) - # Update from site.configuration for row in self.configuration: # update internal flag from master