Commit graph

113 commits

Author SHA1 Message Date
Alexandre Aubin
3e1c9ebaf7 Fix getopts error handling ... 2024-06-29 19:21:08 +02:00
Alexandre Aubin
44bbc34967
Merge pull request #1716 from Salamandar/ynh_secure_remove
Fix ynh_safe_rm: check if target is not a broken symlink before erorring out.
2024-06-29 17:23:50 +02:00
Alexandre Aubin
7b2959a3eb helpers2.1: forgot to rename the apt call in mongodb helpers 2024-06-29 17:18:20 +02:00
Alexandre Aubin
1dfc47d1d7 helpers2.1: in logrotate, make sure to also chown $app the log dir 2024-06-28 20:21:56 +02:00
Alexandre Aubin
ef68485c5f Use the group defined in the manifest by default 2024-06-28 19:24:07 +02:00
Alexandre Aubin
656ff823a9 Also handle files in /etc/$app 2024-06-28 18:56:18 +02:00
Alexandre Aubin
ae3018cdd0 Infer the necessity to use www-data as group from the presence of alias or root in nginx.conf 2024-06-28 18:39:12 +02:00
Alexandre Aubin
8b8768fd77 Only set www-data as group for webapps 2024-06-28 18:09:49 +02:00
Alexandre Aubin
75d7042974
Update helpers/helpers.v2.1.d/utils: use regex matching to check if path is child from a parent path 2024-06-28 16:56:28 +02:00
Alexandre Aubin
3b26ccc2a5 Properly handle case where $parent is empty to simplify condition 2024-06-28 16:55:39 +02:00
Alexandre Aubin
3608c5678c Proper 'if' cases to distinguish between $install_dir vs regular files in $install_dir and $data_dir 2024-06-28 16:45:43 +02:00
Alexandre Aubin
d9d404a5b2 ynh_setup_source: apply default perms *after* extracting files to hopefully remove the need to manually chown/chmod 2024-06-28 16:06:40 +02:00
8846381d47 Rework _ynh_apply_default_permissions, only check if target is a child of install_dir. 2024-06-28 16:03:17 +02:00
650481a58a ynh_safe_rm: Check if target is a symlink
When calling ynh_safe_rm to a broken symlink, the function was erroring out.
(test -e was following the symlink and returning false)
We need to also check if it is a symlink before exiting.
2024-06-28 15:01:59 +02:00
Alexandre Aubin
997388dc79 helpers2.1: fix __PATH__/ handling 2024-06-25 14:16:04 +02:00
Alexandre Aubin
e3bebeac98 helpers2.1: typo in getopts 2024-06-24 22:13:16 +02:00
Alexandre Aubin
2af4c157d9 helpers/mongo: less noisy output when checking the avx flag is here in /proc/cpuinfo 2024-06-24 21:35:35 +02:00
Alexandre Aubin
0aad13cd2f helpers2.1: oopsies in apt helper 2024-06-24 19:11:28 +02:00
Alexandre Aubin
2895d4d99b helpers: Misc cleaning / reorganizing to prepare new doc 2024-06-24 17:42:37 +02:00
Alexandre Aubin
1fb80e5d24 helpers2.1: drop ynh_apps helper because only a single app is using it ... 2024-06-24 06:09:58 +02:00
Alexandre Aubin
30467f8bc3 helpers2.1: fix bad syntax in ynh_app_upstream_version 2024-06-23 20:04:17 +02:00
Alexandre Aubin
d8c3ff4c8a helpers2.1: forgot to propagate the 'goenv latest' fix from helpers v1 2024-06-23 16:35:58 +02:00
Alexandre Aubin
2b1f74268f helpers2.1: var rename / cosmetic etc for nodejs/ruby/go version and install directories 2024-06-23 15:21:25 +02:00
Alexandre Aubin
5f6df6a859 helpers2.1: for some reason sudo -E doesn't preserve PATH even though it's exported, so we gotta explicitly use --preserve-env=PATH 2024-06-23 14:49:11 +02:00
Alexandre Aubin
b3409729a6 helpers2.1: when using ynh_systemctl to reload/start/restart a service with a wait_until and it timesout, handle it as a filure rather than keep going 2024-06-23 14:36:55 +02:00
Alexandre Aubin
9298738d06 helpers2.1: display 100 lines instead of 20 in CI context when service fails to start 2024-06-23 14:30:57 +02:00
Alexandre Aubin
262453f132 helpers2.1: change default timeout of ynh_systemctl to 60s instead of 300s 2024-06-23 14:27:37 +02:00
Alexandre Aubin
d4857834f3 helpers2.1: sudo -u$app -> sudo -u $app 2024-06-23 14:13:17 +02:00
Alexandre Aubin
3942ea12ae helpers2.1: fix ynh_config_add_logrotate when no arg is passed 2024-06-23 14:08:31 +02:00
Alexandre Aubin
be3df69326
Merge pull request #1873 from YunoHost/ynh_app_setting_set_default
helpers: add a new ynh_app_setting_set_default to replace the unecessarily complex 'if [ -z ${foo:-} ]' trick
2024-06-23 00:59:26 +02:00
Alexandre Aubin
7caf7e8b3e
Merge pull request #1874 from YunoHost/rework_fpm_settings_madness
helpers2.1: rework the fpm usage/footprint madness
2024-06-23 00:59:00 +02:00
Alexandre Aubin
e558513609 helpers2.1: fix positional arg parsing in ynh_psql_create_user 2024-06-22 22:52:31 +02:00
Alexandre Aubin
3d728d90ce helpers2.1: rework the fpm usage/footprint madness 2024-06-22 01:59:18 +02:00
Alexandre Aubin
1b5074d857 helpers: add a new ynh_app_setting_set_default to replace the unecessarily complex 'if [ ${foo:-} ]' trick 2024-06-21 18:30:05 +02:00
Alexandre Aubin
dd8db1883a helpers2.1: drop unused 'local source' mechanism from ynh_setup_source 2024-06-21 16:26:14 +02:00
Alexandre Aubin
06c8fbc881 logs: misc ad-hoc tweaks to limit the noise in log sharing 2024-06-21 16:26:07 +02:00
Alexandre Aubin
41b958113a helpers2.1: unbound var @_@ 2024-06-20 19:06:14 +02:00
e0a9bafde2 helpers.v2.1: Add ynh_in_ci_tests to check if the scripts are running in CI or not 2024-06-20 16:37:22 +02:00
Alexandre Aubin
eab36d069d helper2.1: refactor composer helper again: workdir is $install_dir unless $composer_workdir is defined. ynh_composer_install only downloads composer. ynh_composer_exec runs composer command as $app unless composer_user=root is defined prior to calling the helper 2024-06-20 16:15:57 +02:00
Alexandre Aubin
b47aedc932 helpers: remove god forsaken clumsy node_update cron job >_> 2024-06-20 14:02:56 +02:00
Alexandre Aubin
f22c6ec3e9 helpers2.1: ynh_systemd_action -> ynh_systemctl 2024-06-20 13:47:05 +02:00
Alexandre Aubin
d9b9aa1884 helpers2.1: use positional args for file checksum helpers 2024-06-20 13:44:09 +02:00
Alexandre Aubin
b8a1a3a660 helpers2.1: ynh_config_remove_systemd now uses positional 2024-06-19 23:45:37 +02:00
Alexandre Aubin
6b6580a919 helpers2.1: further simplify logging helpers by removing the --message (ynh_script_progression too, no more args except the message) 2024-06-19 23:40:53 +02:00
Alexandre Aubin
11e2b6d63c helpers2.1: ynh_systemd_action '--line_match' -> '--wait_until' 2024-06-19 23:19:19 +02:00
Alexandre Aubin
218bf107fb helpers2.1: rename everything again, i.e. ynh_{nodejs|ruby|composer|...}_install/remove (to have a proper ynh_{tech}_ prefix like we have for mysql/psql helpers) + same idea for ynh_config_add_{nginx|phpfpm|systemd|...} instead of ynh_add_foo_config 2024-06-19 17:06:22 +02:00
Alexandre Aubin
8f8070983d helpers2.1: rework the 'apt' helper: effectivement call them ynh_install/remove_apt_dependencies (instead of 'app_dependencies'...), remove unused stuff, bloat and unecessary non-linear flows... 2024-06-19 04:07:07 +02:00
Alexandre Aubin
5a6a8e6c73 helpers2.1: fix unecessary change in ynh_read_manifest, key shouldnt need to be prefixed with . 2024-06-16 14:12:11 +02:00
Alexandre Aubin
800f93d12e helpers2.1: further simplify mysql/postgresql helper: no keyword arg, remove ynh_foo_setup_db and ynh_foo_remove_db (the other helpers are enough), replace ynh_foosql_connect_as/ynh_foosql_execute* with a single ynh_foosql_db_shell that reads stdin 2024-06-13 12:39:05 +02:00
Alexandre Aubin
3584e6a5b1 helpers2.1: remove legacy ynh_add_app_dependencies 2024-06-13 11:28:59 +02:00