Update packaging_apps.md

This commit is contained in:
jerome.lebleu@mailoo.org 2014-06-04 12:37:46 +02:00 committed by YunoHost
parent 8665f5fa53
commit c66fa651a4

View file

@ -49,27 +49,27 @@ The `manifest.json` file defines the app's constants, a bunch of values that Yun
}
```
* **name** : The name of the app. It does not have to be unique, but it should be, since it is the name shown to all the YunoHost administrators in the app list.
* **name**: The name of the app. It does not have to be unique, but it should be, since it is the name shown to all the YunoHost administrators in the app list.
* **id** : The unique ID of the app. You have to ensure that this ID is unique before submit an app integration request.
* **id**: The unique ID of the app. You have to ensure that this ID is unique before submit an app integration request.
* **description** : The complete description of the app. You can make it as detailed as you feel it should be. Only `en` is required right now, but you can translate the description by prepending the locale prefix.
* **description**: The complete description of the app. You can make it as detailed as you feel it should be. Only `en` is required right now, but you can translate the description by prepending the locale prefix.
* **license** : The license under which the app is distributed. Please use the short name of the license, e.g. `GPL-3` for the GNU General Public License v3. You can find a list of standard abbreviations here: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#license-short-name
* **license**: The license under which the app is distributed. Please use the short name of the license, e.g. `GPL-3` for the GNU General Public License v3. You can find a list of standard abbreviations here: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#license-short-name
* **developer** : Some information about the app maintainer (you!).
* **developer**: Some information about the app maintainer (you!).
* **multi_instance** : This defines your app's ability to be installed multiple times. When YunoHost tries to install a second instance of your app, it will replace the `id` in your scripts by an `id__2`. It means that, if you want to be `multi_instance`, you have to put all the identifiers in the scripts.
* **multi_instance**: This defines your app's ability to be installed multiple times. When YunoHost tries to install a second instance of your app, it will replace the `id` in your scripts by an `id__2`. It means that, if you want to be `multi_instance`, you have to put all the identifiers in the scripts.
<br><br>**E.g.** In my roundcube script, I have to call my database `roundcube`, my install directory `roundcube` and my nginx configuration `roundcube`. This way, the second instance of roundcube will not conflict, and will be installed in the `roundcube__2` database, in the `roundcube__2`directory, and with the `roundcube__2` nginx configuration.
* **arguments** : The settings for the YunoHost's administrator to enter at installation. You have to set a `name` (for argument identification), and a question in `ask` (at least in `en`) that you can translate like the description above. You can also set a `default` value and an `example` to help administrator to fill the input.
* **arguments**: The settings for the YunoHost's administrator to enter at installation. You have to set a `name` (for argument identification), and a question in `ask` (at least in `en`) that you can translate like the description above. You can also set a `default` value and an `example` to help administrator to fill the input.
## Scripts
For now, a YunoHost package must contain 3 bash scripts: `install`, `remove`, and `upgrade`.
These scripts will be executed as `admin` on the YunoHost instances.
Here is an example :
Here is an example:
```bash
# Retrieve arguments
domain=$1
@ -122,7 +122,7 @@ sudo yunohost app ssowatconf
### Usage
You have to put everything in the script in order for the app to install without issue. It means that you have to install dependencies, create required repositories, initialize potential databases, copy sources and configure everything in the single `install` script (and of course do the reverse process in the `remove` script).
**Be careful** : For security reasons, the script is executed as the **admin** user in YunoHost. Be sure to test it as **admin** and prepend `sudo` to commands that require it.
**Be careful**: For security reasons, the script is executed as the **admin** user in YunoHost. Be sure to test it as **admin** and prepend `sudo` to commands that require it.
### Architecture and arguments
Since YunoHost has a unified architecture, you will be able to guess most of the settings you need. But if you need variable ones, like the domain or web path, you will have to ask the administrator at installation (see `arguments` section in the manifest above).
@ -168,7 +168,7 @@ sudo yunohost app checkurl <domain><path> -a <id>
<blockquote>
This helper is useful for web apps and allows you to be sure that the web path is not taken by another app. If not, it "reserves" the path.
<br><br>
**Note** : Do not prepend `http://` or `https://` to the `<domain><path>`.
**Note**: Do not prepend `http://` or `https://` to the `<domain><path>`.
</blockquote>
<br>