diff --git a/README.md b/README.md index 6f975f7..6679aef 100755 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ But the app can be used by multiple users * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/plume%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/plume/) * Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/plume%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/plume/) * Testing x86-64b - [![Build Status](https://ci-apps-unstable.yunohost.org/ci/logs/plume%20%28Community%29%20%28testing%29.svg)](https://ci-apps-unstable.yunohost.org/ci/apps/plume/) -* Unstable x86-64b - [![Build Status](https://ci-apps-unstable.yunohost.org/ci/logs/plume%20%28Community%2920%28unstable%29.svg)](https://ci-apps-unstable.yunohost.org/ci/apps/plume/) +* Unstable x86-64b - [![Build Status](https://ci-apps-unstable.yunohost.org/ci/logs/plume%20%28Community%29%20%28unstable%29.svg)](https://ci-apps-unstable.yunohost.org/ci/apps/plume/) ## Limitations diff --git a/check_process b/check_process index 0cb5a4a..be31990 100755 --- a/check_process +++ b/check_process @@ -8,6 +8,7 @@ domain="domain.tld" (DOMAIN) admin="john" (USER) is_public=1 (PUBLIC|public=1|private=0) + password="pass" name="my blog" registration=0 (BOOLEAN) ; Checks diff --git a/manifest.json b/manifest.json index 44220f3..5f0c6c6 100755 --- a/manifest.json +++ b/manifest.json @@ -48,6 +48,19 @@ }, "default": true }, + { + "name": "password", + "type": "password", + "ask": { + "en": "Set the administrator password", + "fr": "Définissez le mot de passe administrateur" + }, + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + }, + "example": "Choose a password" + }, { "name": "name", "ask": { diff --git a/scripts/change_url b/scripts/change_url index f8eaf29..7b4dc0f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -115,3 +115,4 @@ ynh_store_file_checksum "$final_path/$app/.env" #================================================= systemctl reload nginx +sleep 30 diff --git a/scripts/install b/scripts/install index 9d98e60..60c9c3a 100755 --- a/scripts/install +++ b/scripts/install @@ -29,10 +29,10 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +password=$YNH_APP_ARG_PASSWORD instance_name=$YNH_APP_ARG_NAME registration=$YNH_APP_ARG_REGISTRATION admin_email=$(ynh_user_get_info $admin 'mail') -admin_pass=$(ynh_string_random 24) random_key=$(openssl rand -base64 32) ### If it's a multi-instance app, meaning it can be installed several times independently @@ -219,7 +219,7 @@ else fi # Add admin user -( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm users new --admin -n "$admin" -N "$admin" --email "$admin_email" --password "$admin_pass" ) +( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm users new --admin -n "$admin" -N "$admin" --email "$admin_email" --password "$password" ) # Initialise search index ( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm search init -p $final_path/$app ) @@ -357,16 +357,4 @@ systemctl reload nginx #================================================= yunohost service start $app - -#================================================= -# SEND A README FOR THE ADMIN -#================================================= - -message=" $app was successfully installed :) -Please open your $app domain: https://$domain$path_url - -The admin username is: $admin -The admin password is: $admin_pass - -If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/Plume-org/Plume" -ynh_send_readme_to_admin "$message" "$admin" +sleep 30 \ No newline at end of file diff --git a/scripts/restore b/scripts/restore index f5f3aef..3be1332 100755 --- a/scripts/restore +++ b/scripts/restore @@ -140,5 +140,4 @@ systemctl reload nginx #================================================= yunohost service start $app - - +sleep 30 diff --git a/scripts/upgrade b/scripts/upgrade index 4a25c82..b6ee6aa 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -191,4 +191,4 @@ systemctl reload nginx #================================================= yunohost service start $app - +sleep 30 diff --git a/scripts/ynh_send_readme_to_admin b/scripts/ynh_send_readme_to_admin deleted file mode 100644 index b164f0e..0000000 --- a/scripts/ynh_send_readme_to_admin +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: -m --app_message= - The message to send to the administrator. -# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [m]=app_message= [r]=recipients= ) - local app_message - local recipients - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - local app_message="${app_message:-...No specific information...}" - local recipients="${recipients:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" - - local mail_message="This is an automated message from your beloved YunoHost server. - -Specific information for the application $app. - -$app_message - ---- -Automatic diagnosis data from YunoHost - -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -}