Premier packaging d'application / First application packaging

:fr:

Bonjour,

J’aimerais bien apprendre le packaging d’application pour Yunohost, mais je suis un débutant.

J’ai déjà lu les guides disponibles.

J’aimerais connaître votre avis sur la facilité de packager Fosscord comme première application ?

Je sais que c’est une appli en bêta, mais elle est simple dans son installation.

Merci d’avance

:us: :uk: :england:

Hello,

I would like to learn the application packaging for Yunohost, but I am a beginner.

I have already read the available guides.

I would like to know your opinion on how easy it is to package Fosscord as a first application?

I know it’s a beta app, but it’s simple in its installation.

Thanks

you’ll have to read a lot of packages to understand how it works.

  • First step go to GitHub - YunoHost/example_ynh: Example package for YunoHost applications. and clic on “use this template” to create the new repository for this package, you’ll call it fosscord_ynh
  • In your newly created repo, go and edit manifest.json. It’s easy to understand and depending and your software you can add or delete arguments. in your case, the services you’ll need are only nginx.
  • when saving the manifest, create a new branch called testing, validate but don’t merge
  • now go to the scripts folder and open install script
  • your app is based on nodejs, so go and read the scripts of other apps running nodejs like GitHub - YunoHost-Apps/archivebox_ynh: Self-hosted internet archiving solution to collect, save, and view sites you want to preserve offline, for YunoHost. or GitHub - YunoHost-Apps/mumble-web_ynh at testing or GitHub - YunoHost-Apps/elabftw_ynh at testing and many others
  • read carefully the info in the scripts, it’s very helpful
  • after going through all the scripts, go and check the conf folder where you have app.src (where you’ll define the source file of your app, its hash, etc) and of course the nginx config
  • don’t forget the check_process file at the root of your package, it’s where you define what to check in your package
  • to test your package, install yunohost in a virtual machine, after running the postinstall, the first user, the domain and the system update, make a snapshot of your virtual machine then begin the test by installing your app in apps>install> at the end of the page input the github link for your testing branch, accept the warning and install.
  • your first tries will probably fail, or not and don’t worry. check the logs to understand what’s wrong
  • fix it and retry the install but before that, restore the snapshot since the virtual machine have been modified and won’t be reliable
  • I have noted that in some cases the virtual machine looses the time and date, I had to run sudo systemctl restart ntp

don’t worry, at first it seems hard but with time it’ll be much easier
I think I’ll look for ‘reference packages’ for every environnement to ease the creation of new packages for the future
don’t hesitate to ask

the install of your app is here Setup - Fosscord Docs

Edit : I forgot to mention the docs in the doc folder (documentation and disclaimer) and of course the licence

3 Likes