Merge branch 'testing'

This commit is contained in:
Josué Tille 2020-05-05 21:56:49 +02:00
commit 933146054f
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
15 changed files with 46 additions and 56 deletions

View file

@ -17,9 +17,9 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=333f32482b409de753b1fe2c010c25409da99fa7 upgrade=1 from_commit=db11d890922564dfdcb7937a3a682957082fbb31
upgrade=1 from_commit=2574d127bca88b4dac8325b93c429c8160123719 upgrade=1 from_commit=67e0869de25f4f58710c3d30d5533356745ea676
upgrade=1 from_commit=f9b9e934f6929bd564386f06c0352f0ef41b7619 upgrade=1 from_commit=637a32aa57bc2dc6421e0e79d52862f0924be1cf
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
wrong_user=1 wrong_user=1
@ -44,9 +44,9 @@
Level 10=0 Level 10=0
;;; Upgrade options ;;; Upgrade options
; commit=333f32482b409de753b1fe2c010c25409da99fa7 ; commit=db11d890922564dfdcb7937a3a682957082fbb31
name=Version 6.3.4 - branch Old_version_for_CI_3 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 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 name=The oldest installable version - branch Old_version_for_CI

View file

@ -20,9 +20,16 @@ install_source() {
} }
install_dependance() { 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 \ if [ "$(lsb_release --codename --short)" == "stretch" ]; then
libjpeg62-turbo-dev zlib1g-dev # For building pillow 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 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 # 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 sudo -u $seafile_user pip install --user --upgrade Pillow 'moviepy<1.0' 'imageio<2.8' certifi idna
ynh_del_swap ynh_del_swap
@ -31,7 +38,10 @@ install_dependance() {
set_permission() { set_permission() {
chown -R $seafile_user:$seafile_user $final_path 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 # 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 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 () { ynh_clean_setup () {

View file

@ -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

View file

@ -2,11 +2,10 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_4.1_4.2.sh spawn $seafile_dir/upgrade/upgrade_4.1_4.2.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";
interact interact

View file

@ -2,11 +2,10 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_4.2_4.3.sh spawn $seafile_dir/upgrade/upgrade_4.2_4.3.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";
interact interact

View file

@ -2,11 +2,10 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_4.3_4.4.sh spawn $seafile_dir/upgrade/upgrade_4.3_4.4.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";
interact interact

View file

@ -2,11 +2,10 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_4.4_5.0.sh spawn $seafile_dir/upgrade/upgrade_4.4_5.0.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";
interact interact

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_5.0_5.1.sh spawn $seafile_dir/upgrade/upgrade_5.0_5.1.sh

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_5.1_6.0.sh spawn $seafile_dir/upgrade/upgrade_5.1_6.0.sh

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_6.0_6.1.sh spawn $seafile_dir/upgrade/upgrade_6.0_6.1.sh

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_6.1_6.2.sh spawn $seafile_dir/upgrade/upgrade_6.1_6.2.sh

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_6.2_6.3.sh spawn $seafile_dir/upgrade/upgrade_6.2_6.3.sh

View file

@ -2,7 +2,6 @@
set timeout 5 set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_6.3_7.0.sh spawn $seafile_dir/upgrade/upgrade_6.3_7.0.sh

View file

@ -67,6 +67,12 @@ ynh_app_setting_set --app $app --key installed_version --value $seafile_version
# STANDARD MODIFICATIONS # 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 # Create User
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
ynh_system_user_create --username $seafile_user --home_dir $final_path 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 ynh_script_progression --message="Installing dependencies..." --weight=7
install_dependance install_dependance
# Copy files to the right place # Clean data directory
ynh_script_progression --message="Cleaning data directory..." ynh_script_progression --message="Cleaning data directory..."
test -e $seafile_data && ynh_secure_remove --file="$seafile_data" 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 # Download new version from sources
ynh_script_progression --message="Installing sources files..." --weight=7 ynh_script_progression --message="Installing sources files..." --weight=7
install_source install_source

View file

@ -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) seahub_port=$(ynh_app_setting_get --app $app --key seahub_port)
fileserver_port=$(ynh_app_setting_get --app $app --key fileserver_port) fileserver_port=$(ynh_app_setting_get --app $app --key fileserver_port)
webdav_port=$(ynh_app_setting_get --app $app --key webdav_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) final_path=$(ynh_app_setting_get --app $app --key final_path)
seafile_user=$app 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_system_user_create --username $seafile_user --home_dir $final_path
ynh_app_setting_set --app $app --key final_path --value $final_path ynh_app_setting_set --app $app --key final_path --value $final_path
test -e /var/log/seafile && rm /var/log/$app 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 ln -s $final_path/logs /var/log/seafile
set_permission set_permission
fi fi
@ -97,51 +102,51 @@ chmod +x $final_path/seafile-server-$seafile_version/upgrade/minor-upgrade.sh
case $installed_version in case $installed_version in
"4.0."* ) "4.0."* )
# Update seafile by script # 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."* ) "4.1."* )
# Update seafile by script # 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."* ) "4.3."* )
# Update seafile by script # 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."* ) "4.4."* )
# Update seafile by script # 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."* ) "5.0."* )
# Update seafile by script # 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."* ) "5.1."* )
# Update seafile by script # 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."* ) "6.0."* )
python3 ../conf/update_sso_conf.py || true python3 ../conf/update_sso_conf.py || true
# Update seafile by script # 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 # Enable manually wiki
echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py
;& ;&
"6.1."* ) "6.1."* )
# Update seafile by script # 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."* ) "6.2."* )
# Update seafile by script # 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 # Update logrotate to have the last version
ynh_use_logrotate --logfile $final_path/logs --nonappend ynh_use_logrotate --logfile $final_path/logs --nonappend
;& ;&
"6.3."* ) "6.3."* )
# Update seafile by script # 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 # SSO authentication
echo 'ENABLE_REMOTE_USER_AUTHENTICATION = True' | tee -a $final_path/conf/seahub_settings.py 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 echo "REMOTE_USER_HEADER = 'HTTP_EMAIL'" | tee -a $final_path/conf/seahub_settings.py
@ -155,7 +160,7 @@ case $installed_version in
;& ;&
esac 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 ## Install webdav and logrotate if not installed
if [[ $installed_version = "4.0."* ]] || [[ $installed_version = "4.1."* ]] if [[ $installed_version = "4.0."* ]] || [[ $installed_version = "4.1."* ]]