Update to seafile 6.2.2

This commit is contained in:
Josué Tille 2017-09-30 15:07:56 +02:00
parent b9b346bbca
commit 79fb212189
6 changed files with 57 additions and 31 deletions

View file

@ -1,27 +1,15 @@
location PATHTOCHANGE1 {
alias ALIASTOCHANGE;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:SEAHUB_PORT;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header HTTP_AUTH_USER $remote_user;
proxy_read_timeout 1200s;
# used for view/edit office file via Office Online Server
client_max_body_size 0;
fastcgi_pass 127.0.0.1:SEAHUB_PORT;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REMOTE_ADDR $remote_addr;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;

View file

@ -20,7 +20,7 @@ seafile_init_log=${seafile_dir}/logs/seafile.init.log
seahub_init_log=${seafile_dir}/logs/seahub.init.log
# Change the value of fastcgi to true if fastcgi is to be used
fastcgi=true
fastcgi=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=SEAHUB_PORT

12
conf/upgrade_6.2.exp Normal file
View file

@ -0,0 +1,12 @@
#!/usr/bin/expect
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
expect "to contiune"
send "\r";
interact

View file

@ -3,12 +3,12 @@
# Retrieve arguments
app=$YNH_APP_INSTANCE_NAME
seafile_version=6.1.2
seafile_version=6.2.2
## Adapt sha256sum while you update app
x86_64sum="31f7294782dd8e63b3d441402460036be6f19c9b7471784a274a0fefb4553125"
i386sum="5c5860d796788e45ed015d592637c8958110ab059b1176b58b3c676c4c74e99e"
armsum="673a378e68b1b91b48edb7d03416d24f21d74af3bab26dc4832b7ea06fcc31f2"
x86_64sum="4c77721001b1173b11bbc6904dad8d010b7ebe8c0e0d34b5fe60f2158b49c98f"
i386sum="35442c6455da3c76c130dabe12d83f57a50cd080b87f12e4904203dfcffa7900"
armsum="ac153648d6d0e2913c6777604364700cc7ae9d6ebf2bf8de4622c04cfafd0ae6"
# Detect the system architecture to download the right tarball
# NOTE: `uname -m` is more accurate and universal than `arch`
@ -47,6 +47,19 @@ get_configuration() {
}
config_nginx() {
# In the 3.x seafile version package the seahub_port and fileserver_port wasn't saved in the settings. If the settings is empty we try to get it and save in the settings
if [[ -z $seahub_port ]] || [[ -z $fileserver_port ]]
then
seahub_port=$(head -n 20 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "fastcgi_pass.*127.0.0.1:" | cut -d':' -f2 | cut -d';' -f1)
fileserver_port=$(head -n 20 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "proxy_pass.*127.0.0.1:" | cut -d':' -f3 | cut -d';' -f1 | cut -d'/' -f1)
ynh_app_setting_set $app seahub_port $seahub_port
ynh_app_setting_set $app fileserver_port $fileserver_port
fi
ynh_replace_string PATHTOCHANGE1 $path ../conf/nginx.conf
ynh_replace_string PATHTOCHANGE2 $path2 ../conf/nginx.conf
ynh_replace_string ALIASTOCHANGE $final_path/ ../conf/nginx.conf

View file

@ -16,6 +16,9 @@ get_configuration
domain=$(ynh_app_setting_get $app domain)
path=$(ynh_normalize_url_path $(ynh_app_setting_get $app path))
installed_version=$(ynh_app_setting_get $app installed_version)
seahub_port=$(ynh_app_setting_get $app seahub_port)
fileserver_port=$(ynh_app_setting_get $app fileserver_port)
webdav_port=$(ynh_app_setting_get $app webdav_port)
root_pwd=$(cat /etc/yunohost/mysql)
# Get configuration for user and final path
@ -73,6 +76,10 @@ case $installed_version in
# Enable manually wiki
echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py
;&
"6.1."* )
# Update seafile by script
../conf/upgrade_6.2.exp $final_path/seafile-server-$seafile_version $root_pwd
;&
esac
../conf/minor-upgrade.exp $final_path/seafile-server-$seafile_version $root_pwd
@ -89,10 +96,6 @@ then
yunohost firewall disallow Both $ccnet_port
yunohost firewall disallow Both $seafile_port
# Add webdav to nginx config
ynh_replace_string WEBDAV_PORT $webdav_port ../conf/nginx_add_webdav
echo $(cat ../conf/nginx_add_webdav) | tee -a /etc/nginx/conf.d/$domain.d/seafile.conf
# Add webdav config
cp ../conf/seafdav.conf $final_path/conf/seafdav.conf
ynh_replace_string WEBDAV_PORT $webdav_port $final_path/conf/seafdav.conf
@ -121,6 +124,16 @@ fi
# Fix local warning
ynh_replace_string en_US.UTF-8 $LANG $final_path/seafile-server-$seafile_version/seahub.sh
# Config nginx
config_nginx
# Update init file
cp ../conf/seafile-server /etc/init.d
ynh_replace_string SEAHUB_PORT $seahub_port /etc/init.d/seafile-server
ynh_replace_string SEAFILE_DIR $final_path /etc/init.d/seafile-server
chmod +x /etc/init.d/seafile-server
systemctl daemon-reload
# restore correct permissions
chown -R $seafile_user:$seafile_user $final_path

View file

@ -14,7 +14,7 @@ diff -Naur a/seahub/seahub/auth/middleware.py b/seahub/seahub/auth/middleware.py
" before the RemoteUserMiddleware class.")
try:
- username = request.META[self.header]
+ username = request.META[self.header] + '@' + request.META["HTTP_HOST"]
+ username = request.META["HTTP_AUTH_USER"] + '@' + request.META["HTTP_HOST"]
except KeyError:
# If specified header doesn't exist then return (leaving
# request.user set to AnonymousUser by the