mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
commit
979ad8a39e
5 changed files with 28 additions and 2 deletions
|
@ -34,7 +34,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# BACKUP FAIL2BAN CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -68,6 +68,18 @@ ynh_add_config --template="../conf/addon.config.php" --destination="$install_dir
|
||||||
mkdir -p "$install_dir/view/smarty3"
|
mkdir -p "$install_dir/view/smarty3"
|
||||||
chmod -R 775 "$install_dir/view/smarty3"
|
chmod -R 775 "$install_dir/view/smarty3"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SETUP A CRON
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Setting up the cron job..." --weight=1
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||||
|
chown root: "/etc/cron.d/$app"
|
||||||
|
chmod 644 "/etc/cron.d/$app"
|
||||||
|
|
||||||
|
# Create a dedicated Fail2Ban config
|
||||||
|
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL FRIENDICA
|
# INSTALL FRIENDICA
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -32,7 +32,9 @@ ynh_remove_nginx_config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
#ynh_remove_logrotate
|
||||||
|
|
||||||
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -42,6 +42,10 @@ systemctl enable $app.service --quiet
|
||||||
|
|
||||||
yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
|
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -88,6 +88,9 @@ ynh_add_nginx_config
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low
|
ynh_add_fpm_config --usage=low --footprint=low
|
||||||
|
|
||||||
|
# Create a dedicated Fail2Ban config
|
||||||
|
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"<HOST>\".*$"
|
||||||
|
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Friendica daemon" --log="/var/log/$app/$app.log"
|
||||||
|
|
Loading…
Add table
Reference in a new issue