From e3ccc1f7e2da5481e82d33ca784c367dd39ac9f0 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 16 Oct 2024 10:26:30 +0200 Subject: [PATCH 1/4] fix: Use correct registry to build session containers --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 013929513..4e7ccca98 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ DEVELOPMENT_MODE ?= 0 TIMEOUT ?= 10m -CAPELLA_DOCKERIMAGES = $(MAKE) -C capella-dockerimages PUSH_IMAGES=1 DOCKER_REGISTRY=$(DOCKER_REGISTRY) +CAPELLA_DOCKERIMAGES = $(MAKE) -C capella-dockerimages PUSH_IMAGES=1 DOCKER_REGISTRY=$(CAPELLACOLLAB_SESSIONS_REGISTRY) # Adds support for msys export MSYS_NO_PATHCONV := 1 From 7462b1dd689f4ab20517f556ff19b4a79b9d09e3 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 16 Oct 2024 10:26:59 +0200 Subject: [PATCH 2/4] feat: Add Capella version 7.0.0 as default tool --- backend/capellacollab/core/database/migration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/capellacollab/core/database/migration.py b/backend/capellacollab/core/database/migration.py index 050d7563b..91e1707ab 100644 --- a/backend/capellacollab/core/database/migration.py +++ b/backend/capellacollab/core/database/migration.py @@ -197,7 +197,7 @@ def create_capella_tool(db: orm.Session) -> tools_models.DatabaseTool: ) capella_database = tools_crud.create_tool(db, capella) - for capella_version_name in ("5.0.0", "5.2.0", "6.0.0", "6.1.0"): + for capella_version_name in ("5.0.0", "5.2.0", "6.0.0", "6.1.0", "7.0.0"): if "localhost" in registry: docker_tag = f"{capella_version_name}-latest" else: @@ -206,8 +206,8 @@ def create_capella_tool(db: orm.Session) -> tools_models.DatabaseTool: capella_version = tools_models.CreateToolVersion( name=capella_version_name, config=tools_models.ToolVersionConfiguration( - is_recommended=capella_version_name == "6.1.0", - is_deprecated=capella_version_name == "5.0.0", + is_recommended=capella_version_name == "7.0.0", + is_deprecated=capella_version_name in ("5.0.0", "5.2.0"), sessions=tools_models.SessionToolConfiguration( persistent=tools_models.PersistentSessionToolConfiguration( image=(f"{registry}/capella/remote:{docker_tag}"), From e7577f5eddf4b71522f248428ad15bba7137a4c0 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 16 Oct 2024 10:47:42 +0200 Subject: [PATCH 3/4] feat: Remove experimental status of the Xpra connection method --- ...0ba_add_environment_and_connection_info_to_.py | 13 ++++--------- backend/capellacollab/core/database/migration.py | 15 ++++----------- backend/tests/test_feedback.py | 2 +- docs/docs/admin/tools/configuration.md | 13 ++++--------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/backend/capellacollab/alembic/versions/7683b08b00ba_add_environment_and_connection_info_to_.py b/backend/capellacollab/alembic/versions/7683b08b00ba_add_environment_and_connection_info_to_.py index 7399452ad..e83bf3b33 100644 --- a/backend/capellacollab/alembic/versions/7683b08b00ba_add_environment_and_connection_info_to_.py +++ b/backend/capellacollab/alembic/versions/7683b08b00ba_add_environment_and_connection_info_to_.py @@ -112,11 +112,9 @@ def get_eclipse_configuration(): { "type": "guacamole", "id": "guacamole", - "name": "Classic (Guacamole)", + "name": "Guacamole", "description": ( - "Old connection method using Guacamole. " - "If it has worked fine previously, keep using it. " - "In case of issues, try the Xpra connection method." + "Guacamole doesn't support session sharing." ), "ports": {"metrics": 9118, "rdp": 3389}, "environment": {"CONNECTION_METHOD": "xrdp"}, @@ -124,11 +122,8 @@ def get_eclipse_configuration(): { "type": "http", "id": "xpra", - "name": "Experimental (Xpra)", - "description": ( - "Experimental connection method using Xpra. " - "It's intended for those users who have issues with the Guacamole connection method." - ), + "name": "Xpra", + "description": "Xpra supports session sharing.", "ports": {"http": 10000, "metrics": 9118}, "environment": { "CONNECTION_METHOD": "xpra", diff --git a/backend/capellacollab/core/database/migration.py b/backend/capellacollab/core/database/migration.py index 91e1707ab..87943515e 100644 --- a/backend/capellacollab/core/database/migration.py +++ b/backend/capellacollab/core/database/migration.py @@ -143,22 +143,15 @@ def get_eclipse_session_configuration() -> ( methods=[ tools_models.GuacamoleConnectionMethod( id="guacamole", - name="Classic (Guacamole)", - description=( - "Old connection method using Guacamole. " - "If it has worked fine previously, keep using it. " - "In case of issues, try the Xpra connection method." - ), + name="Guacamole", + description="Guacamole doesn't support session sharing.", ports=tools_models.RDPPorts(metrics=9118, rdp=3389), environment={"CONNECTION_METHOD": "xrdp"}, ), tools_models.HTTPConnectionMethod( id="xpra", - name="Experimental (Xpra)", - description=( - "Experimental connection method using Xpra. " - "It's intended for those users who have issues with the Guacamole connection method." - ), + name="Xpra", + description="Xpra supports session sharing.", ports=tools_models.HTTPPorts(http=10000, metrics=9118), environment={ "CONNECTION_METHOD": "xpra", diff --git a/backend/tests/test_feedback.py b/backend/tests/test_feedback.py index 62c254f03..b8fac1bc5 100644 --- a/backend/tests/test_feedback.py +++ b/backend/tests/test_feedback.py @@ -100,7 +100,7 @@ def test_send_feedback_with_session( "warnings": [], "connection_method": { "id": "xpra", - "name": "Experimental (Xpra)", + "name": "Xpra", }, } ], diff --git a/docs/docs/admin/tools/configuration.md b/docs/docs/admin/tools/configuration.md index 919489889..e60f844c3 100644 --- a/docs/docs/admin/tools/configuration.md +++ b/docs/docs/admin/tools/configuration.md @@ -341,11 +341,8 @@ To help you configure your tools, we provide some examples as part of our methods: - id: guacamole type: guacamole - name: Classic (Guacamole) - description: Old connection method using Guacamole. If - it has worked fine previously, keep using it. - In case of issues, try the Xpra connection - method. + name: Guacamole + description: Guacamole doesn't support session sharing. ports: metrics: 9118 rdp: 3389 @@ -353,10 +350,8 @@ To help you configure your tools, we provide some examples as part of our CONNECTION_METHOD: xrdp - id: xpra type: http - name: Experimental (Xpra) - description: Experimental connection method using Xpra. - It's intended for those users who have issues - with the Guacamole connection method. + name: Xpra + description: Xpra supports session sharing. ports: metrics: 9118 http: 10000 From 2dfe91f649cb7fae29f63ff70b6d6dc8975bffdd Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 16 Oct 2024 12:02:21 +0200 Subject: [PATCH 4/4] chore(dev): Set default port to 4200 in backend configuration This removed some separate handling with the DEVELOPMENT_MODE variable. Also, the internal session viewer can be used out of the box. --- backend/capellacollab/__main__.py | 10 +++------- backend/capellacollab/config/models.py | 2 +- backend/capellacollab/core/database/migration.py | 13 ++----------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/backend/capellacollab/__main__.py b/backend/capellacollab/__main__.py index f26c124ee..a96820ea4 100644 --- a/backend/capellacollab/__main__.py +++ b/backend/capellacollab/__main__.py @@ -15,7 +15,6 @@ import capellacollab.projects.toolmodels.backups.runs.interface as pipeline_runs_interface import capellacollab.sessions.metrics as sessions_metrics import capellacollab.settings.modelsources.t4c.license_server.metrics as t4c_metrics -from capellacollab import core # This import statement is required and should not be removed! (Alembic will not work otherwise) from capellacollab.config import config @@ -42,12 +41,9 @@ handlers=[stream_handler, timed_rotating_file_handler], ) -ALLOW_ORIGINS = ( - [f"{config.general.scheme}//{config.general.host}:{config.general.port}"] - + ["http://localhost:4200", "http://127.0.0.1:4200"] - if core.DEVELOPMENT_MODE - else [] -) +ALLOW_ORIGINS = [ + f"{config.general.scheme}://{config.general.host}:{config.general.port}" +] async def startup(): diff --git a/backend/capellacollab/config/models.py b/backend/capellacollab/config/models.py index fdb199bd7..95424f8ea 100644 --- a/backend/capellacollab/config/models.py +++ b/backend/capellacollab/config/models.py @@ -192,7 +192,7 @@ class GeneralConfig(BaseConfig): examples=["localhost", "capella.example.com"], ) port: int | str = pydantic.Field( - default=8000, + default=4200, description="The port the application should run on.", examples=[8000, 443, 8080], ) diff --git a/backend/capellacollab/core/database/migration.py b/backend/capellacollab/core/database/migration.py index 87943515e..c781289f3 100644 --- a/backend/capellacollab/core/database/migration.py +++ b/backend/capellacollab/core/database/migration.py @@ -11,7 +11,6 @@ from alembic import migration from sqlalchemy import orm -from capellacollab import core from capellacollab.config import config from capellacollab.core import database from capellacollab.events import crud as events_crud @@ -156,11 +155,7 @@ def get_eclipse_session_configuration() -> ( environment={ "CONNECTION_METHOD": "xpra", "XPRA_SUBPATH": "{CAPELLACOLLAB_SESSIONS_BASE_PATH}", - "XPRA_CSP_ORIGIN_HOST": ( - "http://localhost:4200" - if core.DEVELOPMENT_MODE - else "{CAPELLACOLLAB_ORIGIN_BASE_URL}" - ), + "XPRA_CSP_ORIGIN_HOST": "{CAPELLACOLLAB_ORIGIN_BASE_URL}", }, redirect_url="{CAPELLACOLLAB_SESSIONS_SCHEME}://{CAPELLACOLLAB_SESSIONS_HOST}:{CAPELLACOLLAB_SESSIONS_PORT}{CAPELLACOLLAB_SESSIONS_BASE_PATH}/?floating_menu=0&sharing=1&path={CAPELLACOLLAB_SESSIONS_BASE_PATH}/", cookies={ @@ -277,11 +272,7 @@ def create_jupyter_tool(db: orm.Session) -> tools_models.DatabaseTool: environment={ "JUPYTER_PORT": "8888", "JUPYTER_TOKEN": "{CAPELLACOLLAB_SESSION_TOKEN}", - "CSP_ORIGIN_HOST": ( - "http://localhost:4200" - if core.DEVELOPMENT_MODE - else "{CAPELLACOLLAB_ORIGIN_BASE_URL}" - ), + "CSP_ORIGIN_HOST": "{CAPELLACOLLAB_ORIGIN_BASE_URL}", "JUPYTER_BASE_URL": "{CAPELLACOLLAB_SESSIONS_BASE_PATH}", }, connection=tools_models.ToolSessionConnection(