diff --git a/README.md b/README.md index b898cf5..cb5ccd5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview JupyterLab is the next-generation user interface for Project Jupyter offering all the familiar building blocks of the classic Jupyter Notebook (notebook, terminal, text editor, file browser, rich outputs, etc.) in a flexible and powerful user interface. JupyterLab will eventually replace the classic Jupyter Notebook. -**Shipped version:** 3.0.10 +**Shipped version:** 3.0.13 ## Screenshots @@ -39,8 +39,8 @@ How to configure this app: by an admin panel, a plain file with SSH. #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jupyterlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jupyterlab.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/) ## Links diff --git a/README_fr.md b/README_fr.md index 755ca1e..da4595b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble JupyterLab est une interface utilisateur de nouvelle génération pour le projet Jupyter offrant tous les modules de Jupyter Notebook (interpréteur Python, terminal, éditeur de texte, navigateur de fichiers, etc.) dans une interface utilisateur flexible et puissante. JupyterLab remplacera à terme Jupyter Notebook. -**Version incluse :** 3.0.10 +**Version incluse :** 3.0.13 ## Captures d’écran @@ -39,8 +39,8 @@ Comment configurer cette application : via le panneau d'administration, un fichi #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jupyterlab%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jupyterlab.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/) ## Liens diff --git a/manifest.json b/manifest.json index 0bf43ba..307d494 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Code console environment for running Python code interactively.", "fr": "Console de code pour exécuter du code Python de manière interactive." }, - "version": "3.0.10~ynh1", + "version": "3.0.13~ynh1", "url": "https://jupyterlab.readthedocs.io/en/stable/", "license": "BSD-3-Clause", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index da0b085..52ef030 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="python3-dev python3-pip libffi-dev libzmq3-dev" nodejs_version="14" -jupyterlab_version="3.0.10" +jupyterlab_version="3.0.13" #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index 0ab8719..df385d7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -33,6 +33,23 @@ port_hub=$(ynh_app_setting_get --app=$app --key=port_hub) port_http_proxy=$(ynh_app_setting_get --app=$app --key=port_http_proxy) admin=$(ynh_app_setting_get --app=$app --key=admin) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED #================================================= @@ -93,21 +110,10 @@ fi # CONFIGURE JUPYTERLAB #================================================= -ynh_backup_if_checksum_is_different --file="$final_path/config/jupyterhub_config.py" - domain=$new_domain -path_url=$new_path +path=${new_path%/} -cp -f ../conf/jupyterhub_config.py $final_path/config/jupyterhub_config.py -ynh_replace_string --match_string="__URL__" --replace_string="https://$domain" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HUB__" --replace_string="$port_hub" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HTTP_PROXY__" --replace_string="$port_http_proxy" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/config/jupyterhub_config.py" - -ynh_store_file_checksum --file="$final_path/config/jupyterhub_config.py" +ynh_add_config --template="../conf/jupyterhub_config.py" --destination="$final_path/config/jupyterhub_config.py" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 7838a6b..c1dae89 100644 --- a/scripts/install +++ b/scripts/install @@ -134,29 +134,11 @@ ynh_add_systemd_config mkdir -p "$final_path/config" -# JupyterHub configuration -cp -f ../conf/jupyterhub_config.py $final_path/config/jupyterhub_config.py +path=${path_url%/} -ynh_replace_string --match_string="__URL__" --replace_string="https://$domain" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HUB__" --replace_string="$port_hub" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HTTP_PROXY__" --replace_string="$port_http_proxy" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/config/jupyterhub_config.py" +ynh_add_config --template="../conf/jupyterhub_config.py" --destination="$final_path/config/jupyterhub_config.py" -# Jupyter notebook configuration -cp -f ../conf/jupyter_notebook_config.py $final_path/config/jupyter_notebook_config.py - -ynh_replace_string --match_string="__ENABLE_TERMINAL__" --replace_string="$enable_terminal" --target_file="$final_path/config/jupyter_notebook_config.py" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/config/jupyterhub_config.py" -ynh_store_file_checksum --file="$final_path/config/jupyter_notebook_config.py" +ynh_add_config --template="../conf/jupyter_notebook_config.py" --destination="$final_path/config/jupyter_notebook_config.py" #================================================= # GENERIC FINALIZATION diff --git a/scripts/restore b/scripts/restore index e6e76b8..5dc2da6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -108,7 +108,7 @@ yunohost service add $app --description="$app daemon" --log="$app" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action="start" --line_match="JupyterHub is now running at" --log_path="systemd" +ynh_systemd_action --service_name=$app --action=start --line_match="JupyterHub is now running at" --log_path="systemd" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 3039fde..5633efb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,29 +132,13 @@ fi # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_backup_if_checksum_is_different --file="$final_path/config/jupyterhub_config.py" - mkdir -p "$final_path/config" -cp -f ../conf/jupyterhub_config.py $final_path/config/jupyterhub_config.py -ynh_replace_string --match_string="__URL__" --replace_string="https://$domain" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HUB__" --replace_string="$port_hub" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__PORT_HTTP_PROXY__" --replace_string="$port_http_proxy" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="$final_path/config/jupyterhub_config.py" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/config/jupyterhub_config.py" +path=${path_url%/} -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$final_path/config/jupyterhub_config.py" +ynh_add_config --template="../conf/jupyterhub_config.py" --destination="$final_path/config/jupyterhub_config.py" -ynh_backup_if_checksum_is_different --file="$final_path/config/jupyter_notebook_config.py" - -cp -f ../conf/jupyter_notebook_config.py $final_path/config/jupyter_notebook_config.py - -ynh_replace_string --match_string="__ENABLE_TERMINAL__" --replace_string="$enable_terminal" --target_file="$final_path/config/jupyter_notebook_config.py" - -ynh_store_file_checksum --file="$final_path/config/jupyter_notebook_config.py" +ynh_add_config --template="../conf/jupyter_notebook_config.py" --destination="$final_path/config/jupyter_notebook_config.py" #================================================= # SETUP SYSTEMD @@ -187,7 +171,7 @@ yunohost service add $app --description="$app daemon" --log="$app" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --line_match="JupyterHub is now running at" --log_path="systemd" +ynh_systemd_action --service_name=$app --action=start --line_match="JupyterHub is now running at" --log_path="systemd" #================================================= # RELOAD NGINX