YunoHost / issues

General issue tracker for the YunoHost project
72 stars 8 forks source link

No documentation for developing app helpers #2428

Open lotigara opened 1 month ago

lotigara commented 1 month ago

please sorry for my english

Labels

📖 documentation, 🤓 helpers

Describe the bug

There is no documented way to modify app helpers completely

Context

To reproduce

  1. Set up development environment on a YunoHost Bullseye server
  2. cd /ynh-dev/ && ./ynh-dev use-git yunohost && editor yunohost/helpers/helpers.v2.1.d/nginx Note that when I modify a helper, it's counterpant in /usr/share/yunohost/helpers.v2.1.d/ changes too.
  3. cd $PATH_TO_APP && yunohost app install . App's install script doesn't see new helper, and when an old one was modified, script didn't saw changes.

Expected behavior

A documented instruction to re-generate app helpers

Logs

https://paste.yunohost.org/raw/uhoyijegir, there is also a helper at helpers/helpers.v2.1.d/nginx:

[other helpers]

ynh_config_add_nginx_site() {

    local finalnginxconf="/etc/nginx/sites-available/$app.conf"

    ynh_config_add --template="nginx.site" --destination="$finalnginxconf"

    if [ "${path:-}" != "/" ]; then
        ynh_replace --match="^#sub_path_only" --replace="" --file="$finalnginxconf"
    else
        ynh_replace --match="^#root_path_only" --replace="" --file="$finalnginxconf"
    fi

    ynh_store_file_checksum "$finalnginxconf"

    ln -s /etc/nginx/sites-{available,enabled}/$app.conf

    ynh_systemctl --service=nginx --action=reload
}

[other helpers]
alexAubin commented 1 month ago

Can you confirm that you're using an up to date version of ynh-dev, in particular including this commit ? https://github.com/YunoHost/ynh-dev/commit/ce294e69ab6010f9796644576db86d6b89eb039b

lotigara commented 1 month ago

Can you confirm that you're using an up to date version of ynh-dev, in particular including this commit ? YunoHost/ynh-dev@ce294e6

Yes, I'm using up-to-date version. Commit you mentioned is listed in my git shortlog