diff --git a/net-mgmt/seafile-server/Makefile b/net-mgmt/seafile-server/Makefile index 4d2795767903..d6c3bcd88a9e 100644 --- a/net-mgmt/seafile-server/Makefile +++ b/net-mgmt/seafile-server/Makefile @@ -4,6 +4,7 @@ PORTNAME= seafile-server DISTVERSIONPREFIX= v DISTVERSION= ${SEAFILE_VER} DISTVERSIONSUFFIX= -server +PORTREVISION= 1 CATEGORIES= net-mgmt MAINTAINER= ultima@FreeBSD.org diff --git a/net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py b/net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py index 5ffbeda62589..10ebf9c54ec3 100644 --- a/net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py +++ b/net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py @@ -1,4 +1,4 @@ ---- scripts/setup-seafile-mysql.py.orig 2017-03-18 16:19:38 UTC +--- scripts/setup-seafile-mysql.py.orig 2018-08-19 23:40:51 UTC +++ scripts/setup-seafile-mysql.py @@ -19,6 +19,8 @@ from ConfigParser import ConfigParser @@ -9,7 +9,7 @@ try: import readline # pylint: disable=W0611 -@@ -422,8 +424,6 @@ Please choose a way to initialize seafile databases: +@@ -424,8 +426,6 @@ Please choose a way to initialize seafil if not re.match(r'^[a-zA-Z0-9_\-\.]+$', host): raise InvalidAnswer('%s is not a valid host' % Utils.highlight(host)) @@ -18,7 +18,7 @@ return host def ask_mysql_host(self): -@@ -1167,17 +1167,23 @@ share_name = / +@@ -1209,17 +1209,23 @@ limit_request_line = 8190 class UserManualHandler(object): def __init__(self): @@ -43,7 +43,7 @@ def report_config(): print -@@ -1242,6 +1248,8 @@ def create_seafile_server_symlink(): +@@ -1284,6 +1290,8 @@ def create_seafile_server_symlink(): def set_file_perm(): filemode = 0600 dirmode = 0700 @@ -52,7 +52,7 @@ files = [ seahub_config.seahub_settings_py, ] -@@ -1253,8 +1261,10 @@ def set_file_perm(): +@@ -1295,8 +1303,10 @@ def set_file_perm(): ] for fpath in files: os.chmod(fpath, filemode) @@ -63,7 +63,7 @@ env_mgr = EnvManager() ccnet_config = CcnetConfigurator() -@@ -1445,8 +1455,12 @@ def report_success(): +@@ -1488,8 +1498,11 @@ def report_success(): Your seafile server configuration has been finished successfully. ----------------------------------------------------------------- @@ -72,7 +72,6 @@ +run seafile server: sysrc seafile_enable=YES + service seafile { start | stop | restart } +run seahub server: sysrc seahub_enable=YES -+fastcgi (optional): sysrc seahub_fastcgi=1 + service seahub { start | stop | restart } +run reset-admin: ./reset-admin.sh diff --git a/net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh b/net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh index 87e1f8e5d7e3..fc08ed84ca11 100644 --- a/net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh +++ b/net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh @@ -1,6 +1,6 @@ ---- scripts/setup-seafile.sh.orig 2017-03-13 02:59:56 UTC +--- scripts/setup-seafile.sh.orig 2018-08-19 23:40:51 UTC +++ scripts/setup-seafile.sh -@@ -15,6 +15,8 @@ use_existing_seafile="false" +@@ -17,6 +17,8 @@ use_existing_seafile="false" server_manual_http="https://github.com/haiwen/seafile/wiki" @@ -9,7 +9,7 @@ function welcome () { echo "-----------------------------------------------------------------" echo "This script will guide you to config and setup your seafile server." -@@ -318,10 +320,17 @@ fi +@@ -352,10 +354,17 @@ fi } function copy_user_manuals() { @@ -28,7 +28,7 @@ } function parse_params() { -@@ -673,6 +682,13 @@ chmod 0600 "$dest_settings_py" +@@ -713,6 +722,13 @@ chmod 0600 "$dest_settings_py" chmod 0700 "$default_ccnet_conf_dir" chmod 0700 "$seafile_data_dir" chmod 0700 "$default_conf_dir" @@ -42,7 +42,7 @@ # ------------------------------------------- # copy user manuals to library template -@@ -689,9 +705,18 @@ echo +@@ -729,9 +745,17 @@ echo echo "-----------------------------------------------------------------" echo "Your seafile server configuration has been completed successfully." echo "-----------------------------------------------------------------" @@ -54,7 +54,6 @@ + echo "run seafile server: sysrc seafile_enable=YES" + echo " service seafile { start | stop | restart }" + echo "run seahub server: sysrc seahub_enable=YES" -+ echo "fastcgi (optional): sysrc seahub_fastcgi=1" + echo " service seahub { start | stop | restart }" + echo "run reset-admin: ./reset-admin.sh" +else diff --git a/www/seahub/Makefile b/www/seahub/Makefile index 9c4ba657023a..7bd0bc2902f9 100644 --- a/www/seahub/Makefile +++ b/www/seahub/Makefile @@ -4,6 +4,7 @@ PORTNAME= seahub DISTVERSIONPREFIX= v DISTVERSION= ${SEAHUB_VER} DISTVERSIONSUFFIX= -pro +PORTREVISION= 1 CATEGORIES= www MAINTAINER= ultima@FreeBSD.org @@ -68,8 +69,6 @@ SUB_FILES= pkg-message do-patch: echo "${WRKSRC}..." - @${MKDIR} ${WRKSRC}/runtime - ${CP} ${FILESDIR}/runtime_seahub.conf ${WRKSRC}/runtime/seahub.conf ${REINPLACE_CMD} -Ee "s|SEAFILE_VERSION = '[0-9]+\.[0-9]+\.[0-9]+'|SEAFILE_VERSION = '${SEAFILE_VER}'|" \ ${WRKSRC}/seahub/settings.py ${REINPLACE_CMD} -e 's|##FIX_WWWDIR##|${PREFIX}/${HAIWENDIR}|' ${WRKSRC}/*.template @@ -89,10 +88,8 @@ do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/runtime/ \ ${STAGEDIR}${PREFIX}/${SEAHUBDIR} ${STAGEDIR}${PREFIX}/${SEAHUB_DATA_DIR} \ ${STAGEDIR}${PREFIX}/${SEAHUB_DATA_DIR}/custom - ${INSTALL} ${WRKSRC}/runtime/seahub.conf \ - ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/runtime/ (cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/${SEAHUBDIR} \ - "! -name Makefile ! -name runtime ! -name seahub.conf ! -name avatars \ + "! -name Makefile ! -name seahub.conf ! -name avatars \ ! -name default-non-register.jpg ! -name default.png ! -name groups") (cd ${WRKSRC}/media && ${COPYTREE_SHARE} ./avatars \ ${STAGEDIR}${PREFIX}/${SEAHUB_DATA_DIR}) diff --git a/www/seahub/files/runtime_seahub.conf b/www/seahub/files/runtime_seahub.conf deleted file mode 100644 index 01760309f393..000000000000 --- a/www/seahub/files/runtime_seahub.conf +++ /dev/null @@ -1,13 +0,0 @@ -import os - -daemon = True -workers = 3 -threads = 5 - -# Logging -runtime_dir = os.path.dirname(__file__) -pidfile = os.path.join(runtime_dir, 'seahub.pid') -errorlog = os.path.join(runtime_dir, 'error.log') -accesslog = os.path.join(runtime_dir, 'access.log') -# for file upload, we need a longer timeout value (default is only 30s, too short) -timeout = 1200 diff --git a/www/seahub/files/seahub.in b/www/seahub/files/seahub.in index 704b514ff889..ee65aaf85045 100644 --- a/www/seahub/files/seahub.in +++ b/www/seahub/files/seahub.in @@ -29,8 +29,6 @@ # seafile_logdir (str): Set to "" by default will use the path # %%PREFIX%%/%%HAIWENDIR%%/logs. # Set it to a different path. -# seahub_fastcgi (bool): Set to "NO" by default. -# Set to "YES" to start the fastcgi mode. # seahub_host (int): Default is 127.0.0.1. # seahub_port (int): Default is 8000. @@ -55,16 +53,13 @@ clearsessions_cmd="seahub_clearsessions" : ${seafile_conf:="%%PREFIX%%/%%HAIWENDIR%%/conf"} : ${seafile_datadir:="`cat ${seafile_ccnet}/seafile.ini 2>/dev/null`"} : ${seafile_logdir:="%%PREFIX%%/%%HAIWENDIR%%/logs"} -: ${seahub_fastcgi="NO"} : ${seahub_host:="127.0.0.1"} : ${seahub_port:="8000"} manage_py=${seafile_path}/seahub/manage.py gunicorn_exe=%%PREFIX%%/bin/gunicorn -gunicorn_conf=${seafile_path}/runtime/seahub.conf -pidfile=${seafile_path}/runtime/seahub.pid -errorlog=${seafile_path}/runtime/error.log -accesslog=${seafile_path}/runtime/access.log +gunicorn_conf=${seafile_conf}/gunicorn.conf +pidfile=%%PREFIX%%/%%HAIWENDIR%%/pids/seahub.pid command="%%PREFIX%%/bin/%%PYTHON%%" @@ -126,44 +121,21 @@ seahub_clearsessions() { seahub_start() { if checkyesno seahub_enable; then - if checkyesno seahub_fastcgi; then - echo "Starting seahub service fastcgi mode" - check_required_before; - before_start; - - # Returns 127.0.0.1 if SEAFILE_FASTCGI_HOST is unset or hasn't got any value, - # otherwise returns value of SEAFILE_FASTCGI_HOST environment variable - - echo "Starting seahub (fastcgi) at ${seahub_host}:${seahub_port} ..." - su -m "${seafile_user}" -c "$command \"${manage_py}\" runfcgi host=\"${seahub_host}\" port=\"${seahub_port}\" pidfile=$pidfile \ - outlog=${accesslog} errlog=${errorlog}" + check_required_before; + before_start; + echo "Starting seahub at port ${seahub_port} ..." + su -m "${seafile_user}" -c "$command \"${gunicorn_exe}\" seahub.wsgi:application -c \"${gunicorn_conf}\" -b \"0.0.0.0:${seahub_port}\" --preload --chdir \"$seafile_path/seahub\"" # Ensure seahub is started successfully - sleep 5 - if ! pgrep -f "${manage_py}" 1>/dev/null; then - printf "\033[33mError:Seahub failed to start.\033[m\n" - exit 1; - fi - echo - echo "Seahub is started" - echo - else - check_required_before; - before_start; - echo "Starting seahub at port ${seahub_port} ..." - su -m "${seafile_user}" -c "$command \"${gunicorn_exe}\" seahub.wsgi:application -c \"${gunicorn_conf}\" -b \"0.0.0.0:${seahub_port}\" --preload --chdir \"$seafile_path/seahub\"" - - # Ensure seahub is started successfully - sleep 5 - if ! pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then - printf "\033[33mError:Seahub failed to start.\033[m\n" - echo "Please try to run \"./seahub.sh start\" again" - exit 1; - fi - echo - echo "Seahub is started" - echo + sleep 5 + if ! pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then + printf "\033[33mError:Seahub failed to start.\033[m\n" + echo "Please try to run \"./seahub.sh start\" again" + exit 1; fi + echo + echo "Seahub is started" + echo else return 0 fi diff --git a/www/seahub/pkg-plist b/www/seahub/pkg-plist index 9f86e495a315..dc4202f6f524 100644 --- a/www/seahub/pkg-plist +++ b/www/seahub/pkg-plist @@ -2139,7 +2139,6 @@ %%SEAHUBDIR%%/tools/update-seahub-db_0.9.4_to_0.9.5.py @owner %%USERS%% @group %%GROUPS%% -%%SEAFILE_SERVER%%/runtime/seahub.conf %%SEAHUBDIR%%/setenv.sh %%SEAHUBDIR%%/run-seahub.sh %%SEAHUBDIR%%/send_user_notifications.sh