Packaging v2 is a major improvement for the packaging introduced in YunoHost 11.1
The motivations for this new format is:
__FINALPATH__
being replaced by $final_path
(with underscore), or __PATH__
being replaced by $path_url
, etc.ynh_send_readme_to_admin
) for better UI/UX during the install and upgrade process.However, this "v2" is not the end of the story and should be seen as an intermediate stage before a "v3" packaging. In particular this "v3" packaging should also formalize the handling of the system and app configurations files and ultimately rework the entire paradigm of the install/remove/upgrade/backup/restore scripts.
A script is available in https://github.com/YunoHost/apps/tree/master/tools/packaging_v2 and will attempt to convert what it can from the v1 format to the v2 format, in particular:
manifest.toml
and prefilling it with info scrapped from the various scriptsUsage: python3 convert_app_to_packaging_v2.py /path/yo/your/app
This will edit the file in place and you should then carefully review and iterate over what the script did for you.
The example repo illustrates the below.
manifest.toml
) instead of json (manifest.json
). The structure of the manifest itself has been reworked and now include:
upstream
section (now mandatory)integration
section meant to formalize what minimum YunoHost version is required, the list of supported architectures, declare if SSO/LDAP is supported, typical resource usage. This is meant to be displayed both in the catalog (similar to app stores) and on the app info page after installing the app - though this is still work in progress.resource
section (detailed below)$domain
, etc.)set -eu
a.k.a. ynh_abort_if_errors
in appropriate scriptsnew
/old
/change
domain
/path
are now automatically available in the context and a new helper ynh_change_url_nginx_config
takes care of tweaking the nginx conf. Your script should essentially just call that helper and possibly tweak the app's conf and possibly restart the app's serviceresource
mechanism
manifest.toml
.init_main_permission
install question (replacing the is_public
question). No need to write a boring if $is_public ...
in the install script to add visitors anymore ! There is a similar mechanism to init other permissions, eg init_admin_permission
(cf also the doc about the permission
resource)doc/
folder is now meant to be integrated in the webadmin (though this is still WIP as of writing this). In particular:
DESCRIPTION.md
and the screenshots/
folder are expected to be displayed prior to the app install form (similar to app stores on mobile)ADMIN.md
is expected to be made available somewhere in the info page and should contain technical admin notes. Other pages can be defined (just name it WHATEVER.md
). Lang codes are also supported following the existing scheme for the README, eg README_fr.md
is the French version, hence you can create ADMIN_fr.md
, etc.ADMIN.md
page supports the __FOOBAR__
notation that will be automatically replaced with the app's foobar
settingynh_send_readme_to_admin
mechanics. They are also to be added to the doc
folder:
doc/PRE_INSTALL.md
: a note to be displayed prior to the app install. Typically to warn of something unusual, such as "the app install will automatically add 1GB swap to the system".doc/POST_INSTALL.md
: a note to be displayed after the app install. Typically to explain post-install operations to be performed manually by the admin and that cannot be automated.doc/PRE_UPGRADE.md
: a note to be displayed prior to any upgrade of this app.doc/PRE_UPGRADE.d/{version}.md
: a note to be displayed prior to a specific version upgrade.doc/POST_UPGRADE.md
: a note to be displayed after the app upgrade. For example in the context of Nextcloud, the fact that you may need to re-enable custom modules manually?ADMIN.md
, supports the __FOOBAR__
notation that will be automatically replaced with the app's foobar
settingfinal_path
is now install_dir
(this migration should be automatically handled by the core and the convert_app_to_packaging_v2.py
script)datadir
is now data_dir
to be consistent with install_dir
(this migration should be automatically handled by the core and the convert_app_to_packaging_v2.py
script)path
is now always loaded as $path
, no funky $path_url
-but-it-is-saved-as-path
anymore (this migration should be automatically handled by the core and the convert_app_to_packaging_v2.py
script)mysqldbpwd
and psqlpwd
or whatever are now always saved as db_pwd
(cf the database
resource) (this migration should be automatically handled by the core and the convert_app_to_packaging_v2.py
script)$port
or $port_foo_bar
instead of $foo_bar_port
(cf the port
resource) (this migration should be automatically handled by the core and the convert_app_to_packaging_v2.py
script)/var/www/$app
by default for web apps (or can be changed to /opt/????
for non-webapps). Note that YunoHost will automatically move the old install dir to the new install_dir
during the corresponding upgrade.Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to suggest changes.
Powered by Grav + with by Trilby Media. • Terms of Service