mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Improve upgrade management
This commit is contained in:
parent
d9d25f57e7
commit
7d8129b244
4 changed files with 43 additions and 3 deletions
11
conf/arm_7_0.src
Normal file
11
conf/arm_7_0.src
Normal file
|
@ -0,0 +1,11 @@
|
|||
SOURCE_URL=https://github.com/haiwen/seafile-rpi/releases/download/v7.0.5/seafile-server_7.0.5_stable_pi.tar.gz
|
||||
SOURCE_SUM=dae9ab5d232a2b56f129aa29e7e54d2de05d838f0479955543cebcb14c9417db
|
||||
# (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# default: sha256
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
# (Optional) Archive format
|
||||
# default: tar.gz
|
||||
SOURCE_FORMAT=tar.gz
|
||||
# (Optional) Put false if sources are directly in the archive root
|
||||
# default: true
|
||||
SOURCE_IN_SUBDIR=true
|
11
conf/x86-64_7_0.src
Normal file
11
conf/x86-64_7_0.src
Normal file
|
@ -0,0 +1,11 @@
|
|||
SOURCE_URL=https://download.seadrive.org/seafile-server_7.0.5_x86-64.tar.gz
|
||||
SOURCE_SUM=7eb8814f1bc8ee78c80741fa08cbdce2b5ea8895a87730bde2a1b32d031e8f53
|
||||
# (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# default: sha256
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
# (Optional) Archive format
|
||||
# default: tar.gz
|
||||
SOURCE_FORMAT=tar.gz
|
||||
# (Optional) Put false if sources are directly in the archive root
|
||||
# default: true
|
||||
SOURCE_IN_SUBDIR=true
|
|
@ -19,6 +19,17 @@ install_source() {
|
|||
ynh_setup_source "$final_path/seafile-server-$seafile_version" "$architecture"
|
||||
}
|
||||
|
||||
install_source_7_0() {
|
||||
if ! [ -e $final_path/seafile-server-7.0.5 ]; then
|
||||
mkdir "$final_path/seafile-server-7.0.5"
|
||||
if [[ $architecture == "i386" ]]
|
||||
then
|
||||
ynh_die --message "Error : this architecture is no longer supported by the upstream. Please create en issue here : https://github.com/YunoHost-Apps/seafile_ynh/issues to ask to discuss about a support of this architecture"
|
||||
fi
|
||||
ynh_setup_source "$final_path/seafile-server-7.0.5" "$architecture"_7_0
|
||||
fi
|
||||
}
|
||||
|
||||
install_dependance() {
|
||||
ynh_install_app_dependencies python3 python3-setuptools python3-pip python3-requests python3-dev \
|
||||
expect ffmpeg \
|
||||
|
|
|
@ -106,25 +106,31 @@ case $installed_version in
|
|||
;&
|
||||
"4.1."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_4.2.1.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"4.3."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_4.4.3.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"4.4."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_5.0.3.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"5.0."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_5.1.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"5.1."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_6.0.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"6.0."* )
|
||||
install_source_7_0
|
||||
python3 ../conf/update_sso_conf.py || true
|
||||
|
||||
# Update seafile by script
|
||||
|
@ -135,10 +141,12 @@ case $installed_version in
|
|||
;&
|
||||
"6.1."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_6.2.exp $final_path/seafile-server-$seafile_version
|
||||
;&
|
||||
"6.2."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
expect_scripts/upgrade_6.3.exp $final_path/seafile-server-$seafile_version
|
||||
|
||||
# Update logrotate to have the last version
|
||||
|
@ -146,6 +154,7 @@ case $installed_version in
|
|||
;&
|
||||
"6.3."* )
|
||||
# Update seafile by script
|
||||
install_source_7_0
|
||||
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
|
||||
|
@ -157,14 +166,12 @@ case $installed_version in
|
|||
ynh_mysql_execute_as_root --sql "DELETE FROM \`django_session\`" --database seahubdb
|
||||
|
||||
ynh_print_warn --message "To be able to continue to use the SSO you probybly need to migrate your account. You can use the command 'yunohost app action run seafile migrate_user_email_to_mail_email' to migrate all of theses account. Note that after this migratation you need to reconfigure all your client with the official email of the user."
|
||||
ynh_secure_remove --file="$final_path/seafile-server-7.0.5"
|
||||
;&
|
||||
"7.0"* )
|
||||
# Fix file comment
|
||||
$final_path/seafile-server-$seafile_version/seahub.sh python-env seahub/manage.py migrate_file_comment
|
||||
|
||||
# TODO
|
||||
# Check that last version >= 7.0. If not install and upgrade to 7.0 before !!
|
||||
|
||||
# Enable memcached
|
||||
cat > $final_path/conf/seahub_settings.py <<EOF
|
||||
CACHES = {
|
||||
|
|
Loading…
Reference in a new issue