diff --git a/README.md b/README.md index 2dc03c5..53f186c 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,35 @@ + + # æneria for YunoHost -[![Integration level](https://dash.yunohost.org/integration/aeneria.svg)](https://dash.yunohost.org/appci/app/aeneria) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/aeneria.svg)](https://dash.yunohost.org/appci/app/aeneria) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.maintain.svg) [![Install æneria with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=aeneria) -> *This package allows you to install æeneria quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install æneria quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview + The idea of [æneria](https://aeneria.com) is to display energy consumption and weather data on a little dashboard that allow the user to: * Better understand our own energy consumption * Analyse energy consumption throw weather data - **Shipped version:** 1.1.6 + +**Shipped version:** 1.1.6~ynh2 + + ## Screenshots -![æneria startup screen](https://gitlab.com/aeneria/aeneria-app/-/raw/master/docs/img/dash_accueil.png) +![](./doc/screenshots/screenshot1.png) + +## Disclaimers / important information ## Configuration @@ -25,10 +38,6 @@ The idea of [æneria](https://aeneria.com) is to display energy consumption and * After that, install æneria to your Yunohost instance, visit it and just follow instructions * That's it, now wait a bit to see data appear ! -## Documentation - -More information can be found on [æneria documentation](https://docs.aeneria.com). - ## Comming from Pilea æneria is the new name of Pilea. This new name came whith a brand new version. @@ -37,24 +46,13 @@ This new version introduced some breaking changes in data structure: migration f But don't worry, you can easilly transfer your data from Pilea to æneria following [this documentation](https://docs.aeneria.com/fr/latest/administrateur/pilea_migration.html). -## YunoHost specific features +## Documentation and resources -* Integrate with YunoHost users and SSO -* Allow one user to be the administrator (set at the installation) -* Allow multiple instances of this application - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/aeneria%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/aeneria/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/aeneria%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/aeneria/) - -## Links - - * æneria website: https://aeneria.com/ - * æneria repo: https://gitlab.com/aeneria/aeneria-app - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: https://aeneria.com +* Official admin documentation: https://docs.aeneria.com +* Upstream app code repository: https://gitlab.com/aeneria/aeneria-app +* YunoHost documentation for this app: https://yunohost.org/app_aeneria +* Report a bug: https://github.com/YunoHost-Apps/aeneria_ynh/issues ## Developer info @@ -66,3 +64,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/aeneria_ynh/tree/test or sudo yunohost app upgrade aeneria -u https://github.com/YunoHost-Apps/aeneria_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..dbb52bb --- /dev/null +++ b/README_fr.md @@ -0,0 +1,64 @@ +# æneria pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/aeneria.svg)](https://dash.yunohost.org/appci/app/aeneria) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/aeneria.maintain.svg) +[![Installer æneria avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=aeneria) + +*[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* + +> *Ce package vous permet d'installer æneria rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* + +## Vue d'ensemble + +The idea of [æneria](https://aeneria.com) is to display energy consumption and weather data on a little dashboard that allow the user to: + + * Better understand our own energy consumption + * Analyse energy consumption throw weather data + + +**Version incluse :** 1.1.6~ynh2 + + + +## Captures d'écran + +![](./doc/screenshots/screenshot1.png) + +## Avertissements / informations importantes + +## Configuration + +* First of all, you'll need a Linky and an [Enedis account](https://mon-compte-client.enedis.fr/) +* In your Enedis space, go to ["Gérer l'accès à mes données"](https://mon-compte-particulier.enedis.fr/donnees/) tab, and allow Enedis to collect and store your hourly consumption +* After that, install æneria to your Yunohost instance, visit it and just follow instructions +* That's it, now wait a bit to see data appear ! + +## Comming from Pilea + +æneria is the new name of Pilea. This new name came whith a brand new version. + +This new version introduced some breaking changes in data structure: migration from Pilea can't be done automaticly. + +But don't worry, you can easilly transfer your data from Pilea to æneria following [this documentation](https://docs.aeneria.com/fr/latest/administrateur/pilea_migration.html). + +## Documentations et ressources + +* Site officiel de l'app : https://aeneria.com +* Documentation officielle de l'admin : https://docs.aeneria.com +* Dépôt de code officiel de l'app : https://gitlab.com/aeneria/aeneria-app +* Documentation YunoHost pour cette app : https://yunohost.org/app_aeneria +* Signaler un bug : https://github.com/YunoHost-Apps/aeneria_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/aeneria_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/aeneria_ynh/tree/testing --debug +ou +sudo yunohost app upgrade aeneria -u https://github.com/YunoHost-Apps/aeneria_ynh/tree/testing --debug +``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 1b4422b..d505b44 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,8 +17,8 @@ location __PATH__/ { fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_intercept_errors on; } diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..d27d27e --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,4 @@ +The idea of [æneria](https://aeneria.com) is to display energy consumption and weather data on a little dashboard that allow the user to: + + * Better understand our own energy consumption + * Analyse energy consumption throw weather data diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..5e41c6b --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,14 @@ +## Configuration + +* First of all, you'll need a Linky and an [Enedis account](https://mon-compte-client.enedis.fr/) +* In your Enedis space, go to ["Gérer l'accès à mes données"](https://mon-compte-particulier.enedis.fr/donnees/) tab, and allow Enedis to collect and store your hourly consumption +* After that, install æneria to your Yunohost instance, visit it and just follow instructions +* That's it, now wait a bit to see data appear ! + +## Comming from Pilea + +æneria is the new name of Pilea. This new name came whith a brand new version. + +This new version introduced some breaking changes in data structure: migration from Pilea can't be done automaticly. + +But don't worry, you can easilly transfer your data from Pilea to æneria following [this documentation](https://docs.aeneria.com/fr/latest/administrateur/pilea_migration.html). diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/screenshot1.png b/doc/screenshots/screenshot1.png new file mode 100644 index 0000000..3e5d59b Binary files /dev/null and b/doc/screenshots/screenshot1.png differ diff --git a/manifest.json b/manifest.json index abb4aec..a02c22c 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,12 @@ }, "version": "1.1.6~ynh2", "url": "https://gitlab.com/aeneria/aeneria-app", + "upstream": { + "license": "AGPL-3.0-or-later", + "website": "https://aeneria.com", + "admindoc": "https://docs.aeneria.com", + "code": "https://gitlab.com/aeneria/aeneria-app" + }, "license": "AGPL-3.0-or-later", "maintainer": { "name": "Simon Mellerin", @@ -23,7 +29,7 @@ "psql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -34,6 +40,10 @@ "example": "/aeneria", "default": "/aeneria" }, + { + "name": "admin", + "type": "user" + }, { "name": "is_public", "type": "boolean", @@ -42,10 +52,6 @@ "fr": "Choisissez si l'application doit être accessible uniquement pour vos utilisateurs yunohost ou pour tout le monde." }, "default": false - }, - { - "name": "admin", - "type": "user" } ] } diff --git a/scripts/backup b/scripts/backup index b5da1c8..2dbcfe1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -55,7 +55,7 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC BACKUP #================================================= -# BACKUP A CRON FILE +# BACKUP VARIOUS FILES #================================================= ynh_backup --src_path="/etc/cron.d/$app" diff --git a/scripts/change_url b/scripts/change_url index be53f91..ffe1e62 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,7 +30,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 diff --git a/scripts/install b/scripts/install index b99afa3..fb28664 100644 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -104,7 +104,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -129,19 +129,19 @@ ynh_script_progression --message="Installing aeneria..." --weight=1 # Install aeneria pushd $final_path - ynh_exec_as $app php$phpversion bin/console aeneria:install "$app" -n + ynh_exec_as $app php$phpversion bin/console aeneria:install "$app" -n - # Create aeneria's user - for username in $(ynh_user_list) - do - mail=$(ynh_user_get_info --username=$username --key='mail') - user_pass=$(ynh_string_random) - ynh_exec_as $app php$phpversion bin/console aeneria:user:add "$mail" "$user_pass" - done + # Create aeneria's user + for username in $(ynh_user_list) + do + mail=$(ynh_user_get_info --username=$username --key='mail') + user_pass=$(ynh_string_random) + 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 aeneria:user:grant "$mail" + # Set admin user + mail=$(ynh_user_get_info --username=$admin --key='mail') + ynh_exec_as $app php$phpversion bin/console aeneria:user:grant "$mail" popd #================================================= @@ -169,7 +169,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index e5dfdea..540d888 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the PSQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -52,7 +44,7 @@ ynh_secure_remove --file="$final_path" #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= @@ -60,15 +52,23 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # SPECIFIC REMOVE #================================================= -# REMOVE THE CRON FILE +# REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing the cron file..." --weight=1 +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index e77ce4d..6b80349 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -20,7 +20,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -44,7 +44,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the nginx configuration..." --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -70,7 +70,7 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=1 +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 # Restore the file first, so it can have a backup if different ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -100,9 +100,9 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= -# RESTORE THE CRON FILE +# RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring the cron file..." +ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/cron.d/$app" @@ -111,7 +111,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 4e6fc5f..a9be555 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -41,12 +41,14 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -66,9 +68,9 @@ fi # Cleaning legacy permissions if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all + ynh_legacy_permissions_delete_all - ynh_app_setting_delete --app=$app --key=is_public + ynh_app_setting_delete --app=$app --key=is_public fi #================================================= @@ -79,8 +81,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." - # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -116,7 +116,7 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -131,7 +131,7 @@ ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies" #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low #================================================= @@ -155,27 +155,27 @@ ynh_script_progression --message="Upgrading aeneria..." --weight=1 # 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 + ynh_exec_as $app php$phpversion bin/console cache:clear -n + ynh_exec_as $app php$phpversion bin/console doctrine:migrations:migrate -n - # 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 aeneria:user:exist "$mail") - if [ $user_exists -eq 0 ] - then - user_pass=$(ynh_string_random) - ynh_exec_as $app php$phpversion bin/console aeneria:user:add "$mail" "$user_pass" -n - fi - done + # 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 aeneria:user:exist "$mail") + if [ $user_exists -eq 0 ] + then + user_pass=$(ynh_string_random) + 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 aeneria:user:grant "$mail" -n + # Set admin user + mail=$(ynh_user_get_info --username=$admin --key='mail') + ynh_exec_as $app php$phpversion bin/console aeneria:user:grant "$mail" -n - # Regenerate RSA keys - ynh_exec_as $app php$phpversion bin/console aeneria:generate-key --force -n + # Regenerate RSA keys + ynh_exec_as $app php$phpversion bin/console aeneria:generate-key --force -n popd #=================================================