From 8db58fb74fdc6c1f49d6ad51b65889e34be57656 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Wed, 28 Oct 2015 15:48:10 +0100 Subject: [PATCH 01/11] Add license infos Former-commit-id: 9fc420b002f242d2d537af0f301dd75ffdd98b6e --- LICENSE | 22 ++++++++++++++++++++++ README.md | 11 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8b11887 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 tostaki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README.md b/README.md index 0b52dea..34cb496 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,17 @@ Seafile no longer supports armhf architectures AFAIK. /!\ To login use your yunohost email not your username. +License +------- + +Seafile server and its desktop clients are published under GPLv2. + +Mobile clients are published under the GPLv3. + +The Seafile server's web end, i.e. Seahub, is published under the Apache License. + +This package is published under MIT License + TODO ----- From 26d0d190d6a061a6e3d0c39156374af52e55bfeb Mon Sep 17 00:00:00 2001 From: mbugeia Date: Wed, 28 Oct 2015 16:04:51 +0100 Subject: [PATCH 02/11] Implement some best practices Former-commit-id: 54e879cdbe6289f0cce20232cd50bc2eec34f829 --- scripts/install | 31 +++++++++++++++++-------------- scripts/upgrade | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index f0bcaf5..6a9e13c 100644 --- a/scripts/install +++ b/scripts/install @@ -1,4 +1,9 @@ #!/bin/bash + +set -e + +app=seafile + # Retrieve arguments domain=$1 path=$2 @@ -7,7 +12,7 @@ admin=$4 admin_password=$5 is_public=$6 architecture=$7 -final_path=/var/www/seafile +final_path=/var/www/$app seafile_data=/home/yunohost.app/seafile-data seafile_version=4.4.3 @@ -29,10 +34,8 @@ findPort () { } # Check domain/path availability -sudo yunohost app checkurl $domain$path -a seafile -if [[ ! $? -eq 0 ]]; then - exit 1 -fi +sudo yunohost app checkurl $domain$path -a $app \ + || (echo "Path not available: $domain$path" && exit 1) # Check dependencies sudo apt-get install -qq python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup expect @@ -44,7 +47,7 @@ sudo mkdir -p $final_path/logs sudo mkdir -p $final_path/seafile-data sudo mkdir -p $final_path/seafile-server-$seafile_version sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' -sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version +sudo mv seafile-server-$seafile_version/. $final_path/seafile-server-$seafile_version sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' $final_path/installed # Find available ports @@ -56,16 +59,16 @@ findPort 8080 webdav_port=$port # store config in yunohost -sudo yunohost app setting seafile seahub_port -v $seahub_port -sudo yunohost app setting seafile fileserver_port -v $fileserver_port -sudo yunohost app setting seafile webdav_port -v $webdav_port -sudo yunohost app setting seafile is_public -v $is_public -sudo yunohost app setting seafile architecture -v $architecture -sudo yunohost app setting seafile installed_version -v $seafile_version +sudo yunohost app setting $app seahub_port -v $seahub_port +sudo yunohost app setting $app fileserver_port -v $fileserver_port +sudo yunohost app setting $app webdav_port -v $webdav_port +sudo yunohost app setting $app is_public -v $is_public +sudo yunohost app setting $app architecture -v $architecture +sudo yunohost app setting $app installed_version -v $seafile_version # init databases -db_user=seafile -db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p') +db_user=$app +db_pwd=$(openssl rand -hex 15) sudo yunohost app initdb -d ccnetdb -p $db_pwd $db_user sudo yunohost app initdb -d seafiledb -p $db_pwd $db_user sudo yunohost app initdb -d seahubdb -p $db_pwd $db_user diff --git a/scripts/upgrade b/scripts/upgrade index 4dd8934..0836ac6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,4 +1,7 @@ #!/bin/bash + +set -e + app=seafile # Retrieve settings From 48832d86e72fac714e4f5371d1ef9232b30059f8 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Wed, 28 Oct 2015 16:38:27 +0100 Subject: [PATCH 03/11] Can't use set -e because of findport function Former-commit-id: 62a92c7059d433690bcc62d73fad933c199664ad --- scripts/install | 4 +--- scripts/upgrade | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 6a9e13c..7834551 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -set -e - app=seafile # Retrieve arguments @@ -47,7 +45,7 @@ sudo mkdir -p $final_path/logs sudo mkdir -p $final_path/seafile-data sudo mkdir -p $final_path/seafile-server-$seafile_version sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' -sudo mv seafile-server-$seafile_version/. $final_path/seafile-server-$seafile_version +sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' $final_path/installed # Find available ports diff --git a/scripts/upgrade b/scripts/upgrade index 0836ac6..bafa7b3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -set -e - app=seafile # Retrieve settings From e531dfdae3d192be5eb8d0e26a63d8d3b9c2549a Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 26 Dec 2015 13:44:01 +0100 Subject: [PATCH 04/11] Update to seafile v5.0.3 Former-commit-id: c4d7ae40fc81422258e1e9990f119400a8798944 --- conf/upgrade_5.0.3.exp | 11 +++++ scripts/install | 40 +++++++++---------- ...afile-server_4.4.3_i386.tar.REMOVED.git-id | 1 - ...eafile-server_4.4.3_rpi.tar.REMOVED.git-id | 1 - ...ile-server_4.4.3_x86-64.tar.REMOVED.git-id | 1 - ...le-server_5.0.3_i386.tar.gz.REMOVED.git-id | 1 + ...ile-server_5.0.3_rpi.tar.gz.REMOVED.git-id | 1 + ...-server_5.0.3_x86-64.tar.gz.REMOVED.git-id | 1 + 8 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 conf/upgrade_5.0.3.exp delete mode 100644 sources/seafile-server_4.4.3_i386.tar.REMOVED.git-id delete mode 100644 sources/seafile-server_4.4.3_rpi.tar.REMOVED.git-id delete mode 100644 sources/seafile-server_4.4.3_x86-64.tar.REMOVED.git-id create mode 100644 sources/seafile-server_5.0.3_i386.tar.gz.REMOVED.git-id create mode 100644 sources/seafile-server_5.0.3_rpi.tar.gz.REMOVED.git-id create mode 100644 sources/seafile-server_5.0.3_x86-64.tar.gz.REMOVED.git-id diff --git a/conf/upgrade_5.0.3.exp b/conf/upgrade_5.0.3.exp new file mode 100644 index 0000000..370cb72 --- /dev/null +++ b/conf/upgrade_5.0.3.exp @@ -0,0 +1,11 @@ +#!/usr/bin/expect +set timeout 5 + +set mysql_password [lindex $argv 0] + +spawn /var/www/seafile/seafile-server-5.0.3/upgrade/upgrade_4.4_5.0.sh + +expect "to contiune" +send "\r"; + +interact \ No newline at end of file diff --git a/scripts/install b/scripts/install index 7834551..a7acbaa 100644 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,7 @@ is_public=$6 architecture=$7 final_path=/var/www/$app seafile_data=/home/yunohost.app/seafile-data -seafile_version=4.4.3 +seafile_version=5.0.3 # Retrieve admin email admin_email=$(sudo yunohost user info $admin | grep mail: | sed "s/mail: //g") @@ -78,29 +78,29 @@ sudo chmod +x $final_path/seafile-server-$seafile_version/setup-seafile-mysql.sh sudo ../conf/install.exp $server_name $domain $seafile_data $fileserver_port $db_pwd # Update seafile config -sudo sed -i "s@http://@https://@g" $final_path/ccnet/ccnet.conf -sudo sed -i "s@:8000@$path@g" $final_path/ccnet/ccnet.conf -echo 'FILE_SERVER_ROOT = "https://'$domain'/seafhttp"' | sudo tee -a $final_path/seahub_settings.py -echo 'SITE_ROOT = "'$path'/"' | sudo tee -a $final_path/seahub_settings.py -echo 'SERVE_STATIC = False' | sudo tee -a $final_path/seahub_settings.py -echo 'MEDIA_URL = "'$path'/media/"' | sudo tee -a $final_path/seahub_settings.py -echo 'COMPRESS_URL = MEDIA_URL' | sudo tee -a $final_path/seahub_settings.py -echo "STATIC_URL = MEDIA_URL + 'assets/'" | sudo tee -a $final_path/seahub_settings.py +sudo sed -i "s@http://@https://@g" $final_path/conf/ccnet.conf +sudo sed -i "s@:8000@$path@g" $final_path/conf/ccnet.conf +echo 'FILE_SERVER_ROOT = "https://'$domain'/seafhttp"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'SITE_ROOT = "'$path'/"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'SERVE_STATIC = False' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'MEDIA_URL = "'$path'/media/"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'COMPRESS_URL = MEDIA_URL' | sudo tee -a $final_path/conf/seahub_settings.py +echo "STATIC_URL = MEDIA_URL + 'assets/'" | sudo tee -a $final_path/conf/seahub_settings.py # Email configuration -echo 'EMAIL_USE_TLS = False' | sudo tee -a $final_path/seahub_settings.py -echo 'EMAIL_HOST = "localhost"' | sudo tee -a $final_path/seahub_settings.py -echo 'EMAIL_HOST_USER = "seafile@'$domain'"' | sudo tee -a $final_path/seahub_settings.py -echo 'EMAIL_HOST_PASSWORD = ""' | sudo tee -a $final_path/seahub_settings.py -echo 'EMAIL_PORT = "25"' | sudo tee -a $final_path/seahub_settings.py -echo 'DEFAULT_FROM_EMAIL = "seafile@'$domain'"' | sudo tee -a $final_path/seahub_settings.py -echo 'SERVER_EMAIL = "seafile@'$domain'"' | sudo tee -a $final_path/seahub_settings.py +echo 'EMAIL_USE_TLS = False' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'EMAIL_HOST = "localhost"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'EMAIL_HOST_USER = "seafile@'$domain'"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'EMAIL_HOST_PASSWORD = ""' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'EMAIL_PORT = "25"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'DEFAULT_FROM_EMAIL = "seafile@'$domain'"' | sudo tee -a $final_path/conf/seahub_settings.py +echo 'SERVER_EMAIL = "seafile@'$domain'"' | sudo tee -a $final_path/conf/seahub_settings.py # LDAP configuration -echo '[LDAP]' | sudo tee -a $final_path/ccnet/ccnet.conf -echo 'HOST = ldap://localhost:389' | sudo tee -a $final_path/ccnet/ccnet.conf -echo 'BASE = ou=users,dc=yunohost,dc=org' | sudo tee -a $final_path/ccnet/ccnet.conf -echo 'LOGIN_ATTR = mail' | sudo tee -a $final_path/ccnet/ccnet.conf +echo '[LDAP]' | sudo tee -a $final_path/conf/ccnet.conf +echo 'HOST = ldap://localhost:389' | sudo tee -a $final_path/conf/ccnet.conf +echo 'BASE = ou=users,dc=yunohost,dc=org' | sudo tee -a $final_path/conf/ccnet.conf +echo 'LOGIN_ATTR = mail' | sudo tee -a $final_path/conf/ccnet.conf # Add Seafile Server to startup sudo cp ../conf/seafile-server /etc/init.d diff --git a/sources/seafile-server_4.4.3_i386.tar.REMOVED.git-id b/sources/seafile-server_4.4.3_i386.tar.REMOVED.git-id deleted file mode 100644 index 084e045..0000000 --- a/sources/seafile-server_4.4.3_i386.tar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -6a24a05a0990ca9f47644914c363630a4b416c77 \ No newline at end of file diff --git a/sources/seafile-server_4.4.3_rpi.tar.REMOVED.git-id b/sources/seafile-server_4.4.3_rpi.tar.REMOVED.git-id deleted file mode 100644 index 2c3bddd..0000000 --- a/sources/seafile-server_4.4.3_rpi.tar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -38803ad3a16da3bbc3a20b4b9fae20ec7709ce22 \ No newline at end of file diff --git a/sources/seafile-server_4.4.3_x86-64.tar.REMOVED.git-id b/sources/seafile-server_4.4.3_x86-64.tar.REMOVED.git-id deleted file mode 100644 index f0bd264..0000000 --- a/sources/seafile-server_4.4.3_x86-64.tar.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c2866ea4587005d380327ba095bf1a4ae790bceb \ No newline at end of file diff --git a/sources/seafile-server_5.0.3_i386.tar.gz.REMOVED.git-id b/sources/seafile-server_5.0.3_i386.tar.gz.REMOVED.git-id new file mode 100644 index 0000000..cc90b5b --- /dev/null +++ b/sources/seafile-server_5.0.3_i386.tar.gz.REMOVED.git-id @@ -0,0 +1 @@ +601f5fefe734566c4592b46ff22f4c9ab8bcea43 \ No newline at end of file diff --git a/sources/seafile-server_5.0.3_rpi.tar.gz.REMOVED.git-id b/sources/seafile-server_5.0.3_rpi.tar.gz.REMOVED.git-id new file mode 100644 index 0000000..cf853eb --- /dev/null +++ b/sources/seafile-server_5.0.3_rpi.tar.gz.REMOVED.git-id @@ -0,0 +1 @@ +dc83ddf23814ca7dc5e0093ce4f3ad82ec310cbc \ No newline at end of file diff --git a/sources/seafile-server_5.0.3_x86-64.tar.gz.REMOVED.git-id b/sources/seafile-server_5.0.3_x86-64.tar.gz.REMOVED.git-id new file mode 100644 index 0000000..a14e8e7 --- /dev/null +++ b/sources/seafile-server_5.0.3_x86-64.tar.gz.REMOVED.git-id @@ -0,0 +1 @@ +452bfdd255d6f1cc2e8c9ea5b26ea929090b2c51 \ No newline at end of file From 06f2aa5bfe2a8e4d76923c7b9926b9d4f7bb0183 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 26 Dec 2015 13:44:45 +0100 Subject: [PATCH 05/11] Update to seafile v5.0.3 Former-commit-id: aa2b593ed9f9389171f32604df2f11341cd77e61 --- scripts/upgrade | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index bafa7b3..b5583a0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,7 +6,7 @@ app=seafile installed_version=$(sudo yunohost app setting $app installed_version) architecture=$(sudo yunohost app setting $app architecture) root_pwd=$(sudo cat /etc/yunohost/mysql) -seafile_version=4.4.3 +seafile_version=5.0.3 final_path=/var/www/$app # extract new version @@ -23,10 +23,12 @@ sudo chmod +x ../conf/upgrade_4.1.1.exp sudo chmod +x ../conf/upgrade_4.2.1.exp sudo chmod +x ../conf/upgrade_4.3.2.exp sudo chmod +x ../conf/upgrade_4.4.3.exp +sudo chmod +x ../conf/upgrade_5.0.3.exp sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.0_4.1.sh sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.1_4.2.sh sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.2_4.3.sh sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.3_4.4.sh +sudo chmod +x $final_path/seafile-server-$seafile_version/upgrade/upgrade_4.4_5.0.sh # do the upgrade case $installed_version in @@ -45,6 +47,10 @@ case $installed_version in # Update seafile by script sudo ../conf/upgrade_4.4.3.exp $root_pwd ;; +"4.4."* ) + # Update seafile by script + sudo ../conf/upgrade_5.0.3.exp $root_pwd +;; esac ## Install webdav and logrotate if not installed From b2fe60baaaa8300e21f84e0026fe937005295eb9 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 26 Dec 2015 13:45:15 +0100 Subject: [PATCH 06/11] Add info to manifest Former-commit-id: 5496a99111af0e57e615af9d52005d0c9732d7f3 --- manifest.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 3827153..7a32eea 100644 --- a/manifest.json +++ b/manifest.json @@ -6,11 +6,14 @@ "fr": "Stockage Cloud Open Source" }, "developer": { - "name": "", - "email": "", - "url": "" + "name": "mbugeia", + "email": "maxime@max.privy.place" }, "multi_instance": "false", + "services": [ + "nginx", + "mysql" + ], "arguments": { "install": [ { From 0d9551d8c0961bd202b2344109618223a586e3e5 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 26 Dec 2015 14:14:31 +0100 Subject: [PATCH 07/11] Bootstrap backup/restore script Former-commit-id: 7298080dcb478899ad8e4008aa2f92f82c5f93d8 --- scripts/backup | 32 ++++++++++++++++++++++++++++ scripts/restore | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 scripts/backup create mode 100644 scripts/restore diff --git a/scripts/backup b/scripts/backup new file mode 100644 index 0000000..063808b --- /dev/null +++ b/scripts/backup @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e + +# The parameter $1 is the backup directory location dedicated to the app +BACKUP_DIR=$1 + +# The parameter $2 is the id of the app instance ex: strut__2 +app=$2 + +# retrieve useful param +domain=$(sudo yunohost app setting $app domain) +db_pwd=$(sudo yunohost app setting $app mysqlpwd) + +# Backup app files +sudo mkdir -p "${BACKUP_DIR}/www" +sudo cp -a /var/www/$app/. "${BACKUP_DIR}/www" + +# Backup conf files +sudo mkdir -p "${BACKUP_DIR}/conf" +sudo cp -a /etc/nginx/conf.d/$domain.d/$app.conf "${BACKUP_DIR}/conf/${app}.conf" +sudo cp -a /etc/logrotate.d/seafile "${BACKUP_DIR}/conf/seafile" +sudo cp -a /etc/init.d/seafile-server "${BACKUP_DIR}/conf/seafile-server" + +# Backup data +sudo mkdir -p "${BACKUP_DIR}/data" +sudo cp -a /home/yunohost.app/seafile-data/. "${BACKUP_DIR}/data" + +# Backup mysql +sudo mysqldump -u $app -p$db_pwd ccnetdb > "${BACKUP_DIR}/ccnetdb.dmp" +sudo mysqldump -u $app -p$db_pwd seafiledb > "${BACKUP_DIR}/seafiledb.dmp" +sudo mysqldump -u $app -p$db_pwd seahubdb > "${BACKUP_DIR}/seahubdb.dmp" \ No newline at end of file diff --git a/scripts/restore b/scripts/restore new file mode 100644 index 0000000..f97272f --- /dev/null +++ b/scripts/restore @@ -0,0 +1,56 @@ +#!/bin/bash + +set -e + +# The parameter $1 is the backup directory location dedicated to the app +BACKUP_DIR=$1 + +# The parameter $2 is the id of the app instance ex: strut__2 +app=$2 + +domain=$(sudo yunohost app setting $app domain) +path=$(sudo yunohost app setting $app path) +db_pwd=$(sudo yunohost app setting $app mysqlpwd) + +# Check domain/path availability +sudo yunohost app checkurl $domain$path -a $app \ + || (echo "Path not available: $domain$path" && exit 1) + +# Restore dependencies +sudo apt-get update +sudo apt-get install -qq python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup expect + +# Restore app files +final_path=/var/www/$app +sudo mkdir -p $final_path +sudo cp -a "${BACKUP_DIR}/www/." $final_path +sudo chown -R www-data:www-data $final_path + +# Restore conf files +sudo cp -a "${BACKUP_DIR}/conf/${app}.conf" /etc/nginx/conf.d/$domain.d/$app.conf +sudo cp -a "${BACKUP_DIR}/conf/seafile" /etc/logrotate.d/seafile +sudo cp -a "${BACKUP_DIR}/conf/seafile-server" /etc/init.d/seafile-server +sudo chmod +x /etc/init.d/seafile-server + +# Restore data +seafile_data=/home/yunohost.app/seafile-data +mkdir -p $seafile_data +sudo cp -a "${BACKUP_DIR}/data/." /home/yunohost.app/seafile-data/. +sudo chown -R www-data:www-data $seafile_data + +# Restore mysql dump +sudo mysql -u $app -p$db_pwd ccnetdb < "${BACKUP_DIR}/ccnetdb.dmp" +sudo mysql -u $app -p$db_pwd seafiledb < "${BACKUP_DIR}/seafiledb.dmp" +sudo mysql -u $app -p$db_pwd seahubdb < "${BACKUP_DIR}/seahubdb.dmp" + +# Add Seafile to YunoHost's monitored services +sudo yunohost service add seafile-server + +# Reload/restart services +sudo update-rc.d seafile-server defaults +sudo service rsyslog restart +sudo service nginx reload +sudo yunohost app ssowatconf + +# start seafile +sudo service seafile-server start \ No newline at end of file From 13f7f0fddf3de1e7596aec6f8650999f3686d0fe Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 26 Dec 2015 14:15:26 +0100 Subject: [PATCH 08/11] Update before installing dependencies Former-commit-id: 8a0018517b8e7a064856f51f4dd17cae10510cc0 --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index a7acbaa..70af46d 100644 --- a/scripts/install +++ b/scripts/install @@ -36,6 +36,7 @@ sudo yunohost app checkurl $domain$path -a $app \ || (echo "Path not available: $domain$path" && exit 1) # Check dependencies +sudo apt-get update sudo apt-get install -qq python2.7 python-setuptools python-simplejson python-imaging python-mysqldb python-flup expect # Copy files to the right place From 65a13594f6eb15d925ca46366fed4a2ca3aa7907 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 2 Jan 2016 18:07:10 +0100 Subject: [PATCH 09/11] Update readme for 5.0.3 Former-commit-id: f229487f8902e41576c70cc49c2ed659d14ad1da --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 34cb496..4ab85ba 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ From command line: Infos ----- -Seafile server v4.4.3 +Seafile server v5.0.3 -Available for x64, i386, and Raspberry architecture but only tested for x64 (feedback are welcome) +Available for x64, i386, and Raspberry Pi architecture but only tested for x64 (feedback are welcome) -Seafile no longer supports armhf architectures AFAIK. +Seafile no longer distribute binary for generic armhf architectures but rpi binary could work. /!\ To login use your yunohost email not your username. From d8225afdad0b57c6ec42e23451f7ce9e4917113a Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 2 Jan 2016 18:17:44 +0100 Subject: [PATCH 10/11] Fix update to 5.0.3 Former-commit-id: 82d7ce6d9da92195a7aeb6a0b64f162318c41686 --- conf/install.exp | 2 +- scripts/install | 4 ++-- scripts/upgrade | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/install.exp b/conf/install.exp index e753adc..bcbc98d 100644 --- a/conf/install.exp +++ b/conf/install.exp @@ -7,7 +7,7 @@ set seafile_data [lindex $argv 2] set fileserver_port [lindex $argv 3] set db_pwd [lindex $argv 4] -spawn /var/www/seafile/seafile-server-4.4.3/setup-seafile-mysql.sh +spawn /var/www/seafile/seafile-server-5.0.3/setup-seafile-mysql.sh expect "Press ENTER to continue" send "\r"; diff --git a/scripts/install b/scripts/install index 70af46d..ed4a0f1 100644 --- a/scripts/install +++ b/scripts/install @@ -45,9 +45,9 @@ sudo mkdir -p $final_path/installed sudo mkdir -p $final_path/logs sudo mkdir -p $final_path/seafile-data sudo mkdir -p $final_path/seafile-server-$seafile_version -sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' +sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar.gz' sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version -sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' $final_path/installed +sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar.gz' $final_path/installed # Find available ports findPort 8000 diff --git a/scripts/upgrade b/scripts/upgrade index b5583a0..928fae5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,9 +11,9 @@ final_path=/var/www/$app # extract new version sudo mkdir -p $final_path/seafile-server-$seafile_version -sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' +sudo tar xzf ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar.gz' sudo mv seafile-server-$seafile_version/* $final_path/seafile-server-$seafile_version -sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar' $final_path/installed +sudo mv ../sources/'seafile-server_'$seafile_version'_'$architecture'.tar.gz' $final_path/installed # stop seafile server sudo service seafile-server stop @@ -115,7 +115,7 @@ sudo rm -r /tmp/seahub_cache sudo service seafile-server start # remove old version files -sudo rm -f $final_path/installed/seafile-server_$installed_version_$architecture.tar +sudo rm -f $final_path/installed/seafile-server_$installed_version_$architecture.tar* sudo rm -f $final_path/seafile-server_$installed_version_$architecture # store new installed version From 9f20512b53ff29f1fa1fdf0a98190cc101a464c0 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 2 Jan 2016 18:31:41 +0100 Subject: [PATCH 11/11] Add dev info o readme Former-commit-id: 5e0b9eba28ae0cd256f60619de9ba052ef723c08 --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ab85ba..567a8f8 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,21 @@ This package is published under MIT License TODO ----- - - Auto login/logout + - Auto login/logout, see #1 + - Test of backup/restore script + +Developper infos +---------------- + +Please do your pull request to the Dev branch. + +Test or upgrade to dev version: +``` +su - admin +git clone -b Dev https://github.com/mbugeia/seafile_ynh +# to install +sudo yunohost app install -l Seafile /home/admin/seafile_ynh +# to upgrade +sudo yunohost app upgrade -f /home/admin/seafile_ynh seafile + +``` \ No newline at end of file