Skip to content

Commit

Permalink
add ssh enabled to /version endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jan 26, 2023
1 parent 7b63515 commit 988bcae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helm-chart/renku-notebooks/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ spec:
value: "{{ .Values.gitClone.image.name }}:{{ .Values.gitClone.image.tag }}"
- name: NB_ANONYMOUS_SESSIONS_ENABLED
value: {{ .Values.global.anonymousSessions.enabled | quote }}
- name: NB_SSH_ENABLED
value: {{ .Values.ssh.enabled | quote }}
- name: NB_SESSIONS__CULLING__REGISTERED__IDLE_SECONDS
value: {{ .Values.culling.idleThresholdSeconds.registered | quote }}
- name: NB_SESSIONS__CULLING__ANONYMOUS__IDLE_SECONDS
Expand Down
1 change: 1 addition & 0 deletions renku_notebooks/api/notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def version():
"s3": config.cloud_storage.s3.enabled,
"azure_blob": config.cloud_storage.azure_blob.enabled,
},
"sshEnabled": config.ssh_enabled,
},
}
],
Expand Down
3 changes: 3 additions & 0 deletions renku_notebooks/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class _NotebooksConfig:
cloud_storage: _CloudStorage
current_resource_schema_version: int = 1
anonymous_sessions_enabled: Union[Text, bool] = False
ssh_enabled: Union[Text, bool] = False
service_prefix: str = "/notebooks"
version: str = "0.0.0"
keycloak_realm: str = "Renku"
Expand All @@ -36,6 +37,7 @@ def __post_init__(self):
self.anonymous_sessions_enabled = _parse_str_as_bool(
self.anonymous_sessions_enabled
)
self.ssh_enabled = _parse_str_as_bool(self.ssh_enabled)
self.session_get_endpoint_annotations = _ServersGetEndpointAnnotations()
if not self.k8s.enabled:
return
Expand Down Expand Up @@ -197,6 +199,7 @@ def get_config(default_config: str) -> _NotebooksConfig:
mount_folder = /cloudstorage
}
anonymous_sessions_enabled = false
ssh_enabled = false
service_prefix = /notebooks
version = 0.0.0
keycloak_realm = Renku
Expand Down
2 changes: 2 additions & 0 deletions renku_notebooks/config/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,15 @@ class _DynamicConfig:
sentry: _SentryConfig
git: _GitConfig
anonymous_sessions_enabled: Union[Text, bool] = False
ssh_enabled: Union[Text, bool] = False
service_prefix: str = "/notebooks"
version: str = "0.0.0"

def __post_init__(self):
self.anonymous_sessions_enabled = _parse_str_as_bool(
self.anonymous_sessions_enabled
)
self.ssh_enabled = _parse_str_as_bool(self.ssh_enabled)


@dataclass
Expand Down

0 comments on commit 988bcae

Please sign in to comment.