From 6e2975f4542d95b3bbf56d4cb56beed9545cc941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 28 Apr 2020 13:57:07 +0200 Subject: [PATCH] Upgrade to 7.1 and add support for memcached --- conf/create_admin.json | 1 + conf/x86-64.src | 4 +- manifest.json | 4 +- scripts/_common.sh | 15 ++++--- scripts/expect_scripts/install.exp | 4 +- scripts/expect_scripts/upgrade_7.1.exp | 11 ++++++ scripts/install | 54 ++++++++++++-------------- scripts/upgrade | 27 ++++++++++++- 8 files changed, 76 insertions(+), 44 deletions(-) create mode 100644 conf/create_admin.json create mode 100644 scripts/expect_scripts/upgrade_7.1.exp diff --git a/conf/create_admin.json b/conf/create_admin.json new file mode 100644 index 0000000..f38b55c --- /dev/null +++ b/conf/create_admin.json @@ -0,0 +1 @@ +{"email": "__ADMIN__", "password": "__PASSWORD__"} diff --git a/conf/x86-64.src b/conf/x86-64.src index 4bd9e8a..631524b 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://download.seadrive.org/seafile-server_7.0.5_x86-64.tar.gz -SOURCE_SUM=7eb8814f1bc8ee78c80741fa08cbdce2b5ea8895a87730bde2a1b32d031e8f53 +SOURCE_URL=https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_7.1.3_x86-64.tar.gz +SOURCE_SUM=41e1042984c923636e6bb7c2249bb9b784e42d796303450fe60d05855abce15f # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/manifest.json b/manifest.json index e4ce82a..7707bba 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "license": "AGPL-3.0,Apache-2.0,MIT,GPL-2.0", "url": "https://www.seafile.com", - "version": "7.0.5~ynh1", + "version": "7.1.3~ynh1", "description": { "en": "Open Source Cloud Storage", "fr": "Stockage Cloud Open Source" @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 3.5.2.2" + "yunohost": ">= 4.0" }, "arguments": { "install": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 11167cd..0db2dde 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -20,18 +20,17 @@ install_source() { } install_dependance() { - 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_install_app_dependencies python3 python3-setuptools python3-pip python3-requests python3-dev \ + expect ffmpeg \ + memcached libmemcached-dev \ + libjpeg62-turbo-dev zlib1g-dev # For building pillow 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 + sudo -u $seafile_user pip3 install --user --upgrade Pillow pylibmc captcha jinja2 sqlalchemy psd-tools \ + django-pylibmc django-simple-captcha python3-ldap \ + pylibmc django-pylibmc # Memcached support ynh_del_swap } diff --git a/scripts/expect_scripts/install.exp b/scripts/expect_scripts/install.exp index 03db5eb..b2d25d5 100644 --- a/scripts/expect_scripts/install.exp +++ b/scripts/expect_scripts/install.exp @@ -19,8 +19,8 @@ send "$server_name\r"; expect "What is the ip or domain of the server?" send "$domain\r"; -expect "Where do you want to put your seafile data?" -send "$seafile_data\r"; +# expect "Where do you want to put your seafile data?" +# send "$seafile_data\r"; expect "Which port do you want to use for the seafile fileserver?" send "$fileserver_port\r"; diff --git a/scripts/expect_scripts/upgrade_7.1.exp b/scripts/expect_scripts/upgrade_7.1.exp new file mode 100644 index 0000000..c0fe127 --- /dev/null +++ b/scripts/expect_scripts/upgrade_7.1.exp @@ -0,0 +1,11 @@ +#!/usr/bin/expect +set timeout 5 + +set seafile_dir [lindex $argv 0] + +spawn $seafile_dir/upgrade/upgrade_7.0_7.1.sh + +expect "to contiune" +send "\r"; + +interact diff --git a/scripts/install b/scripts/install index c00c158..2a21040 100644 --- a/scripts/install +++ b/scripts/install @@ -71,7 +71,7 @@ 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 +mkdir -p $seafile_data # Create User ynh_script_progression --message="Configuring system user..." @@ -81,10 +81,6 @@ ynh_system_user_create --username $seafile_user --home_dir $final_path ynh_script_progression --message="Installing dependencies..." --weight=7 install_dependance -# Clean data directory -ynh_script_progression --message="Cleaning data directory..." -test -e $seafile_data && ynh_secure_remove --file="$seafile_data" - # Download new version from sources ynh_script_progression --message="Installing sources files..." --weight=7 install_source @@ -102,6 +98,7 @@ ynh_script_progression --message="Configuring application..." --weight=3 chmod +x expect_scripts/install.exp chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh expect_scripts/install.exp "$final_path/seafile-server-$seafile_version" "$server_name" "$domain" "$seafile_data" "$fileserver_port" "$db_pwd" +echo $seafile_data > $final_path/ccnet/seafile.ini # Update seafile config ynh_replace_string --match_string http:// --replace_string https:// --target_file $final_path/conf/ccnet.conf @@ -140,11 +137,28 @@ echo 'LOGIN_ATTR = mail' | tee -a $final_path/conf/ccnet.conf # Enable manually wiki echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py +# Enable memcached +cat >> $final_path/conf/seahub_settings.py <= 7.0. If not install and upgrade to 7.0 before !! + + # Enable memcached + cat > $final_path/conf/seahub_settings.py <