YunoHost-Apps / my_webapp_ynh

Custom Web app with SFTP access
GNU General Public License v3.0
48 stars 39 forks source link

Config Panel 1.0 #82

Closed Tagadda closed 1 year ago

Tagadda commented 2 years ago

Problem

Closes #72

Solution

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

ericgaspar commented 2 years ago

Using config panel outputs an error: https://paste.yunohost.org/raw/uweciqukon

Tagadda commented 2 years ago

Oh, that's because phpversion was none. I'll try to handle phpversion in the config panel too, that will help to hide the php-fpm config if not needed.

Tagadda commented 2 years ago

I'm having an issue in a config panel, where visible act correctly on the CLI, but not in the webadmin :( main.php_fpm_config.fpm_footprint never show :/ nothing in the JS console Something to do with match() I presume https://github.com/YunoHost-Apps/my_webapp_ynh/blob/93532de252e60ecf31a8ab795e4123a8e054ab0a/config_panel.toml#L29-L34

EDIT: Found it! The webadmin search for march(var, "value") with double-quotes and not single-quotes. https://github.com/YunoHost/yunohost-admin/blob/05f2694b1d98383810d2b491217bcc2b5439b3a2/app/src/views/app/AppConfigPanel.vue#L92-L93 I'll use double quotes then

Tagadda commented 2 years ago

The phpversion selection is broken in several scenario. Not sure how to fix it.

ericgaspar commented 2 years ago

Tested with web admin. It works. (haven't checked if the PHP version is really changed thought...) Shall we merge?

ericgaspar commented 2 years ago

after testing, changing PHP8.0 ti 7.4 version from config panel may have broken PHP7.4 service : https://paste.yunohost.org/sobudobola

tituspijean commented 2 years ago

after testing, changing PHP8.0 ti 7.4 version from config panel may have broken PHP7.4 service : https://paste.yunohost.org/sobudobola

Can you check all the config files in /etc/php/{7.4,8.0}/fpm/pool.d and see if there are any duplicate sockets?

ericgaspar commented 2 years ago

OK, after installing with PHP7.4 and switching to PHP8.0, we end up with 2 versions of my_webapp.conf with PHP8.0 service error: already listen on /var/run/php/php7.4-fpm-my_webapp.sock Switching from PHP7.4 to PHP8.0 should erase /etc/php/7.4/fpm/pool.d/my_webapp.conf (et vice-versa) but it doesn't...

tituspijean commented 2 years ago

Heh, it seems we were warned about it. 😛

        # FIXME: This miserably fails because the setting phpversion get his 
        # new value before ynh_app_config_apply gets called, so 
        # ynh_remove_fpm_config try to remove the new not-yet-existent version.
        ynh_remove_fpm_config

https://github.com/Tagadda/my_webapp_ynh/blob/1d8afa6ad6add185338c2f38fc1ada8ffbf6200d/scripts/config#L59-L62

tituspijean commented 2 years ago

We need to use a custom setter to work around that. :)

tituspijean commented 1 year ago

It should be fixed! Please test. 😃

Dont-ask-for-it commented 1 year ago

Whats the fix for this?

tituspijean commented 1 year ago

Whats the fix for this?

What do you mean?

Tagadda commented 1 year ago

LGTM! (Can't approve my own PR tho 😅)