5252from renku_data_services .message_queue .interface import IMessageQueue
5353from renku_data_services .message_queue .redis_queue import RedisQueue
5454from renku_data_services .namespace .db import GroupRepository
55+ from renku_data_services .notebooks .config import _NotebooksConfig
5556from renku_data_services .platform .db import PlatformRepository
5657from renku_data_services .project .db import ProjectMemberRepository , ProjectRepository
5758from renku_data_services .repositories .db import GitRepositoriesRepository
@@ -144,6 +145,7 @@ class Config:
144145 kc_api : IKeycloakAPI
145146 message_queue : IMessageQueue
146147 gitlab_url : str | None
148+ nb_config : _NotebooksConfig
147149
148150 secrets_service_public_key : rsa .RSAPublicKey
149151 """The public key of the secrets service, used to encrypt user secrets that only it can decrypt."""
@@ -210,6 +212,10 @@ def __post_init__(self) -> None:
210212 with open (spec_file ) as f :
211213 repositories = safe_load (f )
212214
215+ spec_file = Path (renku_data_services .notebooks .__file__ ).resolve ().parent / "api.spec.yaml"
216+ with open (spec_file ) as f :
217+ repositories = safe_load (f )
218+
213219 spec_file = Path (renku_data_services .platform .__file__ ).resolve ().parent / "api.spec.yaml"
214220 with open (spec_file ) as f :
215221 platform = safe_load (f )
@@ -422,8 +428,8 @@ def from_env(cls, prefix: str = "") -> "Config":
422428 gitlab_client : base_models .GitlabAPIProtocol
423429 user_preferences_config : UserPreferencesConfig
424430 version = os .environ .get (f"{ prefix } VERSION" , "0.0.1" )
425- server_options_file = os .environ .get ("SERVER_OPTIONS " )
426- server_defaults_file = os .environ .get ("SERVER_DEFAULTS " )
431+ server_options_file = os .environ .get ("NB_SERVER_OPTIONS__UI_CHOICES_PATH " )
432+ server_defaults_file = os .environ .get ("NB_SERVER_OPTIONS__DEFAULTS_PATH " )
427433 k8s_namespace = os .environ .get ("K8S_NAMESPACE" , "default" )
428434 max_pinned_projects = int (os .environ .get (f"{ prefix } MAX_PINNED_PROJECTS" , "10" ))
429435 user_preferences_config = UserPreferencesConfig (max_pinned_projects = max_pinned_projects )
@@ -505,6 +511,7 @@ def from_env(cls, prefix: str = "") -> "Config":
505511 sentry = SentryConfig .from_env (prefix )
506512 trusted_proxies = TrustedProxiesConfig .from_env (prefix )
507513 message_queue = RedisQueue (redis )
514+ nb_config = _NotebooksConfig .from_env (db )
508515
509516 return cls (
510517 version = version ,
@@ -525,4 +532,5 @@ def from_env(cls, prefix: str = "") -> "Config":
525532 encryption_key = encryption_key ,
526533 secrets_service_public_key = secrets_service_public_key ,
527534 gitlab_url = gitlab_url ,
535+ nb_config = nb_config ,
528536 )
0 commit comments