5959from renku_data_services .message_queue .interface import IMessageQueue
6060from renku_data_services .message_queue .redis_queue import RedisQueue
6161from renku_data_services .namespace .db import GroupRepository
62+ from renku_data_services .notebooks .config import _NotebooksConfig
6263from renku_data_services .platform .db import PlatformRepository
6364from renku_data_services .project .db import ProjectMemberRepository , ProjectRepository
6465from renku_data_services .repositories .db import GitRepositoriesRepository
@@ -151,6 +152,7 @@ class Config:
151152 kc_api : IKeycloakAPI
152153 message_queue : IMessageQueue
153154 gitlab_url : str | None
155+ nb_config : _NotebooksConfig
154156
155157 secrets_service_public_key : rsa .RSAPublicKey
156158 """The public key of the secrets service, used to encrypt user secrets that only it can decrypt."""
@@ -228,6 +230,10 @@ def load_apispec() -> dict[str, Any]:
228230 with open (spec_file ) as f :
229231 repositories = safe_load (f )
230232
233+ spec_file = Path (renku_data_services .notebooks .__file__ ).resolve ().parent / "api.spec.yaml"
234+ with open (spec_file ) as f :
235+ repositories = safe_load (f )
236+
231237 spec_file = Path (renku_data_services .platform .__file__ ).resolve ().parent / "api.spec.yaml"
232238 with open (spec_file ) as f :
233239 platform = safe_load (f )
@@ -466,8 +472,8 @@ def from_env(cls, prefix: str = "") -> "Config":
466472 gitlab_client : base_models .GitlabAPIProtocol
467473 user_preferences_config : UserPreferencesConfig
468474 version = os .environ .get (f"{ prefix } VERSION" , "0.0.1" )
469- server_options_file = os .environ .get ("SERVER_OPTIONS " )
470- server_defaults_file = os .environ .get ("SERVER_DEFAULTS " )
475+ server_options_file = os .environ .get ("NB_SERVER_OPTIONS__UI_CHOICES_PATH " )
476+ server_defaults_file = os .environ .get ("NB_SERVER_OPTIONS__DEFAULTS_PATH " )
471477 k8s_namespace = os .environ .get ("K8S_NAMESPACE" , "default" )
472478 max_pinned_projects = int (os .environ .get (f"{ prefix } MAX_PINNED_PROJECTS" , "10" ))
473479 user_preferences_config = UserPreferencesConfig (max_pinned_projects = max_pinned_projects )
@@ -549,6 +555,7 @@ def from_env(cls, prefix: str = "") -> "Config":
549555 sentry = SentryConfig .from_env (prefix )
550556 trusted_proxies = TrustedProxiesConfig .from_env (prefix )
551557 message_queue = RedisQueue (redis )
558+ nb_config = _NotebooksConfig .from_env (db )
552559
553560 return cls (
554561 version = version ,
@@ -569,4 +576,5 @@ def from_env(cls, prefix: str = "") -> "Config":
569576 encryption_key = encryption_key ,
570577 secrets_service_public_key = secrets_service_public_key ,
571578 gitlab_url = gitlab_url ,
579+ nb_config = nb_config ,
572580 )
0 commit comments