mirror of
https://github.com/YunoHost-Apps/zap_ynh.git
synced 2024-09-03 20:36:07 +02:00
Small fixes
This commit is contained in:
parent
4f2dd7fe6b
commit
d48f951085
7 changed files with 20 additions and 57 deletions
|
@ -1,6 +1,5 @@
|
||||||
# ZAP for YunoHost
|
# ZAP for YunoHost
|
||||||
|
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/zap)  
|
[](https://dash.yunohost.org/appci/app/zap)  
|
||||||
[](https://install-app.yunohost.org/?app=zap)
|
[](https://install-app.yunohost.org/?app=zap)
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Run poller periodically to update Hubzilla
|
# Run poller periodically to update Hubzilla
|
||||||
*/10 * * * * __USER__ cd YNH_WWW_PATH; /usr/bin/php__PHP_VERSION__ Zotlabs/Daemon/Master.php Cron > /dev/null 2>&1
|
*/10 * * * * __APP__ cd __FINALPATH__; /usr/bin/php__PHPVERSION__ Zotlabs/Daemon/Master.php Cron > /dev/null 2>&1
|
|
@ -17,7 +17,7 @@
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php7.0-fpm",
|
"php7.3-fpm",
|
||||||
"mysql",
|
"mysql",
|
||||||
"postgresql"
|
"postgresql"
|
||||||
],
|
],
|
||||||
|
@ -35,8 +35,8 @@
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose the ZAP administrator (must be an existing YunoHost user)",
|
"en": "Choose the ZAP administrator",
|
||||||
"fr": "Choisissez l'administrateur de ZAP (doit être un utilisateur YunoHost existant)"
|
"fr": "Choisissez l'administrateur de ZAP"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
email=$(yunohost user info $admin | grep "mail:" | cut -d' ' -f2)
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
upload="256M"
|
upload="256M"
|
||||||
database="1"
|
database="1"
|
||||||
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
|
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
|
||||||
|
@ -117,7 +117,6 @@ pushd "$final_path"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 3 - Some extra folders
|
# 3 - Some extra folders
|
||||||
ynh_script_progression --message="Creating smarty3 folder for personal data..."
|
ynh_script_progression --message="Creating smarty3 folder for personal data..."
|
||||||
|
|
||||||
|
@ -214,10 +213,7 @@ chown -R $app: $final_path
|
||||||
|
|
||||||
# Set up cron job
|
# Set up cron job
|
||||||
ynh_script_progression --message="Setting up cron job..."
|
ynh_script_progression --message="Setting up cron job..."
|
||||||
ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/poller-cron"
|
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
|
||||||
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/poller-cron"
|
|
||||||
ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file="../conf/poller-cron"
|
|
||||||
cp ../conf/poller-cron /etc/cron.d/$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
@ -241,13 +237,6 @@ ynh_script_progression --message="Add Fail2Ban..."
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
|
ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
|
||||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user="$db_name"
|
db_user=$db_name
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
database=$(ynh_app_setting_get --app=$app --key=database)
|
database=$(ynh_app_setting_get --app=$app --key=database)
|
||||||
|
|
||||||
|
|
|
@ -125,9 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
||||||
ynh_systemd_action --action=restart --service_name=fail2ban
|
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
||||||
# Make app public
|
|
||||||
ynh_app_setting_set $app skipped_uris "/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -35,6 +35,18 @@ if [ -z "$db_name" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$final_path" ]; then
|
||||||
|
final_path=/var/www/$app
|
||||||
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -49,30 +61,6 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD UPGRADE STEPS
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
|
||||||
|
|
||||||
# Create a temporary directory
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
# ynh_secure_remove "$final_path"
|
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
|
||||||
if [ -z "$final_path" ]; then
|
|
||||||
final_path=/var/www/$app
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -194,10 +182,7 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph
|
||||||
|
|
||||||
# Set cron job
|
# Set cron job
|
||||||
ynh_print_info "Setting up cron job..."
|
ynh_print_info "Setting up cron job..."
|
||||||
ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/poller-cron"
|
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
|
||||||
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/poller-cron"
|
|
||||||
ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file="../conf/poller-cron"
|
|
||||||
cp -f ../conf/poller-cron /etc/cron.d/$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
|
@ -208,13 +193,6 @@ if [ $database -eq 2 ]; then
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue