mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Merge branch 'testing'
This commit is contained in:
commit
933146054f
15 changed files with 46 additions and 56 deletions
|
@ -17,9 +17,9 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=333f32482b409de753b1fe2c010c25409da99fa7
|
||||
upgrade=1 from_commit=2574d127bca88b4dac8325b93c429c8160123719
|
||||
upgrade=1 from_commit=f9b9e934f6929bd564386f06c0352f0ef41b7619
|
||||
upgrade=1 from_commit=db11d890922564dfdcb7937a3a682957082fbb31
|
||||
upgrade=1 from_commit=67e0869de25f4f58710c3d30d5533356745ea676
|
||||
upgrade=1 from_commit=637a32aa57bc2dc6421e0e79d52862f0924be1cf
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
wrong_user=1
|
||||
|
@ -44,9 +44,9 @@
|
|||
Level 10=0
|
||||
|
||||
;;; Upgrade options
|
||||
; commit=333f32482b409de753b1fe2c010c25409da99fa7
|
||||
; commit=db11d890922564dfdcb7937a3a682957082fbb31
|
||||
name=Version 6.3.4 - branch Old_version_for_CI_3
|
||||
; commit=2574d127bca88b4dac8325b93c429c8160123719
|
||||
; commit=67e0869de25f4f58710c3d30d5533356745ea676
|
||||
name=Before move main dir to opt - branch Old_version_for_CI_2
|
||||
; commit=f9b9e934f6929bd564386f06c0352f0ef41b7619
|
||||
; commit=637a32aa57bc2dc6421e0e79d52862f0924be1cf
|
||||
name=The oldest installable version - branch Old_version_for_CI
|
||||
|
|
|
@ -20,9 +20,16 @@ install_source() {
|
|||
}
|
||||
|
||||
install_dependance() {
|
||||
ynh_install_app_dependencies python2.7 python-pip libpython2.7 python-setuptools python-ldap python-urllib3 python-simplejson python-imaging python-mysqldb python-flup expect python-requests python-dev ffmpeg python-memcache \
|
||||
libjpeg62-turbo-dev zlib1g-dev # For building pillow
|
||||
if [ "$(lsb_release --codename --short)" == "stretch" ]; then
|
||||
ynh_install_app_dependencies python2.7 python-pip libpython2.7 python-setuptools python-ldap python-urllib3 python-simplejson python-imaging python-mysqldb python-flup expect python-requests python-dev ffmpeg python-memcache \
|
||||
libjpeg62-turbo-dev zlib1g-dev # For building pillow
|
||||
else
|
||||
ynh_install_app_dependencies python2.7 python-pip libpython2.7 python-setuptools python-ldap python-urllib3 python-simplejson python-pil python-mysqldb python-flup expect python-requests python-dev ffmpeg python-memcache \
|
||||
libjpeg62-turbo-dev zlib1g-dev # For building pillow
|
||||
fi
|
||||
ynh_add_swap 2000
|
||||
# We need to do that because we can have some issue about the permission access to the pip cache without this
|
||||
set_permission
|
||||
# Note that we install imageio to force the dependance, without this imageio 2.8 is installed and it need python3.5
|
||||
sudo -u $seafile_user pip install --user --upgrade Pillow 'moviepy<1.0' 'imageio<2.8' certifi idna
|
||||
ynh_del_swap
|
||||
|
@ -31,7 +38,10 @@ install_dependance() {
|
|||
set_permission() {
|
||||
chown -R $seafile_user:$seafile_user $final_path
|
||||
# check that this directory exist because in some really old install the data could still be in the main seafile directory
|
||||
# We also check at the install time when data directory is not already initialised
|
||||
test -e /home/yunohost.app/seafile-data && chown -R $seafile_user:$seafile_user /home/yunohost.app/seafile-data
|
||||
# Well need to put this here because if test return false, set_permission also return false and the install fail
|
||||
true
|
||||
}
|
||||
|
||||
ynh_clean_setup () {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/expect
|
||||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_4.0_4.1.sh
|
||||
|
||||
expect "to contiune"
|
||||
send "\r";
|
||||
|
||||
expect "What is the root password for mysql?"
|
||||
send "$mysql_password\r";
|
||||
|
||||
interact
|
|
@ -2,11 +2,10 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_4.1_4.2.sh
|
||||
|
||||
expect "to contiune"
|
||||
send "\r";
|
||||
|
||||
interact
|
||||
interact
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_4.2_4.3.sh
|
||||
|
||||
expect "to contiune"
|
||||
send "\r";
|
||||
|
||||
interact
|
||||
interact
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_4.3_4.4.sh
|
||||
|
||||
expect "to contiune"
|
||||
send "\r";
|
||||
|
||||
interact
|
||||
interact
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_4.4_5.0.sh
|
||||
|
||||
expect "to contiune"
|
||||
send "\r";
|
||||
|
||||
interact
|
||||
interact
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_5.0_5.1.sh
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_5.1_6.0.sh
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_6.0_6.1.sh
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_6.1_6.2.sh
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_6.2_6.3.sh
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
set timeout 5
|
||||
|
||||
set seafile_dir [lindex $argv 0]
|
||||
set mysql_password [lindex $argv 1]
|
||||
|
||||
spawn $seafile_dir/upgrade/upgrade_6.3_7.0.sh
|
||||
|
||||
|
|
|
@ -67,6 +67,12 @@ ynh_app_setting_set --app $app --key installed_version --value $seafile_version
|
|||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Creating base directory..."
|
||||
mkdir -p $final_path
|
||||
mkdir -p $final_path/installed
|
||||
mkdir -p $final_path/logs
|
||||
mkdir -p $final_path/seafile-data
|
||||
|
||||
# Create User
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
ynh_system_user_create --username $seafile_user --home_dir $final_path
|
||||
|
@ -75,16 +81,10 @@ ynh_system_user_create --username $seafile_user --home_dir $final_path
|
|||
ynh_script_progression --message="Installing dependencies..." --weight=7
|
||||
install_dependance
|
||||
|
||||
# Copy files to the right place
|
||||
# Clean data directory
|
||||
ynh_script_progression --message="Cleaning data directory..."
|
||||
test -e $seafile_data && ynh_secure_remove --file="$seafile_data"
|
||||
|
||||
ynh_script_progression --message="Creating base directory..."
|
||||
mkdir -p $final_path
|
||||
mkdir -p $final_path/installed
|
||||
mkdir -p $final_path/logs
|
||||
mkdir -p $final_path/seafile-data
|
||||
|
||||
# Download new version from sources
|
||||
ynh_script_progression --message="Installing sources files..." --weight=7
|
||||
install_source
|
||||
|
|
|
@ -23,7 +23,6 @@ installed_version=$(ynh_app_setting_get --app $app --key installed_version)
|
|||
seahub_port=$(ynh_app_setting_get --app $app --key seahub_port)
|
||||
fileserver_port=$(ynh_app_setting_get --app $app --key fileserver_port)
|
||||
webdav_port=$(ynh_app_setting_get --app $app --key webdav_port)
|
||||
root_pwd=$(cat /etc/yunohost/mysql)
|
||||
final_path=$(ynh_app_setting_get --app $app --key final_path)
|
||||
seafile_user=$app
|
||||
|
||||
|
@ -71,6 +70,12 @@ if [ $final_path == "/var/www/$app" ]; then
|
|||
ynh_system_user_create --username $seafile_user --home_dir $final_path
|
||||
ynh_app_setting_set --app $app --key final_path --value $final_path
|
||||
test -e /var/log/seafile && rm /var/log/$app
|
||||
if ! [ -z "$(ls -A $final_path/seafile_data)" ]; then
|
||||
# Data directory empty, so considere that all data are already in /home/yunohost.app/seafile
|
||||
mv /opt/yunohost/$app/seafile-data/* /home/yunohost.app/seafile-data/
|
||||
ynh_secure_remove $final_path/seafile_data
|
||||
ln -s $seafile_data $final_path/seafile_data
|
||||
fi
|
||||
ln -s $final_path/logs /var/log/seafile
|
||||
set_permission
|
||||
fi
|
||||
|
@ -97,51 +102,51 @@ chmod +x $final_path/seafile-server-$seafile_version/upgrade/minor-upgrade.sh
|
|||
case $installed_version in
|
||||
"4.0."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_4.1.1.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
ynh_die "Upgrade form the version 4.0 was removed. Upgrade from this version won't be supported any more."
|
||||
;&
|
||||
"4.1."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_4.2.1.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_4.2.1.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"4.3."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_4.4.3.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_4.4.3.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"4.4."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_5.0.3.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_5.0.3.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"5.0."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_5.1.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_5.1.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"5.1."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_6.0.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_6.0.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"6.0."* )
|
||||
python3 ../conf/update_sso_conf.py || true
|
||||
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_6.1.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_6.1.exp $final_path/seafile-server-$seafile_version
|
||||
|
||||
# Enable manually wiki
|
||||
echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py
|
||||
;&
|
||||
"6.1."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_6.2.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_6.2.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"6.2."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_6.3.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_6.3.exp $final_path/seafile-server-$seafile_version
|
||||
|
||||
# Update logrotate to have the last version
|
||||
ynh_use_logrotate --logfile $final_path/logs --nonappend
|
||||
;&
|
||||
"6.3."* )
|
||||
# Update seafile by script
|
||||
expect_scripts/upgrade_7.0.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/upgrade_7.0.exp $final_path/seafile-server-$seafile_version
|
||||
# SSO authentication
|
||||
echo 'ENABLE_REMOTE_USER_AUTHENTICATION = True' | tee -a $final_path/conf/seahub_settings.py
|
||||
echo "REMOTE_USER_HEADER = 'HTTP_EMAIL'" | tee -a $final_path/conf/seahub_settings.py
|
||||
|
@ -155,7 +160,7 @@ case $installed_version in
|
|||
;&
|
||||
esac
|
||||
|
||||
expect_scripts/minor-upgrade.exp $final_path/seafile-server-$seafile_version $root_pwd
|
||||
expect_scripts/minor-upgrade.exp $final_path/seafile-server-$seafile_version
|
||||
|
||||
## Install webdav and logrotate if not installed
|
||||
if [[ $installed_version = "4.0."* ]] || [[ $installed_version = "4.1."* ]]
|
||||
|
|
Loading…
Reference in a new issue