diff --git a/helpers/helpers.v1.d/mongodb b/helpers/helpers.v1.d/mongodb index 587a1cb6f3..1afa9d8eec 100644 --- a/helpers/helpers.v1.d/mongodb +++ b/helpers/helpers.v1.d/mongodb @@ -19,7 +19,6 @@ # # Execute a mongo command -# # example: ynh_mongo_exec --command='db.getMongo().getDBNames().indexOf("wekan")' # example: ynh_mongo_exec --command="db.getMongo().getDBNames().indexOf(\"wekan\")" # @@ -33,7 +32,6 @@ # | arg: -c, --command= - The command to evaluate # | arg: -e, --eval - Evaluate instead of execute the command. # -# ynh_mongo_exec() { # Declare an array to define the options of this helper. local legacy_args=upadhPce diff --git a/helpers/helpers.v2.1.d/fail2ban b/helpers/helpers.v2.1.d/fail2ban index 9eba988db3..c2c3a9a7f3 100644 --- a/helpers/helpers.v2.1.d/fail2ban +++ b/helpers/helpers.v2.1.d/fail2ban @@ -30,6 +30,7 @@ # `../conf/f2b_jail.conf` and `../conf/f2b_filter.conf` # # They will typically look like (for example here for synapse): +# # ``` # f2b_jail.conf: # [__APP__] @@ -39,6 +40,7 @@ # logpath = /var/log/__APP__/logfile.log # maxretry = 5 # ``` +# # ``` # f2b_filter.conf: # [INCLUDES] @@ -54,16 +56,17 @@ # ignoreregex = # ``` # -# ##### Regarding the the `failregex` option: +# ##### Regarding the the `failregex` option # # regex to match the password failure messages in the logfile. The host must be # matched by a group named "`host`". The tag "``" can be used for standard # IP/hostname matching and is only an alias for `(?:::f{4,6}:)?(?P[\w\-.^_]+)` # # You can find some more explainations about how to make a regex here : -# https://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Filters +# # # To validate your regex you can test with this command: +# # ``` # fail2ban-regex /var/log/YOUR_LOG_FILE_PATH /etc/fail2ban/filter.d/YOUR_APP.conf # ``` diff --git a/helpers/helpers.v2.1.d/go b/helpers/helpers.v2.1.d/go index 38fa4f09d8..af909d62bf 100644 --- a/helpers/helpers.v2.1.d/go +++ b/helpers/helpers.v2.1.d/go @@ -53,6 +53,7 @@ _ynh_load_go_in_path_and_other_tweaks() { # # The helper adds the appropriate, specific version of go to the `$PATH` variable (which # is preserved when calling `ynh_exec_as_app`). Also defines: +# # - `$path_with_go` (the value of the modified `$PATH`, but you dont really need it?) # - `$go_dir` (the directory containing the specific go version) # diff --git a/helpers/helpers.v2.1.d/multimedia b/helpers/helpers.v2.1.d/multimedia index ef9e2a5d65..226dddf978 100644 --- a/helpers/helpers.v2.1.d/multimedia +++ b/helpers/helpers.v2.1.d/multimedia @@ -67,12 +67,12 @@ ynh_multimedia_build_main_dir() { setfacl -RL -m m::rwx "$MEDIA_DIRECTORY" || true } -# Add a directory in yunohost.multimedia +# Add a directory in `yunohost.multimedia` # # usage: ynh_multimedia_addfolder --source_dir="source_dir" --dest_dir="dest_dir" # # | arg: --source_dir= - Source directory - The real directory which contains your medias. -# | arg: --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia" +# | arg: --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to `/home/yunohost.multimedia` # # This "directory" will be a symbolic link to a existing directory. ynh_multimedia_addfolder() { diff --git a/helpers/helpers.v2.1.d/nginx b/helpers/helpers.v2.1.d/nginx index 7455da4657..92539cca8c 100644 --- a/helpers/helpers.v2.1.d/nginx +++ b/helpers/helpers.v2.1.d/nginx @@ -27,6 +27,7 @@ # format and how placeholders are replaced with actual variables. # # Additionally, ynh_config_add_nginx will replace: +# # - `#sub_path_only` by empty string if `path` is not `'/'` # - `#root_path_only` by empty string if `path` *is* `'/'` # diff --git a/helpers/helpers.v2.1.d/nodejs b/helpers/helpers.v2.1.d/nodejs index 19ffa87772..9d10a3de86 100644 --- a/helpers/helpers.v2.1.d/nodejs +++ b/helpers/helpers.v2.1.d/nodejs @@ -55,6 +55,7 @@ _ynh_load_nodejs_in_path_and_other_tweaks() { # # The helper adds the appropriate, specific version of nodejs to the `$PATH` variable (which # is preserved when calling ynh_exec_as_app). Also defines: +# # - `$path_with_nodejs` to be used in the systemd config (`Environment="PATH=__PATH_WITH_NODEJS__"`) # - `$nodejs_dir`, the directory containing the specific version of nodejs, which may be used in the systemd config too (e.g. `ExecStart=__NODEJS_DIR__/node foo bar`) ynh_nodejs_install() { @@ -120,6 +121,7 @@ ynh_nodejs_install() { # usage: ynh_nodejs_remove # # This helper will check if another app uses the same version of node. +# # - If not, this version of node will be removed. # - If no other app uses node, n will be also removed. ynh_nodejs_remove() { diff --git a/helpers/helpers.v2.1.d/ruby b/helpers/helpers.v2.1.d/ruby index 8059c2f015..1ae31ca2e7 100644 --- a/helpers/helpers.v2.1.d/ruby +++ b/helpers/helpers.v2.1.d/ruby @@ -55,6 +55,7 @@ _ynh_load_ruby_in_path_and_other_tweaks() { # # The helper adds the appropriate, specific version of ruby to the `$PATH` variable (which # is preserved when calling ynh_exec_as_app). Also defines: +# # - `$path_with_ruby` to be used in the systemd config (`Environment="PATH=__PATH_WITH_RUBY__"`) # - `$ruby_dir`, the directory containing the specific version of ruby, which may be used in the systemd config too (e.g. `ExecStart=__RUBY_DIR__/ruby foo bar`) # diff --git a/helpers/helpers.v2.1.d/sources b/helpers/helpers.v2.1.d/sources index 30f80efb26..0666a3f32a 100644 --- a/helpers/helpers.v2.1.d/sources +++ b/helpers/helpers.v2.1.d/sources @@ -59,6 +59,7 @@ # ``` # # You may also define assets url and checksum per-architectures such as: +# # ```toml # [resources.sources] # [resources.sources.main] @@ -71,6 +72,7 @@ # In which case `ynh_setup_source --dest_dir="$install_dir"` will automatically pick the appropriate source depending on the arch # # The helper will: +# # - Download the specific URL if there is no local archive # - Check the integrity with the specific sha256 sum # - Uncompress the archive to `$dest_dir`. diff --git a/helpers/helpers.v2.1.d/systemuser b/helpers/helpers.v2.1.d/systemuser index 5fbd0b6840..7d2b56e98a 100644 --- a/helpers/helpers.v2.1.d/systemuser +++ b/helpers/helpers.v2.1.d/systemuser @@ -57,10 +57,13 @@ ynh_system_group_exists() { # | arg: --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) # # 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 # ``` diff --git a/helpers/helpers.v2.1.d/templating b/helpers/helpers.v2.1.d/templating index 6ca4316eb9..2cff048dc7 100644 --- a/helpers/helpers.v2.1.d/templating +++ b/helpers/helpers.v2.1.d/templating @@ -48,7 +48,7 @@ # mode ain't enough because you need conditional blocks or loops. # # For a full documentation of jinja's syntax you can refer to: -# https://jinja.palletsprojects.com/en/3.1.x/templates/ +# # # Note that in YunoHost context, all variables are from shell variables and therefore are strings # @@ -90,7 +90,7 @@ ynh_config_add() { if [[ "$jinja" == 1 ]]; then # This is ran in a subshell such that the "export" does not "contaminate" the main process - ( + ( export $(compgen -v) j2 "$template_path" -f env -o $destination ) @@ -167,6 +167,8 @@ _ynh_replace_vars() { # if you have several identical keys in your files # # Example of line this helpers can managed correctly +# +# ```text # .yml # title: YunoHost documentation # email: 'yunohost@yunohost.org' @@ -186,6 +188,8 @@ _ynh_replace_vars() { # USER = 8102 # user = 'https://donate.local' # CUSTOM['user'] = 'YunoHost' +# ``` +# ynh_read_var_in_file() { # ============ Argument parsing ============= local -A args_array=([f]=file= [k]=key= [a]=after=)