Changes

Jump to navigation Jump to search
14,517 bytes added ,  08:10, 27 March 2018
Line 15: Line 15:  
|category= file
 
|category= file
 
|tags=cloud,file share
 
|tags=cloud,file share
}}
+
}}{{Warning box|This is early alpha development please use only on test machine, not for production}}
    
===Maintainer===
 
===Maintainer===
Line 28: Line 28:  
{{#smeversion: ccnet }}
 
{{#smeversion: ccnet }}
 
=== Description ===
 
=== Description ===
<!-- add a description here -->
      +
==== install needed repo ====
 +
<syntaxhighlight lang="bash">
 +
yum install --enablerepo=smedev,smecontribs smeserver-extrarepositories-epel smeserver-extrarepositories-centos-sclo -y
 +
signal-event yum-modify
 +
</syntaxhighlight>
 +
 +
==== install ====
 +
<syntaxhighlight lang="bash">
 +
yum install --enablerepo=smedev,smecontribs,epel,centos-sclo-rh,centos-sclo-centos seafile-seahub seafile-server
 +
</syntaxhighlight>this will at least pull :
 +
* ccnet-server          x86_64       5.1.3-4.el6.sme         smedev         91 k
 +
* fuse-libs             x86_64       2.8.3-5.el6             base           74 k
 +
* libarchive            x86_64       2.8.3-7.el6_8           base          127 k
 +
* libccnet              x86_64       5.1.3-4.el6.sme         smedev         38 k
 +
* libevent2             x86_64       2.0.21-2.el6            base          193 k
 +
* libevhtp              x86_64       1.2.11n-4.el6.sme       smedev        125 k
 +
* libsearpc             x86_64       3.0.7-3.el6.sme         smedev         27 k
 +
* libzdb                x86_64       3.1-4.el6.sme           smedev         63 k
 +
* postgresql-libs       x86_64       8.4.20-8.el6_9          updates       202 k
 +
* python-ccnet          noarch       5.1.3-4.el6.sme         smedev         37 k
 +
* python-seafile        noarch       5.1.3-1                 smedev         42 k
 +
* seafile-lib          x86_64       5.1.3-1                 smedev         36 k
 +
NB: you will need new version of sqlite  3.7.17-9.el6.sme  from smecontribs.; need to add this in Requires of the seafile-server rpms<syntaxhighlight lang="bash">
 +
yum update sqlite --enablerepo=smedev,smecontribs
 +
</syntaxhighlight>also will need to update spec file of seafile server :
 +
 +
Requires: /usr/bin/ccnet-init<syntaxhighlight lang="bash">
 +
yum install ccnet --enablerepo=smecontribs,smedev
 +
</syntaxhighlight>
 +
 +
==== NOT TO DO as already compiled : ====
 +
install prerequesites for seafile -server is still missing. maybe not necessary<syntaxhighlight lang="bash">
 +
yum install libevent libcurl4-openssl libglib  uuid  intltool  libsqlite  libmysqlclient  libarchive    libtool  libjansson  valac  libfuse --enablerepo=epel,smedev,smecontribs
 +
</syntaxhighlight>will miss this
 +
* libcurl4-openssl
 +
* libglib
 +
* libsqlite
 +
* libmysqlclient
 +
* libjansson
 +
* valac
 +
* libfuse
 +
 +
==== install python27 ====
 +
<syntaxhighlight lang="bash">
 +
yum install python27-python sclo-python27-python-chardet python27-python-six  --enablerepo=centos-sclo-rh,epel,centos-sclo-centos
 +
</syntaxhighlight>
 +
 +
==== install prerequesite for seahub ====
 +
<syntaxhighlight lang="bash">
 +
yum install --enablerepo=epel pytz
 +
</syntaxhighlight>
 +
 +
will need pip install or create rpm :
 +
 +
install Django and other python related modules
 +
 +
<syntaxhighlight lang="bash">
 +
scl enable python27 "pip install https://github.com/haiwen/django-constance/archive/bde7f7c.zip"
 +
scl enable python27 "pip install django==1.8"
 +
scl enable python27 "pip install django-statici18n"
 +
scl enable python27 "pip install djangorestframework"
 +
scl enable python27 "pip install openpyxl"
 +
scl enable python27 "pip install pytz"
 +
scl enable python27 "pip install django-post_office "
 +
scl enable python27 "pip install django-picklefield "
 +
scl enable python27 "pip install gunicorn "
 +
scl enable python27 "pip install flup "
 +
scl enable python27 "pip install jsonfield "
 +
scl enable python27 "pip install Pillow  "
 +
scl enable python27 "pip install python-dateutil"
 +
</syntaxhighlight>NB, rpm installation of python-six is too old for dateutile : <syntaxhighlight>
 +
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
 +
    100% |████████████████████████████████| 194kB 1.2MB/s
 +
Collecting six>=1.5 (from python-dateutil)
 +
  Downloading six-1.11.0-py2.py3-none-any.whl
 +
Installing collected packages: six, python-dateutil
 +
  Found existing installation: six 1.3.0
 +
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
 +
    Uninstalling six-1.3.0:
 +
 +
</syntaxhighlight>
 +
the following needs gcc
 +
 +
<syntaxhighlight lang="bash">
 +
yum install gcc intltool libtool glib2-devel
 +
yum install python27-python-devel --enablerepo=centos-sclo-rh
 +
scl enable python27 "pip install django-compressor "
 +
yum remove gcc cpp cloog-ppl mpfr ppl autoconf automake gettext-devel gettext-libs libart_lgpl libgcj glib2-devel
 +
yum remove python27-python-devel scl-utils-build
 +
</syntaxhighlight>
 +
 +
well I got some errors and the files in github says different from doc
 +
 +
<nowiki>:</nowiki> test-requirements.txt and      requirements.txt for 5.1 branch (NB server asks for requests==2.8.0 while seahub for 2.3.0)<syntaxhighlight lang="bash">
 +
scl enable python 27
 +
 +
 +
pip install mock==1.0.1
 +
pip install nose==1.3.7
 +
pip install exam==0.10.5
 +
pip install splinter==0.7.2
 +
pip install requests==2.3.0
 +
pip install pytest==2.7.0
 +
pip install pytest-django==2.8.0
 +
pip install python-dateutil
 +
pip install python-memcached==1.57
 +
pip install chardet
 +
pip install six
 +
pip install Pillow>=2.6.1,<3.0.0
 +
pip install Django==1.8.10
 +
pip install django-compressor==1.4
 +
pip install django-post-office==2.0.3
 +
pip install django-statici18n==1.1.2
 +
pip install djangorestframework==3.3.1
 +
pip install git+git://github.com/haiwen/django-constance.git@751f7f8b60651a2828e4a535a47fc05b907883da#egg=django-constance[database]
 +
pip install openpyxl==2.3.0
 +
pip install pytz==2015.7
 +
 +
 +
pip install termcolor==1.1.0
 +
pip install prettytable==0.7.2
 +
pip install pexpect==4.0
 +
pip install httpie
 +
pip install django-constance[database]
 +
 +
</syntaxhighlight>seafile server would need pip install MySQL-python==1.2.5, which will need mysql devel to compile
 +
 +
I also see some memcached service is needed...  seahub/avatar/sql/migration.md
 +
 +
====  startup scripts and sme related db ====
 +
config set seafile service TCPPort 8000 status enabled access private
 +
 +
signal-event remoteaccess-update
 +
 +
==== configuration ====
 +
 +
==== Start server ====
 +
<syntaxhighlight lang="antlr-objc">
 +
scl enable python27 bash
 +
mkdir /opt/seafile/;
 +
cd  /opt/seafile/;
 +
mkdir seafile-server/
 +
mkdir logs pids
 +
mkdir seafile-server/runtime
 +
mkdir -p /opt/seafile/seafile-data/library-template
 +
cd seafile-server/
 +
ln /usr/share/seafile-seahub seahub -s
 +
cd /opt/seafile/
 +
 +
export PYTHONPATH=/opt/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH
 +
export CCNET_CONF_DIR=/opt/seafile/conf/
 +
export SEAFILE_CONF_DIR=/opt/seafile/conf/
 +
 +
seafile-admin setup
 +
 +
python seafile-server/seahub/manage.py syncdb
 +
</syntaxhighlight>
 +
 +
issue: seafile-admin setup makes creation of seahub.db in /usr
 +
 +
<nowiki>-----------------</nowiki>
 +
 +
<nowiki>------------------------------------------------</nowiki>
 +
 +
<nowiki>-----------------------------------------------------------------</nowiki>
 +
 +
Your seafile server configuration has been finished successfully.
 +
 +
<nowiki>-----------------------------------------------------------------</nowiki>
 +
 +
<nowiki>-----------------------------------------------------------------</nowiki>
 +
 +
To start/stop seafile server:
 +
 +
$ cd /opt/seafile
 +
 +
$ seafile-admin { start | stop }
 +
 +
If you have any problem, refer to
 +
 +
Seafile server manual:      <nowiki>https://github.com/haiwen/seafile/wiki</nowiki>
 +
 +
Seafile discussion group:   <nowiki>https://groups.google.com/forum/?fromgroups#!forum/seafile</nowiki>
 +
 +
Seafile website:            <nowiki>http://www.seafile.com</nowiki>
 +
 +
for more information.
 +
 +
<syntaxhighlight lang="bash">
 +
# seafile-admin start
 +
 +
Starting seafile-server...
 +
Starting seahub...
 +
Seahub running on port 8000
 +
Done
 +
 +
</syntaxhighlight>
 +
 +
==== configure httpd reverse proxy ====
 +
the easy way is :<syntaxhighlight lang="bash">
 +
db domains setprop seafile.itx.pialasse.com  Nameservers local ProxyPassTarget http://127.0.0.1:8000/ TemplatePath ProxyPassVirtualHosts
 +
 +
signal-event domain-modify seafile.itx.pialasse.com
 +
</syntaxhighlight>more long way:
 +
 +
<syntaxhighlight lang="bash">
 +
mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/ -p
 +
cat  > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28SeafileProxyPass <<- 'EndOfMessage'
 +
# Seahub for Seafile ProxyPass
 +
{
 +
    $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 +
    $seahubPort = ${'seafile'}{TCPPort} || '8000';
 +
    $OUT = '';
 +
    if ((${'seafile'}{'status'} || 'disabled') eq 'enabled' ){
 +
 +
        if (($port eq "80") && ($haveSSL eq 'yes')){
 +
            $OUT .= "    RewriteRule ^/seafile(/.*|\$)    https://%{HTTP_HOST}/seafile\$1 [L,R]\n";
 +
        }
 +
        else{
 +
            $OUT .= "    ProxyPass /seafile http://127.0.0.1:$seahubPort\n";
 +
            $OUT .= "    ProxyPassReverse /seafile http://127.0.0.1:$seahubPort\n";
 +
        }
 +
 +
        $OUT .=<<"HERE";
 +
 +
    <Location /seafile>
 +
        SSLRequireSSL on
 +
        order deny,allow
 +
        deny from all
 +
        allow from $localAccess $externalSSLAccess
 +
    </Location>
 +
 +
HERE
 +
    }
 +
}
 +
EndOfMessage
 +
expand-template /etc/httpd/conf/httpd.conf
 +
service httpd-e-smith restart
 +
</syntaxhighlight>and then you have to change the configuration to show correctly the images
 +
 +
alternatively if you want to use a domain this way : seafile.mydomain.com<syntaxhighlight lang="bash">
 +
mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/ -p
 +
cat  > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28SeafileProxyPass <<- 'EndOfMessage'
 +
# Seahub for Seafile ProxyPass
 +
{
 +
    $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 +
    $seahubPort = ${'seafile'}{TCPPort} || '8000';
 +
    $seahubdomain = ${'seafile'}{domain} || 'disabled';   
 +
    $OUT = '';
 +
    if ((${'seafile'}{'status'} || 'disabled') eq 'enabled' && $seahubdomain eq 'disabled' ){
 +
 +
        if (($port eq "80") && ($haveSSL eq 'yes')){
 +
            $OUT .= "    RewriteRule ^seafile(/.*|\$)    https://%{HTTP_HOST}seafile\$1 [L,R]\n";
 +
        }
 +
        else{
 +
            $OUT .= "    ProxyPass /seafile http://127.0.0.1:$seahubPort\n";
 +
            $OUT .= "    ProxyPassReverse /seafile http://127.0.0.1:$seahubPort\n";
 +
        }
 +
 +
        $OUT .=<<"HERE";
 +
 +
    <Location /seafile>
 +
        SSLRequireSSL on
 +
        order deny,allow
 +
        deny from all
 +
        allow from $localAccess $externalSSLAccess
 +
    </Location>
 +
 +
HERE
 +
    }
 +
    elseif ($seahubdomain ne 'disabled' ) {
 +
        if (($port eq "80") && ($haveSSL eq 'yes')){
 +
            $OUT .= "    RewriteRule ^(/.*|\$)    https://$seahubdomain\$1 [L,R]\n";
 +
        }
 +
        else{
 +
            $OUT .= "    ProxyPass / http://127.0.0.1:$seahubPort\n";
 +
            $OUT .= "    ProxyPassReverse / http://127.0.0.1:$seahubPort\n";
 +
        }
 +
    }
 +
}
 +
EndOfMessage
 +
expand-template /etc/httpd/conf/httpd.conf
 +
service httpd-e-smith restart
 +
</syntaxhighlight>
 +
 +
==== service start ====
 +
<syntaxhighlight lang="bash">
 +
cat > /etc/rc.d/init.d/seafile << 'EOF'
 +
#!/bin/bash
 +
### BEGIN INIT INFO
 +
# Provides:          seafile-server
 +
# Required-Start:    $remote_fs $syslog
 +
# Required-Stop:    $remote_fs $syslog
 +
# Default-Start:    2 3 4 5
 +
# Default-Stop:      0 1 6
 +
# Short-Description: Seafile server
 +
# Description:      Start Seafile server
 +
### END INIT INFO
 +
 +
# Change the value of "user" to your linux user name
 +
user=root
 +
 +
# Change the value of "seafile_dir" to your path of seafile installation
 +
# usually the home directory of $user
 +
seafile_dir=/opt/seafile
 +
script_path=${seafile_dir}/seafile-server-latest
 +
seafile_init_log=${seafile_dir}/logs/seafile.init.log
 +
seahub_init_log=${seafile_dir}/logs/seahub.init.log
 +
 +
 +
#
 +
# Write a polite log message with date and time
 +
#
 +
echo -e "\n \n About to perform $1 for seafile at `date -Iseconds` \n " >> ${seafile_init_log}
 +
echo -e "\n \n About to perform $1 for seahub at `date -Iseconds` \n " >> ${seahub_init_log}
 +
 +
# Python
 +
sclname='python27'
 +
. /opt/rh/$sclname/enable
 +
export X_SCLS="$X_SCLS $sclname"
 +
 +
# we want start daemon only inside "scl enable" invocation
 +
if ! scl_enabled python27 ; then
 +
    echo "Collection python27 has to be listed in /opt/rh/python27/service-environment"
 +
    exit 1
 +
fi
 +
cd /opt/seafile
 +
export TOPDIR=/opt/seafile
 +
export INSTALLPATH=/opt/seafile
 +
export PYTHONPATH=/opt/seafile:/opt/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH
 +
export CCNET_CONF_DIR=/opt/seafile/conf/
 +
export SEAFILE_CONF_DIR=/opt/seafile/seafile-data/
 +
export SEAFILE_CENTRAL_CONF_DIR=/opt/seafile/conf/
 +
export SEAHUB_LOG_DIR=/opt/seafile/logs
 +
export SEAFILE_PIDFILE=/opt/seafile/pids/controller.pid
 +
 +
case "$1" in
 +
        start)
 +
                /usr/bin/seafile-admin start
 +
        ;;
 +
        restart)
 +
                /usr/bin/seafile-admin stop
 +
                /usr/bin/seafile-admin start
 +
        stop)
 +
                /usr/bin/seafile-admin stop
 +
 +
        ;;
 +
        *)
 +
                echo "Usage: /etc/init.d/seafile {start|stop|restart}"
 +
                exit 1
 +
        ;;
 +
