I tried to add two config values e.g.:
diff --git a/config_panel.toml b/config_panel.toml
index 9a8148e..62b32eb 100644
--- a/config_panel.toml
+++ b/config_panel.toml
@@ -40,3 +40,19 @@ services = ["__APP__"]
choices = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
default = "WARNING"
bind = "log_level:/home/yunohost.app/__APP__/settings.py"
+
+ [main.config.fritz_username]
+ ask = "FRITZ USERNAME"
+ type = "string"
+ help = "Connection user name for your FritzBox"
+ default = ""
+ optional = true
+ bind = "admin_email:/home/yunohost.app/__APP__/settings.py"
+
+ [main.config.fritz_password]
+ ask = "FRITZ PASSWORD"
+ type = "string"
+ help = "Connection user password for your FritzBox"
+ default = ""
+ optional = true
+ bind = "admin_email:/home/yunohost.app/__APP__/settings.py"
diff --git a/manifest.toml b/manifest.toml
index c64bb92..429fda3 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -75,6 +75,20 @@ ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G,
choices = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
default = "WARNING"
+ [main.config.fritz_username] # __FRITZ_USERNAME__
+ ask.en = "FRITZ USERNAME"
+ type = "string"
+ help = "Connection user name for your FritzBox"
+ default = ""
+ optional = true
+
+ [main.config.fritz_password] # __FRITZ_PASSWORD__
+ ask.en = "FRITZ PASSWORD"
+ type = "string"
+ help = "Connection user password for your FritzBox"
+ default = ""
+ optional = true
+
On app upgrade i get this:
+ yunohost app upgrade django-fritzconnection -u https://github.com/YunoHost-Apps/django-fritzconnection_ynh/tree/dev --force --no-safety-backup
Info: Now upgrading django-fritzconnection...
Warning: Skipping the creation of a backup prior to the upgrade.
Info: Updating system_user...
Info: Updating install_dir...
Info: Updating data_dir...
Info: Updating permissions...
Info: Updating ports...
Info: Updating apt...
Info: Updating database...
Info: [+...................] > Stopping systemd service 'django-fritzconnection'...
Info: [#+..................] > Configuring systemd service 'django-fritzconnection'...
Info: [##++++++++++++......] > Create and setup Python virtualenv...
Info: [##############+.....] > Create project configuration files...
Warning: File /home/yunohost.app/django-fritzconnection/settings.py has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//home/yunohost.app/django-fritzconnection/settings.py.backup.20231130.175540
Warning: Variable $fritz_password wasn't initialized when trying to replace __FRITZ_PASSWORD__ in /home/yunohost.app/django-fritzconnection/settings.py
Error: Could not upgrade django-fritzconnection: An error occurred inside the app upgrade script
Info: The operation 'Upgrade the 'django-fritzconnection' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20231130-165524-app_upgrade-django-fritzconnection' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - + [[ -v default_from_email ]]
Info: DEBUG - + match_string=__DEFAULT_FROM_EMAIL__
Info: DEBUG - + match_string=__DEFAULT_FROM_EMAIL__
Info: DEBUG - + replace_string=django-fritzconnection@testyunohost.fritz.box
Info: DEBUG - + replace_string=django-fritzconnection@testyunohost.fritz.box
Info: DEBUG - + replace_string='django-fritzconnection\@testyunohost.fritz.box'
Info: DEBUG - + sed --in-place 's@__DEFAULT_FROM_EMAIL__@django-fritzconnection\@testyunohost.fritz.box@g' /home/yunohost.app/django-fritzconnection/settings.py
Info: DEBUG - + for one_var in "${uniques_vars[@]}"
Info: DEBUG - + [[ -v domain ]]
Info: DEBUG - + match_string=__DOMAIN__
Info: DEBUG - + match_string=__DOMAIN__
Info: DEBUG - + replace_string=testyunohost.fritz.box
Info: DEBUG - + replace_string=testyunohost.fritz.box
Info: DEBUG - + replace_string=testyunohost.fritz.box
Info: DEBUG - + sed --in-place s@__DOMAIN__@testyunohost.fritz.box@g /home/yunohost.app/django-fritzconnection/settings.py
Info: DEBUG - + for one_var in "${uniques_vars[@]}"
Info: DEBUG - + [[ -v fritz_password ]]
Info: DEBUG - + ynh_die '--message=Variable $fritz_password wasn'\''t initialized when trying to replace __FRITZ_PASSWORD__ in /home/yunohost.app/django-fritzconnection/settings.py'
Info: WARNING - Variable $fritz_password wasn't initialized when trying to replace __FRITZ_PASSWORD__ in /home/yunohost.app/django-fritzconnection/settings.py
Info: DEBUG - + ynh_exit_properly
How introduce new configs?!?