mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Create seafile user on install
This commit is contained in:
parent
d19f5aec2e
commit
e84fe12188
4 changed files with 19 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue