Closed tituspijean closed 1 year ago
I am a bit worried by this piece of code:
Is its aim to add all YunoHost users in Aeneria's user database?
At minimum it should exclude admin_legacy
, since it will not have an email address.
At best, we should rather have a hook that creates/deletes users when they are given/removed the I somehow did not even check if the hooks existed sorry...aeneria.main
permission, instead of looping over all the users.
Is its aim to add all YunoHost users in Aeneria's user database?
Looks like it, from my own tests:
# ynh_exec_as $app php$phpversion bin/console aeneria:user:exist "real.email@domain.test"
1
# ynh_exec_as $app php$phpversion bin/console aeneria:user:exist "fake.email@domain.invalid"
0
Is its aim to add all YunoHost users in Aeneria's user database?
Yes that's it.
It was a way to easily synchronize æneria users with ynh users.
Normally, it should not be useful, the hook should do the job, I can't remember why I added this piece of code. May be for retro-compatibility issue.
Do you know if there is a better way to handle this kind of issue (syncro between ynh users and in-app users)?
Go hit by this bug trying to install aeneria. Is there a way to go around this problem ?
Also got hit by the 1.1.6~ynh3
release
We should rather rely on a post_app_addaccess
hook to trigger aforementioned code and on-demand add users in Aeneria's database. Add a loop if the access is given to a group.
@SimonMellerin @arthurlutz @sereinity I have made the linked PR above to try to circumvent this issue. It's working on my test server, but I have not extensively tested out and since it uses relatively advanced Bash magic that I do not quite master, any additional test is welcome.
Basically, if you can try it that would be great.
You can install (yunohost app install https://github.com/YunoHost-Apps/aeneria_ynh/tree/perm-hook -f
or upgrade to that branch (yunohost app upgrade aeneria -u https://github.com/YunoHost-Apps/aeneria_ynh/tree/perm-hook -F
), and try to give/remove new users the aeneria
permission and see what happens.
The upgrade went well:
Info: Now upgrading aeneria...
Info: [+...................] > Loading installation settings...
Info: [#+..................] > Checking version...
Info: [##++................] > Backing up the app before upgrading (may take a while)...
Info: [####+...............] > Ensuring downward compatibility...
Info: [#####+..............] > Making sure dedicated system user exists...
Info: [######++............] > Upgrading NGINX web server configuration...
Info: [########+...........] > Upgrading dependencies...
Info: [#########+++........] > Upgrading PHP-FPM configuration...
Info: [############+.......] > Configuring aeneria...
Info: [#############+......] > Upgrading aeneria...
Info: [##############++....] > Setuping a cron job...
Warning: File /etc/cron.d/aeneria has been manually modified since the installation or last upgrade. So it has been duplicated in /var/ca
che/yunohost/appconfbackup//etc/cron.d/aeneria.backup.20230419.084621
Warning: --- /var/cache/yunohost/appconfbackup//etc/cron.d/aeneria.backup.20230419.084621 2022-12-03 13:42:33.805633783 +0000
Warning: +++ /etc/cron.d/aeneria 2023-04-19 08:46:22.947494642 +0100
Warning: @@ -1 +1,2 @@
Warning: -*/20 * * * * aeneria /usr/bin/php7.4 /var/www/aeneria/bin/console aeneria:fetch-data
Warning: +05 2-23/3 * * * aeneria /usr/bin/php7.4 /var/www/aeneria/bin/console aeneria:fetch-data
Warning: +*/15 * * * * aeneria /usr/bin/php7.4 /var/www/aeneria/bin/console aeneria:pending-action:process-expired
Info: [################+...] > Reloading NGINX web server...
Info: [####################] > Upgrade of aeneria completed
Success! aeneria upgraded
Success! Upgrade complete
The latest release 1.1.6~ynh4
went well. I think we can close this issue.
While trying an upgrade with #32 on YunoHost 11.1 (with admins group created and creation of a
admin_legacy
user for the old non-LDAPadmin
account), I ended up with a failure.https://paste.yunohost.org/raw/uvefifayel