1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Merge remote-tracking branch 'origin/testing' into ci-auto-update-0.13.0

This commit is contained in:
ericgaspar 2023-12-28 09:00:56 +01:00
commit 595ff32cbf
3 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@ admindoc = "https://shaarli.readthedocs.io/en/master/"
code = "https://github.com/shaarli/Shaarli" code = "https://github.com/shaarli/Shaarli"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.9"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true

View file

@ -34,7 +34,7 @@ ynh_add_nginx_config
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
touch "$install_dir/data/log.txt" 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" chown $app:www-data "$install_dir/data/log.txt"
# Create a dedicated Fail2Ban config # Create a dedicated Fail2Ban config
@ -51,13 +51,13 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
timezone=$(cat /etc/timezone) timezone=$(cat /etc/timezone)
# Generate the salt # Generate the salt
salt=$(php$phpversion -r 'echo sha1(uniqid("", true) ."_". mt_rand());') salt=$(ynh_string_random 40)
# Generate the hash with the password # Generate the hash with the password
hash=$(echo -n "${password}${admin}${salt}" | sha1sum | awk '{print $1}') hash=$(echo -n "${password}${admin}${salt}" | sha1sum | awk '{print $1}')
# Generate the API secret # 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. # Set default_private_links. By default, make them public if the app is public.
if ynh_permission_has_user --permission=main --user=visitors if ynh_permission_has_user --permission=main --user=visitors

View file

@ -65,7 +65,7 @@ then
fi fi
chown $app:www-data "$install_dir/data/log.txt" 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 # Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s<HOST>\s-\sLogin failed for user.*$" ynh_add_fail2ban_config --logpath="$install_dir/data/log.txt" --failregex="\s-\s<HOST>\s-\sLogin failed for user.*$"