mirror of
https://github.com/coolsnowwolf/packages.git
synced 2025-05-01 10:31:21 +08:00
seafile-server: update packages
This commit is contained in:
parent
0cee48ba20
commit
ec0883a63e
@ -8,16 +8,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=seafile-ccnet
|
||||
PKG_VERSION:=6.2.2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
|
||||
PKG_VERSION:=6.3.4
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/haiwen/ccnet-server.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=6b9d7e2920aa9b807f9efe9038439b57ce949ecc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=8aed6d2283ac7b3148f9b5c82b1d992ed36dc5193000cf727bdcfae7446ce1fe
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/ccnet-server/tar.gz/v$(PKG_VERSION)-server?
|
||||
PKG_HASH:=ab3d5bda728f87c71929a6247c9f74c5209b9b8e44bafa77db91e8de590ec6ef
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/ccnet-server-$(PKG_VERSION)-server
|
||||
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -29,12 +29,10 @@ define Package/seafile-ccnet
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Seafile server - ccnet component
|
||||
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
|
||||
URL:=http://seafile.com/
|
||||
DEPENDS:=+libsearpc +libevent2 +libopenssl \
|
||||
+glib2 +python +libzdb +libuuid \
|
||||
+libpthread +libsqlite3 +jansson $(ICONV_DEPENDS)
|
||||
EXTRA_DEPENDS:=libsearpc (=6.2.2-8998e7b2c5587f0b94c48db24e2952d08def5add-1)
|
||||
endef
|
||||
|
||||
define Package/seafile-ccnet/description
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seafile-ccnet-5.1.1.orig/lib/Makefile.am seafile-ccnet-5.1.1/lib/Makefile.am
|
||||
--- seafile-ccnet-5.1.1.orig/lib/Makefile.am 2016-04-21 11:04:46.000000000 +0200
|
||||
+++ seafile-ccnet-5.1.1/lib/Makefile.am 2016-04-22 10:02:52.583732050 +0200
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -1,3 +1,4 @@
|
||||
+include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -20,7 +19,7 @@ diff -rupN seafile-ccnet-5.1.1.orig/lib/Makefile.am seafile-ccnet-5.1.1/lib/Make
|
||||
|
||||
searpc_gen = searpc-signature.h searpc-marshal.h
|
||||
|
||||
@@ -86,7 +87,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
|
||||
@@ -86,7 +87,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_table.py
|
||||
@rm -f rpc_table.tmp
|
||||
@touch rpc_table.tmp
|
||||
@echo "[libsearpc]: generating rpc header files"
|
||||
|
@ -0,0 +1,151 @@
|
||||
From 6c825349e1994a991f287e398cf0ead5f790a01b Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Wed, 6 Jun 2018 18:05:33 -0300
|
||||
Subject: [PATCH] Remove API deprecated in openssl 1.1
|
||||
|
||||
With openssl 1.1, we do not call OpenSSL_add_all_algorithms(), as
|
||||
library initialization is done automatically.
|
||||
Functions RAND_pseudo_bytes and RSA_generate_key were deprecated as
|
||||
well.
|
||||
Also, we need to #include <openssl/bn.h> for BN_num_bytes().
|
||||
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
---
|
||||
lib/rsa.c | 15 ++++++++++++---
|
||||
net/common/processors/keepalive-proc.c | 4 ++--
|
||||
net/common/processors/keepalive2-proc.c | 2 +-
|
||||
net/common/processors/sendsessionkey-proc.c | 2 +-
|
||||
net/common/processors/sendsessionkey-v2-proc.c | 2 +-
|
||||
net/server/user-mgr.c | 4 ++++
|
||||
tools/ccnet-init.c | 2 ++
|
||||
7 files changed, 23 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/rsa.c b/lib/rsa.c
|
||||
index 7cca150..d969a62 100644
|
||||
--- a/lib/rsa.c
|
||||
+++ b/lib/rsa.c
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/err.h>
|
||||
+#include <openssl/bn.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
@@ -207,9 +208,17 @@ RSA *
|
||||
generate_private_key(u_int bits)
|
||||
{
|
||||
RSA *private = NULL;
|
||||
-
|
||||
- private = RSA_generate_key(bits, 35, NULL, NULL);
|
||||
- if (private == NULL)
|
||||
+ BIGNUM *e = NULL;
|
||||
+
|
||||
+ private = RSA_new();
|
||||
+ e = BN_new();
|
||||
+ if (private == NULL || e == NULL || !BN_set_word(e, 35) ||
|
||||
+ !RSA_generate_key_ex(private, bits, e, NULL)) {
|
||||
+ RSA_free(private);
|
||||
+ BN_free(e);
|
||||
g_error ("rsa_generate_private_key: key generation failed.");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ BN_free(e);
|
||||
return private;
|
||||
}
|
||||
diff --git a/net/common/processors/keepalive-proc.c b/net/common/processors/keepalive-proc.c
|
||||
index 609d102..42a0c23 100644
|
||||
--- a/net/common/processors/keepalive-proc.c
|
||||
+++ b/net/common/processors/keepalive-proc.c
|
||||
@@ -401,7 +401,7 @@ static void send_challenge(CcnetProcessor *processor)
|
||||
unsigned char *buf;
|
||||
int len;
|
||||
|
||||
- RAND_pseudo_bytes (priv->random_buf, 40);
|
||||
+ RAND_bytes (priv->random_buf, 40);
|
||||
buf = public_key_encrypt (peer->pubkey, priv->random_buf, 40, &len);
|
||||
ccnet_processor_send_update (processor, "311", NULL, (char *)buf, len);
|
||||
|
||||
@@ -434,7 +434,7 @@ static void send_challenge_user(CcnetProcessor *processor, CcnetUser *user)
|
||||
|
||||
ccnet_debug ("[Keepalive] Send user challenge to %.8s\n",
|
||||
processor->peer->id);
|
||||
- RAND_pseudo_bytes (priv->random_buf, 40);
|
||||
+ RAND_bytes (priv->random_buf, 40);
|
||||
buf = public_key_encrypt (user->pubkey, priv->random_buf, 40, &len);
|
||||
ccnet_processor_send_update (processor, "321", NULL, (char *)buf, len);
|
||||
|
||||
diff --git a/net/common/processors/keepalive2-proc.c b/net/common/processors/keepalive2-proc.c
|
||||
index d3e799e..d81c266 100644
|
||||
--- a/net/common/processors/keepalive2-proc.c
|
||||
+++ b/net/common/processors/keepalive2-proc.c
|
||||
@@ -306,7 +306,7 @@ static void send_challenge(CcnetProcessor *processor)
|
||||
unsigned char *buf;
|
||||
int len;
|
||||
|
||||
- RAND_pseudo_bytes (priv->random_buf, 40);
|
||||
+ RAND_bytes (priv->random_buf, 40);
|
||||
buf = public_key_encrypt (peer->pubkey, priv->random_buf, 40, &len);
|
||||
if (len < 0) {
|
||||
ccnet_debug ("[Keepalive] Failed to encrypt challenge "
|
||||
diff --git a/net/common/processors/sendsessionkey-proc.c b/net/common/processors/sendsessionkey-proc.c
|
||||
index 3ec2757..10c3340 100644
|
||||
--- a/net/common/processors/sendsessionkey-proc.c
|
||||
+++ b/net/common/processors/sendsessionkey-proc.c
|
||||
@@ -124,7 +124,7 @@ generate_session_key (CcnetProcessor *processor, int *len_p)
|
||||
unsigned char random_buf[40];
|
||||
SHA_CTX s;
|
||||
|
||||
- RAND_pseudo_bytes (random_buf, sizeof(random_buf));
|
||||
+ RAND_bytes (random_buf, sizeof(random_buf));
|
||||
|
||||
SHA1_Init (&s);
|
||||
SHA1_Update (&s, random_buf, sizeof(random_buf));
|
||||
diff --git a/net/common/processors/sendsessionkey-v2-proc.c b/net/common/processors/sendsessionkey-v2-proc.c
|
||||
index c1c6924..4805ba6 100644
|
||||
--- a/net/common/processors/sendsessionkey-v2-proc.c
|
||||
+++ b/net/common/processors/sendsessionkey-v2-proc.c
|
||||
@@ -125,7 +125,7 @@ generate_session_key (CcnetProcessor *processor, int *len_p)
|
||||
unsigned char random_buf[40];
|
||||
SHA_CTX s;
|
||||
|
||||
- RAND_pseudo_bytes (random_buf, sizeof(random_buf));
|
||||
+ RAND_bytes (random_buf, sizeof(random_buf));
|
||||
|
||||
SHA1_Init (&s);
|
||||
SHA1_Update (&s, random_buf, sizeof(random_buf));
|
||||
diff --git a/net/server/user-mgr.c b/net/server/user-mgr.c
|
||||
index 8a356f0..7a3f5cb 100644
|
||||
--- a/net/server/user-mgr.c
|
||||
+++ b/net/server/user-mgr.c
|
||||
@@ -816,9 +816,13 @@ hash_password_pbkdf2_sha256 (const char *passwd,
|
||||
char salt_str[SHA256_DIGEST_LENGTH*2+1];
|
||||
|
||||
if (!RAND_bytes (salt, sizeof(salt))) {
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_API_COMPAT < 0x10100000L
|
||||
ccnet_warning ("Failed to generate salt "
|
||||
"with RAND_bytes(), use RAND_pseudo_bytes().\n");
|
||||
RAND_pseudo_bytes (salt, sizeof(salt));
|
||||
+#else
|
||||
+ ccnet_warning ("Failed to generate salt with RAND_bytes().\n");
|
||||
+#endif
|
||||
}
|
||||
|
||||
PKCS5_PBKDF2_HMAC (passwd, strlen(passwd),
|
||||
diff --git a/tools/ccnet-init.c b/tools/ccnet-init.c
|
||||
index 4748962..28c9995 100644
|
||||
--- a/tools/ccnet-init.c
|
||||
+++ b/tools/ccnet-init.c
|
||||
@@ -162,7 +162,9 @@ main(int argc, char **argv)
|
||||
|
||||
config_dir = ccnet_expand_path (config_dir);
|
||||
/* printf("[conf_dir=%s\n]", config_dir); */
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
OpenSSL_add_all_algorithms();
|
||||
+#endif
|
||||
|
||||
if (RAND_status() != 1) { /* it should be seeded automatically */
|
||||
fprintf(stderr, "PRNG is not seeded\n");
|
||||
--
|
||||
2.19.1
|
||||
|
@ -8,36 +8,49 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=seafile-seahub
|
||||
PKG_VERSION:=6.2.2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_VERSION:=6.3.4
|
||||
PKG_RELEASE:=7
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/haiwen/seahub.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=120e7a299e77968f1af48ea2dcf4bd9b909c426f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=511500c40dd7b1009f77109c6df810df1cf2c17a84a8f6841d592a9e05d22064
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seahub/tar.gz/v$(PKG_VERSION)-server?
|
||||
PKG_HASH:=53a9efdb6791fd3a2a191e89cb0f133632056046ec08adbb2ad72088e6161430
|
||||
|
||||
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE.txt
|
||||
|
||||
HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="django>=1.11"
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../../lang/python/python-package.mk
|
||||
|
||||
SEAFILE_PYTHON_DEPENDS:= \
|
||||
simplejson chardet dateutil mysqlclient pytz qrcode requests requests-oauthlib \
|
||||
django1 django-constance django-appconf django-compressor django-formtools \
|
||||
django-jsonfield django-picklefield django-postoffice django-restframework \
|
||||
pillow django-simple-captcha django-statici18n django-webpack-loader
|
||||
|
||||
define Package/seafile-seahub
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Seafile server - seahub component
|
||||
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
|
||||
URL:=http://seafile.com/
|
||||
DEPENDS:=+simplejson +python +pillow +chardet +django +django-appconf \
|
||||
+django-compressor +django-constance +django-jsonfield +django-picklefield \
|
||||
+django-postoffice +django-restframework +django-statici18n +et_xmlfile \
|
||||
+flup +gunicorn +jdcal +openpyxl +python-dateutil +python-mysql +pytz +rcssmin
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Seafile server - seahub component
|
||||
URL:=https://seafile.com/
|
||||
DEPENDS:=+python \
|
||||
+python-flup +gunicorn +openpyxl \
|
||||
$(foreach dep,$(SEAFILE_PYTHON_DEPENDS),+python-$(dep))
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
MAKE_VARS += \
|
||||
PYTHON="$(HOST_PYTHON_BIN)" \
|
||||
DJANGO_ADMIN_PY="$(STAGING_DIR_HOSTPKG)/bin/django-admin"
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/HostPyPipInstall,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS))
|
||||
$(call Build/Compile/Default,locale)
|
||||
endef
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seahub-3.1.7-server.orig/seahub/settings.py seahub-3.1.7-server/seahub/settings.py
|
||||
--- seahub-3.1.7-server.orig/seahub/settings.py 2014-10-20 09:32:35.000000000 +0200
|
||||
+++ seahub-3.1.7-server/seahub/settings.py 2014-12-10 15:47:21.625104606 +0100
|
||||
--- a/seahub/settings.py
|
||||
+++ b/seahub/settings.py
|
||||
@@ -46,7 +46,7 @@ SITE_ID = 1
|
||||
|
||||
# If you set this to False, Django will make some optimizations so as not
|
||||
@ -10,8 +9,8 @@ diff -rupN seahub-3.1.7-server.orig/seahub/settings.py seahub-3.1.7-server/seahu
|
||||
|
||||
# If you set this to False, Django will not format dates, numbers and
|
||||
# calendars according to the current locale.
|
||||
@@ -209,7 +209,7 @@ SHOW_REPO_DOWNLOAD_BUTTON = False
|
||||
REPO_PASSWORD_MIN_LENGTH = 8
|
||||
@@ -339,7 +339,7 @@ SHARE_LINK_EMAIL_LANGUAGE = ''
|
||||
ENABLE_UPLOAD_LINK_VIRUS_CHECK = False
|
||||
|
||||
# mininum length for user's password
|
||||
-USER_PASSWORD_MIN_LENGTH = 6
|
||||
@ -19,12 +18,12 @@ diff -rupN seahub-3.1.7-server.orig/seahub/settings.py seahub-3.1.7-server/seahu
|
||||
|
||||
# LEVEL based on four types of input:
|
||||
# num, upper letter, lower letter, other symbols
|
||||
@@ -218,7 +218,7 @@ USER_PASSWORD_STRENGTH_LEVEL = 3
|
||||
@@ -348,7 +348,7 @@ USER_PASSWORD_STRENGTH_LEVEL = 3
|
||||
|
||||
# default False, only check USER_PASSWORD_MIN_LENGTH
|
||||
# when True, check password strength level, STRONG(or above) is allowed
|
||||
-USER_STRONG_PASSWORD_REQUIRED = False
|
||||
+USER_STRONG_PASSWORD_REQUIRED = True
|
||||
|
||||
# Using server side crypto by default, otherwise, let user choose crypto method.
|
||||
FORCE_SERVER_CRYPTO = True
|
||||
# Force user to change password when admin add/reset a user.
|
||||
FORCE_PASSWORD_CHANGE = True
|
||||
|
@ -1,42 +1,39 @@
|
||||
diff -rupN seafile-seahub-6.2.2.orig/Makefile seafile-seahub-6.2.2/Makefile
|
||||
--- seafile-seahub-6.2.2.orig/Makefile 2017-10-22 22:28:22.000000000 +0200
|
||||
+++ seafile-seahub-6.2.2/Makefile 2017-10-22 22:46:18.007470936 +0200
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,3 +1,6 @@
|
||||
+include $(TOPDIR)/rules.mk
|
||||
+include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
|
||||
+PYTHON ?= python
|
||||
+DJANGO_ADMIN_PY ?= django-admin.py
|
||||
+
|
||||
PROJECT=seahub
|
||||
|
||||
develop: setup-git
|
||||
@@ -9,7 +12,9 @@ dist: locale uglify statici18n collectst
|
||||
@@ -9,7 +12,7 @@ dist: locale uglify statici18n collectstatic
|
||||
|
||||
locale:
|
||||
@echo "--> Compile locales"
|
||||
- django-admin.py compilemessages && cd seahub/two_factor && django-admin.py compilemessages
|
||||
+ $(call HostPython,,$(STAGING_DIR)/usr/bin/django-admin.py compilemessages)
|
||||
+ cd seahub/two_factor
|
||||
+ $(call HostPython,,$(STAGING_DIR)/usr/bin/django-admin.py compilemessages)
|
||||
- django-admin.py compilemessages
|
||||
+ $(DJANGO_ADMIN_PY) compilemessages
|
||||
@echo ""
|
||||
|
||||
uglify:
|
||||
@@ -19,17 +24,17 @@ uglify:
|
||||
@@ -19,17 +22,17 @@ uglify:
|
||||
|
||||
statici18n:
|
||||
@echo "--> Generate JS locale files in static/scripts/i18n"
|
||||
- python manage.py compilejsi18n
|
||||
+ $(call HostPython,,manage.py compilejsi18n)
|
||||
+ $(PYTHON) manage.py compilejsi18n
|
||||
|
||||
collectstatic:
|
||||
@echo "--> Collect django static files to media/assets"
|
||||
rm -rf media/assets 2> /dev/null
|
||||
- python manage.py collectstatic --noinput
|
||||
+ $(call HostPython,,manage.py collectstatic --noinput)
|
||||
- python manage.py collectstatic --noinput -i admin -i termsandconditions -i app -i sysadmin-app -i build.js
|
||||
+ $(PYTHON) manage.py collectstatic --noinput -i admin -i termsandconditions -i app -i sysadmin-app -i build.js
|
||||
|
||||
compressstatic:
|
||||
@echo "--> Compress static files(css) to media/CACHE"
|
||||
rm -rf media/CACHE 2> /dev/null
|
||||
- python manage.py compress
|
||||
+ $(call HostPython,,manage.py compress)
|
||||
+ $(PYTHON) manage.py compress
|
||||
|
||||
clean:
|
||||
@echo '--> Cleaning media/static cache & dist'
|
||||
|
@ -9,8 +9,4 @@ config SEAFILE_FUSE_SUPPORT
|
||||
config SEAFILE_CONSOLE_SUPPORT
|
||||
bool "Enable seafile server console"
|
||||
default n
|
||||
|
||||
config SEAFILE_RIAK_SUPPORT
|
||||
bool "Enable support for riak backend"
|
||||
default n
|
||||
endmenu
|
||||
|
@ -8,16 +8,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=seafile-server
|
||||
PKG_VERSION:=6.2.2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
|
||||
PKG_VERSION:=6.3.4
|
||||
PKG_RELEASE:=6
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/haiwen/seafile-server.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=6978d2cb2e05cc774370b4d06c9f0a864df71936
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=99aa9c41641d7c0ffe18bbab75418b1347dd9e156124472bbee5a6dda09a8057
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seafile-server/tar.gz/v$(PKG_VERSION)-server?
|
||||
PKG_HASH:=1ba4c641bad8d7592fd2592827e81470c88b8e802707d2b1e6d551c16d0da100
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-server
|
||||
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@ -25,16 +25,24 @@ include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include ../../lang/python/python-package.mk
|
||||
|
||||
# Check that the actual Makefile version-relase match the above.
|
||||
$(eval $(shell awk '/^PKG_VERSION.*=/ { print "SEAHUB_" $$$$0 }' ../seafile-seahub/Makefile))
|
||||
ifneq ($(PKG_VERSION),$(SEAHUB_PKG_VERSION))
|
||||
$(error $(if $(SEAHUB_PKG_VERSION), \
|
||||
Version mismatch between seafile-seahub ($(SEAHUB_PKG_VERSION)) and \
|
||||
seafile-server ($(PKG_VERSION)), \
|
||||
Could not get PKG_VERSION from seafile-seahub Makefile))
|
||||
endif
|
||||
|
||||
define Package/seafile-server
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Seafile server
|
||||
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
|
||||
URL:=http://seafile.com/
|
||||
DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli +python-mysql +python-urllib3 \
|
||||
+jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient \
|
||||
URL:=https://seafile.com/
|
||||
DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli \
|
||||
+python-mysqlclient +python-urllib3 \
|
||||
+jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient +oniguruma \
|
||||
+libpthread +libuuid +bash +procps-ng +procps-ng-pkill +SEAFILE_FUSE_SUPPORT:libfuse $(ICONV_DEPENDS)
|
||||
EXTRA_DEPENDS:=seafile-ccnet (=6.2.2-6b9d7e2920aa9b807f9efe9038439b57ce949ecc-1), seafile-seahub (=6.2.2-120e7a299e77968f1af48ea2dcf4bd9b909c426f-1)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
@ -46,11 +54,7 @@ define Package/seafile-server/description
|
||||
Open source cloud storage with advanced features on privacy protection and teamwork.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += --disable-client \
|
||||
--enable-server \
|
||||
--enable-python \
|
||||
--disable-static-build \
|
||||
--disable-server-pkg
|
||||
CONFIGURE_ARGS += --enable-python
|
||||
|
||||
ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
|
||||
CONFIGURE_ARGS += --enable-fuse
|
||||
@ -65,12 +69,6 @@ else
|
||||
CONFIGURE_ARGS += --disable-console
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SEAFILE_RIAK_SUPPORT),y)
|
||||
CONFIGURE_ARGS += --enable-riak
|
||||
else
|
||||
CONFIGURE_ARGS += --disable-riak
|
||||
endif
|
||||
|
||||
PKG_BUILD_DEPENDS:=vala/host libevhtp
|
||||
|
||||
# This is required as python-package.mk overrides the default setting of having interlinking enabled
|
||||
@ -80,6 +78,10 @@ endif
|
||||
TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
|
||||
-L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz -levent_openssl -levent
|
||||
|
||||
ifdef CONFIG_GCC_LIBSSP
|
||||
TARGET_LDFLAGS += -lssp
|
||||
endif
|
||||
|
||||
define Package/seafile-server/conffiles
|
||||
/etc/config/seafile
|
||||
endef
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fsck.sh seafile-server-5.1.1/scripts/seaf-fsck.sh
|
||||
--- seafile-server-5.1.1.orig/scripts/seaf-fsck.sh 2016-04-21 11:05:26.000000000 +0200
|
||||
+++ seafile-server-5.1.1/scripts/seaf-fsck.sh 2016-04-22 09:10:13.075581325 +0200
|
||||
--- a/scripts/seaf-fsck.sh
|
||||
+++ b/scripts/seaf-fsck.sh
|
||||
@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
@ -10,9 +9,8 @@ diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fsck.sh seafile-server-5.1.1/s
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
diff -rupN seafile-server-5.1.1.orig/scripts/seaf-gc.sh seafile-server-5.1.1/scripts/seaf-gc.sh
|
||||
--- seafile-server-5.1.1.orig/scripts/seaf-gc.sh 2016-04-21 11:05:26.000000000 +0200
|
||||
+++ seafile-server-5.1.1/scripts/seaf-gc.sh 2016-04-22 09:10:27.211581999 +0200
|
||||
--- a/scripts/seaf-gc.sh
|
||||
+++ b/scripts/seaf-gc.sh
|
||||
@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
@ -22,9 +20,8 @@ diff -rupN seafile-server-5.1.1.orig/scripts/seaf-gc.sh seafile-server-5.1.1/scr
|
||||
seaf_gc_opts=""
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
diff -rupN seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh seafile-server-5.1.1/scripts/setup-seafile-mysql.sh
|
||||
--- seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh 2016-04-21 11:05:26.000000000 +0200
|
||||
+++ seafile-server-5.1.1/scripts/setup-seafile-mysql.sh 2016-04-22 09:11:50.083585953 +0200
|
||||
--- a/scripts/setup-seafile-mysql.sh
|
||||
+++ b/scripts/setup-seafile-mysql.sh
|
||||
@@ -40,15 +40,10 @@ function check_python_executable() {
|
||||
function check_python_module () {
|
||||
module=$1
|
||||
@ -65,10 +62,9 @@ diff -rupN seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh seafile-serv
|
||||
export PYTHON=$PYTHON
|
||||
+export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
|
||||
|
||||
exec $PYTHON "$python_script"
|
||||
diff -rupN seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh seafile-server-5.1.1/scripts/sqlite2mysql.sh
|
||||
--- seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh 2016-04-21 11:05:26.000000000 +0200
|
||||
+++ seafile-server-5.1.1/scripts/sqlite2mysql.sh 2016-04-22 09:02:22.047558854 +0200
|
||||
exec $PYTHON "$python_script" "$@"
|
||||
--- a/scripts/sqlite2mysql.sh
|
||||
+++ b/scripts/sqlite2mysql.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/controller/seafile-controller.c seafile-server-5.1.1/controller/seafile-controller.c
|
||||
--- seafile-server-5.1.1.orig/controller/seafile-controller.c 2016-04-19 15:44:32.000000000 +0200
|
||||
+++ seafile-server-5.1.1/controller/seafile-controller.c 2016-04-19 16:23:05.785000218 +0200
|
||||
--- a/controller/seafile-controller.c
|
||||
+++ b/controller/seafile-controller.c
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
SeafileController *ctl;
|
||||
@ -10,7 +9,7 @@ diff -rupN seafile-server-5.1.1.orig/controller/seafile-controller.c seafile-ser
|
||||
|
||||
char *bin_dir = NULL;
|
||||
char *installpath = NULL;
|
||||
@@ -575,9 +575,9 @@ stop_ccnet_server ()
|
||||
@@ -591,9 +591,9 @@ stop_ccnet_server ()
|
||||
static void
|
||||
init_pidfile_path (SeafileController *ctl)
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/tools/seafile-admin seafile-server-5.1.1/tools/seafile-admin
|
||||
--- seafile-server-5.1.1.orig/tools/seafile-admin 2016-04-19 15:44:33.000000000 +0200
|
||||
+++ seafile-server-5.1.1/tools/seafile-admin 2016-04-26 10:55:11.826798430 +0200
|
||||
--- a/tools/seafile-admin
|
||||
+++ b/tools/seafile-admin
|
||||
@@ -449,9 +449,12 @@ workers = 3
|
||||
|
||||
# Logging
|
||||
|
@ -1,13 +1,12 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Makefile.am
|
||||
--- seafile-server-5.1.1.orig/lib/Makefile.am 2016-04-21 11:05:26.000000000 +0200
|
||||
+++ seafile-server-5.1.1/lib/Makefile.am 2016-04-22 10:09:41.567751561 +0200
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -1,3 +1,5 @@
|
||||
+include $(TOPDIR)/rules.mk
|
||||
+
|
||||
pcfiles = libseafile.pc
|
||||
pkgconfig_DATA = $(pcfiles)
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
@@ -35,7 +37,7 @@ seafile-rpc-wrapper.c: seafile-object.h
|
||||
@@ -33,7 +35,7 @@ seafile_HEADERS = seafile-object.h
|
||||
|
||||
seafile-object.h: ${seafile_object_define}
|
||||
rm -f $@
|
||||
@ -16,7 +15,7 @@ diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Ma
|
||||
|
||||
DISTCLEANFILES = ${searpc_gen}
|
||||
|
||||
@@ -64,7 +66,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
|
||||
@@ -56,7 +58,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_table.py
|
||||
@rm -f rpc_table.tmp
|
||||
@touch rpc_table.tmp
|
||||
@echo "[libsearpc]: generating rpc header files"
|
||||
@ -25,7 +24,7 @@ diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Ma
|
||||
@echo "[libsearpc]: done"
|
||||
@mv -f rpc_table.tmp $@
|
||||
|
||||
@@ -74,7 +76,7 @@ vala.stamp: ${seafile_object_define}
|
||||
@@ -66,7 +68,7 @@ vala.stamp: ${seafile_object_define}
|
||||
rm -f ${seafile_object_gen}
|
||||
@rm -f vala.tmp
|
||||
@touch vala.tmp
|
||||
@ -34,7 +33,7 @@ diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Ma
|
||||
@mv -f vala.tmp $@
|
||||
|
||||
${seafile_object_gen}: vala.stamp
|
||||
@@ -90,5 +92,5 @@ install-data-local:
|
||||
@@ -82,5 +84,5 @@ install-data-local:
|
||||
if MACOS
|
||||
sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
|
||||
else
|
||||
|
@ -1,7 +1,6 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo.vala
|
||||
--- seafile-server-5.1.1.orig/lib/repo.vala 2016-04-19 15:44:32.000000000 +0200
|
||||
+++ seafile-server-5.1.1/lib/repo.vala 2016-04-25 21:29:33.327962235 +0200
|
||||
@@ -30,7 +30,7 @@ public class Repo : Object {
|
||||
--- a/lib/repo.vala
|
||||
+++ b/lib/repo.vala
|
||||
@@ -34,7 +34,7 @@ public class Repo : Object {
|
||||
// data format version
|
||||
public int version { get; set; }
|
||||
|
||||
@ -9,8 +8,8 @@ diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo
|
||||
+ public int64 last_modify { get; set; }
|
||||
public int64 size { get; set; }
|
||||
public int64 file_count { get; set; }
|
||||
public string head_cmmt_id { get; set; }
|
||||
@@ -40,7 +40,7 @@ public class Repo : Object {
|
||||
public string last_modifier { get; set; }
|
||||
@@ -45,7 +45,7 @@ public class Repo : Object {
|
||||
public string repo_id { get; set; }
|
||||
public string repo_name { get; set; }
|
||||
public string repo_desc { get; set; }
|
||||
@ -19,7 +18,7 @@ diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo
|
||||
|
||||
// Section 2: Encryption related
|
||||
// Members in this section should be set for every Repo object
|
||||
@@ -63,7 +63,7 @@ public class Repo : Object {
|
||||
@@ -68,7 +68,7 @@ public class Repo : Object {
|
||||
get { return _relay_id; }
|
||||
set { _relay_id = value; }
|
||||
}
|
||||
@ -28,7 +27,7 @@ diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo
|
||||
public bool auto_sync { get; set; }
|
||||
public bool worktree_invalid { get; set; }
|
||||
|
||||
@@ -155,7 +155,7 @@ public class DeletedEntry : Object {
|
||||
@@ -162,7 +162,7 @@ public class DeletedEntry : Object {
|
||||
public string obj_name { get; set; }
|
||||
public string basedir { get; set; }
|
||||
public int mode { get; set; }
|
||||
|
@ -1,6 +1,5 @@
|
||||
diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fuse.sh seafile-server-5.1.1/scripts/seaf-fuse.sh
|
||||
--- seafile-server-5.1.1.orig/scripts/seaf-fuse.sh 2016-05-29 08:43:19.000000000 +0200
|
||||
+++ seafile-server-5.1.1/scripts/seaf-fuse.sh 2016-05-29 09:13:06.286680653 +0200
|
||||
--- a/scripts/seaf-fuse.sh
|
||||
+++ b/scripts/seaf-fuse.sh
|
||||
@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 13f95a28ce12216ba51cf0ca8d61c3d89689d02b Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Wed, 6 Jun 2018 18:11:47 -0300
|
||||
Subject: [PATCH] Remove API deprecated in openssl 1.1
|
||||
|
||||
Openssl 1.1 has deprecated RAND_pseudo_bytes. It won't compile with
|
||||
openssl built witout deprecated API.
|
||||
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
---
|
||||
common/seafile-crypt.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/common/seafile-crypt.c b/common/seafile-crypt.c
|
||||
index c7d1702..c3cebf5 100644
|
||||
--- a/common/seafile-crypt.c
|
||||
+++ b/common/seafile-crypt.c
|
||||
@@ -81,9 +81,14 @@ seafile_generate_random_key (const char *passwd, char *random_key)
|
||||
|
||||
int rc = RAND_bytes (secret_key, sizeof(secret_key));
|
||||
if (rc != 1) {
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_API_COMPAT < 0x10100000L
|
||||
seaf_warning ("Failed to generate secret key for repo encryption "
|
||||
"with RAND_bytes(), use RAND_pseudo_bytes().\n");
|
||||
RAND_pseudo_bytes (secret_key, sizeof(secret_key));
|
||||
+#else
|
||||
+ seaf_warning ("Failed to generate secret key for repo encryption "
|
||||
+ "with RAND_bytes().\n");
|
||||
+#endif
|
||||
}
|
||||
|
||||
seafile_derive_key (passwd, strlen(passwd), 2, key, iv);
|
||||
--
|
||||
2.16.4
|
||||
|
61
net/seafile-server/patches/090-django-11-compat.patch
Normal file
61
net/seafile-server/patches/090-django-11-compat.patch
Normal file
@ -0,0 +1,61 @@
|
||||
From 115a4583deb9ae11adbc419ea87c990d0b8572fe Mon Sep 17 00:00:00 2001
|
||||
From: Joffrey Darcq <j-off@live.fr>
|
||||
Date: Sat, 28 Apr 2018 22:27:28 +0200
|
||||
Subject: [PATCH 1/2] fix django version 1.11
|
||||
|
||||
---
|
||||
tools/seafile-admin | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/seafile-admin b/tools/seafile-admin
|
||||
index 5e3658b..38e7288 100755
|
||||
--- a/tools/seafile-admin
|
||||
+++ b/tools/seafile-admin
|
||||
@@ -518,10 +518,10 @@ def init_seahub():
|
||||
|
||||
|
||||
def check_django_version():
|
||||
- '''Requires django 1.8'''
|
||||
+ '''Requires django 1.11'''
|
||||
import django
|
||||
- if django.VERSION[0] != 1 or django.VERSION[1] != 8:
|
||||
- error('Django 1.8 is required')
|
||||
+ if django.VERSION[0] != 1 or django.VERSION[1] != 11:
|
||||
+ error('Django 1.11 is required')
|
||||
del django
|
||||
|
||||
|
||||
|
||||
From bf69ff1cf1080081eae5d8115842c26468746736 Mon Sep 17 00:00:00 2001
|
||||
From: Joffrey Darcq <j-off@live.fr>
|
||||
Date: Sun, 3 Jun 2018 15:51:54 +0200
|
||||
Subject: [PATCH 2/2] fix django version 1.11
|
||||
|
||||
---
|
||||
tools/seafile-admin | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/seafile-admin b/tools/seafile-admin
|
||||
index 38e7288..c16aab6 100755
|
||||
--- a/tools/seafile-admin
|
||||
+++ b/tools/seafile-admin
|
||||
@@ -499,8 +499,8 @@ def init_seahub():
|
||||
# create seahub_settings.py
|
||||
create_seahub_settings_py()
|
||||
|
||||
- argv = [PYTHON, 'manage.py', 'syncdb']
|
||||
- # Set proper PYTHONPATH before run django syncdb command
|
||||
+ argv = [PYTHON, 'manage.py', 'migrate']
|
||||
+ # Set proper PYTHONPATH before run django migrate command
|
||||
env = get_seahub_env()
|
||||
|
||||
print
|
||||
@@ -509,7 +509,7 @@ def init_seahub():
|
||||
print
|
||||
|
||||
if run_argv(argv, cwd=seahub_dir, env=env) != 0:
|
||||
- error('Seahub syncdb failed')
|
||||
+ error('Seahub migrate failed')
|
||||
|
||||
info('done')
|
||||
|
@ -0,0 +1,26 @@
|
||||
--- a/tools/seafile-admin
|
||||
+++ b/tools/seafile-admin
|
||||
@@ -831,7 +831,22 @@ def setup_seafile(args):
|
||||
conf[CONF_SEAFILE_CENTRAL_CONF_DIR] = os.path.join(cwd, 'conf')
|
||||
config_ccnet_seafile()
|
||||
init_ccnet_seafile()
|
||||
- init_seahub()
|
||||
+
|
||||
+ # make sure ccnet-server is running to avoid an error creating django superuser
|
||||
+ if not is_running('ccnet-server'):
|
||||
+ argv = [
|
||||
+ 'ccnet-server',
|
||||
+ '-F',
|
||||
+ conf[CONF_SEAFILE_CENTRAL_CONF_DIR],
|
||||
+ '-c',
|
||||
+ conf[CONF_CCNET_DIR],
|
||||
+ '-d'
|
||||
+ ]
|
||||
+ run_argv(argv)
|
||||
+ init_seahub()
|
||||
+ pkill('ccnet-server')
|
||||
+ else:
|
||||
+ init_seahub()
|
||||
|
||||
print
|
||||
print '-----------------------------------------------------------------'
|
40
net/seafile-server/patches/110-libevhtp-linking.patch
Normal file
40
net/seafile-server/patches/110-libevhtp-linking.patch
Normal file
@ -0,0 +1,40 @@
|
||||
Author: David Barbion <davidb@230ruedubac.fr>
|
||||
Description: Use shared object for libevhtp
|
||||
Forwarded: https://github.com/haiwen/seafile-server/pull/12
|
||||
|
||||
Index: seafile-server/configure.ac
|
||||
===================================================================
|
||||
--- seafile-server.orig/configure.ac
|
||||
+++ seafile-server/configure.ac
|
||||
@@ -218,6 +218,10 @@ PKG_CHECK_MODULES(LIBEVENT, [libevent >=
|
||||
AC_SUBST(LIBEVENT_CFLAGS)
|
||||
AC_SUBST(LIBEVENT_LIBS)
|
||||
|
||||
+PKG_CHECK_MODULES(LIBEVHTP, [evhtp])
|
||||
+AC_SUBST(LIBEVHTP_CFLAGS)
|
||||
+AC_SUBST(LIBEVHTP_LIBS)
|
||||
+
|
||||
PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_REQUIRED])
|
||||
AC_SUBST(ZLIB_CFLAGS)
|
||||
AC_SUBST(ZLIB_LIBS)
|
||||
Index: seafile-server/server/Makefile.am
|
||||
===================================================================
|
||||
--- seafile-server.orig/server/Makefile.am
|
||||
+++ seafile-server/server/Makefile.am
|
||||
@@ -13,6 +13,7 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)
|
||||
@GLIB2_CFLAGS@ \
|
||||
@MSVC_CFLAGS@ \
|
||||
@LIBARCHIVE_CFLAGS@ \
|
||||
+ @LIBEVHTP_CFLAGS@ \
|
||||
-Wall
|
||||
|
||||
bin_PROGRAMS = seaf-server
|
||||
@@ -114,7 +115,7 @@ seaf_server_SOURCES = \
|
||||
|
||||
seaf_server_LDADD = @CCNET_LIBS@ \
|
||||
$(top_builddir)/lib/libseafile_common.la \
|
||||
- @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ -levhtp \
|
||||
+ -lonig @GLIB2_LIBS@ @GOBJECT_LIBS@ @SSL_LIBS@ @LIB_RT@ @LIB_UUID@ -lsqlite3 @LIBEVENT_LIBS@ @LIBEVHTP_LIBS@ \
|
||||
$(top_builddir)/common/cdc/libcdc.la \
|
||||
$(top_builddir)/common/db-wrapper/libdbwrapper.la \
|
||||
@SEARPC_LIBS@ @JANSSON_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \
|
69
net/seafile-server/patches/120-recent-libevhtp.patch
Normal file
69
net/seafile-server/patches/120-recent-libevhtp.patch
Normal file
@ -0,0 +1,69 @@
|
||||
Author: Alexandre Rossi <alexandre.rossi@gmail.com>
|
||||
Description: Fix download stalling on recent libevhtp
|
||||
A while ago[1], evhtp_request_pause() behavior changed: it now disables
|
||||
both read and write events. seafile-server would then stall.
|
||||
.
|
||||
[1] https://github.com/criticalstack/libevhtp/commit/6cd89466fd6bd76c5b8624be65af5893afe3e40c
|
||||
[2] https://github.com/haiwen/seafile/issues/1119
|
||||
Forwarded: no
|
||||
|
||||
Index: seafile-server/server/access-file.c
|
||||
===================================================================
|
||||
--- seafile-server.orig/server/access-file.c 2018-02-01 12:23:53.209308343 +0100
|
||||
+++ seafile-server/server/access-file.c 2018-02-01 12:23:53.205308288 +0100
|
||||
@@ -618,7 +618,7 @@
|
||||
/* Block any new request from this connection before finish
|
||||
* handling this request.
|
||||
*/
|
||||
- evhtp_request_pause (req);
|
||||
+ bufferevent_disable(bev, EV_READ);
|
||||
|
||||
/* Kick start data transfer by sending out http headers. */
|
||||
evhtp_send_reply_start(req, EVHTP_RES_OK);
|
||||
@@ -967,7 +967,7 @@
|
||||
/* Block any new request from this connection before finish
|
||||
* handling this request.
|
||||
*/
|
||||
- evhtp_request_pause (req);
|
||||
+ bufferevent_disable(bev, EV_READ);
|
||||
|
||||
/* Kick start data transfer by sending out http headers. */
|
||||
evhtp_send_reply_start(req, EVHTP_RES_PARTIAL);
|
||||
@@ -1032,7 +1032,7 @@
|
||||
/* Block any new request from this connection before finish
|
||||
* handling this request.
|
||||
*/
|
||||
- evhtp_request_pause (req);
|
||||
+ bufferevent_disable(bev, EV_READ);
|
||||
|
||||
/* Kick start data transfer by sending out http headers. */
|
||||
evhtp_send_reply_start(req, EVHTP_RES_OK);
|
||||
@@ -1365,7 +1365,7 @@
|
||||
/* Block any new request from this connection before finish
|
||||
* handling this request.
|
||||
*/
|
||||
- evhtp_request_pause (req);
|
||||
+ bufferevent_disable(bev, EV_READ);
|
||||
|
||||
/* Kick start data transfer by sending out http headers. */
|
||||
evhtp_send_reply_start(req, EVHTP_RES_OK);
|
||||
Index: seafile-server/server/upload-file.c
|
||||
===================================================================
|
||||
--- seafile-server.orig/server/upload-file.c 2018-02-01 12:23:53.209308343 +0100
|
||||
+++ seafile-server/server/upload-file.c 2018-02-01 12:25:14.542400155 +0100
|
||||
@@ -2054,6 +2054,7 @@
|
||||
if (res != EVHTP_RES_OK) {
|
||||
/* Don't receive any data before the connection is closed. */
|
||||
//evhtp_request_pause (req);
|
||||
+ // or for later evhtp bufferevent_disable(evhtp_request_get_bev(req), EV_READ);
|
||||
|
||||
/* Set keepalive to 0. This will cause evhtp to close the
|
||||
* connection after sending the reply.
|
||||
@@ -2271,6 +2272,7 @@
|
||||
err:
|
||||
/* Don't receive any data before the connection is closed. */
|
||||
//evhtp_request_pause (req);
|
||||
+ // or for later evhtp bufferevent_disable(evhtp_request_get_bev(req), EV_READ);
|
||||
|
||||
/* Set keepalive to 0. This will cause evhtp to close the
|
||||
* connection after sending the reply.
|
85
net/seafile-server/patches/130-newer-libevhtp.patch
Normal file
85
net/seafile-server/patches/130-newer-libevhtp.patch
Normal file
@ -0,0 +1,85 @@
|
||||
Author: Alexandre Rossi <alexandre.rossi@gmail.com>
|
||||
Description: Take into account libevhtp API changes
|
||||
Forwarded: no
|
||||
|
||||
Index: seafile-server/server/upload-file.c
|
||||
===================================================================
|
||||
--- seafile-server.orig/server/upload-file.c 2018-02-01 12:25:52.666911934 +0100
|
||||
+++ seafile-server/server/upload-file.c 2018-02-01 12:27:37.812323399 +0100
|
||||
@@ -2059,7 +2059,7 @@
|
||||
/* Set keepalive to 0. This will cause evhtp to close the
|
||||
* connection after sending the reply.
|
||||
*/
|
||||
- req->keepalive = 0;
|
||||
+ req->flags &= ~EVHTP_REQ_FLAG_KEEPALIVE;
|
||||
|
||||
fsm->state = RECV_ERROR;
|
||||
}
|
||||
@@ -2260,8 +2260,8 @@
|
||||
}
|
||||
|
||||
/* Set up per-request hooks, so that we can read file data piece by piece. */
|
||||
- evhtp_set_hook (&req->hooks, evhtp_hook_on_read, upload_read_cb, fsm);
|
||||
- evhtp_set_hook (&req->hooks, evhtp_hook_on_request_fini, upload_finish_cb, fsm);
|
||||
+ evhtp_request_set_hook (req, evhtp_hook_on_read, upload_read_cb, fsm);
|
||||
+ evhtp_request_set_hook (req, evhtp_hook_on_request_fini, upload_finish_cb, fsm);
|
||||
/* Set arg for upload_cb or update_cb. */
|
||||
req->cbarg = fsm;
|
||||
|
||||
@@ -2277,7 +2277,7 @@
|
||||
/* Set keepalive to 0. This will cause evhtp to close the
|
||||
* connection after sending the reply.
|
||||
*/
|
||||
- req->keepalive = 0;
|
||||
+ req->flags &= ~EVHTP_REQ_FLAG_KEEPALIVE;
|
||||
send_error_reply (req, EVHTP_RES_BADREQ, err_msg);
|
||||
|
||||
g_free (repo_id);
|
||||
@@ -2346,38 +2346,32 @@
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/upload/.*", upload_cb, NULL);
|
||||
/* upload_headers_cb() will be called after evhtp parsed all http headers. */
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/upload-api/.*", upload_api_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/upload-raw-blks-api/.*",
|
||||
upload_raw_blks_api_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/upload-blks-api/.*", upload_blks_api_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
-
|
||||
- /* cb = evhtp_set_regex_cb (htp, "^/upload-blks-aj/.*", upload_blks_ajax_cb, NULL); */
|
||||
- /* evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); */
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/upload-aj/.*", upload_ajax_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/update/.*", update_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/update-api/.*", update_api_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/update-blks-api/.*", update_blks_api_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
-
|
||||
- /* cb = evhtp_set_regex_cb (htp, "^/update-blks-aj/.*", update_blks_ajax_cb, NULL); */
|
||||
- /* evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL); */
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
cb = evhtp_set_regex_cb (htp, "^/update-aj/.*", update_ajax_cb, NULL);
|
||||
- evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
+ evhtp_callback_set_hook(cb, evhtp_hook_on_headers, upload_headers_cb, NULL);
|
||||
|
||||
evhtp_set_regex_cb (htp, "^/upload_progress.*", upload_progress_cb, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user