From 647a0dc3fc92759ab87d88f793179998d6bb2e7b Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Fri, 5 Jan 2024 17:39:53 +0100 Subject: [PATCH 01/10] Update upstream app --- conf/.env | 10 +++++----- manifest.toml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/.env b/conf/.env index 73ef891..85584b3 100644 --- a/conf/.env +++ b/conf/.env @@ -42,13 +42,13 @@ AENERIA_PROXY_FOR_GRDF=1 ENEDIS_CLIENT_ID=noneed ENEDIS_CLIENT_SECRET=noneed ENEDIS_REDIRECT_URI=noneed -ENEDIS_ENDPOINT_AUTH=https://mon-compte-particulier.enedis.fr -ENEDIS_ENDPOINT_TOKEN=https://gw.prd.api.enedis.fr -ENEDIS_ENDPOINT_DATA=https://gw.prd.api.enedis.fr +ENEDIS_ENDPOINT_AUTH=noneed +ENEDIS_ENDPOINT_TOKEN=noneed +ENEDIS_ENDPOINT_DATA=noneed # Grdf adict GRDF_CLIENT_ID=noneed GRDF_CLIENT_SECRET=noneed GRDF_REDIRECT_URI=noneed -GRDF_ENDPOINT_AUTH=https://sofit-sso-oidc.grdf.fr -GRDF_ENDPOINT_DATA=https://api.grdf.fr +GRDF_ENDPOINT_AUTH=noneed +GRDF_ENDPOINT_DATA=noneed diff --git a/manifest.toml b/manifest.toml index fe29b01..1b65b93 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "æneria" description.en = "Dashboard to analyse your energy consumption data from Linky, Gazpar & weather" description.fr = "Tableau de bord pour analyser votre consomation d'énergie à partir des données d'un compteur Linky et/ou Gazpar et de la météo" -version = "2.0.0~ynh1" +version = "2.0.3~ynh1" maintainers = ["Simon Mellerin"] @@ -41,8 +41,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://statics.aeneria.com/aeneria-app-2.0.0.tar.gz" - sha256 = "8a36dc2634178e6f087893aca6459ef7cbe7ad9e436c829a7f05f88a8a304571" + url = "https://statics.aeneria.com/aeneria-app-2.0.3.tar.gz" + sha256 = "98322ac8074df007328e66cb9a5561e7e9bbbd8fefba5ef6a14cff54507e85c6" [resources.system_user] From 04d4edd2ea67360998169d072fda1f9127172c56 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 5 Jan 2024 16:40:06 +0000 Subject: [PATCH 02/10] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7521c5d..57c0959 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The idea of [æneria](https://aeneria.com) is to display energy consumption and * Analyse energy consumption throw weather data -**Shipped version:** 2.0.0~ynh1 +**Shipped version:** 2.0.3~ynh1 **Demo:** https://demo.aeneria.com diff --git a/README_fr.md b/README_fr.md index a6ef45e..e58b92c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -21,7 +21,7 @@ L'idée de [æneria](https://aeneria.com) est d'afficher la consommation d'éner * Mieux comprendre sa propre consommation d'énergie * Analyser la consommation d'énergie et les données météorologiques -**Version incluse :** 2.0.0~ynh1 +**Version incluse :** 2.0.3~ynh1 **Démo :** https://demo.aeneria.com From 4b7367721a02cd5d50e2a47e2c5cf685b6031556 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Sun, 7 Jan 2024 16:31:40 +0100 Subject: [PATCH 03/10] Fix ldap patch --- scripts/upgrade | 16 +- ...dap-auth.patch => main-00-ldap-auth.patch} | 151 ++++++++++++++---- 2 files changed, 124 insertions(+), 43 deletions(-) rename sources/patches/{app-00-ldap-auth.patch => main-00-ldap-auth.patch} (50%) diff --git a/scripts/upgrade b/scripts/upgrade index 3c430b8..b2a524e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,22 +46,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - # For aeneria source update, we use a temporary directory because - # without it, patches can't be apply correctly: - # In 'app-00-ldap-auth.patch' we create a new file, if we try - # to apply the patch a second time while the file already exists, it - # throws a warning leading to an upgrade fail. - - # Create tmpdir for new sources - tmpdir="$(ynh_smart_mktemp min_size=300)" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$tmpdir" - - # Replace the old aeneria by the new one - ynh_secure_remove --file="$install_dir" - mv "$tmpdir" "$install_dir" - ynh_secure_remove --file="$tmpdir" + ynh_setup_source --dest_dir="$install_dir" --full_replace fi chown -R $app:www-data "$install_dir" diff --git a/sources/patches/app-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch similarity index 50% rename from sources/patches/app-00-ldap-auth.patch rename to sources/patches/main-00-ldap-auth.patch index 77aca71..1f263cf 100644 --- a/sources/patches/app-00-ldap-auth.patch +++ b/sources/patches/main-00-ldap-auth.patch @@ -1,59 +1,154 @@ -commit 19648694faaf973e7b4b0de1dbe49710e14a8ce7 +commit 7a3e622666fa16ab124158cffec73d9a3e6748bf Author: Simon Mellerin -Date: Fri Dec 22 17:22:41 2023 +0100 +Date: Sun Jan 7 16:25:06 2024 +0100 - Yunohost ldap + YNH LDAP -diff --git a/config/packages/security.yaml b/config/packages/security.yaml -index 6c4457f1..ea1f3dc9 100644 ---- a/config/packages/security.yaml -+++ b/config/packages/security.yaml -@@ -11,6 +11,8 @@ security: +diff --git a/app/config/packages/security.yaml b/app/config/packages/security.yaml +index 6c4457f1..e716ba39 100644 +--- a/app/config/packages/security.yaml ++++ b/app/config/packages/security.yaml +@@ -11,6 +11,11 @@ security: entity: class: App\Entity\User property: username -+ user_provider_yunohost: -+ id: yunohost.provider.ldap ++ ldap_user_provider: ++ id: ynh.ldap.user.provider ++ all_users: ++ chain: ++ providers: ['ldap_user_provider', 'app_user_provider'] firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ -@@ -23,6 +25,10 @@ security: +@@ -22,7 +27,12 @@ security: + form_login: login_path: security.login check_path: security.login ++ provider: app_user_provider enable_csrf: true + http_basic_ldap: -+ provider: user_provider_yunohost -+ service: yunohost.ldap -+ dn_string: "uid={username},ou=users,dc=yunohost,dc=org" ++ provider: ldap_user_provider ++ service: ynh.ldap ++ dn_string: 'uid={username},ou=users,dc=yunohost,dc=org' logout: path: security.logout target: security.login -diff --git a/config/services.yaml b/config/services.yaml -index 4410bfc5..71b9ba86 100644 ---- a/config/services.yaml -+++ b/config/services.yaml -@@ -105,3 +105,16 @@ services: +diff --git a/app/config/services.yaml b/app/config/services.yaml +index 3e770913..83fbec0d 100644 +--- a/app/config/services.yaml ++++ b/app/config/services.yaml +@@ -104,3 +104,21 @@ services: Aeneria\GrdfAdictApi\Client\GrdfAdictClientInterface: alias: Aeneria\GrdfAdictApi\Client\GrdfAdictClient + -+ yunohost.provider.ldap: -+ class: App\Security\YunohostLdapUserProvider -+ arguments: ["@yunohost.ldap", "ou=users,dc=yunohost,dc=org"] ++ ynh.ldap.user.provider: ++ class: App\Security\YnhLdapUserProvider ++ arguments: ++ $ldap: '@ynh.ldap' ++ $baseDn: "dc=yunohost,dc=org" ++ # $searchDn: 'uid={username},ou=users,dc=yunohost,dc=org' ++ $uidKey: "uid" + -+ yunohost.ldap: ++ ynh.ldap: + class: Symfony\Component\Ldap\Ldap -+ arguments: ['@yunohost.ldap.adapter'] ++ arguments: ['@ynh.ldap.adapter'] ++ tags: ['ldap'] + -+ yunohost.ldap.adapter: ++ ynh.ldap.adapter: + class: Symfony\Component\Ldap\Adapter\ExtLdap\Adapter + arguments: + - host: "localhost" -diff --git a/src/Security/YunohostLdapUserProvider.php b/src/Security/YunohostLdapUserProvider.php -new file mode 100644 +diff --git a/app/src/Security/YnhLdapUserProvider.php b/app/src/Security/YnhLdapUserProvider.php +new file mode 100755 +index 00000000..eb8b1149 +--- /dev/null ++++ b/app/src/Security/YnhLdapUserProvider.php +@@ -0,0 +1,79 @@ ++getAttribute('mail'); ++ ++ // Dans le cadre de la connexion LDAP Yunohost, ++ // on cherche l'utilisateur par son id et son mail, ++ // puis on l'enregistre uniquement avec son id. ++ $user = $this->userRepository->findOneBy(['username' => [...$email, $identifier]]); ++ ++ // Si l'utilisateur n'existe pas enore, on le crée. ++ if (!$user) { ++ $user = (new User()) ++ ->setUsername($identifier) ++ ->setPassword(\random_bytes(32)) ++ ->setActive(true) ++ ->setUpdatedAt(new \DateTimeImmutable()) ++ ; ++ ++ $this->entityManager->persist($user); ++ $this->entityManager->flush(); ++ } ++ ++ return $user->setUsername($identifier) ++ ->setEmail(\reset($email)) ++ ; ++ } ++} +diff --git a/app/src/Security/YunohostLdapUserProvider.php b/app/src/Security/YunohostLdapUserProvider.php +new file mode 100755 index 00000000..09ad20c6 --- /dev/null -+++ b/src/Security/YunohostLdapUserProvider.php ++++ b/app/src/Security/YunohostLdapUserProvider.php @@ -0,0 +1,102 @@ + Date: Sun, 7 Jan 2024 16:32:55 +0100 Subject: [PATCH 04/10] remove useless hooks --- hooks/post_app_addaccess | 41 ------------------------------------- hooks/post_app_removeaccess | 32 ----------------------------- scripts/install | 8 -------- scripts/upgrade | 8 -------- 4 files changed, 89 deletions(-) delete mode 100644 hooks/post_app_addaccess delete mode 100644 hooks/post_app_removeaccess diff --git a/hooks/post_app_addaccess b/hooks/post_app_addaccess deleted file mode 100644 index cc14389..0000000 --- a/hooks/post_app_addaccess +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -app=$1 - -# Run only if we are altering aeneria's permissions -[[ "$app" != "__APP__" ]] && exit 0 - -# Source YunoHost helpers -source /usr/share/yunohost/helpers -source /etc/yunohost/apps/$app/scripts/_common.sh - -# Retrieve arguments -usernames=$2 -permission=$3 -groups=$4 -install_dir=$(ynh_app_setting_get "$app" install_dir) -phpversion=$(ynh_app_setting_get "$app" phpversion) - -IFS=',' read -r -a user_list <<< "$usernames" -IFS=',' read -r -a group_list <<< "$groups" - -for group in "${group_list[@]}" -do - group_array=$(yunohost user group list --output-as json --quiet | jq -r --arg group "$group" ".groups.$group.members | @csv" | tr -d \") - IFS=',' read -r -a group_array <<< "$group_array" - user_list+=("${group_array[@]}") -done - -pushd $install_dir - for user in "${user_list[@]}" - do - mail=$(ynh_user_get_info --username="$user" --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 - else - ynh_exec_as $app php$phpversion bin/console aeneria:user:activate "$mail" - fi - done -popd diff --git a/hooks/post_app_removeaccess b/hooks/post_app_removeaccess deleted file mode 100644 index af784b5..0000000 --- a/hooks/post_app_removeaccess +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -app=$1 - -# Run only if we are altering aeneria's permissions -[[ "$app" != "__APP__" ]] && exit 0 - -# Source YunoHost helpers -source /usr/share/yunohost/helpers -source /etc/yunohost/apps/$app/scripts/_common.sh - -# Retrieve arguments -usernames=$2 -permission=$3 -groups=$4 -install_dir=$(ynh_app_setting_get "$app" install_dir) -phpversion=$(ynh_app_setting_get "$app" phpversion) - -IFS=',' read -r -a user_list <<< "$usernames" -IFS=',' read -r -a group_list <<< "$groups" - -for group in "${group_list[@]}" -do - group_array=$(yunohost user group list --output-as json --quiet | jq -r --arg group "$group" ".groups.$group.members | @csv" | tr -d \") - IFS=',' read -r -a group_array <<< "$group_array" - user_list+=("${group_array[@]}") -done - -for user in "${user_list[@]}" -do - mail=$(ynh_user_get_info --username="$user" --key=mail) - cd "$install_dir" && ynh_exec_as $app php$phpversion bin/console aeneria:user:deactivate "$mail" -n -done diff --git a/scripts/install b/scripts/install index 2f5653e..53fd869 100644 --- a/scripts/install +++ b/scripts/install @@ -76,14 +76,6 @@ ynh_add_config --template="aeneria.cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" -#================================================= -# ADAPT HOOK FOR AENERIA INSTANCE -#================================================= -ynh_script_progression --message="Adapting hooks..." --weight=1 - -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_app_addaccess" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_app_removeaccess" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b2a524e..85f73f9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,14 +103,6 @@ pushd $install_dir ynh_exec_as $app php$phpversion bin/console aeneria:generate-key -n popd -#================================================= -# ADAPT HOOK FOR AENERIA INSTANCE -#================================================= -ynh_script_progression --message="Adapting hooks..." --weight=1 - -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_app_addaccess" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_app_removeaccess" - #================================================= # END OF SCRIPT #================================================= From 9bd6bef1a47a359f1db09590bc8f25b6e6c4d499 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Sun, 7 Jan 2024 16:38:32 +0100 Subject: [PATCH 05/10] Fix ldap patch --- sources/patches/main-00-ldap-auth.patch | 124 ++---------------------- 1 file changed, 8 insertions(+), 116 deletions(-) diff --git a/sources/patches/main-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch index 1f263cf..cccd7d8 100644 --- a/sources/patches/main-00-ldap-auth.patch +++ b/sources/patches/main-00-ldap-auth.patch @@ -4,10 +4,10 @@ Date: Sun Jan 7 16:25:06 2024 +0100 YNH LDAP -diff --git a/app/config/packages/security.yaml b/app/config/packages/security.yaml +diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 6c4457f1..e716ba39 100644 ---- a/app/config/packages/security.yaml -+++ b/app/config/packages/security.yaml +--- a/config/packages/security.yaml ++++ b/config/packages/security.yaml @@ -11,6 +11,11 @@ security: entity: class: App\Entity\User @@ -33,10 +33,10 @@ index 6c4457f1..e716ba39 100644 logout: path: security.logout target: security.login -diff --git a/app/config/services.yaml b/app/config/services.yaml +diff --git a/config/services.yaml b/config/services.yaml index 3e770913..83fbec0d 100644 ---- a/app/config/services.yaml -+++ b/app/config/services.yaml +--- a/config/services.yaml ++++ b/config/services.yaml @@ -104,3 +104,21 @@ services: Aeneria\GrdfAdictApi\Client\GrdfAdictClientInterface: @@ -59,11 +59,11 @@ index 3e770913..83fbec0d 100644 + class: Symfony\Component\Ldap\Adapter\ExtLdap\Adapter + arguments: + - host: "localhost" -diff --git a/app/src/Security/YnhLdapUserProvider.php b/app/src/Security/YnhLdapUserProvider.php +diff --git a/src/Security/YnhLdapUserProvider.php b/src/Security/YnhLdapUserProvider.php new file mode 100755 index 00000000..eb8b1149 --- /dev/null -+++ b/app/src/Security/YnhLdapUserProvider.php ++++ b/src/Security/YnhLdapUserProvider.php @@ -0,0 +1,79 @@ +loadUserByIdentifier($username); -+ } -+ -+ /** -+ * {@inheritdoc} -+ */ -+ public function loadUserByIdentifier(string $identifier): UserInterface -+ { -+ try { -+ $this->ldap->bind($this->searchDn, $this->searchPassword); -+ $username = $this->ldap->escape($identifier, '', LdapInterface::ESCAPE_FILTER); -+ $query = str_replace('{username}', $identifier, $this->defaultSearch); -+ $search = $this->ldap->query($this->baseDn, $query); -+ } catch (ConnectionException $e) { -+ throw new UserNotFoundException(sprintf('User "%s" not found.', $identifier), 0, $e); -+ } -+ -+ $entries = $search->execute(); -+ $count = \count($entries); -+ -+ if ($count > 1) { -+ throw new UserNotFoundException('More than one user found.'); -+ } -+ -+ $entry = $entries[0]; -+ -+ $identifier = $this->getAttributeValue($entry, 'mail'); -+ -+ return $this->userRepository->findOneBy(['username' => $identifier]); -+ } -+ -+ /** -+ * {@inheritdoc} -+ */ -+ public function refreshUser(UserInterface $user) -+ { -+ if (!$user instanceof User) { -+ throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); -+ } -+ -+ return $this->userRepository->findOneBy(['username' => $user->getUsername()]); -+ } -+ -+ /** -+ * {@inheritdoc} -+ */ -+ public function supportsClass(string $class) -+ { -+ return User::class === $class; -+ } -+ -+ private function getAttributeValue(Entry $entry, string $attribute) -+ { -+ if (!$entry->hasAttribute($attribute)) { -+ throw new InvalidArgumentException(sprintf('Missing attribute "%s" for user "%s".', $attribute, $entry->getDn())); -+ } -+ -+ $values = $entry->getAttribute($attribute); -+ -+ return $values[0]; -+ } -+} From 0589491e111b82ac14d1fae28dfe6f7c3bed9e0e Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Sun, 7 Jan 2024 16:47:11 +0100 Subject: [PATCH 06/10] fix upgrade script --- scripts/upgrade | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 85f73f9..12ccc5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,8 +46,22 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." + # For aeneria source update, we use a temporary directory because + # without it, patches can't be apply correctly: + # In 'app-00-ldap-auth.patch' we create a new file, if we try + # to apply the patch a second time while the file already exists, it + # throws a warning leading to an upgrade fail. + + # Create tmpdir for new sources + tmpdir="$(ynh_smart_mktemp min_size=300)" + # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace + ynh_setup_source --dest_dir="$tmpdir" + + # Replace the old aeneria by the new one + ynh_secure_remove --file="$install_dir" + mv "$tmpdir" "$install_dir" + ynh_secure_remove --file="$tmpdir" fi chown -R $app:www-data "$install_dir" From 3e0304fe5a14e509fcd8546b13a4f8df74f7826b Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Sun, 7 Jan 2024 19:38:43 +0100 Subject: [PATCH 07/10] upadte ldap patch --- sources/patches/main-00-ldap-auth.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/patches/main-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch index cccd7d8..fdf51e7 100644 --- a/sources/patches/main-00-ldap-auth.patch +++ b/sources/patches/main-00-ldap-auth.patch @@ -122,14 +122,14 @@ index 00000000..eb8b1149 + $email = $entry->getAttribute('mail'); + + // Dans le cadre de la connexion LDAP Yunohost, -+ // on cherche l'utilisateur par son id et son mail, -+ // puis on l'enregistre uniquement avec son id. -+ $user = $this->userRepository->findOneBy(['username' => [...$email, $identifier]]); ++ // on cherche l'utilisateur par son mail. ++ // ++ $user = $this->userRepository->findOneBy(['username' => $email]); + -+ // Si l'utilisateur n'existe pas enore, on le crée. ++ // Si l'utilisateur n'existe pas encore, on le crée. + if (!$user) { + $user = (new User()) -+ ->setUsername($identifier) ++ ->setUsername(\reset($email)) + ->setPassword(\random_bytes(32)) + ->setActive(true) + ->setUpdatedAt(new \DateTimeImmutable()) @@ -139,8 +139,8 @@ index 00000000..eb8b1149 + $this->entityManager->flush(); + } + -+ return $user->setUsername($identifier) -+ ->setEmail(\reset($email)) ++ return $user->setUsername(\reset($email)) ++ ->setIdentifier($identifier) + ; + } +} From 2147310aaaec8d39476bd0cd471aaeea73f28d28 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Mon, 8 Jan 2024 09:48:56 +0100 Subject: [PATCH 08/10] Update upstream app --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 1b65b93..9b682cd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,8 +41,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://statics.aeneria.com/aeneria-app-2.0.3.tar.gz" - sha256 = "98322ac8074df007328e66cb9a5561e7e9bbbd8fefba5ef6a14cff54507e85c6" + url = "https://statics.aeneria.com/aeneria-app-2.0.4.tar.gz" + sha256 = "f7d159bed0a76a05f38c58d8a66e73966580731c709eefb3b2be3cf213a53aae" [resources.system_user] From dbc4a80cf219b36618230003f6088b8ffa9615c4 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Mon, 8 Jan 2024 09:55:28 +0100 Subject: [PATCH 09/10] Fix patch --- sources/patches/main-00-ldap-auth.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/patches/main-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch index fdf51e7..981f010 100644 --- a/sources/patches/main-00-ldap-auth.patch +++ b/sources/patches/main-00-ldap-auth.patch @@ -140,7 +140,7 @@ index 00000000..eb8b1149 + } + + return $user->setUsername(\reset($email)) -+ ->setIdentifier($identifier) ++ ->setUserIdentifier($identifier) + ; + } +} From 04b3c0358034b977a37e5cc7b1d57214f64fa6c3 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Mon, 8 Jan 2024 10:06:35 +0100 Subject: [PATCH 10/10] Keep private dir when upgrading --- scripts/upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 12ccc5c..0676498 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,6 +58,9 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$tmpdir" + # Keep private dir + mv "$install_dir/private" "$tmpdir" + # Replace the old aeneria by the new one ynh_secure_remove --file="$install_dir" mv "$tmpdir" "$install_dir"