diff --git a/manual/outdate/change_default_java.md b/manual/outdate/change_default_java.md deleted file mode 100644 index 60104b6f3..000000000 --- a/manual/outdate/change_default_java.md +++ /dev/null @@ -1,25 +0,0 @@ - -When you have both Java 6 and Java 7 installed, the default Java may not be Java 7. - -Do this by typing `java -version`, and check the output. - -- If the output is like **"java version "1.7.0_xx"**, then the default Java is Java 7, which is good. -- If the output is like **"java version "1.6.0_xx"**, then the default Java is Java 6, we need to configure default Java to Java 7. - -If the default Java is Java 6, then do - -On Debian/Ubuntu: -``` -sudo update-alternatives --config java -``` - -On CentOS/RHEL: -``` -sudo alternatives --config java -``` - -The above command will ask you to choose one of the installed Java versions as default. You should choose Java 7 here. - -After that, re-run `java -version` to make sure the change has taken effect. - -[Reference link](http://unix.stackexchange.com/questions/35185/installing-openjdk-7-jdk-does-not-update-java-which-is-still-version-1-6) diff --git a/manual/outdate/kerberos_config.md b/manual/outdate/kerberos_config.md deleted file mode 100644 index 468e83f90..000000000 --- a/manual/outdate/kerberos_config.md +++ /dev/null @@ -1,68 +0,0 @@ -## Kerberos - -NOTE: Since version 7.0, this documenation is deprecated. Users should use Apache as a proxy server for Kerberos authentication. Then configure Seahub by the instructions in [Remote User Authentication](../config/remote_user.md). - -[Kerberos](https://web.mit.edu/kerberos/) is a widely used single sign on (SSO) protocol. Seafile server supports authentication via Kerberos. It allows users to log in to Seafile without entering credentials again if they have a kerberos ticket. - -In this documentation, we assume the reader is familiar with Kerberos installation and configuration. - -Seahub provides a special URL to handle Kerberos login. The URL is `https://your-server/krb5-login`. Only this URL needs to be configured under Kerberos protection. All other URLs don't go through the Kerberos module. The overall workflow for a user to login with Kerberos is as follows: - -1. In the Seafile login page, there is a separate "Kerberos" login button. When the user clicks the button, it will be redirected to `https://your-server/krb5-login`. -2. Since that URL is controlled by Kerberos, the apache module will try to get a Ticket from the Kerberos server. -3. Seahub reads the user information from the request and brings the user to its home page. -4. Further requests to Seahub will not pass through the Kerberos module. Since Seahub keeps session information internally, the user doesn't need to login again until the session expires. - -The configuration includes three steps: - -1. Get a keytab for Apache from Kerberos -2. Configure Apache -3. Configure Seahub - -## Get keytab for Apache - -Store the keytab under the name defined below and make it accessible only to the apache user (e.g. httpd or www-data and chmod 600). - -## Apache Configuration - -You should create a new location in your virtual host configuration for Kerberos. - -``` - - - ServerName seafile.example.com - DocumentRoot /var/www -... - - SSLRequireSSL - AuthType Kerberos - AuthName "Kerberos EXAMPLE.ORG" - KrbMethodNegotiate On - KrbMethodK5Passwd On - Krb5KeyTab /etc/apache2/conf.d/http.keytab - #ErrorDocument 401 'Kerberos authentication did not pass.' - Require valid-user - -... - - - -``` - -After restarting Apache, you should see in the Apache logs that user@REALM is used when accessing https://seafile.example.com/krb5-login/. - -## Configure Seahub - -Seahub extracts the username from the `REMOTE_USER` environment variable. - -Now we have to tell Seahub what to do with the authentication information passed in by Kerberos. - -Add the following option to seahub_settings.py. - -``` -ENABLE_KRB5_LOGIN = True -``` - -## Verify - -After restarting Apache and Seafile services, you can test the Kerberos login workflow. diff --git a/manual/outdate/outlook_addin_config.md b/manual/outdate/outlook_addin_config.md deleted file mode 100644 index a65f0c557..000000000 --- a/manual/outdate/outlook_addin_config.md +++ /dev/null @@ -1,206 +0,0 @@ -# SSO for Seafile Outlook Add-in - -The Seafile Add-in for Outlook natively supports authentication via username and password. In order to authenticate with SSO, the add-in utilizes SSO support integrated in Seafile's webinterface Seahub. - -Specifically, this is how SSO with the add-in works : - -* When clicking the SSO button in the add-in, the add-in opens a browser window and requests `http(s)://SEAFILE_SERVER_URL/outlook/` -* A PHP script redirects the request to `http(s)://SEAFILE_SERVER_URL/accounts/login/` including a redirect request to /outlook/ following a successful authentication (e.g., `https://demo.seafile.com/accounts/login/?next=/jwt-sso/?page=/outlook/`) -* The identity provider signals to Seafile the user's successful authentication -* The PHP script sends an API-token to the add-in -* The add-in authorizes all API calls with the API-token - -This document explains how to configure Seafile and the reverse proxy and how to deploy the PHP script. - -## Requirements - -SSO authentication must be configured in Seafile. - -Seafile Server must be version 8.0 or above. - -## Installing prerequisites - -The packages php, composer, firebase-jwt, and guzzle must be installed. PHP can usually be downloaded and installed via the distribution's official repositories. firebase-jwt and guzzle are installed using composer. - -First, install the php package and check the installed version: -``` -# CentOS/RedHat -$ sudo yum install -y php-fpm php-curl -$ php --version - -# Debian/Ubuntu -$ sudo apt install -y php-fpm php-curl -$ php --version - -``` - -Second, install composer. You find an up-to-date install manual at https://getcomposer.org/ for CentOS, Debian, and Ubuntu. - -Third, use composer to install firebase-jwt and guzzle in a new directory in `/var/www`: -``` -$ mkdir -p /var/www/outlook-sso -$ cd /var/www/outlook-sso -$ composer require firebase/php-jwt guzzlehttp/guzzle -``` - -## Configuring Seahub - -Add this block to the config file `seahub_settings.py` using a text editor: - -``` -ENABLE_JWT_SSO = True -JWT_SSO_SECRET_KEY = 'SHARED_SECRET' -ENABLE_SYS_ADMIN_GENERATE_USER_AUTH_TOKEN = True -``` - -Replace SHARED_SECRET with a secret of your own. - -## Configuring the proxy server - -The configuration depends on the proxy server use. - -If you use nginx, add the following location block to the nginx configuration: - -``` -location /outlook { - alias /var/www/outlook-sso/public; - index index.php; - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; - fastcgi_param SCRIPT_FILENAME $request_filename; - fastcgi_index index.php; - include fastcgi_params; - } -} -``` - -This sample block assumes that PHP 7.4 is installed. If you have a different PHP version on your system, modify the version in the fastcgi_pass unix. - -Note: The alias path can be altered. We advise against it unless there are good reasons. If you do, make sure you modify the path accordingly in all subsequent steps. - -Finally, check the nginx configuration and restart nginx: - -``` -$ nginx -t -$ nginx -s reload -``` - -## Deploying the PHP script -The PHP script and corresponding configuration files will be saved in the new directory created earlier. Change into it and add a PHP config file: - -``` -$ cd /var/www/outlook-sso -$ nano config.php -``` - -Paste the following content in the `config.php`: - -``` - '', - 'password' => '', -]; - -# Option 2: provide the api-token of a seafile admin user -$seafile_admin_token = ''; - -?> -``` - -First, replace SEAFILE_SERVER_URL with the URL of your Seafile Server and SHARED_SECRET with the key used in [Configuring Seahub](#configuring_seahub). - -Second, add either the user credentials of a Seafile user with admin rights or the API-token of such a user. - -In the next step, create the `index.php` and copy & paste the PHP script: - -``` -mkdir /var/www/outlook-sso/public -$ cd /var/www/outlook-sso/public -$ nano index.php -``` - -Paste the following code block: - -``` - "wrong JWT-Token"]); - die(); - } - - try { - // init connetion to seafile api - $client = new GuzzleHttp\Client(['base_uri' => $seafile_url]); - - // get admin api-token with his credentials (if not set) - if(empty($seafile_admin_token)){ - $request = $client->request('POST', '/api2/auth-token/', ['form_params' => $seafile_admin_account]); - $response = json_decode($request->getBody()); - $seafile_admin_token = $response->token; - } - - // get api-token of the user - $request = $client->request('POST', '/api/v2.1/admin/generate-user-auth-token/', [ - 'json' => ['email' => $decoded->email], - 'headers' => ['Authorization' => 'Token '. $seafile_admin_token] - ]); - $response = json_decode($request->getBody()); - - // create the output for the outlook plugin (json like response) - echo json_encode([ - 'exp' => $decoded->exp, - 'email' => $decoded->email, - 'name' => $decoded->name, - 'token' => $response->token, - ]); - } catch (GuzzleHttp\Exception\ClientException $e){ - echo $e->getResponse()->getBody(); - } -} -else{ // no jwt-token. therefore redirect to the login page of seafile - header("Location: ". $seafile_url ."/accounts/login/?next=/jwt-sso/?page=/outlook"); -} ?> - -``` - -Note: Contrary to the config.php, no replacements or modifications are necessary in this file. - -The directory layout in `/var/www/sso-outlook/` should now look as follows: - -``` -$ tree -L 2 /var/www/outlook-sso -/var/www/outlook-sso/ -├── composer.json -├── composer.lock -├── config.php -├── public -| └── index.php -└── vendor - ├── autoload.php - ├── composer - └── firebase -``` - -Seafile and Seahub are now configured to support SSO in the Seafile Add-in for Outlook. - -# Testing -You can now test SSO authentication in the add-in. Hit the SSO button in the settings of the Seafile add-in. - - diff --git a/manual/outdate/seaf_encrypt.md b/manual/outdate/seaf_encrypt.md deleted file mode 100644 index 720b8a4d7..000000000 --- a/manual/outdate/seaf_encrypt.md +++ /dev/null @@ -1,93 +0,0 @@ -# Seafile Storage Encryption Backend - -> This feature is deprecated. We recommend you to use the encryption feature provided the storage system. - -Since Seafile Professional Server 5.1.3, we support storage enryption backend functionality. When enabled, all seafile objects (commit, fs, block) will be encrypted with AES 256 CBC algorithm, before writing them to the storage backend. Currently supported backends are: file system, Ceph, Swift and S3. - -Note that all objects will be encrypted with the same global key/iv pair. The key/iv pair has to be generated by the system admin and stored safely. If the key/iv pair is lost, all data cannot be recovered. - -## Configure Storage Backend Encryption - -### Generate Key and IV - -Go to /seafile-server-latest, execute `./seaf-gen-key.sh -h`. it will print the following usage information: - -``` -usage : -seaf-gen-key.sh - -p -``` - -By default, the key/iv pair will be saved to a file named seaf-key.txt in the current directory. You can use '-p' option to change the path. - -### Configure a freshly installed Seafile Server - -Add the following configuration to seafile.conf: - -``` -[store_crypt] -key_path = -``` - -Now the encryption feature should be working. - -### Migrating Existing Seafile Server - -If you have existing data in the Seafile server, you have to migrate/encrypt the existing data. **You must stop Seafile server before migrating the data.** - -#### Create Directories for Encrypted Data - -Create new configuration and data directories for the encrypted data. - -``` -cd seafile-server-latest -cp -r conf conf-enc -mkdir seafile-data-enc -cp -r seafile-data/library-template seafile-data-enc -# If you use SQLite database -cp seafile-data/seafile.db seafile-data-enc/ -``` - -#### Edit Config Files - -If you configured S3/Swift/Ceph backend, edit /conf-enc/seafile.conf. You must use a different bucket/container/pool to store the encrypted data. - -Then add the following configuration to /conf-enc/seafile.conf - -``` -[store_crypt] -key_path = -``` - -#### Migrate the Data - -Go to /seafile-server-latest, use the seaf-encrypt.sh script to migrate the data. - -Run `./seaf-encrypt.sh -f ../conf-enc -e ../seafile-data-enc`, - -``` -Starting seaf-encrypt, please wait ... -[04/26/16 06:59:40] seaf-encrypt.c(444): Start to encrypt 57 block among 12 repo. -[04/26/16 06:59:40] seaf-encrypt.c(444): Start to encrypt 102 fs among 12 repo. -[04/26/16 06:59:41] seaf-encrypt.c(454): Success encrypt all fs. -[04/26/16 06:59:40] seaf-encrypt.c(444): Start to encrypt 66 commit among 12 repo. -[04/26/16 06:59:41] seaf-encrypt.c(454): Success encrypt all commit. -[04/26/16 06:59:41] seaf-encrypt.c(454): Success encrypt all block. -seaf-encrypt run done -Done. -``` - -If there are error messages after executing seaf-encrypt.sh, you can fix the problem and run the script again. Objects that have already been migrated will not be copied again. - -#### Clean Up - -Go to , execute following commands: - -``` -mv conf conf-bak -mv seafile-data seafile-data-bak -mv conf-enc conf -mv seafile-data-enc seafile-data -``` - -Restart Seafile Server. If everything works okay, you can remove the backup directories. diff --git a/manual/outdate/sqlite_to_mysql.sh b/manual/outdate/sqlite_to_mysql.sh deleted file mode 100644 index 5b20d41e3..000000000 --- a/manual/outdate/sqlite_to_mysql.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -# -# This shell script uses sqlite3 commands to export data only(no schema) from seafile sqlite3 installation -# -# Setup: -# -# 1. Move this file to the top directory of your Seafile -# installation path (e.g. /data/haiwen). -# 2. Run: ./sqlite_to_mysql.sh -# 3. Three files(ccnet_db_data.sql, seafile_db_data.sql, seahub_db_data.sql) are created. -# 4. Loads these files to MySQL after you load schema -# example: (mysql> source ccnet_db_data.sql) -# - -#Function that generates INSERT statements for all data in given database -#Parameter1 = database_path - -Sqlite2MysqlData () { - echo "SET FOREIGN_KEY_CHECKS=0;" - for TABLE in $(sqlite3 $1 .tables) - do - #get columns and insert ``, around every one - COLS=$(sqlite3 $1 "PRAGMA table_info('${TABLE}');" | cut -d'|' -f2 | sed 's/^/`/' | sed 's/$/`, /' ) - - #remove comma from last one - COLS_PURE=$(echo $COLS | sed 's/.$//') - - #generate insertstatemets (via echoMultipleCommands support by sqlite3), does not include column names - echo ".mode insert\nselect * from '${TABLE}';" | sqlite3 $1 | - - #replace 3rd word with columns from above: TableName(`col1`, `col2`, `col3`, ...) - sed "s/[^ ]*[^ ]/${TABLE}(${COLS_PURE})/3" - done - echo "SET FOREIGN_KEY_CHECKS=1;" -} - -CCNET_DB='ccnet_db_data.sql' -SEAFILE_DB='seafile_db_data.sql' -SEAHUB_DB='seahub_db_data.sql' - -########## ccnet - -seafile_path=$(pwd) - -if [ -d "${seafile_path}/ccnet" ]; then - USER_MGR_DB=${seafile_path}/ccnet/PeerMgr/usermgr.db - GRP_MGR_DB=${seafile_path}/ccnet/GroupMgr/groupmgr.db -else - echo "${seafile_path}/ccnet does not exists." - read -p "Please provide your ccnet folder path(e.g. /data/haiwen/ccnet): " ccnet_path - if [ -d ${ccnet_path} ]; then - USER_MGR_DB=$(dirname "${ccnet_path}")/PeerMgr/usermgr.db - GRP_MGR_DB=$(dirname "${ccnet_path}")/GroupMgr/groupmgr.db - else - echo "${ccnet_path} does not exists, quit." - exit 1 - fi -fi - -rm -rf ${CCNET_DB} - -echo "Start export ccnet data from user" -Sqlite2MysqlData ${USER_MGR_DB} > ${CCNET_DB} - -echo "Start export ccnet data from group" -Sqlite2MysqlData ${GRP_MGR_DB} >> ${CCNET_DB} - -echo "Done export ccnet data" - -########## seafile - -if [ -f "${seafile_path}/seafile-data/seafile.db" ]; then - SEAFILE_SQLITE_DB=${seafile_path}/seafile-data/seafile.db -else - echo "${seafile_path}/seafile-data/seafile.db does not exists." - read -p "Please provide your seafile.db path(e.g. /data/haiwen/seafile-data/seafile.db): " seafile_db_path - if [ -f ${seafile_db_path} ];then - SEAFILE_SQLITE_DB=${seafile_db_path} - else - echo "${seafile_db_path} does not exists, quit." - exit 1 - fi -fi - -rm -rf ${SEAFILE_DB} - -echo "Start export seafile data" -Sqlite2MysqlData ${SEAFILE_SQLITE_DB} > ${SEAFILE_DB} - -echo "Done export seafile data" - -########## seahub - -if [ -f "${seafile_path}/seahub.db" ]; then - SEAHUB_SQLITE_DB=${seafile_path}/seahub.db -else - echo "${seafile_path}/seahub.db does not exists." - read -p "Please prove your seahub.db path(e.g. /data/haiwen/seahub.db): " seahub_db_path - if [ -f ${seahub_db_path} ]; then - SEAHUB_SQLITE_DB=${seahub_db_path} - else - echo "${seahub_db_path} does not exists, quit." - exit 1 - fi -fi - -rm -rf ${SEAHUB_DB} - -#delete existed data from `django_content_type`: -echo "DELETE FROM \`django_content_type\`;" > ${SEAHUB_DB} - -#delete existed data from `django_migrations`: -echo "DELETE FROM \`django_migrations\`;" >> ${SEAHUB_DB} - -echo "Start export seahub data" -Sqlite2MysqlData ${SEAHUB_SQLITE_DB} >> ${SEAHUB_DB} - -echo "Done export seahub data" diff --git a/manual/outdate/terms_and_conditions.md b/manual/outdate/terms_and_conditions.md deleted file mode 100644 index bcfc65b12..000000000 --- a/manual/outdate/terms_and_conditions.md +++ /dev/null @@ -1,10 +0,0 @@ -# Terms and Conditions - -Starting from version 6.0, system admin can add T&C at admin panel, all users need to accept that before using the site. - -In order to use this feature, please add following line to `seahub_settings.py`, -``` -ENABLE_TERMS_AND_CONDITIONS = True -``` - -After restarting, there will be "Terms and Conditions" section at sidebar of admin panel. diff --git a/manual/outdate/using_fuse.md b/manual/outdate/using_fuse.md deleted file mode 100644 index 06ebdb06a..000000000 --- a/manual/outdate/using_fuse.md +++ /dev/null @@ -1,89 +0,0 @@ -# Seafile -## Using Fuse - -Files in the seafile system are split to blocks, which means what are stored on your seafile server are not complete files, but blocks. This design faciliates effective data deduplication. - -However, administrators sometimes want to access the files directly on the server. You can use seaf-fuse to do this. - -`Seaf-fuse` is an implementation of the [http://fuse.sourceforge.net FUSE] virtual filesystem. In a word, it mounts all the seafile files to a folder (which is called the '''mount point'''), so that you can access all the files managed by seafile server, just as you access a normal folder on your server. - -Seaf-fuse is added since Seafile Server '''2.1.0'''. - -'''Note:''' -* Encrypted folders can't be accessed by seaf-fuse. -* Currently the implementation is '''read-only''', which means you can't modify the files through the mounted folder. -* One debian/centos systems, you need to be in the "fuse" group to have the permission to mount a FUSE folder. - -## How to start seaf-fuse - -Assume we want to mount to `/data/seafile-fuse`. - -#### Create the folder as the mount point - -``` -mkdir -p /data/seafile-fuse -``` - -#### Start seaf-fuse with the script - -'''Note:''' Before start seaf-fuse, you should have started seafile server with `./seafile.sh start`. - -``` -./seaf-fuse.sh start /data/seafile-fuse -``` - -#### Stop seaf-fuse - -``` -./seaf-fuse.sh stop -``` - -## Contents of the mounted folder - -#### The top level folder - -Now you can list the content of `/data/seafile-fuse`. - -``` -$ ls -lhp /data/seafile-fuse - -drwxr-xr-x 2 root root 4.0K Jan 1 1970 abc@abc.com/ -drwxr-xr-x 2 root root 4.0K Jan 1 1970 foo@foo.com/ -drwxr-xr-x 2 root root 4.0K Jan 1 1970 plus@plus.com/ -drwxr-xr-x 2 root root 4.0K Jan 1 1970 sharp@sharp.com/ -drwxr-xr-x 2 root root 4.0K Jan 1 1970 test@test.com/ -``` - -* The top level folder contains many subfolders, each of which corresponds to a user -* The time stamp of files and folders is not preserved. - -#### The folder for each user - -``` -$ ls -lhp /data/seafile-fuse/abc@abc.com - -drwxr-xr-x 2 root root 924 Jan 1 1970 5403ac56-5552-4e31-a4f1-1de4eb889a5f_Photos/ -drwxr-xr-x 2 root root 1.6K Jan 1 1970 a09ab9fc-7bd0-49f1-929d-6abeb8491397_My Notes/ -``` - -From the above list you can see, under the folder of a user there are subfolders, each of which represents a library of that user, and has a name of this format: '''{library_id}-{library-name}'''. - -#### The folder for a library - -``` -$ ls -lhp /data/seafile-fuse/abc@abc.com/5403ac56-5552-4e31-a4f1-1de4eb889a5f_Photos/ - --rw-r--r-- 1 root root 501K Jan 1 1970 image.png --rw-r--r-- 1 root root 501K Jan 1 1970 sample.jpng -``` - -#### If you get a "Permission denied" error - -If you get an error message saying "Permission denied" when running `./seaf-fuse.sh start`, most likely you are not in the "fuse group". You should: - -* Add yourself to the fuse group -``` -sudo usermod -a -G fuse -``` -* Logout your shell and login again -* Now try `./seaf-fuse.sh start ` again. diff --git a/manual/outdate/video_thumbnails.md b/manual/outdate/video_thumbnails.md deleted file mode 100644 index 62a7ddb0c..000000000 --- a/manual/outdate/video_thumbnails.md +++ /dev/null @@ -1,57 +0,0 @@ -# Video thumbnails - -### Install ffmpeg package - -You need to install ffmpeg package to let the video thumbnail work correctly: - -**Ubuntu 16.04** -``` -# Install ffmpeg -sudo apt-get update && sudo apt-get -y install ffmpeg - -# Now we need to install some modules -pip install pillow moviepy -``` - -**Centos 7** -``` -# We need to activate the epel repos -yum -y install epel-release -rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro - -# Then update the repo and install ffmpeg -yum -y install ffmpeg ffmpeg-devel - -# Now we need to install some modules -pip install pillow moviepy -``` - -**Debian Jessie** -```python -# Add backports repo to /etc/apt/sources.list.d/ -# e.g. the following repo works (June 2017) -sudo echo "deb http://httpredir.debian.org/debian $(lsb_release -cs)-backports main non-free" > /etc/apt/sources.list.d/debian-backports.list - -# Then update the repo and install ffmpeg -sudo apt-get update && sudo apt-get -y install ffmpeg - -# Now we need to install some modules -pip install pillow moviepy -``` - -### Configure Seafile to create thumbnails - -Now configure accordingly in `seahub_settings.py` - -```python -# Enable or disable thumbnail for video. ffmpeg and moviepy should be installed first. -# For details, please refer to https://manual.seafile.com/deploy/video_thumbnails/ -# NOTE: since version 6.1 -ENABLE_VIDEO_THUMBNAIL = True - -# Use the frame at 5 second as thumbnail -THUMBNAIL_VIDEO_FRAME_TIME = 5 - -# Absolute filesystem path to the directory that will hold thumbnail files. -THUMBNAIL_ROOT = '/haiwen/seahub-data/thumbnail/thumb/' -``` diff --git a/manual/setup/cluster_deploy_with_docker.md b/manual/setup/cluster_deploy_with_docker.md index 1c37a9507..9b85c8f52 100644 --- a/manual/setup/cluster_deploy_with_docker.md +++ b/manual/setup/cluster_deploy_with_docker.md @@ -76,8 +76,13 @@ Seafile Server: 2 frontend nodes, 1 backend node !!! tip If you have already deployed S3 storage backend and plan to apply it to Seafile cluster, you can modify the variables in `.env` to [set them synchronously during initialization](../config/env.md#s3-storage-backend-configurations-only-valid-in-pro-edition-at-deploying-first-time). +5. Pleace license file -5. Start the Seafile docker + If you have a `seafile-license.txt` license file, simply put it in the volume of the Seafile container. The volumne's default path in the Compose file is `/opt/seafile/shared`. If you have modified the path, save the license file under your custom path. + + !!! danger "If the license file has a different name or cannot be read, Seafile server will start with in trailer mode with most THREE users" + +6. Start the Seafile docker ```sh docker compose up -d @@ -123,13 +128,13 @@ Seafile Server: 2 frontend nodes, 1 backend node ``` -6. In initialization mode, the service will not be started. During this time you can check the generated configuration files (e.g., MySQL, Memcached, Elasticsearch) in configuration files: +7. In initialization mode, the service will not be started. During this time you can check the generated configuration files (e.g., MySQL, Memcached, Elasticsearch) in configuration files: - [seafevents.conf](../config/seafevents-conf.md) - [seafile.conf](../config/seafile-conf.md) - [seahub_settings.py](../config/seahub_settings_py.md) -7. After initailizing the cluster, the following fields can be removed in `.env` +8. After initailizing the cluster, the following fields can be removed in `.env` - `CLUSTER_INIT_MODE`, must be removed from .env file - `CLUSTER_INIT_MEMCACHED_HOST` - `CLUSTER_INIT_ES_HOST` @@ -148,7 +153,7 @@ Seafile Server: 2 frontend nodes, 1 backend node cp -r /opt/seafile/shared /opt/seafile/shared-bak ``` -8. Restart the container to start the service in frontend node +9. Restart the container to start the service in frontend node ```sh docker compose down @@ -175,7 +180,6 @@ Seafile Server: 2 frontend nodes, 1 backend node Starting seafile server, please wait ... - License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users Seafile server started Done. @@ -250,7 +254,6 @@ Seafile Server: 2 frontend nodes, 1 backend node Starting seafile server, please wait ... - License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users Seafile server started Done. @@ -289,53 +292,53 @@ Refer to [AWS documentation](http://docs.aws.amazon.com/elasticloadbalancing/lat 1. Install Nginx in the host if you would like to deploy load balance service -```sh -sudo apt update -sudo apt install nginx -``` + ```sh + sudo apt update + sudo apt install nginx + ``` 2. Create the configurations file for Seafile cluster -```sh -sudo nano /etc/nginx/sites-available/seafile-cluster -``` + ```sh + sudo nano /etc/nginx/sites-available/seafile-cluster + ``` -and, add the following contents into this file: + and, add the following contents into this file: -```nginx -upstream seafile_cluster { - server :80; - server :80; - ... -} + ```nginx + upstream seafile_cluster { + server :80; + server :80; + ... + } -server { - listen 80; - server_name ; - - location / { - proxy_pass http://seafile_cluster; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - http_502 http_503 http_504; + server { + listen 80; + server_name ; + + location / { + proxy_pass http://seafile_cluster; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + http_502 http_503 http_504; + } } -} -``` + ``` 3. Link the configurations file to `sites-enabled` directory: -```sh -sudo ln -s /etc/nginx/sites-available/seafile-cluster /etc/nginx/sites-enabled/ -``` + ```sh + sudo ln -s /etc/nginx/sites-available/seafile-cluster /etc/nginx/sites-enabled/ + ``` 4. Test and enable configuration -```sh -sudo nginx -t -sudo nginx -s reload -``` + ```sh + sudo nginx -t + sudo nginx -s reload + ``` ### HAproxy and Keepalived services diff --git a/manual/setup/setup_pro_by_docker.md b/manual/setup/setup_pro_by_docker.md index 5db70d251..22046e19b 100644 --- a/manual/setup/setup_pro_by_docker.md +++ b/manual/setup/setup_pro_by_docker.md @@ -209,6 +209,8 @@ The system logs are under `/shared/logs/var-log`, or `/opt/seafile-data/logs/var If you have a `seafile-license.txt` license file, simply put it in the volume of the Seafile container. The volumne's default path in the Compose file is `/opt/seafile-data`. If you have modified the path, save the license file under your custom path. +!!! danger "If the license file has a different name or cannot be read, Seafile server will start with in trailer mode with most THREE users" + Then restart Seafile: ```bash diff --git a/manual/setup_binary/cluster_deployment.md b/manual/setup_binary/cluster_deployment.md index daf55bcb0..4c1222f35 100644 --- a/manual/setup_binary/cluster_deployment.md +++ b/manual/setup_binary/cluster_deployment.md @@ -23,6 +23,8 @@ Seafile Server: 2 frontend nodes, 1 backend node Please follow [here](./installation_pro.md#installing-prerequisites) to install prerequisites +!!! note "Cache server (the first step) is not necessary, if you donot wish this node deploy it" + ### Create user `seafile` Create a new user and follow the instructions on the screen: @@ -49,7 +51,94 @@ su seafile Save the license file in Seafile's programm directory `/opt/seafile`. Make sure that the name is `seafile-license.txt`. -!!! danger "If the license file has a different name or cannot be read, Seafile server will not start" +!!! danger "If the license file has a different name or cannot be read, Seafile server will start with in trailer mode with most THREE users" + +### Setup and configure Nginx (only for frontend nodes) + +For security reasons, the Seafile frontend service will only listen to requests from the local port `8000`. You need to use Nginx to reverse proxy this port to port `80` for external access: + +1. Install Nginx + + ```sh + sudo apt update + sudo apt install nginx + ``` + +2. Create the configurations file for current node + + ```sh + sudo nano /etc/nginx/sites-available/seafile.conf + ``` + + and, add the following contents into this file: + + ```nginx + log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time'; + + server { + listen 80; + server_name ; + + proxy_set_header X-Forwarded-For $remote_addr; + + location / { + proxy_pass http://127.0.0.1:8000; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + proxy_read_timeout 1200s; + + # used for view/edit office file via Office Online Server + client_max_body_size 0; + + access_log /var/log/nginx/seahub.access.log seafileformat; + error_log /var/log/nginx/seahub.error.log; + } + + location /seafhttp { + rewrite ^/seafhttp(.*)$ $1 break; + proxy_pass http://127.0.0.1:8082; + client_max_body_size 0; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 36000s; + proxy_send_timeout 36000s; + + send_timeout 36000s; + + access_log /var/log/nginx/seafhttp.access.log seafileformat; + error_log /var/log/nginx/seafhttp.error.log; + } + location /media { + root /opt/seafile/seafile-server-latest/seahub; + } + } + ``` + +3. Link the configurations file to `sites-enabled` directory: + + ```sh + sudo ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/ + ``` + +4. Test and enable configuration + + ```sh + sudo nginx -t + sudo nginx -s reload + ``` + +### Start Seafile Service on boot (optional) + +It would be convenient to setup Seafile service to start on system boot. Follow [this documentation](./start_seafile_at_system_bootup.md) to set it up on. + +### Firewall Settings + +There are 2 firewall rule changes for Seafile cluster: + +* On each nodes, you should open the health check port (default 11001); +* On the Cache and ElasticSearch server, please only allow Seafile servers to access this port for security resons. ## Setup the first frontend Node @@ -175,13 +264,6 @@ USE seahub_db; CREATE TABLE `avatar_uploaded` (`filename` TEXT NOT NULL, `filename_md5` CHAR(32) NOT NULL PRIMARY KEY, `data` MEDIUMTEXT NOT NULL, `size` INTEGER NOT NULL, `mtime` datetime NOT NULL); ``` -### Setup Nginx/Apache and HTTP - -Nginx/Apache with HTTP need to set it up on each machine running Seafile server. This is make sure only port 80 need to be exposed to load balancer. (HTTPS should be setup at the load balancer) - -Please check the following documents on how to setup HTTP with [Nginx](./https_with_nginx.md). (HTTPS is not needed) - - ### Run and Test the Single Node Once you have finished configuring this single node, start it to test if it runs properly: @@ -201,12 +283,27 @@ su seafile ``` !!! success - The first time you start seahub, the script would prompt you to create an admin account for your Seafile server, then you can visit `http://ip-address-of-this-node:80` and login with the admin account to test if this node is working fine or not. + The first time you start seahub, the script would prompt you to create an admin account for your Seafile server. Then you can see the following message in your console: + + ``` + Starting seafile server, please wait ... + Seafile server started + + Done. + + Starting seahub at port 8000 ... + Seahub is started + + Done. + ``` + + Finally, you can visit `http://ip-address-of-this-node:80` and login with the admin account to test if this node is working fine or not. -## Configure other nodes -If the first node works fine, you can compress the whole directory `/opt/seafile` into a tarball and copy it to all other Seafile server nodes. You can simply uncompress it and start the server on other frontend nodes by: +## Configure other frontend nodes + +If the first frontend node works fine, you can **compress** the whole directory `/opt/seafile` into a **tarball** and **copy it** to all other Seafile server nodes. You can simply **uncompress** it and **start** the server by: !!! note For installations using python virtual environment, activate it if it isn't already active @@ -222,7 +319,7 @@ su seafile ./seahub.sh start ``` -### backend node +## Backend node In the backend node, you need to execute the following command to start Seafile server. **CLUSTER_MODE=backend** means this node is seafile backend server. @@ -241,17 +338,6 @@ su seafile ./seafile-background-tasks.sh start ``` -## Start Seafile Service on boot - -It would be convenient to setup Seafile service to start on system boot. Follow [this documentation](./start_seafile_at_system_bootup.md) to set it up on **all nodes**. - -## Firewall Settings - -There are 2 firewall rule changes for Seafile cluster: - -* On each Seafile server machine, you should open the health check port (default 11001); -* On the Cache and ElasticSearch server, please only allow Seafile servers to access this port for security resons. - ## Load Balancer Setting !!! note @@ -281,53 +367,53 @@ Refer to [AWS documentation](http://docs.aws.amazon.com/elasticloadbalancing/lat 1. Install Nginx in the host if you would like to deploy load balance service -```sh -sudo apt update -sudo apt install nginx -``` + ```sh + sudo apt update + sudo apt install nginx + ``` 2. Create the configurations file for Seafile cluster -```sh -sudo nano /etc/nginx/sites-available/seafile-cluster -``` + ```sh + sudo nano /etc/nginx/sites-available/seafile-cluster + ``` + + and, add the following contents into this file: -and, add the following contents into this file: - -```nginx -upstream seafile_cluster { - server :80; - server :80; - ... -} - -server { - listen 80; - server_name ; - - location / { - proxy_pass http://seafile_cluster; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - http_502 http_503 http_504; + ```nginx + upstream seafile_cluster { + server :80; + server :80; + ... } -} -``` + + server { + listen 80; + server_name ; + + location / { + proxy_pass http://seafile_cluster; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + http_502 http_503 http_504; + } + } + ``` 3. Link the configurations file to `sites-enabled` directory: -```sh -sudo ln -s /etc/nginx/sites-available/seafile-cluster /etc/nginx/sites-enabled/ -``` + ```sh + sudo ln -s /etc/nginx/sites-available/seafile-cluster /etc/nginx/sites-enabled/ + ``` 4. Test and enable configuration -```sh -sudo nginx -t -sudo nginx -s reload -``` + ```sh + sudo nginx -t + sudo nginx -s reload + ``` ### HAProxy diff --git a/manual/setup_binary/installation_ce.md b/manual/setup_binary/installation_ce.md index efb3577aa..a43718d32 100644 --- a/manual/setup_binary/installation_ce.md +++ b/manual/setup_binary/installation_ce.md @@ -23,70 +23,70 @@ Seafile uses the mysql_native_password plugin for authentication. The versions o !!! tip The standard directory `/opt/seafile` is assumed for Seafile's program and we will use it on the rest of this manual. If you decide to put Seafile in another directory, modify the commands accordingly. -=== "Ubuntu 24.04" - !!! note - Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. +1. Install cache server (e.g., *Memcached*) - ``` - # Ubuntu 24.04 + ```sh sudo apt-get update - sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv sudo apt-get install -y memcached libmemcached-dev + ``` - mkdir /opt/seafile - cd /opt/seafile +2. Install Python and related libraries - # create the vitual environment in the python-venv directory - python3 -m venv python-venv + === "Ubuntu 24.04" + !!! note + Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. - # activate the venv - source python-venv/bin/activate - # Notice that this will usually change your prompt so you know the venv is active + ``` + sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv - # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). - pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ - pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ - psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.* - ``` -=== "Debian 12" - !!! note - Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. + mkdir /opt/seafile + cd /opt/seafile - ``` - # Debian 12 - sudo apt-get update - sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmariadb-dev-compat ldap-utils libldap2-dev libsasl2-dev python3.11-venv - sudo apt-get install -y memcached libmemcached-dev + # create the vitual environment in the python-venv directory + python3 -m venv python-venv - mkdir /opt/seafile - cd /opt/seafile + # activate the venv + source python-venv/bin/activate + # Notice that this will usually change your prompt so you know the venv is active - # create the vitual environment in the python-venv directory - python3 -m venv python-venv + # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). + pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ + pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ + psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.* + ``` + === "Debian 12" + !!! note + Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. - # activate the venv - source python-venv/bin/activate - # Notice that this will usually change your prompt so you know the venv is active + ``` + sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmariadb-dev-compat ldap-utils libldap2-dev libsasl2-dev python3.11-venv - # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). - pip3 install --timeout=3600 django==4.2.* future==0.18.* mysqlclient==2.1.* pymysql pillow==10.0.* pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==2.0.18 psd-tools django-pylibmc django_simple_captcha==0.5.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 lxml python-ldap==3.4.3 - ``` -=== "Debian 11/Ubuntu 22.04" + mkdir /opt/seafile + cd /opt/seafile - ``` - # Ubuntu 22.04 (almost the same for Ubuntu 20.04 and Debian 11, Debian 10) - sudo apt-get update - sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev - sudo apt-get install -y memcached libmemcached-dev + # create the vitual environment in the python-venv directory + python3 -m venv python-venv - sudo mkdir /opt/seafile - cd /opt/seafile + # activate the venv + source python-venv/bin/activate + # Notice that this will usually change your prompt so you know the venv is active - sudo pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ - pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ - psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.95.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.4.3 lxml gevent==24.2.* + # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). + pip3 install --timeout=3600 django==4.2.* future==0.18.* mysqlclient==2.1.* pymysql pillow==10.0.* pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==2.0.18 psd-tools django-pylibmc django_simple_captcha==0.5.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 lxml python-ldap==3.4.3 + ``` + === "Debian 11/Ubuntu 22.04" - ``` + ``` + sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev + + sudo mkdir /opt/seafile + cd /opt/seafile + + sudo pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ + pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ + psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.95.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.4.3 lxml gevent==24.2.* + + ``` ### Creating user seafile diff --git a/manual/setup_binary/installation_pro.md b/manual/setup_binary/installation_pro.md index d57fa719b..be96d54b7 100644 --- a/manual/setup_binary/installation_pro.md +++ b/manual/setup_binary/installation_pro.md @@ -23,67 +23,75 @@ Seafile uses the `mysql_native_password` plugin for authentication. The versions !!! tip The standard directory `/opt/seafile` is assumed for the rest of this manual. If you decide to put Seafile in another directory, some commands need to be modified accordingly -=== "Ubuntu 24.04" - !!! note - Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. +1. Install cache server (e.g., *Memcached*) ```sh sudo apt-get update - sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv sudo apt-get install -y memcached libmemcached-dev + ``` - # create the data directory - mkdir /opt/seafile - cd /opt/seafile +2. Install Python and related libraries - # create the vitual environment in the python-venv directory - python3 -m venv python-venv + === "Ubuntu 24.04" + !!! note + Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. - # activate the venv - source python-venv/bin/activate - # Notice that this will usually change your prompt so you know the venv is active + ```sh + + sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmysqlclient-dev ldap-utils libldap2-dev python3.12-venv + - # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). - pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ - pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ - psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.* - ``` -=== "Debian 12" - !!! note - Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. - ```sh - sudo apt-get update - sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmariadb-dev-compat ldap-utils libldap2-dev libsasl2-dev python3.11-venv - sudo apt-get install -y memcached libmemcached-dev + # create the data directory + mkdir /opt/seafile + cd /opt/seafile - # create the data directory - mkdir /opt/seafile - cd /opt/seafile + # create the vitual environment in the python-venv directory + python3 -m venv python-venv - # create the vitual environment in the python-venv directory - python3 -m venv python-venv + # activate the venv + source python-venv/bin/activate + # Notice that this will usually change your prompt so you know the venv is active - # activate the venv - source python-venv/bin/activate - # Notice that this will usually change your prompt so you know the venv is active + # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). + pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ + pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ + psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.9.* pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 lxml python-ldap==3.4.* gevent==24.2.* + ``` + === "Debian 12" + !!! note + Debian 12 and Ubuntu 24.04 are now discouraging system-wide installation of python modules with pip. It is preferred now to install modules into a virtual environment which keeps them separate from the files installed by the system package manager, and enables different versions to be installed for different applications. With these python virtual environments (venv for short) to work, you have to activate the venv to make the packages installed in it available to the programs you run. That is done here with `source python-venv/bin/activate`. - # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). - pip3 install --timeout=3600 django==4.2.* future==0.18.* mysqlclient==2.1.* pymysql pillow==10.0.* pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==2.0.18 psd-tools django-pylibmc django_simple_captcha==0.5.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 lxml python-ldap==3.4.3 - ``` -=== "Ubuntu 22.04/Debian 11" - ```sh - # on (on , it is almost the same) - apt-get update - apt-get install -y python3 python3-dev python3-setuptools python3-pip python3-ldap libmysqlclient-dev ldap-utils libldap2-dev dnsutils - apt-get install -y memcached libmemcached-dev - apt-get install -y poppler-utils - # create the data directory - mkdir /opt/seafile - cd /opt/seafile - sudo pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ - pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ - psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.95.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.4.3 lxml gevent==24.2.* - ``` + ```sh + sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip libmariadb-dev-compat ldap-utils libldap2-dev libsasl2-dev python3.11-venv + + # create the data directory + mkdir /opt/seafile + cd /opt/seafile + + # create the vitual environment in the python-venv directory + python3 -m venv python-venv + + # activate the venv + source python-venv/bin/activate + # Notice that this will usually change your prompt so you know the venv is active + + # install packages into the active venv with pip (sudo isn't needed because this is installing in the venv, not system-wide). + pip3 install --timeout=3600 django==4.2.* future==0.18.* mysqlclient==2.1.* pymysql pillow==10.0.* pylibmc captcha==0.4 markupsafe==2.0.1 jinja2 sqlalchemy==2.0.18 psd-tools django-pylibmc django_simple_captcha==0.5.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 lxml python-ldap==3.4.3 + ``` + === "Ubuntu 22.04/Debian 11" + + ```sh + # on (on , it is almost the same) + apt-get install -y python3 python3-dev python3-setuptools python3-pip python3-ldap libmysqlclient-dev ldap-utils libldap2-dev dnsutils + apt-get install -y poppler-utils + + # create the data directory + mkdir /opt/seafile + cd /opt/seafile + sudo pip3 install --timeout=3600 django==4.2.* future==1.0.* mysqlclient==2.2.* \ + pymysql pillow==10.4.* pylibmc captcha==0.6.* markupsafe==2.0.1 jinja2 sqlalchemy==2.0.* \ + psd-tools django-pylibmc django_simple_captcha==0.6.* djangosaml2==1.95.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.4.3 lxml gevent==24.2.* + ``` ### Creating user seafile @@ -113,7 +121,7 @@ su seafile Save the license file in Seafile's programm directory `/opt/seafile`. Make sure that the name is `seafile-license.txt`. -!!! danger "If the license file has a different name or cannot be read, Seafile server will not start" +!!! danger "If the license file has a different name or cannot be read, Seafile server will start with in trailer mode with most THREE users" ### Downloading the install package diff --git a/manual/upgrade/upgrade_a_cluster.md b/manual/upgrade/upgrade_a_cluster.md index e76760a73..272924e2e 100644 --- a/manual/upgrade/upgrade_a_cluster.md +++ b/manual/upgrade/upgrade_a_cluster.md @@ -1,207 +1,147 @@ ---- -status: new ---- - # Upgrade a Seafile cluster ## Major and minor version upgrade Seafile adds new features in major and minor versions. It is likely that some database tables need to be modified or the search index need to be updated. In general, upgrading a cluster contains the following steps: -1. Upgrade the database -2. Update symbolic link at frontend and backend nodes to point to the newest version +1. Update Seafile image +2. Upgrade the database 3. Update configuration files at each node 4. Update search index in the backend node In general, to upgrade a cluster, you need: -1. Run the upgrade script (for example, ./upgrade/upgrade_4_0_4_1.sh) in one frontend node -2. Run the minor upgrade script (./upgrade/minor_upgrade.sh) in all other nodes to update symbolic link +1. Download the new image, stop the old docker container, modify the Seafile image version in docker-compose.yml to the new version. Start with docker compose up. +2. Run the upgrade script in container (for example, `/opt/seafile/seafile-server-latest/upgrade/upgrade_x_x_x_x.sh`) in one frontend node 3. Update configuration files at each node according to the documentation for each version 4. Delete old search index in the backend node if needed -## Maintanence upgrade - -Doing maintanence upgrading is simple, you only need to run the script `./upgrade/minor_upgrade.sh` at each node to update the symbolic link. - -## Specific instructions for each version - -### From 7.0 to 7.1 - -In the background node, Seahub no longer need to be started. Nginx is not needed too. - -The way of how office converter work is changed. The Seahub in front end nodes directly access a service in background node. - -#### For front-end nodes - -**seahub_settings.py** - -``` -OFFICE_CONVERTOR_ROOT = 'http://' -⬇️ -OFFICE_CONVERTOR_ROOT = 'http://:6000' - -``` - -**seafevents.conf** - -``` -[OFFICE CONVERTER] -enabled = true -workers = 1 -max-size = 10 - -⬇️ -[OFFICE CONVERTER] -enabled = true -workers = 1 -max-size = 10 -host = -port = 6000 - -``` - -#### For backend node - -**seahub_settings.py is not needed. **But you can leave it unchanged. - -**seafevents.conf** - -``` -[OFFICE CONVERTER] -enabled = true -workers = 1 -max-size = 10 - -⬇️ -[OFFICE CONVERTER] -enabled = true -workers = 1 -max-size = 10 -host = -port = 6000 - -``` - -### From 6.3 to 7.0 - -No special upgrade operations. - -### From 6.2 to 6.3 - -In version 6.2.11, the included Django was upgraded. The memcached configuration needed to be upgraded if you were using a cluster. If you upgrade from a version below 6.1.11, don't forget to change your memcache configuration. If the configuration in your `seahub_settings.py` is: - -``` -CACHES = { - 'default': { - 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache', - 'LOCATION': ':11211', - } -} - -COMPRESS_CACHE_BACKEND = 'django.core.cache.backends.locmem.LocMemCache' - -``` - -Now you need to change to: - -``` -CACHES = { - 'default': { - 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache', - 'LOCATION': ':11211', - }, - 'locmem': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - }, -} -COMPRESS_CACHE_BACKEND = 'locmem' - -``` - -### From 6.1 to 6.2 - -No special upgrade operations. - -### From 6.0 to 6.1 +## Upgrade a cluster from Seafile 11 to 12 -In version 6.1, we upgraded the included ElasticSearch server. The old server listen on port 9500, new server listen on port 9200. Please change your firewall settings. +1. Stop the seafile service in all nodes -### From 5.1 to 6.0 + ```sh + docker compose down + ``` -In version 6.0, the folder download mechanism has been updated. This requires that, in a cluster deployment, seafile-data/httptemp folder must be in an NFS share. You can make this folder a symlink to the NFS share. +2. Download the docker-compose files for *Seafile 12* -``` -cd /data/haiwen/ -ln -s /nfs-share/seafile-httptemp seafile-data/httptemp + ```sh + wget -O .env https://manual.seafile.com/12.0/docker/cluster/env + wget https://manual.seafile.com/12.0/docker/cluster/seafile-server.yml + ``` -``` +3. Modify `.env`: -The httptemp folder only contains temp files for downloading/uploading file on web UI. So there is no reliability requirement for the NFS share. You can export it from any node in the cluster. + - Generate a JWT key -### From v5.0 to v5.1 + ```sh + pwgen -s 40 1 -Because Django is upgraded to 1.8, the COMPRESS_CACHE_BACKEND should be changed + # e.g., EkosWcXonPCrpPE9CFsnyQLLPqoPhSJZaqA3JMFw + ``` -``` - - COMPRESS_CACHE_BACKEND = 'locmem://' - + COMPRESS_CACHE_BACKEND = 'django.core.cache.backends.locmem.LocMemCache' + - Fill up the following field according to your configurations using in *Seafile 11*: -``` + ```sh + SEAFILE_SERVER_HOSTNAME= + SEAFILE_SERVER_PROTOCOL=https # or http + SEAFILE_MYSQL_DB_HOST= + SEAFILE_MYSQL_DB_USER=seafile # if you don't use `seafile` as your Seafile server's account, please correct it + SEAFILE_MYSQL_DB_PASSWORD= + JWT_PRIVATE_KEY= + ``` -### From v4.4 to v5.0 + !!! tip "Remove the variables using in Cluster initialization" + Since Seafile has been initialized in Seafile 11, the variables related to Seafile cluster initialization can be removed from `.env`: -v5.0 introduces some database schema change, and all configuration files (ccnet.conf, seafile.conf, seafevents.conf, seahub_settings.py) are moved to a central config directory. + - INIT_SEAFILE_MYSQL_ROOT_PASSWORD + - CLUSTER_INIT_MODE + - CLUSTER_INIT_MEMCACHED_HOST + - CLUSTER_INIT_ES_HOST + - CLUSTER_INIT_ES_PORT + - INIT_S3_STORAGE_BACKEND_CONFIG + - INIT_S3_COMMIT_BUCKET + - INIT_S3_FS_BUCKET + - INIT_S3_BLOCK_BUCKET + - INIT_S3_KEY_ID + - INIT_S3_USE_V4_SIGNATURE + - INIT_S3_SECRET_KEY + - INIT_S3_AWS_REGION + - INIT_S3_HOST + - INIT_S3_USE_HTTPS -Perform the following steps to upgrade: +4. Start the Seafile in a node -* Run the upgrade script at one fronend node to upgrade the database. + !!! note + According to this upgrade document, a **frontend** service will be started here. If you plan to use this node as a backend node, you need to modify this item in `.env` and set it to `backend`: + ```sh + CLUSTER_MODE=backend + ``` -``` -./upgrade/upgrade_4.4_5.0.sh + ```sh + docker compose up -d + ``` -``` +5. Upgrade Seafile -* Then, on all other frontend nodes and the background node, run the upgrade script with `SEAFILE_SKIP_DB_UPGRADE` environmental variable turned on: + ```sh + docker exec -it seafile bash + # enter the container `seafile` + # stop servers + cd /opt/seafile/seafile-server-latest + ./seafile.sh stop + ./seahub.sh stop + + # upgrade seafile + cd upgrade + ./upgrade_11.0_12.0.sh + ``` -``` -SEAFILE_SKIP_DB_UPGRADE=1 ./upgrade/upgrade_4.4_5.0.sh + !!! success + After upgrading the Seafile, you can see the following messages in your console: -``` + ``` + Updating seafile/seahub database ... -After the upgrade, you should see the configuration files has been moved to the conf/ folder. + [INFO] You are using MySQL + [INFO] updating seafile database... + [INFO] updating seahub database... + [INFO] updating seafevents database... + Done -``` -conf/ - |__ seafile.conf - |__ seafevent.conf - |__ seafdav.conf - |__ seahub_settings.conf + migrating avatars ... -``` + Done -### From v4.3 to v4.4 + updating /opt/seafile/seafile-server-latest symbolic link to /opt/seafile/seafile-pro-server-12.0.6 ... -There are no database and search index upgrade from v4.3 to v4.4. Perform the following steps to upgrade: -1. Run the minor upgrade script at frontend and backend nodes -### From v4.2 to v4.3 + ----------------------------------------------------------------- + Upgraded your seafile server successfully. + ----------------------------------------------------------------- + ``` -v4.3 contains no database table change from v4.2. But the old search index will be deleted and regenerated. + Then you can exit the container by `exit` -A new option COMPRESS_CACHE_BACKEND = 'django.core.cache.backends.locmem.LocMemCache' should be added to seahub_settings.py +6. Restart current node -The secret key in seahub_settings.py need to be regenerated, the old secret key lack enough randomness. + ```sh + docker compose down + docker compose up -d + ``` -Perform the following steps to upgrade: + !!! tip + - You can use `docker logs -f seafile` to check whether the current node service is running normally -1. Run the upgrade script at one fronend node to modify the seahub_settings.py -2. Modify seahub_settings.py at each node, replacing the old secret key with the new one and add option COMPRESS_CACHE_BACKEND -3. Run the minor upgrade script at frontend and backend nodes -4. Delete the old search index (the folder pro-data/search) at the backend node -5. Delete the old office preview output folder (/tmp/seafile-office-output) at the backend node +7. Operations for other nodes + - Download and modify `.env` similar to the first node (for backend node, you should set `CLUSTER_MODE=backend`) + - Start the Seafile server: + ```sh + docker compose up -d + ``` diff --git a/manual/upgrade/upgrade_a_cluster_binary.md b/manual/upgrade/upgrade_a_cluster_binary.md new file mode 100644 index 000000000..404faffa0 --- /dev/null +++ b/manual/upgrade/upgrade_a_cluster_binary.md @@ -0,0 +1,83 @@ +# Upgrade a Seafile cluster (binary) + +## Major and minor version upgrade + +Seafile adds new features in major and minor versions. It is likely that some database tables need to be modified or the search index need to be updated. In general, upgrading a cluster contains the following steps: + +1. Upgrade the database +2. Update symbolic link at frontend and backend nodes to point to the newest version +3. Update configuration files at each node +4. Update search index in the backend node + +In general, to upgrade a cluster, you need: + +1. Run the upgrade script (for example, ./upgrade/upgrade_4_0_4_1.sh) in one frontend node +2. Run the minor upgrade script (./upgrade/minor_upgrade.sh) in all other nodes to update symbolic link +3. Update configuration files at each node according to the documentation for each version +4. Delete old search index in the backend node if needed + +## Maintanence upgrade + +Doing maintanence upgrading is simple, you only need to run the script `./upgrade/minor_upgrade.sh` at each node to update the symbolic link. + +## Upgrade from Seafile 11 cluster (all nodes) + +!!! tip "Clean Database" + If you have a large number of `Activity` in MySQL, clear this table first [Clean Database](../../administration/clean_database). Otherwise, the database upgrade will take a long time. + +1. Stop Seafile server + + !!! note + For installations using python virtual environment, activate it if it isn't already active + + ```sh + source python-venv/bin/activate + ``` + + === "Frontend node" + ```sh + cd /opt/seafile/seafile-server-latest + su seafile + ./seafile.sh stop + ./seahub.sh stop + ``` + === "Backend node" + ```sh + cd /opt/seafile/seafile-server-latest + su seafile + ./seafile.sh stop + ./seafile-background-tasks.sh stop + ``` + +2. Install [new Python libraries](./upgrade_notes_for_12.0.x.md#new-python-libraries) + +3. [Download](../setup_binary/installation_pro.md#downloading-the-install-package) and [uncompress](../setup_binary/installation_pro.md#uncompressing-the-package) the package + +4. Upgrade + + ```sh + seafile-pro-server-12.x.x/upgrade/upgrade_11.0_12.0.sh + ``` + +5. Follow [here](./upgrade_notes_for_12.0.x.md#3-create-the-env-file-in-conf-directory) to create the `.env` file in `conf/` directory + +6. Start Seafile server + + === "Frontend node" + ```sh + cd /opt/seafile/seafile-server-latest + su seafile + ./seafile.sh start + ./seahub.sh start + ``` + === "Backend node" + ```sh + cd /opt/seafile/seafile-server-latest + su seafile + ./seafile.sh start + ./seafile-background-tasks.sh start + ``` + +7. Refer [here](./upgrade_notes_for_12.0.x.md#5-upgrade-notification-server) to upgrade notification server + +8. Refer [here](./upgrade_notes_for_12.0.x.md#upgrade-seadoc-from-08-to-10) to upgrade SeaDoc server diff --git a/manual/upgrade/upgrade_a_cluster_docker.md b/manual/upgrade/upgrade_a_cluster_docker.md deleted file mode 100644 index b6400b928..000000000 --- a/manual/upgrade/upgrade_a_cluster_docker.md +++ /dev/null @@ -1,147 +0,0 @@ -# Upgrade a Seafile cluster (Docker) - -## Major and minor version upgrade - -Seafile adds new features in major and minor versions. It is likely that some database tables need to be modified or the search index need to be updated. In general, upgrading a cluster contains the following steps: - -1. Update Seafile image -2. Upgrade the database -3. Update configuration files at each node -4. Update search index in the backend node - -In general, to upgrade a cluster, you need: - -1. Download the new image, stop the old docker container, modify the Seafile image version in docker-compose.yml to the new version. Start with docker compose up. -2. Run the upgrade script in container (for example, `/opt/seafile/seafile-server-latest/upgrade/upgrade_x_x_x_x.sh`) in one frontend node -3. Update configuration files at each node according to the documentation for each version -4. Delete old search index in the backend node if needed - -## Upgrade a cluster from Seafile 11 to 12 - -1. Stop the seafile service in all nodes - - ```sh - docker compose down - ``` - -2. Download the docker-compose files for *Seafile 12* - - ```sh - wget -O .env https://manual.seafile.com/12.0/docker/cluster/env - wget https://manual.seafile.com/12.0/docker/cluster/seafile-server.yml - ``` - -3. Modify `.env`: - - - Generate a JWT key - - ```sh - pwgen -s 40 1 - - # e.g., EkosWcXonPCrpPE9CFsnyQLLPqoPhSJZaqA3JMFw - ``` - - - Fill up the following field according to your configurations using in *Seafile 11*: - - ```sh - SEAFILE_SERVER_HOSTNAME= - SEAFILE_SERVER_PROTOCOL=https # or http - SEAFILE_MYSQL_DB_HOST= - SEAFILE_MYSQL_DB_USER=seafile # if you don't use `seafile` as your Seafile server's account, please correct it - SEAFILE_MYSQL_DB_PASSWORD= - JWT_PRIVATE_KEY= - ``` - - !!! tip "Remove the variables using in Cluster initialization" - Since Seafile has been initialized in Seafile 11, the variables related to Seafile cluster initialization can be removed from `.env`: - - - INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - CLUSTER_INIT_MODE - - CLUSTER_INIT_MEMCACHED_HOST - - CLUSTER_INIT_ES_HOST - - CLUSTER_INIT_ES_PORT - - INIT_S3_STORAGE_BACKEND_CONFIG - - INIT_S3_COMMIT_BUCKET - - INIT_S3_FS_BUCKET - - INIT_S3_BLOCK_BUCKET - - INIT_S3_KEY_ID - - INIT_S3_USE_V4_SIGNATURE - - INIT_S3_SECRET_KEY - - INIT_S3_AWS_REGION - - INIT_S3_HOST - - INIT_S3_USE_HTTPS - -4. Start the Seafile in a node - - !!! note - According to this upgrade document, a **frontend** service will be started here. If you plan to use this node as a backend node, you need to modify this item in `.env` and set it to `backend`: - - ```sh - CLUSTER_MODE=backend - ``` - - ```sh - docker compose up -d - ``` - -5. Upgrade Seafile - - ```sh - docker exec -it seafile bash - # enter the container `seafile` - - # stop servers - cd /opt/seafile/seafile-server-latest - ./seafile.sh stop - ./seahub.sh stop - - # upgrade seafile - cd upgrade - ./upgrade_11.0_12.0.sh - ``` - - !!! success - After upgrading the Seafile, you can see the following messages in your console: - - ``` - Updating seafile/seahub database ... - - [INFO] You are using MySQL - [INFO] updating seafile database... - [INFO] updating seahub database... - [INFO] updating seafevents database... - Done - - migrating avatars ... - - Done - - updating /opt/seafile/seafile-server-latest symbolic link to /opt/seafile/seafile-pro-server-12.0.6 ... - - - - ----------------------------------------------------------------- - Upgraded your seafile server successfully. - ----------------------------------------------------------------- - ``` - - Then you can exit the container by `exit` - -6. Restart current node - - ```sh - docker compose down - docker compose up -d - ``` - - !!! tip - - You can use `docker logs -f seafile` to check whether the current node service is running normally - -7. Operations for other nodes - - - Download and modify `.env` similar to the first node (for backend node, you should set `CLUSTER_MODE=backend`) - - - Start the Seafile server: - ```sh - docker compose up -d - ``` diff --git a/manual/upgrade/upgrade_notes_for_12.0.x.md b/manual/upgrade/upgrade_notes_for_12.0.x.md index dbc986a02..9272a1d4a 100644 --- a/manual/upgrade/upgrade_notes_for_12.0.x.md +++ b/manual/upgrade/upgrade_notes_for_12.0.x.md @@ -62,7 +62,7 @@ pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 python-ldap==3.4.* The following instruction is for binary package based installation. If you use Docker based installation, please see [*Updgrade Docker*](./upgrade_docker.md) -!!! note +!!! note "Notification Server" If you has deployed the [Notification Server](../extension/notification-server.md). The *Notification Server* should be **re-deployed** with the same version as Seafile server. For example: @@ -82,7 +82,8 @@ The following instruction is for binary package based installation. If you use D docker compose restart ``` -Note: If you have a large number of `Activity` in MySQL, clear this table first [Clean Database](../../administration/clean_database). Otherwise, the database upgrade will take a long time. +!!! tip "Clean Database" + If you have a large number of `Activity` in MySQL, clear this table first [Clean Database](../../administration/clean_database). Otherwise, the database upgrade will take a long time. ### 1) Stop Seafile-11.0.x server @@ -92,7 +93,7 @@ Note: If you have a large number of `Activity` in MySQL, clear this table first upgrade/upgrade_11.0_12.0.sh ``` -### 3) Create the `.env` file in conf/ directory +### 3) Create the `.env` file in `conf/` directory conf/.env @@ -109,7 +110,12 @@ SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db ``` -Note: JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters, generate example: `pwgen -s 40 1` +!!! tip + JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters, can be generated by + + ```sh + pwgen -s 40 1 + ``` ### 4) Start Seafile-12.0.x server diff --git a/mkdocs.yml b/mkdocs.yml index 9493a885f..50533a68e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -179,7 +179,7 @@ nav: - Outline: upgrade/upgrade.md - Upgrade Seafile Docker: upgrade/upgrade_docker.md - Upgrade Seafile Cluster: upgrade/upgrade_a_cluster.md - - Upgrade Seafile Cluster (Docker): upgrade/upgrade_a_cluster_docker.md + - Upgrade Seafile Cluster (binary): upgrade/upgrade_a_cluster_binary.md - Upgrade notes for 7.1.x: upgrade/upgrade_notes_for_7.1.x.md - Upgrade notes for 8.0.x: upgrade/upgrade_notes_for_8.0.x.md - Upgrade notes for 9.0.x: upgrade/upgrade_notes_for_9.0.x.md