esac
 +
EOF
 +
 +
chkconfig seafile on
 +
ln -s /etc/rc.d/init.d/seafile /etc/rc.d/rc7.d/S85seafile
 +
</syntaxhighlight>
 +
 +
==== add ldap support ====
 +
simply add this to /opt/seafile/conf/ccnet.conf<syntaxhighlight lang="bash">
 +
[LDAP]
 +
HOST = ldap://localhost
 +
BASE = ou=Users,dc=domain,dc=tld
 +
LOGIN_ATTR = mail
 +
FILTER = objectClass=inetOrgPerson
 +
 +
</syntaxhighlight>
 +
 +
==== add log to syslog ====
 +
see https://manual.seafile.com/maintain/logs.html and more : https://manual.seafile.com/deploy/using_syslog.html
 +
 +
there are 2 files to edit. Then arrange logrotate
    
=== Installation ===
 
=== Installation ===
yum --enablerepo=smecontribs install {{#var:smecontribname}}
+
for now you need to do :
    +
latter you will be able to do this:
 +
yum --enablerepo=smecontribs install smeserver-seafile-server {{#var:smecontribname}}
    +
=== Client usage ===
 +
If you want to connect locally you need to do the following:<syntaxhighlight lang="bash">
 +
cd ~
 +
mkdir ~/seafile-client
 +
seaf-cli init -d ~/seafile-client
 +
seaf-cli start
 +
seaf-cli download -l "the id of the library" -s  "the url + port of server" -d "the folder where the library folder will be downloaded" -u "username on server" [-p "password"]
 +
seaf-cli status
 +
</syntaxhighlight>
    
=== Uninstall ===
 
=== Uninstall ===
Line 48: Line 430:  
Only released version in smecontrib are listed here.
 
Only released version in smecontrib are listed here.
   −
{{ #smechangelog: {{#var:smecontribname}} }}
+
{{#smechangelog: {{#var:smecontribname}} }}
 
     −
<!-- list of category you want to see this page in -->
+
=== References ===
 +
* https://manual.seafile.com/build_seafile/server.html
 +
* <!-- list of category you want to see this page in -->
 
[[Category: Contrib]]
 
[[Category: Contrib]]
   
<!-- Please keep there the template revision  number as is -->
 
<!-- Please keep there the template revision  number as is -->
[[contribtemplate::1| ]]
+
=== TODO ===
[[contriblang:: {{#var:lang}} | ]]
+
* compile seafdav
 +
* add pythonmodules for seafdav
 +
* patch controller of seafile-server to force pid folder
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,250

edits

Navigation menu