Issues with actions and config-panel features

Sorry Aleks that I got rid of the template, it does not apply here.

So @Bram @Bram @Bram @Bram @Bram @Bram @Bram @Bram, if I can’t summon you that way, I don’t know how to do it…

Here the issues I have with config-panel and actions.
Considering I’m only using the admin panel, that’s the purpose of those features.

  • There’s no log of what 's going on. Looks like we still have stderr, but not stdout and the info output.
  • Arguments in an action does not print properly, I only have a checkbox.
  • The default values aren’t from the values read into the files. But only the default values as set into the toml file.
  • And more importantly since it breaks fallback_ynh’s config-panel entirely, there’s a laconic error saying:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py", line 439, in process
    ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 527, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/log.py", line 287, in func_wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/moulinette/yunohost/app.py", line 1824, in app_config_show_panel
    config_panel = _get_app_config_panel(app)
  File "/usr/lib/moulinette/yunohost/app.py", line 2163, in _get_app_config_panel
    option["ask"] = {"en": option["ask"]}
KeyError: 'ask'

just because it doesn’t allow sub entry like:

[main]
name = "Fallback configuration"

    [main.main_server]
    name = "Fallback, main server configuration"

        [main.main_server.encryption]
        name = "Encryption"

            [main.main_server.encryption.encrypt]
            ask = "Do you want to encrypt your backups ?"
            type = "boolean"
            default = true

It works only with:

[main]
name = "Fallback configuration"

    [main.main_server]
    name = "Fallback, main server configuration"

#        [main.main_server.encryption]
#        name = "Encryption"

#            [main.main_server.encryption.encrypt]
            [main.main_server.encrypt]
            ask = "Do you want to encrypt your backups ?"
            type = "boolean"
            default = true

Which change completely the shape of the menu, as well as all the variables used by the script.


toml files used for those test were https://github.com/YunoHost-Apps/fallback_ynh/blob/master/config_panel.toml and https://github.com/YunoHost-Apps/etherpad_mypads_ynh/blob/testing/config_panel.toml.
For the action, especially with arguments, it’s this one https://github.com/YunoHost-Apps/etherpad_mypads_ynh/blob/testing/actions.toml

It could as well be because of a misconfiguration or a syntax change that I didn’t heard about yet.
One way or the other, could be nice to go forward of these features.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

Bump @Bram :sweat:

Ah oupsi, gonna look at that >.>

1 Like

Using ynh_return instead of echo in the config script solve that issue.
Forgot that change and didn’t update all my script at that time. It will be done now.

The other errors are still relevant though.

1 Like

Do you mind sharing working examples scripts?
Is it plan to add this to the “example_ynh”? I can create a dedicated branch for it and create a PR to discuss about it.

Also, is there some “documentation draft” or a location with information about this feature somewhere? I’am thinking of something like https://github.com/YunoHost/doc/blob/group-and-permissions/groups_and_permissions.md

As my server is now running YunoHost 3.7, I get complain with new group permission and cannot really test the config-panel functionality

We will add it to example_ynh when this feature is considered stable.

@Maniack_Crudelis is this config panel looks good for you?

Moreover, I’ve added

ynh_script_progression --message="Super message"

in the apply_config function, and I get this log, so I don’t understand your first point?

1 Like

Having a quick look to your config_panel, you removed a sub entry into the menu.
So yes for sure it works that way, but you just bypassed the error.

That for sure I could find a way to change the menu and make it works without a sub entry. But it feels like it would be better to fix the issue.

Not sure, but I think I was talking about actions, not config. Did you try it as well ?

Yes, I’ve plan to do that. But, as the feature isn’t yet stable, I rather prefer to keep it for me for now.
Still you can find some examples in my apps.

As soon as it will be ready, I planned to add all my works about it into the example app. But for now, it’s changing quite often.

1 Like

I just removed

[main]
name = "Fallback configuration"

For me it’s not supposed to change anything?

Moreover, the panel looks like the json one.

I may not understand everything here, but what is the role of the “main” section?

I don’t know if the main section is needed or not. But what if you add another layer ?
If the issue is about the number of layer, then there’s an error somewhere as we didn’t have this limitation before.
If it’s only about the main, ok we can get rid of it.

What’s for sure is that removing the “main” section removes one layer to the menu.

Thanks for this, I will avoid to spend too much time on this then.