From 110847bab67a1bec3e0079c889bd6a845b837738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Sun, 20 Jan 2019 12:34:35 +0100 Subject: [PATCH 1/7] remove service log file redirection --- conf/systemd.service.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service.default b/conf/systemd.service.default index 0b35399..1e36a5a 100644 --- a/conf/systemd.service.default +++ b/conf/systemd.service.default @@ -4,7 +4,7 @@ After=syslog.target network.target [Service] Environment="PATH=__FINALPATH__/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -ExecStart=__FINALPATH__/bin/jupyterhub -f __CONFIGPATH__/jupyterhub_config.py 2&>> /var/log/__APP__.log +ExecStart=__FINALPATH__/bin/jupyterhub -f __CONFIGPATH__/jupyterhub_config.py Restart=always RestartSec=10 WorkingDirectory=__FINALPATH__ From 2575f3dceba7ddca25079ebc9a604ebc00496a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Sun, 20 Jan 2019 12:35:56 +0100 Subject: [PATCH 2/7] clean change_url and install scripts --- scripts/change_url | 2 -- scripts/install | 1 - 2 files changed, 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 184db43..15329f7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -41,8 +41,6 @@ port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy) # CHECK PATHS SYNTAX #================================================= -test -n "$old_path" || old_path="/" -test -n "$new_path" || new_path="/" new_path=$(ynh_normalize_url_path $new_path) old_path=$(ynh_normalize_url_path $old_path) diff --git a/scripts/install b/scripts/install index e0a0ac0..b8a2173 100644 --- a/scripts/install +++ b/scripts/install @@ -31,7 +31,6 @@ enable_terminal=$YNH_APP_ARG_ENABLE_TERMINAL #================================================= # Normalize the url path syntax -test -n "$path_url" || path_url="/" path_url=$(ynh_normalize_url_path $path_url) # This function check also the availability of this one From 9fcbe6a6e1ec00c201a884edb1e6a7120edc1a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Sun, 20 Jan 2019 12:36:14 +0100 Subject: [PATCH 3/7] add upgrade script --- scripts/upgrade | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 scripts/upgrade diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..4633d29 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,126 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +# IMPORT GENERIC HELPERS +source /usr/share/yunohost/helpers +source ./experimental_helper.sh + +# Load common variables and helpers +source ./_common.sh + +#================================================= +# LOAD SETTINGS +#================================================= + +app=$YNH_APP_INSTANCE_NAME + +# Retrieve app settings +domain=$(ynh_app_setting_get "$app" domain) +path_url=$(ynh_app_setting_get "$app" path_url) +admin=$(ynh_app_setting_get "$app" admin) +is_public=$(ynh_app_setting_get "$app" is_public) +port=$(ynh_app_setting_get "$app" port) +port_hub=$(ynh_app_setting_get "$app" port_hub) +port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy) + +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= + +# TODO Add backup/restore scripts +## Backup the current version of the app +#ynh_backup_before_upgrade +#ynh_clean_setup () { +# # 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 THE PATH +#================================================= + +# Normalize the URL path syntax +path_url=$(ynh_normalize_url_path $path_url) + +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# NGINX CONFIGURATION +#================================================= + +# Modify Nginx configuration file and copy it to Nginx conf directory +ynh_add_nginx_config + +#================================================= +# CONFIGURE JUPYTERLAB +#================================================= + +# Configure jupyterlab with jupyterhub_config.py file +config_jupyterlab + +#================================================= +# DOWNLOAD, CHECK AND INSTALL JUPYTERLAB +#================================================= + +setup_source $miniconda_architecture + +#================================================= +# SPECIFIC SETUP +#================================================= +# ADD HUB EXTENSION +#================================================= + +jupyter labextension install @jupyterlab/hub-extension +jupyter lab build + +chown $admin -R $final_path/share/jupyter + +#================================================= +# CONFIGURE JUPYTER NOTEBOOK +#================================================= +config_jupyter_notebook + +#================================================= +# SETUP SYSTEMD +#================================================= + +# Create a dedicated systemd config +add_systemd_config + +#================================================= +# GENERIC FINALIZATION +#================================================= +# SETUP SSOWAT +#================================================= + +# If app is public, add url to SSOWat conf as skipped_uris +if [[ $is_public -eq 1 ]]; then + # See install script + ynh_app_setting_set "$app" unprotected_uris "/" +fi + +#================================================= +# RELOAD NGINX +#================================================= + +systemctl reload nginx + +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app --log "systemd" + +#================================================= +# START SERVICE +#================================================= + +ynh_systemd_action -n $app -a restart -l "JupyterHub is now running at" -p "systemd" \ No newline at end of file From 1f4ed865708161ab1f6462ce4a7f6880e55503f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Mon, 21 Jan 2019 23:21:41 +0100 Subject: [PATCH 4/7] fix ynh_systemd_action for change_url --- scripts/experimental_helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 8afa310..5e6a77f 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -36,7 +36,7 @@ ynh_systemd_action() { # Following the starting of the app in its log if [ "$log_path" == "systemd" ] ; then # Read the systemd journal - journalctl -u $service_name -f --since=-45 > "$templog" & + journalctl -u $service_name -f -n0 > "$templog" & else # Read the specified log file tail -F -n0 "$log_path" > "$templog" & From 923fcf98fb2242d511ab0d74006d100d36a32d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Mon, 21 Jan 2019 23:48:18 +0100 Subject: [PATCH 5/7] fix upgrade --- scripts/_common.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index cbdc2cd..b09af15 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -134,21 +134,26 @@ setup_source() { if [ "$src_filename" = "" ] ; then src_filename="${src_id}.${src_format}" fi - local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}" - if test -e "$local_src" - then # Use the local source file if it is present - cp $local_src $src_filename - else # If not, download the source - local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err $out + if ! test -e "$final_path" + then + + local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}" + + if test -e "$local_src" + then # Use the local source file if it is present + cp $local_src $src_filename + else # If not, download the source + local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err $out + fi + + # Check the control sum + echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \ + || ynh_die "Corrupt source" + + bash $src_filename -b -p $final_path fi - - # Check the control sum - echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \ - || ynh_die "Corrupt source" - - bash $src_filename -b -p $final_path - + export "PATH=$final_path/bin/:$PATH" if [ "$src_id" = "arm" ] From f7baa5da3b2bc1cd7ca5b3cc11368b8aa091051a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Mon, 21 Jan 2019 23:55:14 +0100 Subject: [PATCH 6/7] add enable_terminal in upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 4633d29..9dce9cb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ is_public=$(ynh_app_setting_get "$app" is_public) port=$(ynh_app_setting_get "$app" port) port_hub=$(ynh_app_setting_get "$app" port_hub) port_http_proxy=$(ynh_app_setting_get "$app" port_http_proxy) +enable_terminal=$(ynh_app_setting_get "$app" enable_terminal) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From da8a45990e2fe7ccb82afd662bf86f78949ef98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Tue, 22 Jan 2019 00:05:02 +0100 Subject: [PATCH 7/7] Update readme --- README.md | 8 ++++---- manifest.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2d11ae8..e942419 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JupyterLab for YunoHost -[![Integration level](https://dash.yunohost.org/integration/jupyterlab.svg)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20%28Community%29/lastBuild/consoleFull) +[![Integration level](https://dash.yunohost.org/integration/jupyterlab.svg)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20%28Community%29/lastBuild/consoleFull) [![Install jupyterlab with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=jupyterlab) > *This package allow you to install jupyterlab quickly and simply on a YunoHost server. @@ -36,9 +36,9 @@ Can the app be used by multiple users? **Yes** #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/jupyterlab%20(Community)/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/jenkins/job/jupyterlab%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/jupyterlab%20(Community)%20(%7EARM%7E)/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/jenkins/job/jupyterlab%20(Community)/badge/icon)](https://ci-stretch.nohost.me/jenkins/job/jupyterlab%20(Community)/) +* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/jupyterlab/) +* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jupyterlab/) +* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/jupyterlab%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/jupyterlab/) ## Links diff --git a/manifest.json b/manifest.json index 59e9c44..f9186d3 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "JupyterLab", "id": "jupyterlab", "packaging_format": 1, - "version": "0.35.4~ynh1", + "version": "0.35.4~ynh2", "description": { "en": "JupyterLab for Yunohost, an extensible environment for interactive and reproducible computing (notebook, terminal, text editor, file browser, rich outputs, etc.)", "fr": "JupyterLab pour YunoHost, un environnement informatique extensible, interactif et reproductible (bloc-notes, terminal, éditeur de texte, explorateur de fichiers, texte enrichi, etc.)"