diff --git a/scripts/install b/scripts/install index 95477f7..ad8a063 100644 --- a/scripts/install +++ b/scripts/install @@ -64,12 +64,12 @@ chown $app:$app "$install_dir/config.json" #================================================= # INSTALL YARN AND APP #================================================= -ynh_script_progression --message="Installing app dependencies and creating admin user..." --weight=15 +ynh_script_progression --message="Installing app dependencies..." --weight=15 pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install - ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $mail $password admin --config ./config.json + ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn install # Install dependencies + #ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH yarn build popd #================================================= @@ -80,7 +80,18 @@ popd ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +# It also initializes the database to allow creating the admin user +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="START TASK MANAGER" --timeout=30 + +#================================================= +# CREATING ADMIN USER +#================================================= +ynh_script_progression --message="Creating admin user..." --weight=15 + +pushd $install_dir + admin_mail=$(ynh_user_get_info --username=$admin --key=mail) + ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH ./server/cli.js users create $admin_mail $password admin --config ./config.json +popd #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 41c7ccf..a111339 100644 --- a/scripts/restore +++ b/scripts/restore @@ -73,7 +73,7 @@ yunohost service add $app --description="Federated shared agenda for local commu ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 # Typically you only have either $app or php-fpm but not both at the same time... -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="START TASK MANAGER" --timeout=30 ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 384ffdd..32247d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,7 +75,7 @@ popd #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="START TASK MANAGER" --timeout=30 #================================================= # END OF SCRIPT