diff --git a/scripts/install b/scripts/install index 10d9d77..0619b38 100644 --- a/scripts/install +++ b/scripts/install @@ -72,6 +72,9 @@ ynh_mysql_create_db ccnetdb "$dbuser" "$db_pwd" ynh_mysql_create_db seafiledb "$dbuser" "$db_pwd" ynh_mysql_create_db seahubdb "$dbuser" "$db_pwd" +# Create User +ynh_system_user_create $seafile_user $final_path + # Run install script chmod +x ../conf/install.exp chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh @@ -155,6 +158,7 @@ fi # Add logrotate ynh_use_logrotate $final_path/logs +ln -s $final_path/logs /var/log/seafile-server # register yunohost service yunohost service add seafile-server diff --git a/scripts/remove b/scripts/remove index 8c17dd8..0badde3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,12 +25,16 @@ ynh_secure_remove /opt/yunohost/$app ynh_secure_remove /etc/init.d/seafile-server ynh_secure_remove /home/yunohost.app/seafile-data ynh_secure_remove /tmp/seahub_cache +ynh_secure_remove /var/log/seafile-server # Remove databases ynh_mysql_drop_db ccnetdb ynh_mysql_drop_db seafiledb ynh_mysql_drop_db seahubdb +# Remove user +ynh_system_user_delete seafile + # Remove depandance ynh_remove_app_dependencies diff --git a/scripts/restore b/scripts/restore index d5840ae..4ab92eb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,9 +9,6 @@ ynh_abort_if_errors # Import common cmd source ../settings/scripts/_common.sh -# Init get Final path -get_configuration - # Retrieve arguments domain=$(ynh_app_setting_get $app domain) path=$(ynh_normalize_url_path $(ynh_app_setting_get $app path)) @@ -29,6 +26,9 @@ ynh_restore # Get configuration for user and final path get_configuration +# Create user if it need +[[ $seafile_user = "seafile" ]] && ynh_system_user_create $seafile_user $final_path + # Restore mysql dump dbuser=seafile ynh_mysql_create_db ccnetdb "$dbuser" "$db_pwd" diff --git a/scripts/upgrade b/scripts/upgrade index 2649855..a5fa8d0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,6 +83,13 @@ case $installed_version in # Update seafile by script ../conf/upgrade_6.2.exp $final_path/seafile-server-$seafile_version $root_pwd ;& +# "6.2."* ) +# # Update seafile by script +# ../conf/upgrade_6.3.exp $final_path/seafile-server-$seafile_version $root_pwd +# +# # Update logrotate to have the last version +# ynh_use_logrotate $final_path/logs --non-append +# ;& esac ../conf/minor-upgrade.exp $final_path/seafile-server-$seafile_version $root_pwd @@ -114,8 +121,7 @@ then echo "STATIC_URL = MEDIA_URL + 'assets/'" | tee -a $final_path/conf/seahub_settings.py # Add logrotate - ynh_use_logrotate $final_path/logs/seaf-server.log - ynh_use_logrotate $final_path/logs/ccnet.log + ynh_use_logrotate $final_path/logs fi # Update seahub config for old version to version 5.0.4