From 22486a6ac224f99dbaa675cd2cc52a3d44573789 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 12 Dec 2023 23:56:13 +0100 Subject: [PATCH 1/5] Iconsistent ynh_use_logrotate syntax --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index ded9798..a2b52d1 100644 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,7 @@ ynh_add_nginx_config # Use logrotate to manage application logfile(s) touch "$install_dir/data/log.txt" -ynh_use_logrotate "$install_dir/data/log.txt" --specific_user=$app +ynh_use_logrotate --logfile="$install_dir/data/log.txt" --specific_user=$app chown $app:www-data "$install_dir/data/log.txt" # Create a dedicated Fail2Ban config diff --git a/scripts/upgrade b/scripts/upgrade index 29c7413..31947bc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -65,7 +65,7 @@ then fi chown $app:www-data "$install_dir/data/log.txt" -ynh_use_logrotate --non-append --specific_user=$app +ynh_use_logrotate --logfile="$install_dir/data/log.txt" --non-append --specific_user=$app # Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s\s-\sLogin failed for user.*$" From 48435375a84af7038adbade9254992ac64a93d77 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 21 Dec 2023 15:02:50 +0100 Subject: [PATCH 2/5] This sounds like a very convoluted way to generate a 12-char random string ... --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a2b52d1..d19384a 100644 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ salt=$(php$phpversion -r 'echo sha1(uniqid("", true) ."_". mt_rand());') hash=$(echo -n "${password}${admin}${salt}" | sha1sum | awk '{print $1}') # Generate the API secret -secret=$(php${YNH_PHP_VERSION} -r "echo str_shuffle(substr(hash_hmac('sha512', uniqid('${salt}'), '${admin}'), 10, 12));") +secret=$(ynh_string_random 64) # Set default_private_links. By default, make them public if the app is public. if ynh_permission_has_user --permission=main --user=visitors From 085b9fefe55ef8637742f0f8199fdbaaae0ffa43 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 21 Dec 2023 15:13:24 +0100 Subject: [PATCH 3/5] This sounds like a very convoluted way to generate a 40-char random string ... --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d19384a..af595d8 100644 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 timezone=$(cat /etc/timezone) # Generate the salt -salt=$(php$phpversion -r 'echo sha1(uniqid("", true) ."_". mt_rand());') +salt=$(ynh_string_random 40) # Generate the hash with the password hash=$(echo -n "${password}${admin}${salt}" | sha1sum | awk '{print $1}') From 96f975bd21c8c179f8a29ce025d2cba5f04876b2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:38:40 +0100 Subject: [PATCH 4/5] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 915ce7d..f71a05e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://shaarli.readthedocs.io/en/master/" code = "https://github.com/shaarli/Shaarli" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.9" architectures = "all" multi_instance = true From fb7ef80b9a91014b1972355afa95cbf1b9d0ec18 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 28 Dec 2023 01:03:44 +0100 Subject: [PATCH 5/5] Update manifest.toml: bump version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f71a05e..72dbf81 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Shaarli" description.en = "Save, sort, synchronize and share web addresses" description.fr = "Sauvegarder, trier, synchroniser et partager des adresses web" -version = "0.12.2~ynh1" +version = "0.12.2~ynh2" maintainers = ["Lapineige"]