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

Merge pull request #46 from YunoHost-Apps/master

Align testing with master
This commit is contained in:
lapineige 2019-07-28 08:29:42 +02:00 committed by GitHub
commit b419a8870e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -16,7 +16,7 @@
},
"url": "https://github.com/shaarli/Shaarli",
"license": "MIT",
"version": "0.10.4~ynh1",
"version": "0.10.4~ynh2",
"multi_instance": true,
"services": [
"nginx",
@ -50,6 +50,10 @@
"en": "Is it a public Shaarli site ?",
"fr": "Est-ce un site Shaarli public ?"
},
"help": {
"en": "If set as public, Shaarli will be visible to anyone, including non-Yunohost users. However only Shaarli users can add bookmarks. Set this to public if you want people to see your (public) bookmarks",
"fr": "Si configuré en public, Shaarli sera visible par tout le monde, y compris des personnes sans compte sur votre Yunohost. Cependant seules les personnes avec un compte Shaarli pourrons ajouter des marques-pages. Activer la visibilité publique si vous voulez que les gens voient vos marques-pages (publiques)."
},
"default": false
}
]

View file

@ -31,7 +31,7 @@ pkg_dependencies="php-cli php-gettext php-curl php-intl php-gd php-mbstring open
# | arg: failregex - Failregex to be looked for by fail2ban
# | arg: max_retry - Maximum number of retries allowed before banning IP address - default: 3
# | arg: ports - Ports blocked for a banned IP address - default: http,https
ynh_add_fail2ban_config () {
ynh_add_fail2ban_config_temp () {
# Process parameters
logpath=$1
failregex=$2
@ -66,7 +66,7 @@ EOF
ynh_store_file_checksum "$finalfail2banjailconf"
ynh_store_file_checksum "$finalfail2banfilterconf"
systemctl restart fail2ban
service fail2ban restart
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
if [ -n "$fail2ban_error" ]
then

View file

@ -131,8 +131,8 @@ ynh_add_fpm_config
# set proper permissions
ynh_print_info "Set permissions..."
sudo find $final_path -type f | xargs sudo chmod 644
sudo find $final_path -type d | xargs sudo chmod 755
find $final_path -type f | xargs sudo chmod 644
find $final_path -type d | xargs sudo chmod 755
# Set right permissions for curl install
ynh_print_info "Set rights..."
@ -159,7 +159,7 @@ ynh_use_logrotate "$final_path/data/log.txt"
# SETUP FAIL2BAN
#=================================================
ynh_print_info "Add Fail2Ban configuration..."
ynh_add_fail2ban_config "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
ynh_add_fail2ban_config_temp "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
#=================================================
# SETUP SSOWAT

View file

@ -76,6 +76,8 @@ path_url=$(ynh_normalize_url_path $path_url)
tmpdir="$(ynh_smart_mktemp 600)"
# Backup the config file in the temp dir
cp -a "$final_path/data" "$tmpdir/"
# Backup the theme file in the temp dir
cp -a "$final_path/tpl" "$tmpdir/"
# Remove the app directory securely
ynh_secure_remove "$final_path"
@ -87,6 +89,7 @@ ynh_print_info "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
sudo cp -a "$tmpdir/data" "${final_path}/"
sudo cp -a "$tmpdir/tpl" "${final_path}/"
sudo rm -Rf "$tmpdir"
#=================================================
@ -132,7 +135,7 @@ ynh_use_logrotate --non-append
# SETUP FAIL2BAN
#=================================================
ynh_print_info "Upgrading Fail2Ban configuration..."
ynh_add_fail2ban_config "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
ynh_add_fail2ban_config_temp "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
# Set right permissions
chown -R $app: $final_path