mirror of
https://github.com/haiwen/seafile-admin-docs.git
synced 2025-12-26 02:32:50 +00:00
Merge pull request #214 from haiwen/update-env-server
update env server
This commit is contained in:
commit
abb168299e
|
|
@ -1,156 +0,0 @@
|
|||
# FreeBSD
|
||||
|
||||
#### Preparation
|
||||
|
||||
**support for FreeBSD** is still under construction.
|
||||
|
||||
The following list is what you need to install on your development machine. **You should install all of them before you build seafile**.
|
||||
|
||||
Package names are according to FreeBSD Ports. You might install your ports
|
||||
manually or via `pkgng`.
|
||||
|
||||
* devel/autoconf
|
||||
* devel/automake
|
||||
* textproc/intltool
|
||||
* textproc/gsed
|
||||
* devel/libtool
|
||||
* devel/libevent2
|
||||
* ftp/curl
|
||||
* devel/glib20
|
||||
* misc/ossp-uuid
|
||||
* databases/sqlite3
|
||||
* devel/jansson
|
||||
* lang/vala
|
||||
* devel/cmake
|
||||
* archivers/libarchive
|
||||
* devel/py-simplejson (removed in furture release)
|
||||
|
||||
GUI
|
||||
|
||||
* devel/qt4
|
||||
|
||||
```bash
|
||||
#portmaster devel/autoconf devel/automake textproc/intltool textproc/gsed \
|
||||
devel/libtool devel/libevent2 ftp/curl devel/glib20 misc/ossp-uuid databases/sqlite3 \
|
||||
devel/jansson lang/vala devel/cmake devel/py-simplejson archivers/libarchive
|
||||
|
||||
```
|
||||
|
||||
For a fresh PkgNG users,
|
||||
|
||||
```bash
|
||||
#pkg install autoconf automake intltool gsed libtool libevent2 curl \
|
||||
glib20 ossp-uuid sqlite3 jansson vala cmake py-simplejson libarchive
|
||||
|
||||
```
|
||||
|
||||
#### Building
|
||||
|
||||
First you should get the latest source of libsearpc/ccnet/seafile/seafile-client:
|
||||
|
||||
Download the source tarball of the latest tag from
|
||||
|
||||
* <https://github.com/haiwen/libsearpc/tags> (use v3.0-latest)
|
||||
* <https://github.com/haiwen/ccnet/tags>
|
||||
* <https://github.com/haiwen/seafile/tags>
|
||||
* <https://github.com/haiwen/seafile-client/tags>
|
||||
|
||||
For example, if the latest released seafile client is 3.1.0, then just use the **v3.1.0** tags of the four projects. You should get four tarballs:
|
||||
|
||||
* libsearpc-v3.0-latest.tar.gz
|
||||
* ccnet-3.1.0.tar.gz
|
||||
* seafile-3.1.0.tar.gz
|
||||
* seafile-client-3.1.0.tar.gz
|
||||
|
||||
```sh
|
||||
export version=3.1.0
|
||||
alias wget='wget --content-disposition -nc'
|
||||
wget https://github.com/haiwen/libsearpc/archive/v3.0-latest.tar.gz
|
||||
wget https://github.com/haiwen/ccnet/archive/v${version}.tar.gz
|
||||
wget https://github.com/haiwen/seafile/archive/v${version}.tar.gz
|
||||
wget https://github.com/haiwen/seafile-client/archive/v${version}.tar.gz
|
||||
|
||||
```
|
||||
|
||||
Now uncompress them:
|
||||
|
||||
```sh
|
||||
tar xf libsearpc-v3.0-latest.tar.gz
|
||||
tar xf ccnet-${version}.tar.gz
|
||||
tar xf seafile-${version}.tar.gz
|
||||
tar xf seafile-client-${version}.tar.gz
|
||||
|
||||
```
|
||||
|
||||
To build Seafile client, you need first build **libsearpc** and **ccnet**, **seafile**.
|
||||
|
||||
##### set paths
|
||||
|
||||
```bash
|
||||
ln -sfh ../libdata/pkgconfig /usr/local/lib/pkgconfig
|
||||
|
||||
```
|
||||
|
||||
##### libsearpc
|
||||
|
||||
```bash
|
||||
cd libsearpc-${version}
|
||||
./autogen.sh
|
||||
./configure --prefix=$PREFIX
|
||||
make
|
||||
sudo make install
|
||||
|
||||
```
|
||||
|
||||
##### ccnet
|
||||
|
||||
```bash
|
||||
export CFLAGS="-I/usr/local/include/ossp/uuid -I/usr/local/include/event2"
|
||||
export LDFLAGS="-L/usr/local/lib -L/usr/local/lib/event2"
|
||||
cd ccnet-${version}
|
||||
./autogen.sh
|
||||
./configure --prefix=$PREFIX
|
||||
make
|
||||
sudo make install
|
||||
|
||||
```
|
||||
|
||||
##### seafile
|
||||
|
||||
```bash
|
||||
cd seafile-${version}/
|
||||
./autogen.sh
|
||||
./configure --prefix=$PREFIX
|
||||
make
|
||||
sudo make install
|
||||
|
||||
```
|
||||
|
||||
#### seafile-client
|
||||
|
||||
```bash
|
||||
cd seafile-client-${version}
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .
|
||||
make
|
||||
sudo make install
|
||||
|
||||
```
|
||||
|
||||
#### custom prefix
|
||||
|
||||
when installing to a custom `$PREFIX`, i.e. `/opt`, you may need a script to set the path variables correctly
|
||||
|
||||
```bash
|
||||
cat >$PREFIX/bin/seafile-applet.sh <<END
|
||||
#!/bin/bash
|
||||
exec seafile-applet $@
|
||||
END
|
||||
cat >$PREFIX/bin/seaf-cli.sh <<END
|
||||
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
|
||||
exec seaf-cli $@
|
||||
END
|
||||
chmod +x $PREFIX/bin/seafile-applet.sh $PREFIX/bin/seaf-cli.sh
|
||||
|
||||
```
|
||||
|
||||
you can now start the client with `$PREFIX/bin/seafile-applet.sh`.
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
This is the document for deploying Seafile open source development environment in Ubuntu 1804 docker container.
|
||||
This is the document for deploying Seafile open source development environment in Ubuntu 2204 docker container.
|
||||
|
||||
## Run a container
|
||||
|
||||
```
|
||||
docker run -it -p 8000:8000 -p 8082:8082 -p 3000:3000 --name seafile-ce-env ubuntu:18.04 bash
|
||||
docker run -it -p 8000:8000 -p 8082:8082 -p 3000:3000 --name seafile-ce-env ubuntu:22.04 bash
|
||||
```
|
||||
|
||||
Note, the following commands are all executed in the seafile-ce-env docker container.
|
||||
|
|
@ -13,26 +13,16 @@ Note, the following commands are all executed in the seafile-ce-env docker conta
|
|||
```
|
||||
apt-get update && apt-get upgrade -y
|
||||
|
||||
apt-get install -y ssh libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev python-dateutil cmake re2c flex sqlite3 python-pip python-simplejson git libssl-dev libldap2-dev libonig-dev vim vim-scripts wget cmake gcc autoconf automake mysql-client librados-dev libxml2-dev curl sudo telnet netcat unzip netbase ca-certificates apt-transport-https build-essential libxslt1-dev libffi-dev libpcre3-dev libz-dev xz-utils nginx pkg-config poppler-utils libmemcached-dev sudo
|
||||
apt-get install -y ssh libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev python-dateutil cmake re2c flex sqlite3 python-pip python-simplejson git libssl-dev libldap2-dev libonig-dev vim vim-scripts wget cmake gcc autoconf automake mysql-client librados-dev libxml2-dev curl sudo telnet netcat unzip netbase ca-certificates apt-transport-https build-essential libxslt1-dev libffi-dev libpcre3-dev libz-dev xz-utils nginx pkg-config poppler-utils libmemcached-dev sudo ldap-utils libldap2-dev
|
||||
|
||||
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
|
||||
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
apt-get install -y python3-pip python3.6 python3.6-dev
|
||||
apt-get install -y python3 python3-dev python3-pip python3-setuptools python3-ldap
|
||||
|
||||
python3.6 -m pip install --upgrade pip
|
||||
python3 -m pip install --upgrade pip
|
||||
|
||||
rm /usr/bin/python
|
||||
rm /usr/bin/python3
|
||||
ln -s /usr/bin/python3.6 /usr/bin/python
|
||||
ln -s /usr/bin/python3.6 /usr/bin/python3
|
||||
|
||||
rm /usr/bin/pip
|
||||
rm /usr/bin/pip3
|
||||
ln -s /usr/local/bin/pip3.6 /usr/bin/pip
|
||||
ln -s /usr/local/bin/pip3.6 /usr/bin/pip3
|
||||
|
||||
pip install python-cas djangosaml2 cffi sqlalchemy pymysql pillow pycryptodome configparser pylibmc django-pylibmc elasticsearch==5.5.0 elasticsearch-dsl==5.4.0 Django==2.2.14 future captcha django-statici18n django-post_office==3.3.0 django-webpack_loader==0.7.0 gunicorn mysqlclient django-picklefield==2.1.1 openpyxl qrcode django-formtools django-simple-captcha djangorestframework==3.11.1 python-dateutil requests pillow pyjwt pycryptodome requests_oauthlib mock nose exam splinter pytest pytest-django
|
||||
pip3 install Django==4.2.* django-statici18n==2.3.* django_webpack_loader==1.7.* django_picklefield==3.1 django_formtools==2.4 django_simple_captcha==0.5.* djangosaml2==1.5.* djangorestframework==3.14.* python-dateutil==2.8.* pyjwt==2.6.* pycryptodome==3.16.* python-cas==1.6.* pysaml2==7.2.* requests==2.28.* requests_oauthlib==1.3.* future==0.18.* gunicorn==20.1.* mysqlclient==2.1.* qrcode==7.3.* pillow==9.3.* chardet==5.1.* cffi==1.15.1 captcha==0.4 openpyxl==3.0.* Markdown==3.4.* bleach==5.0.* python-ldap==3.4.* sqlalchemy==2.0.18 redis mock pytest pymysql configparser pylibmc django-pylibmc nose exam splinter pytest-django
|
||||
```
|
||||
|
||||
## Install MariaDB and Create Databases
|
||||
|
|
@ -63,15 +53,17 @@ git clone https://github.com/haiwen/libsearpc.git
|
|||
git clone https://github.com/haiwen/seafile-server.git
|
||||
git clone https://github.com/haiwen/seahub.git
|
||||
|
||||
cd libevhtp/
|
||||
git checkout tags/1.1.7 -b tag-1.1.7
|
||||
|
||||
cd libsearpc/
|
||||
git fetch origin 8.0:8.0
|
||||
git checkout 8.0
|
||||
git checkout tags/v3.3-latest -b tag-v3.3-latest
|
||||
|
||||
cd ../seafile-server
|
||||
git checkout tags/v8.0.0-server -b tag-v8.0.0-server
|
||||
git checkout tags/v11.0.0-server -b tag-v11.0.0-server
|
||||
|
||||
cd ../seahub
|
||||
git checkout tags/v8.0.0-server -b tag-v8.0.0-server
|
||||
git checkout tags/v11.0.0-server -b tag-v11.0.0-server
|
||||
```
|
||||
|
||||
## Compile and Install seaf-server
|
||||
|
|
@ -114,9 +106,6 @@ PASSWD = 123456
|
|||
DB = ccnet
|
||||
CONNECTION_CHARSET = utf8
|
||||
CREATE_TABLES = true
|
||||
|
||||
[General]
|
||||
SERVICE_URL = http://127.0.0.1:8000
|
||||
EOF
|
||||
|
||||
cat > seahub_settings.py <<EOF
|
||||
|
|
@ -131,6 +120,7 @@ DATABASES = {
|
|||
}
|
||||
}
|
||||
FILE_SERVER_ROOT = 'http://127.0.0.1:8082'
|
||||
SERVICE_URL = 'http://127.0.0.1:8000'
|
||||
EOF
|
||||
|
||||
|
||||
|
|
@ -163,7 +153,7 @@ seaf-server -c /root/dev/conf -d /root/dev/seafile-data -D all -f -l - &
|
|||
```
|
||||
cd ~/dev/source-code/seahub/
|
||||
|
||||
export PYTHONPATH=/usr/local/lib/python3.6/site-packages/:/root/dev/source-code/seahub/thirdpart:$PYTHONPATH
|
||||
export PYTHONPATH=/usr/local/lib/python3.10/site-packages/:/root/dev/source-code/seahub/thirdpart:$PYTHONPATH
|
||||
export CCNET_CONF_DIR=/root/dev/conf
|
||||
export SEAFILE_CONF_DIR=/root/dev/seafile-data
|
||||
export SEAFILE_CENTRAL_CONF_DIR=/root/dev/conf
|
||||
|
|
@ -172,19 +162,19 @@ export SEAFILE_CENTRAL_CONF_DIR=/root/dev/conf
|
|||
### Create seahub database tables
|
||||
|
||||
```
|
||||
python manage.py migrate
|
||||
python3 manage.py migrate
|
||||
```
|
||||
|
||||
### Create user
|
||||
|
||||
```
|
||||
python manage.py createsuperuser
|
||||
python3 manage.py createsuperuser
|
||||
```
|
||||
|
||||
### Start seahub
|
||||
|
||||
```
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
python3 manage.py runserver 0.0.0.0:8000
|
||||
```
|
||||
|
||||
Then, you can visit <http://127.0.0.1:8000/> to use Seafile.
|
||||
|
|
@ -199,13 +189,13 @@ Then, you can visit <http://127.0.0.1:8000/> to use Seafile.
|
|||
|
||||
For deploying frontend development enviroment, you need:
|
||||
|
||||
1, checkout seahub to 8.0 branch
|
||||
1, checkout seahub to master branch
|
||||
|
||||
```
|
||||
cd /root/dev/source-code/seahub
|
||||
|
||||
git fetch origin 8.0:8.0
|
||||
git checkout 8.0
|
||||
git fetch origin master:master
|
||||
git checkout master
|
||||
```
|
||||
|
||||
2, add the following configration to /root/dev/conf/seahub_settings.py
|
||||
|
|
|
|||
|
|
@ -1,153 +0,0 @@
|
|||
# Setup Seafile Server Development Environment
|
||||
|
||||
The following operations have been tested on ubuntu-16.04.1-desktop-amd64 system.
|
||||
|
||||
## Install Necessary Packages
|
||||
|
||||
#### install necessary packages by `apt`
|
||||
|
||||
```
|
||||
sudo apt install ssh libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev python-dateutil cmake re2c flex sqlite3 python-pip python-simplejson git libssl-dev libldap2-dev libonig-dev
|
||||
```
|
||||
|
||||
#### install `libevhtp` from source
|
||||
|
||||
```
|
||||
cd ~/Downloads/
|
||||
git clone https://github.com/haiwen/libevhtp.git
|
||||
cd libevhtp/
|
||||
cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
## Download and Build Seafile
|
||||
|
||||
#### create project root directory *dev*
|
||||
|
||||
```
|
||||
cd
|
||||
mkdir dev
|
||||
```
|
||||
|
||||
#### download and install `libsearpc`
|
||||
|
||||
```
|
||||
cd ~/dev/
|
||||
git clone https://github.com/haiwen/libsearpc.git
|
||||
cd libsearpc/
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
#### download and install `ccnet-server`
|
||||
|
||||
```
|
||||
cd ~/dev/
|
||||
git clone https://github.com/haiwen/ccnet-server.git
|
||||
cd ccnet-server/
|
||||
./autogen.sh
|
||||
./configure --enable-ldap
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
#### download and install `seafile-server`
|
||||
|
||||
```
|
||||
cd ~/dev/
|
||||
git clone https://github.com/haiwen/seafile-server.git
|
||||
cd seafile-server/
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
#### download `seahub`
|
||||
|
||||
```
|
||||
cd ~/dev/
|
||||
git clone https://github.com/haiwen/seahub.git
|
||||
cd seahub/
|
||||
```
|
||||
|
||||
## Start `ccnet-server` and `seaf-server`
|
||||
|
||||
Start `ccnet-server` and `seaf-server` in two separate terminals.
|
||||
|
||||
```
|
||||
cd ~/dev/seafile-server/tests
|
||||
ccnet-server -c conf -f -
|
||||
```
|
||||
|
||||
```
|
||||
cd ~/dev/seafile-server/tests
|
||||
mkdir -p conf/seafile-data
|
||||
touch conf/seafile-data/seafile.conf
|
||||
cat > conf/seafile-data/seafile.conf << EOF
|
||||
[database]
|
||||
create_tables = true
|
||||
EOF
|
||||
seaf-server -c conf -d conf/seafile-data -f -l -
|
||||
```
|
||||
|
||||
The config files and databases (if you use sqlite, which is by default) of `ccnet-server` are located in `~/dev/seafile-server/tests/conf`. This directory is called "ccnet conf directory". The config files, databases and data of `seaf-server` are located in `~/dev/seafile-server/tests/conf/seafile-data`. This directory is called "seafile conf directory".
|
||||
|
||||
## Start `seahub`
|
||||
|
||||
`Seahub` is the web front end of Seafile. It is written in the Django framework, requires Python 2.7 installed on your server.
|
||||
|
||||
#### set environment
|
||||
|
||||
```
|
||||
cd ~/dev/seahub/
|
||||
|
||||
cat > setenv.sh << EOF
|
||||
export CCNET_CONF_DIR=~/dev/seafile-server/tests/conf
|
||||
export SEAFILE_CONF_DIR=~/dev/seafile-server/tests/conf/seafile-data
|
||||
export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:thirdpart:\$PYTHONPATH
|
||||
EOF
|
||||
|
||||
sudo chmod u+x setenv.sh
|
||||
```
|
||||
|
||||
#### install requirements
|
||||
|
||||
```
|
||||
# Expand setenv.sh in the current shell
|
||||
. setenv.sh
|
||||
cd ~/dev/seahub/
|
||||
sudo pip install -r requirements.txt
|
||||
```
|
||||
|
||||
**NOTE**: if *locale.Error: unsupported locale setting*, you should `export LC_ALL=en_US.UTF-8`
|
||||
|
||||
#### create database and admin account
|
||||
|
||||
```
|
||||
. setenv.sh
|
||||
python manage.py migrate
|
||||
python tools/seahub-admin.py # create admin account
|
||||
```
|
||||
|
||||
**NOTE**: currently, your *ccnet directory* is `~/dev/seafile-server/tests/conf`
|
||||
|
||||
#### run `seahub`
|
||||
|
||||
```
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
```
|
||||
|
||||
then open browser and navigate to http://127.0.0.1:8000
|
||||
|
||||
If you have set up Nginx/Apache to run Seafile, you should run seahub in fastcgi mode.
|
||||
|
||||
```
|
||||
python manage.py runfcgi host=127.0.0.1 port=8000
|
||||
```
|
||||
|
|
@ -166,12 +166,10 @@ nav:
|
|||
- How to Build Seafile:
|
||||
- Outline: build_seafile/README.md
|
||||
- Linux: build_seafile/linux.md
|
||||
- FreeBSD: build_seafile/freebsd.md
|
||||
- Mac OS X: build_seafile/osx.md
|
||||
- Windows: build_seafile/windows.md
|
||||
- Server: build_seafile/server.md
|
||||
- Raspberry Pi: build_seafile/rpi.md
|
||||
- Develop env: develop/env.md
|
||||
- Translation: develop/translation.md
|
||||
- Web API V2.1: develop/web_api_v2.1.md
|
||||
- Python API: develop/python_api.md
|
||||
|
|
|
|||
Loading…
Reference in New Issue