From 7b9ccad49c2d49412e828312f7e5e0a16d21ca27 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 12 Dec 2024 14:32:16 -0800 Subject: [PATCH 1/2] update con --- backend/danswer/connectors/web/connector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/danswer/connectors/web/connector.py b/backend/danswer/connectors/web/connector.py index 9e406b71674..285aed1d731 100644 --- a/backend/danswer/connectors/web/connector.py +++ b/backend/danswer/connectors/web/connector.py @@ -33,6 +33,7 @@ from danswer.file_processing.html_utils import web_html_cleanup from danswer.utils.logger import setup_logger from danswer.utils.sitemap import list_pages_for_site +from shared_configs.configs import MULTI_TENANT logger = setup_logger() @@ -241,6 +242,9 @@ def __init__( self.to_visit_list = extract_urls_from_sitemap(_ensure_valid_url(base_url)) elif web_connector_type == WEB_CONNECTOR_VALID_SETTINGS.UPLOAD: + if MULTI_TENANT: + raise ValueError("Upload connector is not supported in the cloud") + logger.warning( "This is not a UI supported Web Connector flow, " "are you sure you want to do this?" From d516b8fc0ab6c1228bace9c42a0a9d25581622f6 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 12 Dec 2024 14:34:05 -0800 Subject: [PATCH 2/2] k --- backend/danswer/connectors/web/connector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/web/connector.py b/backend/danswer/connectors/web/connector.py index 285aed1d731..3fdb5e2aa04 100644 --- a/backend/danswer/connectors/web/connector.py +++ b/backend/danswer/connectors/web/connector.py @@ -242,8 +242,11 @@ def __init__( self.to_visit_list = extract_urls_from_sitemap(_ensure_valid_url(base_url)) elif web_connector_type == WEB_CONNECTOR_VALID_SETTINGS.UPLOAD: + # Explicitly check if running in multi-tenant mode to prevent potential security risks if MULTI_TENANT: - raise ValueError("Upload connector is not supported in the cloud") + raise ValueError( + "Upload input for web connector is not supported in cloud environments" + ) logger.warning( "This is not a UI supported Web Connector flow, "