# \[Packageur en herbe\] packaging application YesWiki

**URL:** <https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962>\
**Category:** Apps packaging\
**Tags:** french, english\
**Created:** [April 15, 2020, 9:24pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962 "2020-04-15T21:24:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 15, 2020, 9:24pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/1 "2020-04-15T21:24:52Z")

</div>

Bonjour,

~~je cherche à packager l’application [Uwazi](https://www.uwazi.io/) ([depot GitHub](https://github.com/huridocs/uwazi)).  
Mon depot d’application [github.com/Plumf/uwazi\_ynh](https://github.com/Plumf/uwazi_ynh)~~

Je suis en train de packager l’application [YesWiki](https://yeswiki.net/?AccueiL) et [mon dépot GitHub pour YesWiki](https://github.com/Plumf/yeswiki_ynh)

Je debute dans le packaging,j’ai suivi les recommandations de la doc : [ici](https://yunohost.org/#/packaging_apps_start), [ici](https://yunohost.org/#/packaging_apps) et [là](https://yunohost.org/#/packaging_apps_manifest)

Quelques petites questions me viennent et je n’arrive pas à trouver de réponse. Quelle est la différence entre les dépendances (dans le fichier `script/_common.sh`) et les services à compléter dans le fichier `manifeste.json` ?

Dans le depot d’exemple de YunoHost que j’utilise comme base de travail le service `mysql` est marqué tandis que Uwazi utilise MongoDB (sur leur dépot github c’est marqué comme dépendance par ailleur.

merci d’avance de vos réponses. @Plumf

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 15, 2020, 9:44pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/2 "2020-04-15T21:44:38Z")

</div>

Hi @Plumf

I guess by “dépendances” you mean this line [https://github.com/YunoHost/example\_ynh/blob/master/scripts/\_common.sh#L8](https://github.com/YunoHost/example_ynh/blob/master/scripts/_common.sh#L8)  
Those are apt packages you need to install for your app.

Services in the manifest are (I would say, useless…) kind of a list of services you need to be running when using the app.

To be honest, if that’s your first package, this app doesn’t look like a good choice to start.  
A quick look to the install doc ([https://github.com/huridocs/uwazi/wiki/Install-Uwazi-on-your-server](https://github.com/huridocs/uwazi/wiki/Install-Uwazi-on-your-server)) make me think of the kind of app for which the dev didn’t think it was going to be used by real users.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 15, 2020, 9:47pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/3 "2020-04-15T21:47:00Z")

</div>

Hi @Maniack_Crudelis thank for your answer, i note this. For beginning it’s not a good idea maybe. I’m going to leave that package out so you don’t disgust me. But I’m still looking for an application simple enough to packager to make my hand. What should I look at? There must be one in the notworking list with which it’s possible …

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 15, 2020, 9:52pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/4 "2020-04-15T21:52:19Z")

</div>

Huh first, don’t bother you with English, I can perfectly understand you in French.

There’s many apps you can start with. But to lead you toward the right one, I should know what kind of apps you’re looking for.  
Always better to work on an app you’re actually going to use.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 15, 2020, 10:10pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/5 "2020-04-15T22:10:38Z")

</div>

Not problems, it’s good to my english training. =) Il take the time tomorow to write a liste with interesting applications (in wishlist and not working apps). Thnak for your help

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 15, 2020, 10:12pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/6 "2020-04-15T22:12:54Z")

</div>

If you prefer then, you can do that.  
Don’t hesitate also to look for non maintained apps.

As soon as you have your list, we’ll have a look to it to find you an easy one.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 16, 2020, 9:32am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/7 "2020-04-16T09:32:51Z")

</div>

Hi @Maniack_Crudelis, I looks some applications and in this order, I’m interesting by :

1. [YesWiki](https://yeswiki.net/?AccueiL) - [git](https://github.com/YesWiki/yeswiki)
2. [lychee](https://lychee.electerious.com/) - [git](https://github.com/electerious/Lychee)
3. [Wisemapping](http://wisemapping.com/) - [infos](https://wisemapping.atlassian.net/wiki/spaces/WS/overview)
4. [Umap](https://wiki.openstreetmap.org/wiki/UMap) - [git](https://github.com/umap-project/umap/)
5. [Docspell](https://docspell.org/) - [git](https://github.com/eikek/docspell)
6. [alf.io](https://alf.io/) - [git](https://github.com/alfio-event/alf.io)

Tell me which ones would be easy to package and I works =) Thanks for all.

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 16, 2020, 10:17am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/8 "2020-04-16T10:17:53Z")

</div>

To take in the right order, the first one is perfect.

Really an easy pick.

The [documentation](https://yeswiki.net/?DocumentationInstallation) is a little bit sloppy but it will do it.  
And the spirit of the software seems perfect for YunoHost.

But, from a quick look, I can already told you, do not `chmod 777` ! Never !

Otherwise, to go for this one could be a good idea.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 16, 2020, 10:51am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/9 "2020-04-16T10:51:45Z")

</div>

I’m note this, and I go work to package Yes Wiki. I come back with a first beta package. Thanks !!!

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 18, 2020, 9:07am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/10 "2020-04-18T09:07:29Z")

</div>

Bonjour, toujours en avancant à pas de fourmis dans le packagage de l’application YesWiki, je suis devant un mur, dans le script d’[installation](https://github.com/Plumf/yeswiki_ynh/blob/testing/scripts/install) je ne sais pas si je dois utiliser l’outil `curl` ou non et du coup juste après comment configurer et où configurer l’installation (ligne 242 - install)

En installant YesWiki par un ftp il y a tout un formulaire à remplir, mais je cale car je n’arrive pas à savoir ou obtenir les clefs des informations.

~~Notamment pour comprendre je me suis inspiré de cela (install Wallabag)~~

Les valeurs `database_user` et autre sont elles universelles ? Y a t il un endroit par defenition où installer la configuration ou est ce totalement arbitraire ?

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 18, 2020, 9:53am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/11 "2020-04-18T09:53:19Z")

</div>

Salut !

Je viens de tester une installation rapide de YesWiki. Tu dois passer par `curl` on dirait, car si tu regardes le fichier `setup/install.php`, il récupère toutes les variables provenant du formulaire pour ensuite créer les tables de la base de données:

```php
// fetch configuration
$config = $config2 = $_POST['config'];

```

J’ai capturé la requête `POST` dans Firefox. Tu peux le faire en ouvrant le menu développeur à l’onglet Réseau, et en cliquant sur Continuer après avoir rempli le formulaire. La ligne `POST` peux être copiée en tant que commande “cURL (posix)”. Tu peux virer tous les _headers_ commençant par `-H`:

`curl 'https://domain.tld/yeswiki/?PagePrincipale&installAction=install' --data 'config%5Bdefault_language%5D=fr&config%5Bwakka_name%5D=Mon+site+YesWiki&config%5Bmeta_description%5D=&config%5Bmeta_keywords%5D=&config%5Broot_page%5D=PagePrincipale&config%5Bmysql_host%5D=localhost&config%5Bmysql_database%5D=test&config%5Bmysql_user%5D=test&config%5Bmysql_password%5D=test&config%5Btable_prefix%5D=yeswiki_&admin_name=WikiAdmin&admin_password=test&admin_password_conf=test&admin_email=test%40domain.tld&config%5Bbase_url%5D=https%3A%2F%2Fdomain.tld%2Fyeswiki%2F%3F&config%5Brewrite_mode%5D=0&config%5Ballow_raw_html%5D=1'`

C’est pas très joli, mais tu peux aisément repérer mes variables de test et les remplacer par les variables de ton `manifest`. 😉

Le cas de Wallabag ne marchera pas pour toi, car Wallabag se sert du fichier `parameters.yml` pour **charger** les paramètres lors de l’installation, alors que YesWiki se sert de son fichier config pour **stocker** ces paramètres **après** l’installation, a posteriori donc. 😕

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 18, 2020, 9:56am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/12 "2020-04-18T09:56:22Z")

</div>

merci pour les infos je vais regarder ça de plus près. Toujours en cherchant des points de comparaisons avec d’autres paquets de YunoHost, le cas de WordPress est il plus indiqué ?  
(Il ny a notamment l’usage de Curl)

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 18, 2020, 10:00am UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/13 "2020-04-18T10:00:14Z")

</div>

Oui ça me semble pas mal l’exemple de Wordpress. Garde un oeil sur `example_ynh` tout de même, car le code y est plus propre et sans les étapes spécifiques à Wordpress.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 19, 2020, 1:53pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/14 "2020-04-19T13:53:04Z")

</div>

Re-petit problème :  
les log de ma dernière version : [https://paste.yunohost.org/raw/vofuyuvane](https://paste.yunohost.org/raw/vofuyuvane)

A la fin du script d’installation il y a ces lignes :

```auto
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================

### `ynh_store_file_checksum` is used to store the checksum of a file.
### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`,
### you can make a backup of this file before modifying it again if the admin had modified it.

# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/wakka.config.php"

```

Si je ne me trompe pas dans l’interpretation de ces lignes c’est pour vérier l’intégrité du fichier de configuration ? (Il y a dedans les infos MYSQL, Nom du wiki dans le cas présent et autre…) Mais tant que le processus n’a pas finit, le fichier n’existe pas ce qui me renvoit durant l’installation à une erreur.

Est ce que je me suis trompé ou il y a une manière de le créer avant ?

Autre question, serait possible d’avoir une explication quant à l’utilisation et l’usage de cette partie :

```auto
#=================================================
# MODIFY A CONFIG FILE
#=================================================

### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)

#ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/CONFIG_FILE"

```

Merci d’avance

---

<div class="post-metadata">

**Author:** ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)\
**Post date:** [April 19, 2020, 2:35pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/15 "2020-04-19T14:35:42Z")

</div>

Toutes les parties des scripts de `example_ynh` ne sont pas obligatoires:

- Pour le _checksum_, ce n’est intéressant que si tu veux surveiller les modifications du fichier de configuration. Or il contient par exemple le titre du wiki, ce qui est aisément modifiable par l’utilisateur. Je ne pense donc pas qu’il soit important de surveiller de telles modifications. Si tu veux absolument le surveiller, tu peux simplement déplacer ce bloc de code plus bas, après la génération du fichier.
- Quant au `ynh_replace_string`, idem, ce n’est nécessaire que si tu veux modifier un fichier par la ligne de commande. Ici ton fichier de configuration sera généré par ta requête cURL, donc ce bloc n’est peut-être pas nécessaire.
  - Imaginons que tu aies un fichier `config.conf` préparé pour être rempli avec les variables de l’utilisateur. Prenons l’exemple de `$admin`. Tu laisseras un ` __ADMIN__ ` dans le-dit fichier, au bon endroit, et tu appeleras la commande: `ynh_replace_string --match_string=" __ADMIN__" --replace_string="$admin" --target_file="$final_path/config.conf"`. Regarde ce que j’ai fait dans [`flarum_ynh/script/install`](https://github.com/YunoHost-Apps/flarum_ynh/blob/6c0f19d95b5a7cec8e8278173472f3bf4a1adab6/scripts/install#L215) et [`flarum_ynh/conf/configuration.yml`](https://github.com/YunoHost-Apps/flarum_ynh/blob/master/conf/configuration.yml)

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 19, 2020, 4:07pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/16 "2020-04-19T16:07:22Z")

</div>

**Point d’étape** L’installation fonctionne ([depot testing](https://github.com/Plumf/yeswiki_ynh/tree/testing))  
Mais lors du lancement de l’application, YesWiki me renvoit à la page de configuration & d’installation… problème que je n’arrive pas à identifier dans [les logs](https://paste.yunohost.org/omawufiyuh)

Second point j’ai commenté ces lignes

```auto
#=================================================
# SETUP FAIL2BAN
#=================================================
#ynh_script_progression --message="Configuring fail2ban..." --time --weight=1

# Create a dedicated fail2ban config
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"

```

Elle bloquait l’installation mais je ne sais pas trop si j’ai bien fais…

Merci du coup de main =)

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 19, 2020, 4:14pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/17 "2020-04-19T16:14:40Z")

</div>

> [@Plumf](#):
>
> Second point j’ai commenté ces lignes

What is your dev environment ? ynh-dev, VirtualBox, other virtualization, a real server ?

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 19, 2020, 5:09pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/18 "2020-04-19T17:09:00Z")

</div>

It’s a Virtual machin (I’m usign virt-manager)

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [April 19, 2020, 5:15pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/19 "2020-04-19T17:15:10Z")

</div>

Ok, just to be sure, I just fixed an issue with fail2ban with system with a lot of banned IP. So I had a doubt you weren’t on a virtual machine.

fail2ban is not a priority, but that’s better to have it enable for your app when everything else is ok.

If your app shows the install page, that may means that the app does not consider the installation is done.  
Sometimes, the install process removes the install dir, you can have a look to what the install page actually does.

---

<div class="post-metadata">

**Author:** ![Plumf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/plumf/32/7174_2.png) [@Plumf](https://forum.yunohost.org/u/Plumf)\
**Post date:** [April 19, 2020, 5:26pm UTC](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962/20 "2020-04-19T17:26:16Z")

</div>

I have a doubt about the process, especially about the `Input` and how it works. (line 233 [here](https://github.com/Plumf/yeswiki_ynh/blob/testing/scripts/install)

[Next page](https://forum.yunohost.org/t/packageur-en-herbe-packaging-application-yeswiki/10962.md?page=2)
