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."""
@@ -208,6 +210,10 @@ def __post_init__(self) -> None:
208210 with open (spec_file ) as f :
209211 repositories = safe_load (f )
210212
213+ spec_file = Path (renku_data_services .notebooks .__file__ ).resolve ().parent / "api.spec.yaml"
214+ with open (spec_file ) as f :
215+ repositories = safe_load (f )
216+
211217 spec_file = Path (renku_data_services .platform .__file__ ).resolve ().parent / "api.spec.yaml"
212218 with open (spec_file ) as f :
213219 platform = safe_load (f )
@@ -408,8 +414,8 @@ def from_env(cls, prefix: str = "") -> "Config":
408414 gitlab_client : base_models .GitlabAPIProtocol
409415 user_preferences_config : UserPreferencesConfig
410416 version = os .environ .get (f"{ prefix } VERSION" , "0.0.1" )
411- server_options_file = os .environ .get ("SERVER_OPTIONS " )
412- server_defaults_file = os .environ .get ("SERVER_DEFAULTS " )
417+ server_options_file = os .environ .get ("NB_SERVER_OPTIONS__UI_CHOICES_PATH " )
418+ server_defaults_file = os .environ .get ("NB_SERVER_OPTIONS__DEFAULTS_PATH " )
413419 k8s_namespace = os .environ .get ("K8S_NAMESPACE" , "default" )
414420 max_pinned_projects = int (os .environ .get (f"{ prefix } MAX_PINNED_PROJECTS" , "10" ))
415421 user_preferences_config = UserPreferencesConfig (max_pinned_projects = max_pinned_projects )
@@ -491,6 +497,7 @@ def from_env(cls, prefix: str = "") -> "Config":
491497 sentry = SentryConfig .from_env (prefix )
492498 trusted_proxies = TrustedProxiesConfig .from_env (prefix )
493499 message_queue = RedisQueue (redis )
500+ nb_config = _NotebooksConfig .from_env (db )
494501
495502 return cls (
496503 version = version ,
@@ -511,4 +518,5 @@ def from_env(cls, prefix: str = "") -> "Config":
511518 encryption_key = encryption_key ,
512519 secrets_service_public_key = secrets_service_public_key ,
513520 gitlab_url = gitlab_url ,
521+ nb_config = nb_config ,
514522 )
0 commit comments