Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conf files not upgraded on upgrade? #31

Closed
fflorent opened this issue Sep 13, 2021 · 2 comments
Closed

Conf files not upgraded on upgrade? #31

fflorent opened this issue Sep 13, 2021 · 2 comments

Comments

@fflorent
Copy link
Contributor

Hello!

I am reading the code of the application for packaging another app.

I see in the code of the upgrade that we first remove the final_path directory:

ynh_secure_remove --file="$final_path"/asmux.go

A bit later then, we backup the config files:

ynh_backup_if_checksum_is_different --file="$mautrix_config_path"
ynh_backup_if_checksum_is_different --file="$app_service_registration_path/$app.yaml"

As the $mautrix_config_path file is stored in $final_path, shouldn't we backup before the final_path directory?

Although I have not tested what I suspect, so I may be wrong

@Gredin67
Copy link
Collaborator

I see in the code of the upgrade that we first remove the final_path directory:

this line is just for upgrade from a specific version, don't consider it for packaging a new app.
Which app do you plan to package? I may be able to help.

As the $mautrix_config_path file is stored in $final_path, shouldn't we backup before the final_path directory?
You may be right. Basically what we want to handle in the longer term are following cases:

  • The administrator changed the config file manually from the standard config set at install (with manifest parameters)
  • The template config file was changed upstream (more or less parameters)
    Currently, if one or the other occurs, then at upgrade checksum differs, the previously used config will be renamed and the user warned. The up-to-date template config file with manifest parameters will be set. And the admin has to adapt it again manually if required.

A system for better handling of config files is being developped for an upcoming YunoHost version. Therefore, I would not spend much time on config file issues before it is out. The most important is that the file follows the upstream template such that install succeeds. Then the user can modify it manually.

The config panel is already in the dev branch!
YunoHost/yunohost-admin#366
YunoHost/yunohost#987

@fflorent
Copy link
Contributor Author

fflorent commented Sep 13, 2021

this line is just for upgrade from a specific version, don't consider it for packaging a new app.

OK!

Which app do you plan to package? I may be able to help.

I plan to package the mx-puppet-discord app:

The documentation has to be done, but as far as I tested, it already works! (installation, removal, backup, restoration, upgrade).

There are still warning about… checksum precisely :)

Maybe we can talk in private if you're interested. Code review is highly welcome :).

You may be right. Basically what we want to handle in the longer term are following cases:

Actually, I discovered that I was wrong, because that's not the $final_path but the $src_path that is being removed, so that's perfectly fine!

BTW, ynh_add_config performs a checksum computation and stores it (source). Good to know :)

The config panel is already in the dev branch!
YunoHost/yunohost-admin#366
YunoHost/yunohost#987

🎉 I hope to play with it relatively soon!

Florent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants