Corrections and enhancements
maniackcrudelis opened this issue · comments
Because is about to become an official app, there are some things we have to discuss about some parts of the code.
Let's go :)
- nginx.conf#L3
Are you sure it works without a equivalent setting in your php config ? Did you already test it ? - backup#L25
Can you use the final_path stored in the config instead of set it here. You store this value in your instal script. - change_url#L64
Didn't we change this line somewhere else to have a more simple version of this sed ? Or I just tried and didn't make it ? - install#L2
Are you sure you really need that ?
You don't use any glob inside a double quotes. And it works fine without double quotes. If you need that, just explain a little more what is it. - install#L103
Can you use instead the Picture directory of yunohost.multimedia ? In order to not duplicate this media. - install#L123
It's already done by the helper just above. - install#L125-L175
Can you add here more "big" comment to structure the code. - install#L129-L131
Why a sleep here ?
And these 2 reload are not needed, the respective helpers reload their service. - remove#L4
I think it's really a bad idea, if this script fail, the app will be in a non-installed / non-removed status. So, you can't remove it, and you can't reinstall it. - remove#L39
Are you sure you really want to remove all the pictures and photos of the users ? - remove#L54-L56
The previous helpers reload their service. - upgrade#L27-L69
Please more comments and blank lines ;) - upgrade#L73
Is it lost ? - And same things than the install script for the upgrade script.
Processed points
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/conf/nginx.conf#L3
Are you sure it works without a equivalent setting in your php config ? Did you already test it ?
Just settled to 1h and 100Mo max, set on both nginx and PHP-FPM sides. 15e1300
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/backup#L25
Can you use the final_path stored in the config instead of set it here. You store this value in your instal script.
Fixed. 8124787
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L123-L173
Can you add here more "big" comment to structure the code.
Added. 8d061f1
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/remove#L4
I think it's really a bad idea, if this script fail, the app will be in a non-installed / non-removed status. So, you can't remove it, and you can't reinstall it.
Fixed. 6780bd4
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/remove#L39
Are you sure you really want to remove all the pictures and photos of the users ?
Not really 😉
Fixed. 6780bd4
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/remove#L54-L56
The previous helpers reload their service.
Fixed. 6780bd4
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/upgrade#L27-L69
Please more comments and blank lines ;)
I can maybe compact lines with ";"...?
Fixed. 89eddb9
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L121
It's already done by the helper just above.
Fixed. 90d3303
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L2
Are you sure you really need that ?
You don't use any glob inside a double quotes. And it works fine without double quotes. If you need that, just explain a little more what is it.
You need it for this syntax cp -a $TMPDIR/!(upload|galleries) $final_path
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L127-L129
Why a sleep here ?
And these 2 reload are not needed, the respective helpers reload their service.
Tested without any sleep
on x86_64 and ARM, seems to be fine now. Fixed. 90d3303 2c824f4
No, used later on: https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/upgrade#L170
- And same things than the install script for the upgrade script.
install and upgrade script are now on par.
Remaining points
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/change_url#L64
Didn't we change this line somewhere else to have a more simple version of this sed ? Or I just tried and didn't make it ?
It's the latest proposal in example_ynh... To be further discussed.
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L103
Can you use instead the Picture directory of yunohost.multimedia ? In order to not duplicate this media.
Images are stored in upload
and _data
directories, and images/thumbnails and intermediate sizes are mixed together... so I think it won't fit well with yunohost.multimedia.
Corresponding PR
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L121
It's already done by the helper just above.
Fixed. 90d3303
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L103
Can you use instead the Picture directory of yunohost.multimedia ? In order to not duplicate this media.
Images are stored in upload
and _data
directories, and images/thumbnails and intermediate sizes are mixed together... so I think it won't fit well with yunohost.multimedia.
- https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/install#L127-L129
Why a sleep here ?
And these 2 reload are not needed, the respective helpers reload their service.
Tested without any sleep
on x86_64 and ARM, seems to be fine now. Fixed. 90d3303 2c824f4
- And same things than the install script for the upgrade script.
install and upgrade script are now on par.
Except the two remaining points for which I'm waiting for your answer/approval, there's no actions on my side any more.
Oh ok the 2 remaining points.
So, for the change_url script, as you said, we have to discuss about that. So for now, let's say it's ok.
And, for yunohost.multimedia, if you think it's not relevant, let's skip that. Maybe adding a comment to explain that can be nice. Just to not ask you again about that later.
Though I not recheck your code.
PR merged in master.
Because you forced me ;)
(22:38:12) Maniack C: @JimboJoe, je suis en train de revoir ton app piwigo
(22:38:24) JimboJoe a quitté le salon (Disconnected: closed)
(22:38:34) Maniack C: Je réouvre l'issue ou je te fais mes remarques ici ?
I have to write down here my remarks about piwigo ;)
But there nothing really bad.
- In your install script, seems the line 125 is useless.
- In your remove script, you load 2 times the variable domain. https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/remove#L20
- In your upgrade script, I think you don't have to restart php at the end. https://github.com/YunoHost-Apps/piwigo_ynh/blob/master/scripts/upgrade#L217.
If you have to, can you reload instead ? - And, just if you can avoid to use uppercase characters for your variables. It's better ;)
- That's all !
So for me, this app is "almost" ready to become official \o/
JimboJoe, you've forgot to say us my last remarks have been fixed just the day after !
f7a6d6c
So now for me your code is all good.
Just you have to say if we're ready to go forward. Regarding the 2 other current issues.
The two issues had been fixed previously; I guess we're ready to move forward...