1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/aeneria_ynh.git synced 2024-09-03 18:06:15 +02:00

Merge pull request #41 from YunoHost-Apps/cleaning

Cleaning
This commit is contained in:
eric_G 2023-11-23 10:35:28 +01:00 committed by GitHub
commit 78e3399d14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 63 deletions

View file

@ -28,29 +28,12 @@ The idea of [æneria](https://aeneria.com) is to display energy consumption and
![Screenshot of æneria](./doc/screenshots/screenshot1.png) ![Screenshot of æneria](./doc/screenshots/screenshot1.png)
## Disclaimers / important information
## 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).
## Documentation and resources ## Documentation and resources
* Official app website: <https://aeneria.com> * Official app website: <https://aeneria.com>
* Official admin documentation: <https://docs.aeneria.com> * Official admin documentation: <https://docs.aeneria.com>
* Upstream app code repository: <https://gitlab.com/aeneria/aeneria-app> * Upstream app code repository: <https://gitlab.com/aeneria/aeneria-app>
* YunoHost documentation for this app: <https://yunohost.org/app_aeneria> * YunoHost Store: <https://apps.yunohost.org/app/aeneria>
* Report a bug: <https://github.com/YunoHost-Apps/aeneria_ynh/issues> * Report a bug: <https://github.com/YunoHost-Apps/aeneria_ynh/issues>
## Developer info ## Developer info

View file

@ -16,11 +16,10 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
## Vue densemble ## Vue densemble
The idea of [æneria](https://aeneria.com) is to display energy consumption and weather data on a little dashboard that allow the user to: L'idée de [æneria](https://aeneria.com) est d'afficher la consommation d'énergie et les données météorologiques sur un petit tableau de bord qui permet à l'utilisateur de :
* Better understand our own energy consumption
* Analyse energy consumption throw weather data
* Mieux comprendre sa propre consommation d'énergie
* Analyser la consommation d'énergie et les données météorologiques
**Version incluse :** 1.1.6~ynh4 **Version incluse :** 1.1.6~ynh4
@ -28,29 +27,12 @@ The idea of [æneria](https://aeneria.com) is to display energy consumption and
![Capture décran de æneria](./doc/screenshots/screenshot1.png) ![Capture décran de æneria](./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 ## Documentations et ressources
* Site officiel de lapp : <https://aeneria.com> * Site officiel de lapp : <https://aeneria.com>
* Documentation officielle de ladmin : <https://docs.aeneria.com> * Documentation officielle de ladmin : <https://docs.aeneria.com>
* Dépôt de code officiel de lapp : <https://gitlab.com/aeneria/aeneria-app> * Dépôt de code officiel de lapp : <https://gitlab.com/aeneria/aeneria-app>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_aeneria> * YunoHost Store: <https://apps.yunohost.org/app/aeneria>
* Signaler un bug : <https://github.com/YunoHost-Apps/aeneria_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/aeneria_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs

View file

@ -2,13 +2,5 @@
* First of all, you'll need a Linky and an [Enedis account](https://mon-compte-client.enedis.fr/) * 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 * 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 * 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! * 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).

6
doc/ADMIN_fr.md Normal file
View file

@ -0,0 +1,6 @@
## Configuration
* Tout d'abord, vous aurez besoin d'un Linky et d'un [compte Enedis](https://mon-compte-client.enedis.fr/)
* Dans votre espace Enedis, rendez-vous dans l'onglet ["Gérer l'accès à mes données"](https://mon-compte-particulier.enedis.fr/donnees/), et permettez à Enedis de collecter et stocker votre consommation horaire
* Après cela, installez æneria sur votre instance YunoHost, visitez-la et suivez simplement les instructions
* Ça y est, attendez maintenant un peu pour voir les données apparaître !

4
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1,4 @@
L'idée de [æneria](https://aeneria.com) est d'afficher la consommation d'énergie et les données météorologiques sur un petit tableau de bord qui permet à l'utilisateur de :
* Mieux comprendre sa propre consommation d'énergie
* Analyser la consommation d'énergie et les données météorologiques

View file

@ -12,7 +12,7 @@ source /etc/yunohost/apps/$app/scripts/_common.sh
usernames=$2 usernames=$2
permission=$3 permission=$3
groups=$4 groups=$4
final_path=$(ynh_app_setting_get "$app" final_path) install_dir=$(ynh_app_setting_get "$app" install_dir)
phpversion=$(ynh_app_setting_get "$app" phpversion) phpversion=$(ynh_app_setting_get "$app" phpversion)
IFS=',' read -r -a user_list <<< "$usernames" IFS=',' read -r -a user_list <<< "$usernames"
@ -25,7 +25,7 @@ do
user_list+=("${group_array[@]}") user_list+=("${group_array[@]}")
done done
pushd $final_path pushd $install_dir
for user in "${user_list[@]}" for user in "${user_list[@]}"
do do
mail=$(ynh_user_get_info --username="$user" --key=mail) mail=$(ynh_user_get_info --username="$user" --key=mail)

View file

@ -12,7 +12,7 @@ source /etc/yunohost/apps/$app/scripts/_common.sh
usernames=$2 usernames=$2
permission=$3 permission=$3
groups=$4 groups=$4
final_path=$(ynh_app_setting_get "$app" final_path) install_dir=$(ynh_app_setting_get "$app" install_dir)
phpversion=$(ynh_app_setting_get "$app" phpversion) phpversion=$(ynh_app_setting_get "$app" phpversion)
IFS=',' read -r -a user_list <<< "$usernames" IFS=',' read -r -a user_list <<< "$usernames"
@ -28,5 +28,5 @@ done
for user in "${user_list[@]}" for user in "${user_list[@]}"
do do
mail=$(ynh_user_get_info --username="$user" --key=mail) mail=$(ynh_user_get_info --username="$user" --key=mail)
cd "$final_path" && ynh_exec_as $app php$phpversion bin/console aeneria:user:deactivate "$mail" -n cd "$install_dir" && ynh_exec_as $app php$phpversion bin/console aeneria:user:deactivate "$mail" -n
done done

View file

@ -19,8 +19,11 @@ code = "https://gitlab.com/aeneria/aeneria-app"
yunohost = ">= 11.2" yunohost = ">= 11.2"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = false ldap = false
sso = false sso = false
disk = "50M" disk = "50M"
ram.build = "50M" ram.build = "50M"
ram.runtime = "50M" ram.runtime = "50M"

View file

@ -28,9 +28,9 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
@ -43,9 +43,9 @@ ynh_add_fpm_config
#================================================= #=================================================
# CONFIGURE AENERIA # CONFIGURE AENERIA
#================================================= #=================================================
ynh_script_progression --message="Configuring aeneria..." --weight=1 ynh_script_progression --message="Configuring $app..." --weight=1
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" ynh_add_config --template=".env" --destination="$install_dir/.env"
# Restrict rights to aeneria user only # Restrict rights to aeneria user only
chmod 600 "$install_dir/.env" chmod 600 "$install_dir/.env"

View file

@ -10,9 +10,9 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config

View file

@ -27,10 +27,12 @@ ynh_script_progression --message="Restoring the PSQL database..." --weight=1
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
# Restore the file first, so it can have a backup if different # 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" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"

View file

@ -58,9 +58,9 @@ chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# NGINX CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config