FreeBSD Bugzilla – Attachment 180905 Details for
Bug 217873
net-mgmt/seafile-server: Fix setup scripts and corrected proper startup procedures
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
seafile-server.diff
seafile-server.diff (text/plain), 8.64 KB, created by
Ultima
on 2017-03-17 17:02:53 UTC
(
hide
)
Description:
seafile-server.diff
Filename:
MIME Type:
Creator:
Ultima
Created:
2017-03-17 17:02:53 UTC
Size:
8.64 KB
patch
obsolete
>Index: net-mgmt/seafile-server/Makefile >=================================================================== >--- net-mgmt/seafile-server/Makefile (revision 436345) >+++ net-mgmt/seafile-server/Makefile (working copy) >@@ -4,6 +4,7 @@ > PORTVERSION= 6.0.8 > DISTVERSIONPREFIX= v > DISTVERSIONSUFFIX= -server >+PORTREVISION= 1 > CATEGORIES= net-mgmt > > MAINTAINER= ultima1252@gmail.com >@@ -94,6 +95,8 @@ > ${REINPLACE_CMD} 's/<evhtp.h>/<evhtp\/evhtp.h>/' ${WRKSRC}/server/upload-file.c \ > ${WRKSRC}/server/access-file.c ${WRKSRC}/server/http-server.c > ${REINPLACE_CMD} -E 's/stat.+\$$/stat -f %Su $$/' ${WRKSRC}/scripts/seafile.sh >+ ${REINPLACE_CMD} 's/%%SEAFILE_USER%%/${USERS}/ ; s/%%SEAFILE_GROUP%%/${GROUPS}/' \ >+ ${WRKSRC}/scripts/setup-seafile.sh ${WRKSRC}/scripts/setup-seafile-mysql.py > post-install: > @${MKDIR} ${STAGEDIR}${PREFIX}/${SEABIN} ${STAGEDIR}${PREFIX}/${SEALIB} \ > ${STAGEDIR}${PREFIX}/${SEAFILE_SERVER}/seafile/share/doc/seafile \ >Index: net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py >=================================================================== >--- net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py (nonexistent) >+++ net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py (working copy) >@@ -0,0 +1,71 @@ >+--- scripts/setup-seafile-mysql.py.orig 2017-03-13 03:33:30 UTC >++++ scripts/setup-seafile-mysql.py >+@@ -19,6 +19,8 @@ from ConfigParser import ConfigParser >+ >+ import MySQLdb >+ >++import pwd >++import grp >+ >+ try: >+ import readline # pylint: disable=W0611 >+@@ -1167,17 +1169,23 @@ share_name = / >+ >+ class UserManualHandler(object): >+ def __init__(self): >+- self.src_docs_dir = os.path.join(env_mgr.install_path, 'seafile', 'docs') >++ self.src_docs_dir = os.path.join(env_mgr.install_path, 'seafile', 'share', 'doc', 'seafile') >+ self.library_template_dir = None >+ >+ def copy_user_manuals(self): >+ self.library_template_dir = os.path.join(seafile_config.seafile_dir, 'library-template') >+ Utils.must_mkdir(self.library_template_dir) >+ >++ uid = pwd.getpwnam("%%SEAFILE_USER%%").pw_uid >++ gid = grp.getgrnam("%%SEAFILE_GROUP%%").gr_gid >++ os.chown(self.library_template_dir, uid, gid) >++ >+ pattern = os.path.join(self.src_docs_dir, '*.doc') >+ >+ for doc in glob.glob(pattern): >+ Utils.must_copy(doc, self.library_template_dir) >++ doc_full = os.path.join(self.library_template_dir, os.path.basename(doc)) >++ os.chown(doc_full, uid, gid) >+ >+ def report_config(): >+ print >+@@ -1242,6 +1250,8 @@ def create_seafile_server_symlink(): >+ def set_file_perm(): >+ filemode = 0600 >+ dirmode = 0700 >++ uid = pwd.getpwnam("%%SEAFILE_USER%%").pw_uid >++ gid = grp.getgrnam("%%SEAFILE_GROUP%%").gr_gid >+ files = [ >+ seahub_config.seahub_settings_py, >+ ] >+@@ -1253,8 +1263,10 @@ def set_file_perm(): >+ ] >+ for fpath in files: >+ os.chmod(fpath, filemode) >++ os.chown(fpath, uid, gid) >+ for dpath in dirs: >+ os.chmod(dpath, dirmode) >++ os.chown(dpath, uid, gid) >+ >+ env_mgr = EnvManager() >+ ccnet_config = CcnetConfigurator() >+@@ -1445,8 +1457,12 @@ def report_success(): >+ Your seafile server configuration has been finished successfully. >+ ----------------------------------------------------------------- >+ >+-run seafile server: ./seafile.sh { start | stop | restart } >+-run seahub server: ./seahub.sh { start <port> | stop | restart <port> } >++run seafile server: echo "seafile_enable=\"YES\"" >>/etc/rc.conf >++ service seafile { start | stop | restart } >++run seahub server: echo "seahub_enable=\"YES\"" >>/etc/rc.conf >++fastcgi (optional): echo "seahub_fastcgi=\"1\"" >>/etc/rc.conf >++ service seahub { start | stop | restart } >++run reset-admin: ./reset-admin.sh >+ >+ ----------------------------------------------------------------- >+ If you are behind a firewall, remember to allow input/output of these tcp ports: > >Property changes on: net-mgmt/seafile-server/files/patch-scripts_setup-seafile-mysql.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh >=================================================================== >--- net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh (revision 436345) >+++ net-mgmt/seafile-server/files/patch-scripts_setup-seafile.sh (working copy) >@@ -1,11 +1,20 @@ >---- scripts/setup-seafile.sh.orig 2016-10-21 22:12:15 UTC >+--- scripts/setup-seafile.sh.orig 2017-03-13 02:59:56 UTC > +++ scripts/setup-seafile.sh >-@@ -318,7 +318,11 @@ fi >+@@ -15,6 +15,8 @@ use_existing_seafile="false" >+ >+ server_manual_http="https://github.com/haiwen/seafile/wiki" >+ >++os_bsd=$(uname | grep -cm1 -e BSD -e DragonFly) >++ >+ function welcome () { >+ echo "-----------------------------------------------------------------" >+ echo "This script will guide you to config and setup your seafile server." >+@@ -318,10 +320,17 @@ fi > } > > function copy_user_manuals() { > - src_docs_dir=${INSTALLPATH}/seafile/docs/ >-+ if [ $(uname | grep -e BSD -e DragonFly | wc -l) == "1" ]; then >++ if [ $os_bsd == "1" ]; then > + src_docs_dir=${INSTALLPATH}/seafile/share/doc/seafile/ > + else > + src_docs_dir=${INSTALLPATH}/seafile/docs/ >@@ -13,3 +22,45 @@ > library_template_dir=${seafile_data_dir}/library-template > mkdir -p ${library_template_dir} > cp -f ${src_docs_dir}/*.doc ${library_template_dir} >++ if [ $os_bsd == "1" ]; then >++ chown -R %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "${library_template_dir}" >++ fi >+ } >+ >+ function parse_params() { >+@@ -673,6 +682,13 @@ chmod 0600 "$dest_settings_py" >+ chmod 0700 "$default_ccnet_conf_dir" >+ chmod 0700 "$seafile_data_dir" >+ chmod 0700 "$default_conf_dir" >++if [ $os_bsd == "1" ]; then >++ chown %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "$dest_settings_py" >++ chown %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "$default_ccnet_conf_dir" >++ chown -R %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "$seafile_data_dir" >++ chown %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "$default_conf_dir" >++ chown %%SEAFILE_USER%%:%%SEAFILE_GROUP%% "$seahub_db" >++fi >+ >+ # ------------------------------------------- >+ # copy user manuals to library template >+@@ -689,9 +705,18 @@ echo >+ echo "-----------------------------------------------------------------" >+ echo "Your seafile server configuration has been completed successfully." >+ echo "-----------------------------------------------------------------" >+-echo >+-echo "run seafile server: ./seafile.sh { start | stop | restart }" >+-echo "run seahub server: ./seahub.sh { start <port> | stop | restart <port> }" >++echo >++if [ $os_bsd == "1" ]; then >++ echo "run seafile server: echo \"seafile_enable=\\\"YES\\\"\" >>/etc/rc.conf" >++ echo " service seafile { start | stop | restart }" >++ echo "run seahub server: echo \"seahub_enable=\\\"YES\\\"\" >>/etc/rc.conf" >++ echo "fastcgi (optional): echo \"seahub_fastcgi=\\\"1\\\"\" >>/etc/rc.conf" >++ echo " service seahub { start | stop | restart }" >++ echo "run reset-admin: ./reset-admin.sh" >++else >++ echo "run seafile server: ./seafile.sh { start | stop | restart }" >++ echo "run seahub server: ./seahub.sh { start <port> | stop | restart <port> }" >++fi >+ echo >+ echo "-----------------------------------------------------------------" >+ echo "If the server is behind a firewall, remember to open these tcp ports:" >Index: net-mgmt/seafile-server/files/pkg-message.in >=================================================================== >--- net-mgmt/seafile-server/files/pkg-message.in (revision 436345) >+++ net-mgmt/seafile-server/files/pkg-message.in (working copy) >@@ -1,10 +1,10 @@ >-For an existing config, or creating a new one, fix the UID/GID. >-Do not change %%PREFIX%%/%%SEAFILE_SERVER%% unless your front >-end is using the seafile UID/GID as well. >+To generate a new config, >+cd %%PREFIX%%/%%SEAFILE_SERVER%% >+Then choose sqlite or mysql, mysql needs to be setup with root. >+sqlite: ./setup-seafile.sh >+mysql: ./setup-seafile-mysql.sh >+Further instructions will be provided after the setup script is finished. > >-chown -R seafile:seafile %%PREFIX%%/%%HAIWENDIR%%/conf \ >- %%PREFIX%%/%%HAIWENDIR%%/ccnet %%PREFIX%%/%%HAIWENDIR%%/seafile-data \ >- %%PREFIX%%/%%HAIWENDIR%%/pids %%PREFIX%%/%%HAIWENDIR%%/logs > > Don't forget to run update scripts after every minor and major update located in > %%PREFIX%%/%%SEAFILE_SERVER%%/upgrade
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
Ultima1252
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 217873
:
180905
|
180929