From 4fc57d402294f5f340f04958647da37efb151ce6 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Thu, 26 Nov 2020 19:01:52 +0100 Subject: [PATCH] Fixies --- README.md | 10 +++------- hooks/post_user_delete | 2 +- issue_template.md | 4 ++-- pull_request_template.md | 2 +- scripts/_common.sh | 4 ++-- scripts/install | 10 ++++++---- scripts/upgrade | 14 +++++++------- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 94c5239..bb9a032 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,9 @@ The idea of [æneria](https://gitlab.com/aeneria/aeneria-app) is to display elec ## Configuration -First of all: - -* You'll need a Linky (obviously) and a [Enedis account](https://mon-compte-client.enedis.fr/) - -Then, go parameter page to follow instructions. - -That's it, now wait a bit to see data appear ! +* First of all, you'll need a Linky (obviously) and an [Enedis account](https://mon-compte-client.enedis.fr/) +* After you have installed the app, just visit it and follow instructions +* That's it, now wait a bit to see data appear ! ## Documentation diff --git a/hooks/post_user_delete b/hooks/post_user_delete index fcbcceb..5472601 100644 --- a/hooks/post_user_delete +++ b/hooks/post_user_delete @@ -13,5 +13,5 @@ firstname=$4 lastname=$5 final_path=$(ynh_app_setting_get "$app" final_path) -# Deactivate the user in Pilea +# Deactivate the user in aeneria cd "$final_path" && ynh_exec_as $app php7.3 bin/console aeneria:user:deactivate "$mail" -n \ No newline at end of file diff --git a/issue_template.md b/issue_template.md index 3bd92a6..4c358ea 100644 --- a/issue_template.md +++ b/issue_template.md @@ -8,7 +8,7 @@ about: Create a report to help us debug, it would be nice to fill the template a 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* - - *Otherwise, the issue may be due to pilea itself. Refer to its documentation or repository for help.* + - *Otherwise, the issue may be due to aeneria itself. Refer to its documentation or repository for help.* - *If you have a doubt, post here, we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- @@ -29,7 +29,7 @@ about: Create a report to help us debug, it would be nice to fill the template a *Steps to reproduce the behavior.* - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install pilea + sudo yunohost app install aeneria ``` - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* diff --git a/pull_request_template.md b/pull_request_template.md index 1ee10a6..dbaee56 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -15,4 +15,4 @@ --- *If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/pilea_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/pilea_ynh%20PR-NUM-%20(USERNAME)/) +[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/aeneria_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/aeneria_ynh%20PR-NUM-%20(USERNAME)/) diff --git a/scripts/_common.sh b/scripts/_common.sh index a35a5f1..a068211 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,11 +5,11 @@ #================================================= # dependencies used by the app -pkg_dependencies="apt-transport-https" +pkg_dependencies="apt-transport-https postgresql postgresql-contrib" YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-ldap" +extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-psql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-sqlite3 php${YNH_PHP_VERSION}-ldap" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 2b2ad6b..3f1e85e 100644 --- a/scripts/install +++ b/scripts/install @@ -63,10 +63,12 @@ ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= -# CREATE A MYSQL DATABASE +# CREATE A PSQL DATABASE #================================================= ynh_script_progression --message="Creating a PSQL database..." --weight=1 +ynh_psql_test_if_first_run + db_name=$(ynh_sanitize_dbid --db_name=$app) db_user="$db_name" ynh_app_setting_set --app=$app --key=db_name --value=$db_name @@ -154,12 +156,12 @@ pushd $final_path do mail=$(ynh_user_get_info --username=$username --key='mail') user_pass=$(ynh_string_random) - ynh_exec_as $app php$phpversion bin/console pilea:user:add "$mail" "$user_pass" + ynh_exec_as $app php$phpversion bin/console aeneria:user:add "$mail" "$user_pass" done # Set admin user mail=$(ynh_user_get_info --username=$admin --key='mail') - ynh_exec_as $app php$phpversion bin/console pilea:user:grant "$mail" + ynh_exec_as $app php$phpversion bin/console aeneria:user:grant "$mail" popd #================================================= @@ -176,7 +178,7 @@ ynh_replace_string "#USER#" "$app" "$cron_path" ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path" #================================================= -# ADAPT HOOK FOR PILEA INSTANCE +# ADAPT HOOK FOR AENERIA INSTANCE #================================================= ynh_script_progression --message="Adapting hooks..." --weight=1 diff --git a/scripts/upgrade b/scripts/upgrade index 65207fe..1682f8b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -160,26 +160,26 @@ ynh_script_progression --message="Upgrading æneria..." --weight=1 chown -R $app: $final_path chmod 755 $final_path -# Install dependencies and Pilea +# Install dependencies and aeneria pushd $final_path ynh_exec_as $app php$phpversion bin/console cache:clear -n ynh_exec_as $app php$phpversion bin/console doctrine:migrations:migrate -n - # Create Pilea's user + # Create aeneria's user for username in $(ynh_user_list) do mail=$(ynh_user_get_info --username=$username --key='mail') - user_exists=$(ynh_exec_as $app php$phpversion bin/console pilea:user:exist "$mail") + user_exists=$(ynh_exec_as $app php$phpversion bin/console aeneria:user:exist "$mail") if [ $user_exists -eq 0 ] then user_pass=$(ynh_string_random) - ynh_exec_as $app php$phpversion bin/console pilea:user:add "$mail" "$user_pass" -n + ynh_exec_as $app php$phpversion bin/console aeneria:user:add "$mail" "$user_pass" -n fi done # Set admin user mail=$(ynh_user_get_info --username=$admin --key='mail') - ynh_exec_as $app php$phpversion bin/console pilea:user:grant "$mail" + ynh_exec_as $app php$phpversion bin/console aeneria:user:grant "$mail" popd #================================================= @@ -188,7 +188,7 @@ popd ynh_script_progression --message="Setuping a cron job..." --weight=1 cron_path="/etc/cron.d/$app" -cp -a ../conf/pilea.cron "$cron_path" +cp -a ../conf/aeneria.cron "$cron_path" chown root: "$cron_path" chmod 644 "$cron_path" @@ -196,7 +196,7 @@ ynh_replace_string --match_string="#USER#" --replace_string="$app" --target_file ynh_replace_string --match_string="#DESTDIR#" --replace_string="$final_path" --target_file="$cron_path" #================================================= -# ADAPT HOOK FOR PILEA INSTANCE +# ADAPT HOOK FOR AENERIA INSTANCE #================================================= ynh_script_progression --message="Adapting hooks..." --weight=1 ynh_replace_string --match_string="APPNAMETOCHANGE" --replace_string=$app --target_file="../hooks/post_user_create"