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:
commit
595ff32cbf
3 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -51,13 +51,13 @@ 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}')
|
||||
|
||||
# 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
|
||||
|
|
|
@ -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<HOST>\s-\sLogin failed for user.*$"
|
||||
|
|
Loading…
Reference in a new issue