From c5ae4de7dc1c287e389735618321ef0e0d2016aa Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Tue, 14 May 2024 14:48:37 +0200 Subject: [PATCH 1/2] Fix deprecated domain cert-* command --- .../25.domains/01.certificate/certificate.de.md | 8 ++++---- .../25.domains/01.certificate/certificate.es.md | 8 ++++---- .../25.domains/01.certificate/certificate.fr.md | 8 ++++---- .../25.domains/01.certificate/certificate.it.md | 8 ++++---- .../25.domains/01.certificate/certificate.md | 8 ++++---- .../60.advanced_packagers/advanced_packagers.md | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.de.md b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.de.md index 884f0080..e4f93921 100644 --- a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.de.md +++ b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.de.md @@ -55,13 +55,13 @@ SSH-Zugang auf Ihrem Server herstellen. So können Sie den aktuellen Status des digitalen Zertifikats überprüfen ```bash -yunohost domain cert-status Ihre.domain.tld +yunohost domain cert status Ihre.domain.tld ``` Dann Let's Encrypt-Zertifikat installieren ```bash -yunohost domain cert-install Ihre.domain.tld +yunohost domain cert install Ihre.domain.tld ``` Ergebnis sollte so aussehen : @@ -82,7 +82,7 @@ Wenn das Zertifikat aufgrund einer schlechten Handhabung nicht funktionsfähig i ein selbst-signiertes Zertifikat zu regenerieren : ```bash -yunohost domain cert-install Ihre.domain.tld --self-signed --force +yunohost domain cert install Ihre.domain.tld --self-signed --force ``` Trotz einer sorgfältigen Überprüfung der DNS-Konfiguration und auch von außen @@ -90,4 +90,4 @@ die Möglichkeit mit HTTP-Modus Zugriff auf den Webserver besteht, kann YunoHost manschmal die Einstellungen verweigern. In diesem Fall ist es notwendig : - die Parameter `127.0.0.1 Ihre.domain.tld` auf der Datei `/etc/hosts` des Webserver hinzufügen. -Wenn es immer noch nicht funktionsfähig ist, also die Überprüfungen deaktivieren mit `--no-checks` nach dem Befehl `cert-install`. +Wenn es immer noch nicht funktionsfähig ist, also die Überprüfungen deaktivieren mit `--no-checks` nach dem Befehl `cert install`. diff --git a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.es.md b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.es.md index bc887a5d..ba16cfd6 100644 --- a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.es.md +++ b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.es.md @@ -50,13 +50,13 @@ Conectate en tu servidor en SSH. Puedes comprobar el estatus corriente de tu certificado vía ```bash -yunohost domain cert-status tu.dominio.tld +yunohost domain cert status tu.dominio.tld ``` Instala el certificado Let's Encrypt vía ```bash -yunohost domain cert-install tu.dominio.tld +yunohost domain cert install tu.dominio.tld ``` Este comando debe devolverte : @@ -73,10 +73,10 @@ Una vez que la instalación está terminada, puedes dirigirte a tu dominio vía Si, después de una manipulación incorrecta, un certificado se encuentra en una mala situación (e.g. pérdida del certificado o imposibilidad de leerlo), es posible regenerar un certificado autofirmado : ```bash -yunohost domain cert-install tu.dominio.tld --self-signed --force +yunohost domain cert install tu.dominio.tld --self-signed --force ``` Si YunoHost te dice que tu dominio está mal configurado mientras que has verificado tu configuración DNS y que tienes acceso a tu servidor en HTTP desde afuera, puedes intentar : - de añadir una línea `127.0.0.1 tu.dominio.tld` al archivo `/etc/hosts` en tu servidor ; -- si la instalación todavía no funciona, desactiva las verificaciones añadiendo `--no-checks` al comando `cert-install`. +- si la instalación todavía no funciona, desactiva las verificaciones añadiendo `--no-checks` al comando `cert install`. diff --git a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.fr.md b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.fr.md index 40a531e0..7da3f12c 100644 --- a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.fr.md +++ b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.fr.md @@ -59,13 +59,13 @@ Connectez-vous sur votre serveur en SSH. Vous pouvez vérifier le statut actuel de votre certificat via : ```bash -yunohost domain cert-status votre.domaine.tld +yunohost domain cert status votre.domaine.tld ``` Installez le certificat Let's Encrypt via : ```bash -yunohost domain cert-install votre.domaine.tld +yunohost domain cert install votre.domaine.tld ``` Cette commande doit retourner : @@ -88,7 +88,7 @@ certificat), il est possible de repartir sur des bases propres en regénérant u certificat auto-signé : ```bash -yunohost domain cert-install votre.domaine.tld --self-signed --force +yunohost domain cert install votre.domaine.tld --self-signed --force ``` Si YunoHost trouve que votre domaine est mal configuré quand bien même vous @@ -96,4 +96,4 @@ avez bien vérifié votre configuration DNS et avez bien accès à votre serveur HTTP depuis l'extérieur, vous pouvez tenter : - d'ajouter une ligne `127.0.0.1 votre.domaine.tld` au fichier `/etc/hosts` sur votre serveur ; -- si l'installation ne fonctionne toujours pas, de désactiver les vérifications en ajoutant `--no-checks` à la commande `cert-install`. +- si l'installation ne fonctionne toujours pas, de désactiver les vérifications en ajoutant `--no-checks` à la commande `cert install`. diff --git a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.it.md b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.it.md index b8719133..6c337f3b 100644 --- a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.it.md +++ b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.it.md @@ -57,13 +57,13 @@ Collegatevi al server con SSH. Potete controllare lo stato del certificato in uso con il comando: ```bash -yunohost domain cert-status your.domain.tld +yunohost domain cert status your.domain.tld ``` Installate il certificato Let's Encrypt con il comando: ```bash -yunohost domain cert-install your.domain.tld +yunohost domain cert install your.domain.tld ``` Che dovrebbe dare come risultato: @@ -83,10 +83,10 @@ Una volta installato il certificato potete verificarne il corretto funzionamento Se il vostro certificato risultasse non funzionante a causa di qualche errore (ad esempio lo avete perso oppure non siete in grado di leggere i file) potete ripulire la situazione rigenerando un certificato autofirmato con questo comando: ```bash -yunohost domain cert-install your.domain.tld --self-signed --force +yunohost domain cert install your.domain.tld --self-signed --force ``` Se YunoHost pensa che il vostro dominio non è configurato correttamente nonstante abbiate controllato la configurazione del DNS e riuscite a collegarvi in HTTP al vostro server anche dall'esterno della rete locale allora potete: - aggiungere una linea `127.0.0.1 vostrodominio.tld` nel file `/etc/hosts` sul vostro server; -- se nonostante questo l'installazione del certificato dovesse ancora fallire potete disabilitare il controllo con l'opzione `--no-checks` dopo il comando `cert-install`. +- se nonostante questo l'installazione del certificato dovesse ancora fallire potete disabilitare il controllo con l'opzione `--no-checks` dopo il comando `cert install`. diff --git a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.md b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.md index fe8b57fe..49791ec6 100644 --- a/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.md +++ b/pages/02.administer/15.admin_guide/25.domains/01.certificate/certificate.md @@ -50,13 +50,13 @@ Connect to your server through SSH. You can check the status of your current certificate with: ```bash -yunohost domain cert-status your.domain.tld +yunohost domain cert status your.domain.tld ``` Install a Let's Encrypt certificate with ```bash -yunohost domain cert-install your.domain.tld +yunohost domain cert install your.domain.tld ``` This should return : @@ -76,10 +76,10 @@ Once this is done, you can check that the certificate is live via your browser b If due to some bad tweaking, your certificate ends up in a bad state (e.g. lost the certificate or unable to read the files), you should be able to clean the situation by regenerating a self-signed certificate: ```bash -yunohost domain cert-install your.domain.tld --self-signed --force +yunohost domain cert install your.domain.tld --self-signed --force ``` If YunoHost thinks that your domain is badly configured despite the fact that you checked the DNS configuration and you have access in HTTP to your server from outside your local network, then you can: - add a line `127.0.0.1 your.domain.tld` to the file `/etc/hosts` on your server; -- if the certificate installation still doesn't work, you can disable the checks with `--no-checks` after the `cert-install` command. +- if the certificate installation still doesn't work, you can disable the checks with `--no-checks` after the `cert install` command. diff --git a/pages/06.contribute/10.packaging_apps/60.advanced/60.advanced_packagers/advanced_packagers.md b/pages/06.contribute/10.packaging_apps/60.advanced/60.advanced_packagers/advanced_packagers.md index c8b5def6..87e658b5 100644 --- a/pages/06.contribute/10.packaging_apps/60.advanced/60.advanced_packagers/advanced_packagers.md +++ b/pages/06.contribute/10.packaging_apps/60.advanced/60.advanced_packagers/advanced_packagers.md @@ -58,7 +58,7 @@ With that you will be able to install two apps on the same YunoHost first one at When your infrastructure is up and ready, you will have to do snapshots of each VMs/LXCs. Doing that, you will be able to revert back to an happy and healthy YunoHost after doing install/backup/restore/upgrade of and app... -Don't forget to regularly upgrade your YunoHosts VMs/LXCs to the last release doing: revert back to last happy/healthy YunoHost snapshot and doing `yunohost domain cert-renew --no-check && yunohost tools update && yunohost tools upgrade --apps && yunohost tools upgrade --system && apt autoremove`. Take a snapshot after that successfull full upgrade. And after some testings or one week later, remove old snapshot. PS: that can be automated... +Don't forget to regularly upgrade your YunoHosts VMs/LXCs to the last release doing: revert back to last happy/healthy YunoHost snapshot and doing `yunohost domain cert renew --no-check && yunohost tools update && yunohost tools upgrade --apps && yunohost tools upgrade --system && apt autoremove`. Take a snapshot after that successfull full upgrade. And after some testings or one week later, remove old snapshot. PS: that can be automated... Example of a script to upgrade a master VirtualBox VM From 0157b052481407b3c06cc2892de225f14c42520b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 20 May 2024 01:49:53 +0200 Subject: [PATCH 2/2] Update helpers+app resources doc, followup of yunohost 11.2.12 --- .../packaging_app_manifest_resources.md | 5 +- .../packaging_app_scripts_helpers.md | 1174 +++++------------ 2 files changed, 302 insertions(+), 877 deletions(-) diff --git a/pages/06.contribute/10.packaging_apps/10.manifest/10.appresources/packaging_app_manifest_resources.md b/pages/06.contribute/10.packaging_apps/10.manifest/10.appresources/packaging_app_manifest_resources.md index 4adfd90c..a333ad00 100644 --- a/pages/06.contribute/10.packaging_apps/10.manifest/10.appresources/packaging_app_manifest_resources.md +++ b/pages/06.contribute/10.packaging_apps/10.manifest/10.appresources/packaging_app_manifest_resources.md @@ -1,5 +1,5 @@ --- -title: App manifest resources +title: App resources template: docs taxonomy: category: docs @@ -7,7 +7,7 @@ routes: default: '/packaging_apps_resources' --- -Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/doc/generate_resource_doc.py) on 11/04/2024 (YunoHost version 11.2.11.2) +Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/doc/generate_resource_doc.py) on 20/05/2024 (YunoHost version 11.2.12) --- @@ -342,3 +342,4 @@ Provision a system user to be used by the app. The username is exactly equal to ### Deprovision - deletes the user and group + diff --git a/pages/06.contribute/10.packaging_apps/20.scripts/10.helpers/packaging_app_scripts_helpers.md b/pages/06.contribute/10.packaging_apps/20.scripts/10.helpers/packaging_app_scripts_helpers.md index 5420003d..434d6dfe 100644 --- a/pages/06.contribute/10.packaging_apps/20.scripts/10.helpers/packaging_app_scripts_helpers.md +++ b/pages/06.contribute/10.packaging_apps/20.scripts/10.helpers/packaging_app_scripts_helpers.md @@ -1,15 +1,13 @@ --- -title: App scripts helpers +title: App helpers template: docs taxonomy: category: docs routes: - default: '/packaging_apps_scripts_helpers' - aliases: - - '/packaging_apps_helpers' + default: '/packaging_apps_helpers' --- -Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/doc/generate_helper_doc.py) on 11/04/2024 (YunoHost version 11.2.11.2) +Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/doc/generate_helper_doc.py) on 20/05/2024 (YunoHost version 11.2.12) ## APPS @@ -26,7 +24,7 @@ Doc auto-generated by [this script](https://github.com/YunoHost/yunohost/blob/7d Requires YunoHost version *.*.* or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apps#L9) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/apps#L9) [/details] --- @@ -42,7 +40,7 @@ Other YunoHost apps will be removed only if no other apps need them. Requires YunoHost version *.*.* or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apps#L65) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/apps#L65) [/details] --- @@ -71,7 +69,7 @@ from the app's service configuration file (defaults to $app.service, overridable If the app relies on a specific PHP version, then `php` will be aliased that version. The PHP command will also be appended with the `phpflags` settings. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apps#L128) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/apps#L128) [/details] --- @@ -95,185 +93,7 @@ If the app relies on a specific PHP version, then `php` will be aliased that ver Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L53) -[/details] - ---- - -### ynh_package_version -[details summary="Get the version of an installed package" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_version --package=name` - -**Arguments**: -- `-p`, `--package=`: the package name to get version - -**Returns**: the version or an empty string - -**Example**: `version=$(ynh_package_version --package=yunohost)` - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L74) -[/details] - ---- - -### ynh_package_update -[details summary="Update package index files" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_update` - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L106) -[/details] - ---- - -### ynh_package_install -[details summary="Install package(s)" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_install name [name [...]]` - -**Arguments**: -- `name`: the package name to install - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L116) -[/details] - ---- - -### ynh_package_remove -[details summary="Remove package(s)" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_remove name [name [...]]` - -**Arguments**: -- `name`: the package name to remove - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L127) -[/details] - ---- - -### ynh_package_autoremove -[details summary="Remove package(s) and their uneeded dependencies" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_autoremove name [name [...]]` - -**Arguments**: -- `name`: the package name to remove - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L137) -[/details] - ---- - -### ynh_package_autopurge -[details summary="Purge package(s) and their uneeded dependencies" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_package_autopurge name [name [...]]` - -**Arguments**: -- `name`: the package name to autoremove and purge - -**Details**: -Requires YunoHost version 2.7.2 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L147) -[/details] - ---- - -### ynh_install_app_dependencies -[details summary="Define and install dependencies with a equivs control file" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_install_app_dependencies dep [dep [...]]` - -**Arguments**: -- `dep`: the package name to install in dependence. -- `"dep1|dep2|…"`: You can specify alternatives. It will require to install (dep1 or dep2, etc). - -**Details**: -This helper can/should only be called once per app - -example : ynh_install_app_dependencies dep1 dep2 "dep3|dep4|dep5" - -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L224) -[/details] - ---- - -### ynh_add_app_dependencies -[details summary="Add dependencies to install with ynh_install_app_dependencies" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_add_app_dependencies --package=phpversion [--replace]` - -**Arguments**: -- `-p`, `--package=`: Packages to add as dependencies for the app. - -**Details**: -Requires YunoHost version 3.8.1 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L337) -[/details] - ---- - -### ynh_remove_app_dependencies -[details summary="Remove fake package and its dependencies" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_remove_app_dependencies` - -**Details**: -Dependencies will removed only if no other package need them. - -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L356) -[/details] - ---- - -### ynh_install_extra_app_dependencies -[details summary="Install packages from an extra repository properly." class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_install_extra_app_dependencies --repo="repo" --package="dep1 dep2" [--key=key_url] [--name=name]` - -**Arguments**: -- `-r`, `--repo=`: Complete url of the extra repository. -- `-p`, `--package=`: The packages to install from this extra repository -- `-k`, `--key=`: url to get the public key. -- `-n`, `--name=`: Name for the files for this repo, $app as default value. - -**Details**: -Requires YunoHost version 3.8.1 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/apt#L390) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/apt#L53) [/details] --- @@ -346,7 +166,7 @@ Requires YunoHost version 2.4.0 or higher. Requires YunoHost version 3.5.0 or higher for the argument `--not_mandatory` -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L64) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L64) [/details] --- @@ -360,7 +180,7 @@ Requires YunoHost version 3.5.0 or higher for the argument `--not_mandatory` Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L179) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L179) [/details] --- @@ -405,7 +225,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 3.5.0 or higher for the argument --not_mandatory -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L238) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L238) [/details] --- @@ -424,7 +244,7 @@ $app should be defined when calling this helper Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L306) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L306) [/details] --- @@ -446,7 +266,7 @@ modified config files. Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L357) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L357) [/details] --- @@ -465,53 +285,7 @@ $app should be defined when calling this helper Requires YunoHost version 3.3.1 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L397) -[/details] - ---- - -### ynh_backup_before_upgrade -[details summary="Make a backup in case of failed upgrade" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_backup_before_upgrade` - -**Details**: -Usage in a package script: -``` - ynh_backup_before_upgrade - ynh_clean_setup () { - ynh_restore_upgradebackup - } - ynh_abort_if_errors -``` - -Requires YunoHost version 2.7.2 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L432) -[/details] - ---- - -### ynh_restore_upgradebackup -[details summary="Restore a previous backup if the upgrade process failed" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_restore_upgradebackup` - -**Details**: -Usage in a package script: -``` - ynh_backup_before_upgrade - ynh_clean_setup () { - ynh_restore_upgradebackup - } - ynh_abort_if_errors -``` - -Requires YunoHost version 2.7.2 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/backup#L480) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/backup#L397) [/details] --- @@ -536,8 +310,6 @@ Requires YunoHost version 2.7.2 or higher. - `-t`, `--use_template`: Use this helper in template mode **Details**: ------------------------------------------------------------------------------ - This will use a template in `../conf/f2b_jail.conf` and `../conf/f2b_filter.conf` See the documentation of `ynh_add_config` for a description of the template format and how placeholders are replaced with actual variables. @@ -586,7 +358,7 @@ fail2ban-regex /var/log/YOUR_LOG_FILE_PATH /etc/fail2ban/filter.d/YOUR_APP.conf Requires YunoHost version 4.1.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/fail2ban#L62) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/fail2ban#L60) [/details] --- @@ -600,7 +372,7 @@ Requires YunoHost version 4.1.0 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/fail2ban#L134) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/fail2ban#L132) [/details] --- @@ -609,53 +381,113 @@ Requires YunoHost version 3.5.0 or higher. ## GETOPTS +## GO + +### ynh_use_go +[details summary="Load the version of Go for an app, and set variables." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_use_go` + +**Details**: +ynh_use_go has to be used in any app scripts before using Go for the first time. +This helper will provide alias and variables to use in your scripts. + +To use gem or Go, use the alias `ynh_gem` and `ynh_go` +Those alias will use the correct version installed for the app +For example: use `ynh_gem install` instead of `gem install` + +With `sudo` or `ynh_exec_as`, use instead the fallback variables `$ynh_gem` and `$ynh_go` +And propagate $PATH to sudo with $ynh_go_load_path +Exemple: `ynh_exec_as $app $ynh_go_load_path $ynh_gem install` + +$PATH contains the path of the requested version of Go. +However, $PATH is duplicated into $go_path to outlast any manipulation of $PATH +You can use the variable `$ynh_go_load_path` to quickly load your Go version + in $PATH for an usage into a separate script. +Exemple: `$ynh_go_load_path $install_dir/script_that_use_gem.sh` + +Finally, to start a Go service with the correct version, 2 solutions + Either the app is dependent of Go or gem, but does not called it directly. + In such situation, you need to load PATH + `Environment="__YNH_GO_LOAD_PATH__"` + `ExecStart=__INSTALL_DIR__/my_app` + You will replace __YNH_GO_LOAD_PATH__ with $ynh_go_load_path + +Or Go start the app directly, then you don't need to load the PATH variable + `ExecStart=__YNH_GO__ my_app run` + You will replace __YNH_GO__ with $ynh_go + +one other variable is also available + - $go_path: The absolute path to Go binaries for the chosen version. + +Requires YunoHost version 3.2.2 or higher. + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/go#L54) +[/details] + +--- + +### ynh_install_go +[details summary="Install a specific version of Go" class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_install_go --go_version=go_version` + +**Arguments**: +- `-v`, `--go_version=`: Version of go to install. + +**Details**: +ynh_install_go will install the version of Go provided as argument by using goenv. + +This helper creates a /etc/profile.d/goenv.sh that configures PATH environment for goenv +for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) + +Don't forget to execute go-dependent command in a login environment +(e.g. sudo --login option) +When not possible (e.g. in systemd service definition), please use direct path +to goenv shims (e.g. $goenv_ROOT/shims/bundle) + +Requires YunoHost version 3.2.2 or higher. + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/go#L96) +[/details] + +--- + +### ynh_remove_go +[details summary="Remove the version of Go used by the app." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_remove_go` + +**Details**: +This helper will also cleanup Go versions + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/go#L191) +[/details] + +--- + +### ynh_cleanup_go +[details summary="Remove no more needed versions of Go used by the app." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_cleanup_go` + +**Details**: +This helper will check what Go version are no more required, +and uninstall them +If no app uses Go, goenv will be also removed. + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/go#L214) +[/details] + +--- + + ## HARDWARE -### ynh_get_ram -[details summary="Get the total or free amount of RAM+swap on the system" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_get_ram [--free|--total] [--ignore_swap|--only_swap]` - -**Arguments**: -- `-f`, `--free`: Count free RAM+swap -- `-t`, `--total`: Count total RAM+swap -- `-s`, `--ignore_swap`: Ignore swap, consider only real RAM -- `-o`, `--only_swap`: Ignore real RAM, consider only swap - -**Returns**: the amount of free ram, in MB (MegaBytes) - -**Details**: -Requires YunoHost version 3.8.1 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/hardware#L13) -[/details] - ---- - -### ynh_require_ram -[details summary="Return 0 or 1 depending if the system has a given amount of RAM+swap free or total" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_require_ram --required=RAM [--free|--total] [--ignore_swap|--only_swap]` - -**Arguments**: -- `-r`, `--required=`: The amount to require, in MB -- `-f`, `--free`: Count free RAM+swap -- `-t`, `--total`: Count total RAM+swap -- `-s`, `--ignore_swap`: Ignore swap, consider only real RAM -- `-o`, `--only_swap`: Ignore real RAM, consider only swap - -**Returns**: 1 if the ram is under the requirement, 0 otherwise. - -**Details**: -Requires YunoHost version 3.8.1 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/hardware#L75) -[/details] - ---- - ## LOGGING @@ -672,7 +504,7 @@ Requires YunoHost version 3.8.1 or higher. Requires YunoHost version 2.4.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L10) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L10) [/details] --- @@ -689,7 +521,7 @@ Requires YunoHost version 2.4.0 or higher. Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L30) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L30) [/details] --- @@ -706,7 +538,7 @@ Requires YunoHost version 3.2.0 or higher. Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L56) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L56) [/details] --- @@ -723,7 +555,7 @@ Requires YunoHost version 3.2.0 or higher. Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L73) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L73) [/details] --- @@ -742,7 +574,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_err Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L92) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L92) [/details] --- @@ -761,7 +593,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_warn Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L113) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L113) [/details] --- @@ -780,7 +612,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_warn Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L134) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L134) [/details] --- @@ -799,7 +631,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_warn Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L155) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L155) [/details] --- @@ -818,7 +650,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_quie Requires YunoHost version 3.2.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L176) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L176) [/details] --- @@ -837,7 +669,7 @@ Note that you should NOT quote the command but only prefix it with ynh_exec_and_ Requires YunoHost version 11.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L197) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L197) [/details] --- @@ -857,7 +689,7 @@ Requires YunoHost version 11.2 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L257) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L257) [/details] --- @@ -872,7 +704,7 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 3.6.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logging#L345) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logging#L345) [/details] --- @@ -896,7 +728,7 @@ If no `--logfile` is provided, `/var/log/$app` will be used as default. Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logrotate#L15) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logrotate#L15) [/details] --- @@ -910,7 +742,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/logrotate#L99) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/logrotate#L99) [/details] --- @@ -927,7 +759,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 4.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/multimedia#L11) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/multimedia#L11) [/details] --- @@ -947,7 +779,7 @@ This "directory" will be a symbolic link to a existing directory. Requires YunoHost version 4.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/multimedia#L64) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/multimedia#L64) [/details] --- @@ -964,7 +796,7 @@ Requires YunoHost version 4.2 or higher. Requires YunoHost version 4.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/multimedia#L93) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/multimedia#L93) [/details] --- @@ -997,7 +829,7 @@ Requires YunoHost version 4.2 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L15) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/mysql#L15) [/details] --- @@ -1015,7 +847,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L36) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/mysql#L36) [/details] --- @@ -1033,7 +865,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L60) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/mysql#L60) [/details] --- @@ -1054,66 +886,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L128) -[/details] - ---- - -### ynh_mysql_user_exists -[details summary="Check if a mysql user exists" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_mysql_user_exists --user=user` - -**Arguments**: -- `-u`, `--user=`: the user for which to check existence - -**Returns**: 0 if the user exists, 1 otherwise. - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L160) -[/details] - ---- - -### ynh_mysql_setup_db -[details summary="Create a database, an user and its password. Then store the password in the app's config" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_mysql_setup_db --db_user=user --db_name=name [--db_pwd=pwd]` - -**Arguments**: -- `-u`, `--db_user=`: Owner of the database -- `-n`, `--db_name=`: Name of the database -- `-p`, `--db_pwd=`: Password of the database. If not provided, a password will be generated - -**Details**: -After executing this helper, the password of the created database will be available in `$db_pwd` -It will also be stored as "`mysqlpwd`" into the app settings. - -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L198) -[/details] - ---- - -### ynh_mysql_remove_db -[details summary="Remove a database if it exists, and the associated user" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_mysql_remove_db --db_user=user --db_name=name` - -**Arguments**: -- `-u`, `--db_user=`: Owner of the database -- `-n`, `--db_name=`: Name of the database - -**Details**: -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/mysql#L224) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/mysql#L128) [/details] --- @@ -1121,48 +894,6 @@ Requires YunoHost version 2.6.4 or higher. ## NETWORK -### ynh_find_port -[details summary="Find a free port and return it" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_find_port --port=begin_port` - -**Arguments**: -- `-p`, `--port=`: port to start to search - -**Returns**: the port number - -**Example**: `port=$(ynh_find_port --port=8080)` - -**Details**: -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/network#L12) -[/details] - ---- - -### ynh_port_available -[details summary="Test if a port is available" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_find_port --port=XYZ` - -**Arguments**: -- `-p`, `--port=`: port to check - -**Returns**: 0 if the port is available, 1 if it is already used by another process. - -**Example**: `ynh_port_available --port=1234 || ynh_die --message="Port 1234 is needs to be available for this app"` - -**Details**: -Requires YunoHost version 3.8.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/network#L36) -[/details] - ---- - ### ynh_validate_ip4 [details summary="Validate an IPv4 address" class="helper-card-subtitle text-muted"] @@ -1179,7 +910,7 @@ Requires YunoHost version 3.8.0 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/network#L99) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/network#L103) [/details] --- @@ -1200,7 +931,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/network#L119) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/network#L123) [/details] --- @@ -1228,7 +959,7 @@ location Requires YunoHost version 4.1.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nginx#L19) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nginx#L19) [/details] --- @@ -1242,7 +973,7 @@ Requires YunoHost version 4.1.0 or higher. Requires YunoHost version 2.7.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nginx#L41) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nginx#L41) [/details] --- @@ -1256,7 +987,7 @@ Requires YunoHost version 2.7.2 or higher. Requires YunoHost version 11.1.9 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nginx#L52) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nginx#L52) [/details] --- @@ -1310,7 +1041,7 @@ You will replace __YNH_NODE__ with $ynh_node Requires YunoHost version 2.7.12 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nodejs#L52) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nodejs#L52) [/details] --- @@ -1334,7 +1065,7 @@ Refer to `ynh_use_nodejs` for more information about available commands and vari Requires YunoHost version 2.7.12 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nodejs#L92) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nodejs#L94) [/details] --- @@ -1352,7 +1083,7 @@ This helper will check if another app uses the same version of node. Requires YunoHost version 2.7.12 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/nodejs#L165) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/nodejs#L167) [/details] --- @@ -1360,159 +1091,6 @@ Requires YunoHost version 2.7.12 or higher. ## PERMISSION -### ynh_permission_create -[details summary="Create a new permission for the app" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_permission_create --permission="permission" [--url="url"] [--additional_urls="second-url" [ "third-url" ]] [--auth_header=true|false] - [--allowed=group1 [ group2 ]] [--label="label"] [--show_tile=true|false] - [--protected=true|false]` - -**Arguments**: -- `-p`, `--permission=`: the name for the permission (by default a permission named "main" already exist) -- `-u`, `--url=`: (optional) URL for which access will be allowed/forbidden. Note that if 'show_tile' is enabled, this URL will be the URL of the tile. -- `-A`, `--additional_urls=`: (optional) List of additional URL for which access will be allowed/forbidden -- `-h`, `--auth_header=`: (optional) Define for the URL of this permission, if SSOwat pass the authentication header to the application. Default is true -- `-a`, `--allowed=`: (optional) A list of group/user to allow for the permission -- `-l`, `--label=`: (optional) Define a name for the permission. This label will be shown on the SSO and in the admin. Default is "APP_LABEL (permission name)". -- `-t`, `--show_tile=`: (optional) Define if a tile will be shown in the SSO. If yes the name of the tile will be the 'label' parameter. Defaults to false for the permission different than 'main'. -- `-P`, `--protected=`: (optional) Define if this permission is protected. If it is protected the administrator won't be able to add or remove the visitors group of this permission. Defaults to 'false'. - -**Details**: -Example 1: `ynh_permission_create --permission=admin --url=/admin --additional_urls=domain.tld/admin /superadmin --allowed=alice bob \ - --label="My app admin" --show_tile=true` - -This example will create a new permission permission with this following effect: -- A tile named "My app admin" in the SSO will be available for the users alice and bob. This tile will point to the relative url '/admin'. -- Only the user alice and bob will have the access to theses following url: /admin, domain.tld/admin, /superadmin - -Example 2: - -ynh_permission_create --permission=api --url=domain.tld/api --auth_header=false --allowed=visitors \ - --label="MyApp API" --protected=true - -This example will create a new protected permission. So the admin won't be able to add/remove the visitors group of this permission. -In case of an API with need to be always public it avoid that the admin break anything. -With this permission all client will be allowed to access to the url 'domain.tld/api'. -Note that in this case no tile will be show on the SSO. -Note that the auth_header parameter is to 'false'. So no authentication header will be passed to the application. -Generally the API is requested by an application and enabling the auth_header has no advantage and could bring some issues in some case. -So in this case it's better to disable this option for all API. - -If provided, 'url' or 'additional_urls' is assumed to be relative to the app domain/path if they -start with '/'. For example: - / -> domain.tld/app - /admin -> domain.tld/app/admin - domain.tld/app/api -> domain.tld/app/api - -'url' or 'additional_urls' can be treated as a PCRE (not lua) regex if it starts with "re:". -For example: - re:/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$ - re:domain.tld/app/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$ - -Note that globally the parameter 'url' and 'additional_urls' are same. The only difference is: -- 'url' is only one url, 'additional_urls' can be a list of urls. There are no limitation of 'additional_urls' -- 'url' is used for the url of tile in the SSO (if enabled with the 'show_tile' parameter) - -About the authentication header (auth_header parameter). -The SSO pass (by default) to the application theses following HTTP header (linked to the authenticated user) to the application: - - "Auth-User": username - - "Remote-User": username - - "Email": user email - -Generally this feature is usefull to authenticate automatically the user in the application but in some case the application don't work with theses header and theses header need to be disabled to have the application to work correctly. -See https://github.com/YunoHost/issues/issues/1420 for more informations - -Requires YunoHost version 3.7.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L66) -[/details] - ---- - -### ynh_permission_delete -[details summary="Remove a permission for the app (note that when the app is removed all permission is automatically removed)" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_permission_delete --permission="permission"` - -**Arguments**: -- `-p`, `--permission=`: the name for the permission (by default a permission named "main" is removed automatically when the app is removed) - -**Example**: `ynh_permission_delete --permission=editors` - -**Details**: -Requires YunoHost version 3.7.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L152) -[/details] - ---- - -### ynh_permission_exists -[details summary="Check if a permission exists" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_permission_exists --permission=permission -| exit: Return 1 if the permission doesn't exist, 0 otherwise` - -**Arguments**: -- `-p`, `--permission=`: the permission to check - -**Details**: -Requires YunoHost version 3.7.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L169) -[/details] - ---- - -### ynh_permission_url -[details summary="Redefine the url associated to a permission" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_permission_url --permission "permission" [--url="url"] [--add_url="new-url" [ "other-new-url" ]] [--remove_url="old-url" [ "other-old-url" ]] - [--auth_header=true|false] [--clear_urls]` - -**Arguments**: -- `-p`, `--permission=`: the name for the permission (by default a permission named "main" is removed automatically when the app is removed) -- `-u`, `--url=`: (optional) URL for which access will be allowed/forbidden. Note that if you want to remove url you can pass an empty sting as arguments (""). -- `-a`, `--add_url=`: (optional) List of additional url to add for which access will be allowed/forbidden. -- `-r`, `--remove_url=`: (optional) List of additional url to remove for which access will be allowed/forbidden -- `-h`, `--auth_header=`: (optional) Define for the URL of this permission, if SSOwat pass the authentication header to the application -- `-c`, `--clear_urls`: (optional) Clean all urls (url and additional_urls) - -**Details**: -Requires YunoHost version 3.7.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L192) -[/details] - ---- - -### ynh_permission_update -[details summary="Update a permission for the app" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_permission_update --permission "permission" [--add="group" ["group" ...]] [--remove="group" ["group" ...]] - [--label="label"] [--show_tile=true|false] [--protected=true|false]` - -**Arguments**: -- `-p`, `--permission=`: the name for the permission (by default a permission named "main" already exist) -- `-a`, `--add=`: the list of group or users to enable add to the permission -- `-r`, `--remove=`: the list of group or users to remove from the permission -- `-l`, `--label=`: (optional) Define a name for the permission. This label will be shown on the SSO and in the admin. -- `-t`, `--show_tile=`: (optional) Define if a tile will be shown in the SSO -- `-P`, `--protected=`: (optional) Define if this permission is protected. If it is protected the administrator won't be able to add or remove the visitors group of this permission. - -**Details**: -Requires YunoHost version 3.7.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L260) -[/details] - ---- - ### ynh_permission_has_user [details summary="Check if a permission has an user" class="helper-card-subtitle text-muted"] @@ -1529,33 +1107,7 @@ Requires YunoHost version 3.7.0 or higher. Requires YunoHost version 3.7.1 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L329) -[/details] - ---- - -### ynh_legacy_permissions_exists -[details summary="Check if a legacy permissions exist" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_legacy_permissions_exists -| exit: Return 1 if the permission doesn't exist, 0 otherwise` - -**Details**: -Requires YunoHost version 4.1.2 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L359) -[/details] - ---- - -### ynh_legacy_permissions_delete_all -[details summary="Remove all legacy permissions" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_legacy_permissions_delete_all` - -**Example**: `if ynh_legacy_permissions_exists then ynh_legacy_permissions_delete_all # You can recreate the required permissions here with ynh_permission_create fi Requires YunoHost version 4.1.2 or higher.` -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/permission#L379) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/permission#L339) [/details] --- @@ -1629,7 +1181,7 @@ Set as 'high', the process manager will be set at 'static'. There will be always Requires YunoHost version 4.1.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/php#L70) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/php#L70) [/details] --- @@ -1643,7 +1195,7 @@ Requires YunoHost version 4.1.0 or higher. Requires YunoHost version 2.7.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/php#L284) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/php#L284) [/details] --- @@ -1662,7 +1214,7 @@ Requires YunoHost version 2.7.2 or higher. Requires YunoHost version 4.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/php#L517) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/php#L517) [/details] --- @@ -1682,7 +1234,7 @@ Requires YunoHost version 4.2 or higher. Requires YunoHost version 4.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/php#L549) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/php#L549) [/details] --- @@ -1715,7 +1267,7 @@ Requires YunoHost version 4.2 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L18) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/postgresql#L18) [/details] --- @@ -1733,7 +1285,7 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L39) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/postgresql#L39) [/details] --- @@ -1751,7 +1303,7 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L64) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/postgresql#L64) [/details] --- @@ -1772,25 +1324,7 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L135) -[/details] - ---- - -### ynh_psql_user_exists -[details summary="Check if a psql user exists" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_psql_user_exists --user=user -| exit: Return 1 if the user doesn't exist, 0 otherwise` - -**Arguments**: -- `-u`, `--user=`: the user for which to check existence - -**Details**: -Requires YunoHost version 3.5.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L168) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/postgresql#L135) [/details] --- @@ -1808,47 +1342,139 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L190) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/postgresql#L192) [/details] --- -### ynh_psql_setup_db -[details summary="Create a database, an user and its password. Then store the password in the app's config" class="helper-card-subtitle text-muted"] -**Usage**: `ynh_psql_setup_db --db_user=user --db_name=name [--db_pwd=pwd]` +## REDIS -**Arguments**: -- `-u`, `--db_user=`: Owner of the database -- `-n`, `--db_name=`: Name of the database -- `-p`, `--db_pwd=`: Password of the database. If not provided, a password will be generated +### ynh_redis_get_free_db +[details summary="get the first available redis database" class="helper-card-subtitle text-muted"] -**Details**: -After executing this helper, the password of the created database will be available in $db_pwd -It will also be stored as "psqlpwd" into the app settings. +**Usage**: `ynh_redis_get_free_db` -Requires YunoHost version 2.7.13 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L234) +**Returns**: the database number to use +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/redis#L7) [/details] --- -### ynh_psql_remove_db -[details summary="Remove a database if it exists, and the associated user" class="helper-card-subtitle text-muted"] +### ynh_redis_remove_db +[details summary="Create a master password and set up global settings +Please always call this script in install and restore scripts" class="helper-card-subtitle text-muted"] -**Usage**: `ynh_psql_remove_db --db_user=user --db_name=name` +**Usage**: `ynh_redis_remove_db database` **Arguments**: -- `-u`, `--db_user=`: Owner of the database -- `-n`, `--db_name=`: Name of the database +- `database`: the database to erase +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/redis#L36) +[/details] + +--- + + +## RUBY + +### ynh_use_ruby +[details summary="Load the version of Ruby for an app, and set variables." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_use_ruby` **Details**: -Requires YunoHost version 2.7.13 or higher. +ynh_use_ruby has to be used in any app scripts before using Ruby for the first time. +This helper will provide alias and variables to use in your scripts. + +To use gem or Ruby, use the alias `ynh_gem` and `ynh_ruby` +Those alias will use the correct version installed for the app +For example: use `ynh_gem install` instead of `gem install` + +With `sudo` or `ynh_exec_as`, use instead the fallback variables `$ynh_gem` and `$ynh_ruby` +And propagate $PATH to sudo with $ynh_ruby_load_path +Exemple: `ynh_exec_as $app $ynh_ruby_load_path $ynh_gem install` + +$PATH contains the path of the requested version of Ruby. +However, $PATH is duplicated into $ruby_path to outlast any manipulation of $PATH +You can use the variable `$ynh_ruby_load_path` to quickly load your Ruby version + in $PATH for an usage into a separate script. +Exemple: $ynh_ruby_load_path $final_path/script_that_use_gem.sh` + +Finally, to start a Ruby service with the correct version, 2 solutions + Either the app is dependent of Ruby or gem, but does not called it directly. + In such situation, you need to load PATH + `Environment="__YNH_RUBY_LOAD_PATH__"` + `ExecStart=__FINALPATH__/my_app` + You will replace __YNH_RUBY_LOAD_PATH__ with $ynh_ruby_load_path + +Or Ruby start the app directly, then you don't need to load the PATH variable + `ExecStart=__YNH_RUBY__ my_app run` + You will replace __YNH_RUBY__ with $ynh_ruby + +one other variable is also available + - $ruby_path: The absolute path to Ruby binaries for the chosen version. + +Requires YunoHost version 3.2.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/postgresql#L265) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/ruby#L53) +[/details] + +--- + +### ynh_install_ruby +[details summary="Install a specific version of Ruby" class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_install_ruby --ruby_version=ruby_version` + +**Arguments**: +- `-v`, `--ruby_version=`: Version of ruby to install. + +**Details**: +ynh_install_ruby will install the version of Ruby provided as argument by using rbenv. + +This helper creates a /etc/profile.d/rbenv.sh that configures PATH environment for rbenv +for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) + +Don't forget to execute ruby-dependent command in a login environment +(e.g. sudo --login option) +When not possible (e.g. in systemd service definition), please use direct path +to rbenv shims (e.g. $RBENV_ROOT/shims/bundle) + +Requires YunoHost version 3.2.2 or higher. + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/ruby#L98) +[/details] + +--- + +### ynh_remove_ruby +[details summary="Remove the version of Ruby used by the app." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_remove_ruby` + +**Details**: +This helper will also cleanup Ruby versions + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/ruby#L240) +[/details] + +--- + +### ynh_cleanup_ruby +[details summary="Remove no more needed versions of Ruby used by the app." class="helper-card-subtitle text-muted"] + +**Usage**: `ynh_cleanup_ruby` + +**Details**: +This helper will check what Ruby version are no more required, +and uninstall them +If no app uses Ruby, rbenv will be also removed. + + +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/ruby#L265) [/details] --- @@ -1869,7 +1495,7 @@ Requires YunoHost version 2.7.13 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/setting#L10) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/setting#L10) [/details] --- @@ -1888,7 +1514,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/setting#L36) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/setting#L36) [/details] --- @@ -1906,48 +1532,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/setting#L62) -[/details] - ---- - -### ynh_webpath_available -[details summary="Check availability of a web path" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_webpath_available --domain=domain --path_url=path` - -**Arguments**: -- `-d`, `--domain=`: the domain/host of the url -- `-p`, `--path_url=`: the web path to check the availability of - -**Example**: `ynh_webpath_available --domain=some.domain.tld --path_url=/coffee` - -**Details**: -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/setting#L123) -[/details] - ---- - -### ynh_webpath_register -[details summary="Register/book a web path for an app" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_webpath_register --app=app --domain=domain --path_url=path` - -**Arguments**: -- `-a`, `--app=`: the app for which the domain should be registered -- `-d`, `--domain=`: the domain/host of the web path -- `-p`, `--path_url=`: the web path to be registered - -**Example**: `ynh_webpath_register --app=wordpress --domain=some.domain.tld --path_url=/coffee` - -**Details**: -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/setting#L145) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/setting#L62) [/details] --- @@ -1972,7 +1557,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/string#L13) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/string#L13) [/details] --- @@ -1994,7 +1579,7 @@ sub-expressions can be used (see sed manual page for more information) Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/string#L40) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/string#L40) [/details] --- @@ -2016,30 +1601,7 @@ characters, you can't use some regular expressions and sub-expressions. Requires YunoHost version 2.7.7 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/string#L71) -[/details] - ---- - -### ynh_sanitize_dbid -[details summary="Sanitize a string intended to be the name of a database" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_sanitize_dbid --db_name=name` - -**Arguments**: -- `-n`, `--db_name=`: name to correct/sanitize - -**Returns**: the corrected name - -**Example**: `dbname=$(ynh_sanitize_dbid $app)` - -**Details**: -Underscorify the string (replace - and . by _) - -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/string#L103) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/string#L71) [/details] --- @@ -2065,7 +1627,7 @@ format and how placeholders are replaced with actual variables. Requires YunoHost version 4.1.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/systemd#L15) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/systemd#L15) [/details] --- @@ -2082,7 +1644,7 @@ Requires YunoHost version 4.1.0 or higher. Requires YunoHost version 2.7.2 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/systemd#L38) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/systemd#L38) [/details] --- @@ -2104,7 +1666,7 @@ Requires YunoHost version 2.7.2 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/systemd#L67) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/systemd#L67) [/details] --- @@ -2128,7 +1690,7 @@ Requires YunoHost version 3.5.0 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L12) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/user#L12) [/details] --- @@ -2150,7 +1712,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.2.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L33) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/user#L33) [/details] --- @@ -2168,91 +1730,7 @@ Requires YunoHost version 2.2.4 or higher. Requires YunoHost version 2.4.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L53) -[/details] - ---- - -### ynh_system_user_exists -[details summary="Check if a user exists on the system" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_system_user_exists --username=username` - -**Arguments**: -- `-u`, `--username=`: the username to check - -**Returns**: 0 if the user exists, 1 otherwise. - -**Details**: -Requires YunoHost version 2.2.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L64) -[/details] - ---- - -### ynh_system_group_exists -[details summary="Check if a group exists on the system" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_system_group_exists --group=group` - -**Arguments**: -- `-g`, `--group=`: the group to check - -**Returns**: 0 if the group exists, 1 otherwise. - -**Details**: -Requires YunoHost version 3.5.0.2 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L82) -[/details] - ---- - -### ynh_system_user_create -[details summary="Create a system user" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_system_user_create --username=user_name [--home_dir=home_dir] [--use_shell] [--groups="group1 group2"]` - -**Arguments**: -- `-u`, `--username=`: Name of the system user that will be create -- `-h`, `--home_dir=`: Path of the home dir for the user. Usually the final path of the app. If this argument is omitted, the user will be created without home -- `-s`, `--use_shell`: Create a user using the default login shell if present. If this argument is omitted, the user will be created with /usr/sbin/nologin shell -- `-g`, `--groups`: Add the user to system groups. Typically meant to add the user to the ssh.app / sftp.app group (e.g. for borgserver, my_webapp) - -**Details**: -Create a nextcloud user with no home directory and /usr/sbin/nologin login shell (hence no login capability) : -``` -ynh_system_user_create --username=nextcloud -``` -Create a discourse user using /var/www/discourse as home directory and the default login shell : -``` -ynh_system_user_create --username=discourse --home_dir=/var/www/discourse --use_shell -``` - -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L111) -[/details] - ---- - -### ynh_system_user_delete -[details summary="Delete a system user" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_system_user_delete --username=user_name` - -**Arguments**: -- `-u`, `--username=`: Name of the system user that will be create - -**Details**: -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L153) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/user#L53) [/details] --- @@ -2266,7 +1744,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 4.1.7 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/user#L179) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/user#L187) [/details] --- @@ -2274,24 +1752,6 @@ Requires YunoHost version 4.1.7 or higher. ## UTILS -### ynh_abort_if_errors -[details summary="Exits if an error occurs during the execution of the script." class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_abort_if_errors` - -**Details**: -This configure the rest of the script execution such that, if an error occurs -or if an empty variable is used, the execution of the script stops immediately -and a call to `ynh_clean_setup` is triggered if it has been defined by your script. - -Requires YunoHost version 2.6.4 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L61) -[/details] - ---- - ### ynh_setup_source [details summary="Download, check integrity, uncompress and patch the source from app.src" class="helper-card-subtitle text-muted"] @@ -2301,7 +1761,7 @@ Requires YunoHost version 2.6.4 or higher. - `-d`, `--dest_dir=`: Directory where to setup sources - `-s`, `--source_id=`: Name of the source, defaults to `main` (when the sources resource exists in manifest.toml) or (legacy) `app` otherwise - `-k`, `--keep=`: Space-separated list of files/folders that will be backup/restored in $dest_dir, such as a config file you don't want to overwrite. For example 'conf.json secrets.json logs' (no trailing `/` for folders) -- `-r`, `--full_replace=`: Remove previous sources before installing new sources +- `-r`, `--full_replace=`: Remove previous sources before installing new sources (can be 1 or 0, default to 0) **Details**: #### New 'sources' resources @@ -2379,7 +1839,7 @@ The helper will: Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L154) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L156) [/details] --- @@ -2405,7 +1865,7 @@ For multiple calls, cookies are persisted between each call for the same app Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L404) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L406) [/details] --- @@ -2463,7 +1923,7 @@ into the app settings when configuration is done. Requires YunoHost version 4.1.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L488) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L490) [/details] --- @@ -2508,7 +1968,7 @@ Example of line this helpers can managed correctly Requires YunoHost version 4.3 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L646) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L648) [/details] --- @@ -2528,23 +1988,7 @@ Requires YunoHost version 4.3 or higher. Requires YunoHost version 4.3 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L724) -[/details] - ---- - -### ynh_get_debian_release -[details summary="Fetch the Debian release codename" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_get_debian_release` - -**Returns**: The Debian release codename (i.e. jessie, stretch, ...) - -**Details**: -Requires YunoHost version 2.7.12 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L839) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L726) [/details] --- @@ -2561,7 +2005,7 @@ Requires YunoHost version 2.7.12 or higher. Requires YunoHost version 2.6.4 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L870) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L874) [/details] --- @@ -2581,7 +2025,7 @@ Requires YunoHost version 2.6.4 or higher. Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L904) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L908) [/details] --- @@ -2606,30 +2050,7 @@ For example, if the manifest contains `4.3-2~ynh3` the function will return `4.3 Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L947) -[/details] - ---- - -### ynh_app_package_version -[details summary="Read package version from the manifest" class="helper-card-subtitle text-muted"] - -**Usage**: `ynh_app_package_version [--manifest="manifest.json"]` - -**Arguments**: -- `-m`, `--manifest=`: Path of the manifest to read - -**Returns**: the version number of the package - -**Details**: -The version number in the manifest is defined by `~ynh`. - -For example, if the manifest contains `4.3-2~ynh3` the function will return `3` - -Requires YunoHost version 3.5.0 or higher. - - -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L976) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L951) [/details] --- @@ -2648,7 +2069,7 @@ of it, when it's not needed Requires YunoHost version 3.5.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L997) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L1003) [/details] --- @@ -2680,5 +2101,8 @@ fi Requires YunoHost version 3.8.0 or higher. -[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca/helpers/utils#L1027) +[Dude, show me the code!](https://github.com/YunoHost/yunohost/blob/d5e054fe80002862bd5966d61b20e9fafcf0578e/helpers/utils#L1033) [/details] + +--- +