From 0928b203205202893ef5db2e2e3b0a8b3c6af1e8 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 30 Mar 2020 16:19:47 +0200 Subject: [PATCH] Update Helpers --- packaging_apps_helpers.md | 309 +++++++++++++++++++++++++++++++++++--- 1 file changed, 284 insertions(+), 25 deletions(-) diff --git a/packaging_apps_helpers.md b/packaging_apps_helpers.md index 71cb32f7..3decc36c 100644 --- a/packaging_apps_helpers.md +++ b/packaging_apps_helpers.md @@ -411,7 +411,7 @@

- Dude, show me the code ! + Dude, show me the code !

@@ -1428,14 +1428,13 @@ ynh_exec_fully_quiet "your_command | other_command"
ynh_script_progression
-
Print a message as INFO and show progression during an app script
+
Print a progress bar showing the progression of an app script

- Usage: ynh_script_progression --message=message [--weight=weight] [--time] -The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. + Usage: ynh_script_progression --message=message [--weight=weight] [--time]

@@ -1452,7 +1451,7 @@ The execution time is given for the duration since the previous call. So the wei -
  • -t, --time= : Print the execution time since the last call to this helper. Especially usefull to define weights.
  • +
  • -t, --time= : Print the execution time since the last call to this helper. Especially usefull to define weights. The execution time is given for the duration since the previous call. So the weight should be applied to this previous call.
  • @@ -1474,7 +1473,7 @@ The execution time is given for the duration since the previous call. So the wei

    - Dude, show me the code ! + Dude, show me the code !

    @@ -1511,7 +1510,7 @@ The execution time is given for the duration since the previous call. So the wei

    - Dude, show me the code ! + Dude, show me the code !

    @@ -1562,7 +1561,7 @@ The execution time is given for the duration since the previous call. So the wei

    - Dude, show me the code ! + Dude, show me the code !

    @@ -1610,7 +1609,7 @@ ynh_debug_exec "your_command | other_command"

    - Dude, show me the code ! + Dude, show me the code !

    @@ -1706,7 +1705,7 @@ ynh_debug_exec "your_command | other_command"

    - Dude, show me the code ! + Dude, show me the code !

    @@ -3392,7 +3391,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -3451,7 +3450,267 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code ! +

    + + + + + + + + +
    +
    +
    +
    ynh_permission_create
    +
    Create a new permission for the app
    +
    +
    +
    +

    + + Usage: ynh_permission_create --permission "permission" [--url "url"] [--allowed group1 group2] + +

    + +

    + Arguments: +

      + + +
    • permission : the name for the permission (by default a permission named "main" already exist)
    • + + + +
    • url : (optional) URL for which access will be allowed/forbidden
    • + + + +
    • allowed : (optional) A list of group/user to allow for the permission
    • + + +
    +

    + + + +

    + Example: ynh_permission_create --permission admin --url /admin --allowed alice bob +

    + + + +

    + Details: +

    + If provided, 'url' 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' can be later treated as a 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]*$

    Requires YunoHost version 3.7.0 or higher.

    +

    +

    + +

    + Dude, show me the code ! +

    + +
    +
    + +
    + + + +
    +
    +
    +
    ynh_permission_delete
    +
    Remove a permission for the app (note that when the app is removed all permission is automatically removed)
    +
    +
    +
    +

    + + Usage: ynh_permission_delete --permission "permission" + +

    + +

    + Arguments: +

      + + +
    • 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 ! +

    + +
    +
    + +
    + + + +
    +
    +
    +
    ynh_permission_exists
    +
    Check if a permission exists
    +
    +
    +
    +

    + + Usage: ynh_permission_exists --permission=permission + +

    + +

    + Arguments: +

      + + +
    • -p, --permission : the permission to check
    • + + +
    +

    + + + + + +

    + Details: +

    + Requires YunoHost version 3.7.0 or higher.

    +

    +

    + +

    + Dude, show me the code ! +

    + +
    +
    + +
    + + + +
    +
    +
    +
    ynh_permission_url
    +
    Redefine the url associated to a permission
    +
    +
    +
    +

    + + Usage: ynh_permission_url --permission "permission" --url "url" + +

    + +

    + Arguments: +

      + + +
    • permission : the name for the permission (by default a permission named "main" is removed automatically when the app is removed)
    • + + + +
    • url : (optional) URL for which access will be allowed/forbidden
    • + + +
    +

    + + + + + +

    + Details: +

    + Requires YunoHost version 3.7.0 or higher.

    +

    +

    + +

    + Dude, show me the code ! +

    + +
    +
    + +
    + + + +
    +
    +
    +
    ynh_permission_update
    +
    Update a permission for the app
    +
    +
    +
    +

    + + Usage: ynh_permission_update --permission "permission" --add "group" ["group" ...] --remove "group" ["group" ...] + +

    + +

    + Arguments: +

      + + +
    • permission : the name for the permission (by default a permission named "main" already exist)
    • + + + +
    • add : the list of group or users to enable add to the permission
    • + + + +
    • remove : the list of group or users to remove from the permission
    • + + +
    +

    + + + +

    + Example: ynh_permission_update --permission admin --add samdoe --remove all_users Requires YunoHost version 3.7.0 or higher. +

    + + + +

    + Dude, show me the code !

    @@ -4359,7 +4618,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4410,7 +4669,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4473,7 +4732,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4524,7 +4783,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4564,7 +4823,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4611,7 +4870,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4655,7 +4914,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4706,7 +4965,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4753,7 +5012,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4800,7 +5059,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4836,7 +5095,7 @@ Please always call this script in install and restore scripts

    - Dude, show me the code ! + Dude, show me the code !

    @@ -4847,7 +5106,7 @@ Please always call this script in install and restore scripts -

    Generated by this script on 07/11/2019 (Yunohost version 3.6.4.3)

    +

    Generated by this script on 03/30/2020 (Yunohost version 3.7.0.12)

    + \ No newline at end of file