1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jupyterlab_ynh.git synced 2024-09-03 19:26:35 +02:00

Add infos

This commit is contained in:
Pierre Bourré 2019-01-26 15:03:05 +01:00
parent c87bdc2ae5
commit 03ba0348c2
5 changed files with 31 additions and 0 deletions

View file

@ -34,6 +34,8 @@ create_dir() {
# CONFIGURATION FILES FOR JUPYTERLAB
#=================================================
config_jupyterlab() {
ynh_print_info "Configuring JupyterLab..."
create_dir
jupyterlab_conf_path="$config_path/jupyterhub_config.py"
@ -55,6 +57,8 @@ config_jupyterlab() {
}
config_jupyter_notebook() {
ynh_print_info "Configuring Jupyter Notebook..."
jupyter_notebook_conf_path="$final_path/etc/jupyter/jupyter_notebook_config.py"
ynh_backup_if_checksum_is_different $jupyter_notebook_conf_path
@ -71,6 +75,8 @@ config_jupyter_notebook() {
# CREATE A DEDICATED SYSTEMD CONFIG
#=================================================
add_systemd_config () {
ynh_print_info "Adding Jupyterlab as a service..."
sudo cp ../conf/systemd.service.default ../conf/systemd.service
tempsystemdconf="../conf/systemd.service"
@ -85,6 +91,8 @@ add_systemd_config () {
# REMOVE THE CONFIGURATION FILE FOR JUPYTERLAB
#=================================================
remove_config_jupyterlab() {
ynh_print_info "Removing the configuration file..."
ynh_secure_remove "$config_path/jupyterhub_config.py"
}
@ -140,6 +148,9 @@ setup_source() {
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
ynh_print_info "Downloading anaconda files (used by JupyterLab)..."
if test -e "$local_src"
then # Use the local source file if it is present
cp $local_src $src_filename
@ -151,11 +162,16 @@ setup_source() {
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|| ynh_die "Corrupt source"
ynh_print_info "Installing anaconda (used by JupyterLab)..."
bash $src_filename -b -p $final_path
fi
export "PATH=$final_path/bin/:$PATH"
ynh_print_info "Installing JupyterLab..."
if [ "$src_id" = "arm" ]
then
conda install jupyterlab=$jupyterlab_version notebook nodejs -y

View file

@ -80,14 +80,22 @@ nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
if [ $change_path -eq 1 ]
then
ynh_print_info "Changing path..."
# Make a backup of the original nginx config file if modified
ynh_backup_if_checksum_is_different "$nginx_conf_path"
# Set global variables for nginx helper
domain="$old_domain"
path_url="$new_path"
# Create a dedicated nginx config
ynh_add_nginx_config
fi
# Change the domain for nginx
if [ $change_domain -eq 1 ]
then
ynh_print_info "Changing domain..."
# Delete file checksum for the old conf file location
ynh_delete_file_checksum "$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf

View file

@ -11,6 +11,7 @@
# | arg: -t, --timeout= - Timeout - The maximum time to wait before ending the watching. Default : 300 seconds.
# | arg: -e, --length= - Length of the error log : Default : 20
ynh_systemd_action() {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= )
local service_name
@ -29,6 +30,8 @@ ynh_systemd_action() {
local length=${length:-20}
local timeout=${timeout:-300}
ynh_print_info "Waiting for a response from $service_name..."
# Start to read the log
if [[ -n "${line_match:-}" ]]
then

View file

@ -61,6 +61,8 @@ ynh_app_setting_set $app enable_terminal $enable_terminal
# FIND AND OPEN PORTS
#=================================================
ynh_print_info "Getting ports..."
# Find free ports
port=$(ynh_find_port 8080)
port_hub=$(ynh_find_port $(($port + 1)))

View file

@ -54,6 +54,8 @@ remove_config_jupyterlab
# REMOVE APP MAIN DIR
#=================================================
ynh_print_info "Removing JupyterLab..."
ynh_secure_remove "$final_path"
ynh_secure_remove "$config_path"