Packaging v2 <-> Config panels

How does “Config panels” works with Packaging v2?

The doc pages Packaging v2 | Yunohost Documentation and Config panels | Yunohost Documentation doesn’t explain it, isn’t it?

I assume i can use [install] section in manifest.toml ?!?

Tada :tada:

We have published a doc about config panel and a more accurate and auto generated version is already in ConfigPanel and app install form Options documentation by Axolotle · Pull Request #1653 · YunoHost/yunohost · GitHub

3 Likes

Now i successfully convert my example project: Manifest v2 by jedie · Pull Request #39 · YunoHost-Apps/django_example_ynh · GitHub

Related to this topic:

OLD: config_panel.toml Manifest v2 by jedie · Pull Request #39 · YunoHost-Apps/django_example_ynh · GitHub

# https://github.com/YunoHost/example_ynh/blob/master/config_panel.toml.example

version = "1.0"

[main]
name.en = "Main configuration"
name.fr = "Configuration principale"
services = ["__APP__"]

    [main.config]
    name = "Configuration Options"

        [main.config.default_from_email]
        ask = "from email"
        type = "email"
        help = "Default email address to use for various automated emails."
        bind = "default_from_email:__FINALPATH__/settings.py"

        [main.config.admin_email]
        ask = "ADMIN email"
        type = "email"
        help = "EMail address for error emails."
        bind = "admin_email:__FINALPATH__/settings.py"

        [main.config.debug_enabled]
        ask = "DEBUG mode"
        type = "boolean"
        yes = "1"
        no = "0"
        help = "Should be never enabled in production!"
        bind = "debug_enabled:__FINALPATH__/settings.py"

        [main.config.log_level]
        type = "string"
        ask = "Log Level"
        choices = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
        default = "WARNING"
        bind = "log_level:__FINALPATH__/settings.py" ein

NEW: manifest.toml Manifest v2 by jedie · Pull Request #39 · YunoHost-Apps/django_example_ynh · GitHub

...
    [install.default_from_email] # __DEFAULT_FROM_EMAIL__
    ask.en = "Default email address to use for various automated emails."
    type = "email"
    example = "admin@example.com"

    [install.admin_email] # __ADMIN_EMAIL__
    ask.en = "EMail address for error emails."
    type = "email"
    example = "admin@example.com"

    [install.debug_enabled] # __DEBUG_ENABLED__
    ask.en = "Should be never enabled in production!"
    type = "select"
    choices = ["YES", "NO"]
    default = "NO"

    [install.log_level] # __LOG_LEVEL__
    ask.en = "Logging level"
    type = "select"
    choices = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
    default = "WARNING"
...

I switched __DEBUG_ENABLED__ from “1”/“0” to “YES”/“NO” evaluated in python here: Manifest v2 by jedie · Pull Request #39 · YunoHost-Apps/django_example_ynh · GitHub

  DEBUG_ENABLED = '__DEBUG_ENABLED__'
- DEBUG = bool(int(DEBUG_ENABLED))
+ DEBUG = DEBUG_ENABLED == 'YES'