1
0
Fork 0
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:
ericgaspar 2021-02-15 16:03:52 +01:00
parent 4f2dd7fe6b
commit d48f951085
No known key found for this signature in database
GPG key ID: 574F281483054D44
7 changed files with 20 additions and 57 deletions

View file

@ -1,6 +1,5 @@
# ZAP for YunoHost
[![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg)
[![Install Zap with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=zap)

View file

@ -1,2 +1,2 @@
# 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

View file

@ -17,7 +17,7 @@
"multi_instance": true,
"services": [
"nginx",
"php7.0-fpm",
"php7.3-fpm",
"mysql",
"postgresql"
],
@ -35,8 +35,8 @@
"name": "admin",
"type": "user",
"ask": {
"en": "Choose the ZAP administrator (must be an existing YunoHost user)",
"fr": "Choisissez l'administrateur de ZAP (doit être un utilisateur YunoHost existant)"
"en": "Choose the ZAP administrator",
"fr": "Choisissez l'administrateur de ZAP"
}
},
{

View file

@ -27,7 +27,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
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"
database="1"
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
@ -117,7 +117,6 @@ pushd "$final_path"
popd
# 3 - Some extra folders
ynh_script_progression --message="Creating smarty3 folder for personal data..."
@ -214,10 +213,7 @@ chown -R $app: $final_path
# Set 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_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
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
#=================================================
# 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"
#=================================================
# 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
#=================================================

View file

@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
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)
database=$(ynh_app_setting_get --app=$app --key=database)

View file

@ -125,9 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban
# Make app public
ynh_app_setting_set $app skipped_uris "/"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -35,6 +35,18 @@ if [ -z "$db_name" ]; then
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
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
#=================================================
@ -49,30 +61,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
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
#=================================================
@ -194,10 +182,7 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph
# Set 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_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
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
#=================================================
# UPGRADE DEPENDENCIES
@ -208,13 +193,6 @@ if [ $database -eq 2 ]; then
ynh_install_app_dependencies $pkg_dependencies
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
#=================================================