From 7e67efb5aa58c52093cd46438bdf5f4ebf20c0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Thu, 3 Jan 2019 20:02:31 +0100 Subject: [PATCH] add the ability to disable the terminal --- conf/jupyter_notebook_config.py | 2 +- manifest.json | 9 +++++++++ scripts/_common.sh | 2 ++ scripts/install | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/jupyter_notebook_config.py b/conf/jupyter_notebook_config.py index 8566da2..4e6a58d 100644 --- a/conf/jupyter_notebook_config.py +++ b/conf/jupyter_notebook_config.py @@ -329,7 +329,7 @@ c.NotebookApp.terminado_settings = {'shell_command': ['/bin/bash']} # # Terminals may also be automatically disabled if the terminado package is not # available. -#c.NotebookApp.terminals_enabled = True +c.NotebookApp.terminals_enabled = __ENABLE_TERMINAL__ ## Token used for authenticating first-time connections to the server. # diff --git a/manifest.json b/manifest.json index 9bc7d05..ed1eef3 100644 --- a/manifest.json +++ b/manifest.json @@ -59,6 +59,15 @@ "fr": "Est-ce une application publique ?" }, "default": true + }, + { + "name": "enable_terminal", + "type": "boolean", + "ask": { + "en": "Enable terminal in the lab?", + "fr": "Activer le terminal dans le lab ?" + }, + "default": true } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 5035248..cebe3a8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -61,6 +61,8 @@ config_jupyter_notebook() { # Jupyter notebook configuration cp -f ../conf/jupyter_notebook_config.py $jupyter_notebook_conf_path + ynh_replace_string "__ENABLE_TERMINAL__" "$enable_terminal" $jupyter_notebook_conf_path + ynh_store_file_checksum $jupyter_notebook_conf_path } diff --git a/scripts/install b/scripts/install index 4ac9f28..6e0799e 100644 --- a/scripts/install +++ b/scripts/install @@ -23,6 +23,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC admin=$YNH_APP_ARG_ADMIN +enable_terminal=$YNH_APP_ARG_ENABLE_TERMINAL #================================================= # REGISTER DOMAIN @@ -51,6 +52,7 @@ ynh_app_setting_set $app admin $admin ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path_url $path_url ynh_app_setting_set $app is_public $is_public +ynh_app_setting_set $app enable_terminal $is_public #================================================= # STANDARD MODIFICATIONS