### Run Seafile Pro Setup Script Source: https://manual.seafile.com/latest/setup_binary/installation Navigate to the Seafile Pro server directory and execute the setup script for MySQL installations. This script automates the initial setup process. ```bash cd seafile-pro-server-13.0.10 ./setup-seafile-mysql.sh ``` -------------------------------- ### Configure Multi-LDAP Server Setup (Example) Source: https://manual.seafile.com/latest/config/ldap_in_pro Enable multi-LDAP support with ENABLE_MULTI_LDAP = True and configure individual servers using MULTI_LDAP_1_* settings. This allows Seafile to query multiple LDAP servers sequentially. ```python # Basic config options ENABLE_LDAP = True ...... # Multi ldap config options ENABLE_MULTI_LDAP = True MULTI_LDAP_1_SERVER_URL = 'ldap://192.168.0.2' MULTI_LDAP_1_BASE_DN = 'ou=test,dc=seafile,dc=top' MULTI_LDAP_1_ADMIN_DN = 'administrator@example.top' MULTI_LDAP_1_ADMIN_PASSWORD = 'Hello@123' MULTI_LDAP_1_PROVIDER = 'ldap1' MULTI_LDAP_1_LOGIN_ATTR = 'userPrincipalName' # Optional configs MULTI_LDAP_1_USER_FIRST_NAME_ATTR = 'givenName' MULTI_LDAP_1_USER_LAST_NAME_ATTR = 'sn' MULTI_LDAP_1_USER_NAME_REVERSE = False ENABLE_MULTI_LDAP_1_EXTRA_USER_INFO_SYNC = True MULTI_LDAP_1_FILTER = 'memberOf=CN=testgroup,OU=test,DC=seafile,DC=ren' MULTI_LDAP_1_USE_PAGED_RESULT = False MULTI_LDAP_1_FOLLOW_REFERRALS = True ENABLE_MULTI_LDAP_1_USER_SYNC = True ENABLE_MULTI_LDAP_1_GROUP_SYNC = True MULTI_LDAP_1_SYNC_DEPARTMENT_FROM_OU = True MULTI_LDAP_1_USER_OBJECT_CLASS = 'person' MULTI_LDAP_1_DEPT_ATTR = '' MULTI_LDAP_1_UID_ATTR = '' MULTI_LDAP_1_CONTACT_EMAIL_ATTR = '' MULTI_LDAP_1_USER_ROLE_ATTR = '' MULTI_LDAP_1_AUTO_REACTIVATE_USERS = True MULTI_LDAP_1_GROUP_OBJECT_CLASS = 'group' MULTI_LDAP_1_GROUP_FILTER = '' MULTI_LDAP_1_GROUP_MEMBER_ATTR = 'member' MULTI_LDAP_1_GROUP_UUID_ATTR = 'objectGUID' MULTI_LDAP_1_CREATE_DEPARTMENT_LIBRARY = False MULTI_LDAP_1_DEPT_REPO_PERM = 'rw' MULTI_LDAP_1_DEFAULT_DEPARTMENT_QUOTA = -2 MULTI_LDAP_1_SYNC_GROUP_AS_DEPARTMENT = False MULTI_LDAP_1_USE_GROUP_MEMBER_RANGE_QUERY = False MULTI_LDAP_1_USER_ATTR_IN_MEMBERUID = 'uid' MULTI_LDAP_1_DEPT_NAME_ATTR = '' ...... ``` -------------------------------- ### Install Nginx Source: https://manual.seafile.com/latest/setup_binary/https_with_nginx?q= Installs Nginx using the apt package manager. Ensure Nginx starts on system boot. ```bash sudo apt install nginx -y ``` ```bash sudo systemctl start nginx sudo systemctl enable nginx ``` -------------------------------- ### Install and configure MariaDB Source: https://manual.seafile.com/latest/develop/server Install the database server and set the root password. ```bash apt-get install -y mariadb-server service mariadb start mysqladmin -u root password your_password ``` -------------------------------- ### Configure seaf-fuse start options Source: https://manual.seafile.com/latest/extension/fuse Examples for setting ownership or disabling block caching in Pro edition. ```bash ./seaf-fuse.sh start -o uid= /data/seafile-fuse ``` ```bash ./seaf-fuse.sh start --disable-block-cache /data/seafile-fuse ``` -------------------------------- ### Install Redis Server and Client Libraries Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x Installs Redis server and client libraries on Debian/Ubuntu systems. This is recommended for Seafile's cache provider. Includes enabling and starting the Redis service. ```bash apt-get install -y redis-server libhiredis-dev # activate the venv source python-venv/bin/activate pip3 install redis django-redis systemctl enable --now redis-server ``` -------------------------------- ### Initialize Seafile Environment Source: https://manual.seafile.com/latest/setup_binary/installation Installs system-level dependencies, creates the installation directory, and sets up a Python virtual environment. ```bash sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip python3-ldap python3-rados libmariadb-dev-compat libmemcached-dev ldap-utils libldap2-dev libsasl2-dev pkg-config python3.11-venv 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 ``` -------------------------------- ### Compile and install seaf-server components Source: https://manual.seafile.com/latest/develop/server Build and install the core Seafile components from source. ```bash cd ../libevhtp cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF . make make install ldconfig cd ../libsearpc ./autogen.sh ./configure make make install ldconfig cd ../seafile-server ./autogen.sh ./configure --disable-fuse make make install ldconfig ``` -------------------------------- ### Install Node.js Source: https://manual.seafile.com/latest/develop/server Install Node 20 from the Nodesource repository. ```bash curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash - apt-get install -y nodejs ``` -------------------------------- ### Enable and Start Services Source: https://manual.seafile.com/latest/setup/cluster_deploy_with_docker Enables and starts the HAproxy and Keepalived services on both frontend servers. ```bash $ systemctl enable --now haproxy $ systemctl enable --now keepalived ``` -------------------------------- ### Install dependencies and enable memcached Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x Activate the virtual environment, install required Python packages, and enable the memcached service. ```bash source python-venv/bin/activate pip3 install pylibmc django-pylibmc systemctl enable --now memcached ``` -------------------------------- ### Start Seafile Server Source: https://manual.seafile.com/latest/upgrade/upgrade?q= Commands to start the Seafile server after the upgrade is complete. ```bash cd seafile/seafile-server-latest/ ./seafile.sh start ./seahub.sh start # or "./seahub.sh start-fastcgi" if you're using fastcgi # or via service /etc/init.d/seafile-server start ``` ```bash ./seafile.sh start ./seahub.sh start # or via service /etc/init.d/seafile-server start ``` -------------------------------- ### Install and configure Redis Source: https://manual.seafile.com/latest/setup_binary/installation Commands to install Redis and configure the environment for Seafile. ```bash # on Debian/Ubuntu 18.04+ apt-get install -y redis-server libhiredis-dev # activate the venv source python-venv/bin/activate pip3 install redis django-redis systemctl enable --now redis-server ``` ```text ## Cache CACHE_PROVIDER=redis ### Redis REDIS_HOST='' REDIS_PORT=6379 REDIS_PASSWORD= ``` -------------------------------- ### Build and Install libsearpc Source: https://manual.seafile.com/latest/develop/linux Compiles and installs the libsearpc library. This is a prerequisite for building Seafile. ```bash cd libsearpc ./autogen.sh ./configure --prefix=$PREFIX make sudo make install cd .. ``` -------------------------------- ### Build and Install Seafile Source: https://manual.seafile.com/latest/develop/linux Compiles and installs the Seafile server components. The `--enable-ws=yes` flag enables the notification server. ```bash cd seafile ./autogen.sh ./configure --prefix=$PREFIX --enable-ws=yes make sudo make install cd .. ``` -------------------------------- ### Start Seafile Server (Frontend Node) Source: https://manual.seafile.com/latest/upgrade/upgrade_a_cluster_binary?q= Start the Seafile and Seahub services on the frontend node after the upgrade. Ensure the Python virtual environment is activated if applicable. ```bash cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seahub.sh start ``` -------------------------------- ### Start Seafile Services Source: https://manual.seafile.com/latest/upgrade/upgrade_a_cluster_binary Commands to start Seafile services on frontend and backend nodes. ```bash cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seahub.sh start ``` ```bash cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seafile-background-tasks.sh start ``` -------------------------------- ### Install System Libraries (Ubuntu/Debian) Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x Installs necessary system libraries for Seafile on Ubuntu 24.04/22.04 and Debian 11. Ensure these are installed before proceeding with the upgrade. ```bash apt-get install -y default-libmysqlclient-dev build-essential pkg-config libmemcached-dev ``` ```bash apt-get install -y libsasl2-dev ``` -------------------------------- ### Start seaf-fuse in Docker Source: https://manual.seafile.com/latest/extension/fuse Commands to initialize the container and start the FUSE service. ```bash docker compose up -d docker exec -it seafile bash ``` ```bash cd /opt/seafile/seafile-server-latest/ ./seaf-fuse.sh start /seafile-fuse ``` -------------------------------- ### Install Redis Server and Development Libraries Source: https://manual.seafile.com/latest/setup_binary/installation Installs the Redis server and its development libraries using apt-get. This is a prerequisite for Seafile. ```bash sudo apt-get update sudo apt-get install -y redis-server libhiredis-dev ``` -------------------------------- ### Install and configure Memcached Source: https://manual.seafile.com/latest/setup_binary/installation Commands to install Memcached and configure the environment for Seafile. ```bash # on Debian/Ubuntu 18.04+ apt-get install memcached libmemcached-dev -y # activate the venv source python-venv/bin/activate pip3 install --timeout=3600 pylibmc django-pylibmc systemctl enable --now memcached ``` ```text ## Cache CACHE_PROVIDER=memcached ### Memcached MEMCACHED_HOST='' MEMCACHED_PORT=11211 ``` -------------------------------- ### Start Seafile Server Source: https://manual.seafile.com/latest/setup/setup_ce_by_docker Commands to initialize and start the Seafile service using Docker Compose. ```bash docker compose up -d ``` ```bash docker compose --env-file /path/to/.env up -d ``` -------------------------------- ### Start Seafile Server (Binary Package) Source: https://manual.seafile.com/latest/upgrade/upgrade After the upgrade scripts have been executed, start the Seafile server using these commands. Choose the appropriate command based on your Seahub deployment method (direct or fastcgi). ```bash cd seafile/seafile-server-latest/ ./seafile.sh start ./seahub.sh start # or "./seahub.sh start-fastcgi" if you're using fastcgi # or via service /etc/init.d/seafile-server start ``` -------------------------------- ### Start Seafile and Seahub services Source: https://manual.seafile.com/latest/setup_binary/installation Commands to activate the virtual environment and start the Seafile server components. ```bash source python-venv/bin/activate ``` ```bash su seafile ./seafile.sh start # Start Seafile service ./seahub.sh start # Start seahub website, port defaults to 127.0.0.1:8000 ``` -------------------------------- ### Install Redis server Source: https://manual.seafile.com/latest/setup_binary/installation?q= Installs the Redis cache server and development headers required for Seafile. ```bash sudo apt-get update sudo apt-get install -y redis-server libhiredis-dev ``` -------------------------------- ### Start Backend Node Services Source: https://manual.seafile.com/latest/setup_binary/cluster_deployment?q= Commands to start services specifically for a backend node in a cluster. ```bash export CLUSTER_MODE=backend cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seafile-background-tasks.sh start ``` -------------------------------- ### Start Seafile and Seahub on Frontend Node Source: https://manual.seafile.com/latest/setup_binary/cluster_deployment Navigate to the Seafile directory and start the Seafile server and Seahub. This is typically done on frontend nodes in a cluster. ```bash cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seahub.sh start ``` -------------------------------- ### Start Seafile Server (Backend Node) Source: https://manual.seafile.com/latest/upgrade/upgrade_a_cluster_binary?q= Start the Seafile and Seafile background tasks services on the backend node after the upgrade. Ensure the Python virtual environment is activated if applicable. ```bash cd /opt/seafile/seafile-server-latest su seafile ./seafile.sh start ./seafile-background-tasks.sh start ``` -------------------------------- ### Install SAML prerequisites on Ubuntu Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_11.0.x?q= Install required system packages for SAML functionality on Ubuntu 20.04 or 22.04. ```bash sudo apt-get update sudo apt-get install -y dnsutils ``` -------------------------------- ### Start Seafile and Seahub Services Source: https://manual.seafile.com/latest/setup_binary/installation?q= Execute the `seafile.sh` and `seahub.sh` scripts to start the Seafile service and the Seahub website. Ensure the Python virtual environment is activated if used. ```bash source python-venv/bin/activate su seafile ./seafile.sh start # Start Seafile service ./seahub.sh start # Start seahub website, port defaults to 127.0.0.1:8000 ``` -------------------------------- ### Install DNS Utilities for SAML Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_11.0.x On Ubuntu 20.04/22.04, install the 'dnsutils' package for SAML prerequisites. ```bash sudo apt-get update sudo apt-get install -y dnsutils ``` -------------------------------- ### Install cache server dependencies Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x?q= Commands to install and configure Redis or Memcached as the cache provider. ```bash apt-get install -y redis-server libhiredis-dev # activate the venv source python-venv/bin/activate pip3 install redis django-redis systemctl enable --now redis-server ``` ```bash apt-get install memcached libmemcached-dev -y ``` -------------------------------- ### Start Seafile Server Source: https://manual.seafile.com/latest/setup/migrate_backends_data Commands to initiate the Seafile server service. ```bash docker compose up -d ``` ```bash # make sure you are in the directory `/opt/seafile/seafile-server-latest` ./seahub.sh start ./seafile.sh start ``` -------------------------------- ### Install K8S Gateway API Source: https://manual.seafile.com/latest/setup/k8s_advanced_management Apply the standard installation manifest for the Kubernetes Gateway API. ```bash kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml ``` -------------------------------- ### Install and Configure HAproxy Source: https://manual.seafile.com/latest/setup/cluster_deploy_with_docker Installs HAproxy and Keepalived, then creates the HAproxy configuration file. Ensure Front-End IP addresses are updated to match your environment. ```bash $ apt install haproxy keepalived -y $ mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bak $ cat > /etc/haproxy/haproxy.cfg << 'EOF' global log 127.0.0.1 local1 notice maxconn 4096 user haproxy group haproxy defaults log global mode http retries 3 timeout connect 10000 timeout client 300000 timeout server 36000000 listen seafile 0.0.0.0:80 mode http option httplog option dontlognull option forwardfor cookie SERVERID insert indirect nocache server seafile01 Front-End01-IP:8001 check port 11001 cookie seafile01 server seafile02 Front-End02-IP:8001 check port 11001 cookie seafile02 EOF ``` -------------------------------- ### Build and Install Seafile Client Source: https://manual.seafile.com/latest/develop/linux Compiles and installs the Seafile client application using CMake. Set `CMAKE_BUILD_TYPE` to `Release` for optimized builds. ```bash cd seafile-client cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX . make sudo make install cd .. ``` -------------------------------- ### Update system and install base dependencies Source: https://manual.seafile.com/latest/develop/server Update the package list and install essential build tools and libraries. ```bash 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 python3-dateutil cmake re2c flex sqlite3 python3-pip python3-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 libjwt-dev libunwind-dev libhiredis-dev google-perftools libgoogle-perftools-dev ``` -------------------------------- ### Activate Virtual Environment and Install Dependencies Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x?q= Activate the Python virtual environment and install necessary packages for Seafile. Ensure you have pip3 available. ```bash source python-venv/bin/activate pip3 install pylibmc django-pylibmc ``` -------------------------------- ### Example seafile-server.yml Configuration Source: https://manual.seafile.com/latest/setup/use_other_reverse_proxy Example of a modified seafile-server.yml file with the ports section defined and the labels section removed. ```yaml services: # ... other services seafile: image: ${SEAFILE_IMAGE:-seafileltd/seafile-pro-mc:13.0-latest} container_name: seafile ports: - "80:80" volumes: - ${SEAFILE_VOLUME:-/opt/seafile-data}:/shared environment: ... # enviroment variables map, donnot make change # please remove the `label` section #label: ... <- remove this section depends_on: ... # dependencies, donnot make change ... # ... other options ``` -------------------------------- ### Create 7.x Compatible Indexes Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_9.0.x Initialize the new indexes with the required mappings and settings. ```bash curl -X PUT -H 'Content-Type: application/json' 'http{s}://{es server IP}:9200/new_repo_head?include_type_name=false&pretty=true' -d ' { "mappings" : { "properties" : { "commit" : { "type" : "text", "index" : false }, "repo" : { "type" : "text", "index" : false }, "updatingto" : { "type" : "text", "index" : false } } } }' curl -X PUT -H 'Content-Type: application/json' 'http{s}://{es server IP}:9200/new_repofiles/?include_type_name=false&pretty=true' -d ' { "settings" : { "index" : { "number_of_shards" : 5, "number_of_replicas" : 1, "analysis" : { "analyzer" : { "seafile_file_name_ngram_analyzer" : { "filter" : [ "lowercase" ], "type" : "custom", "tokenizer" : "seafile_file_name_ngram_tokenizer" } }, "tokenizer" : { "seafile_file_name_ngram_tokenizer" : { "type" : "ngram", "min_gram" : "3", "max_gram" : "4" } } } } }, "mappings" : { "properties" : { "content" : { "type" : "text", "term_vector" : "with_positions_offsets" }, "filename" : { "type" : "text", "fields" : { "ngram" : { "type" : "text", "analyzer" : "seafile_file_name_ngram_analyzer" } } }, "is_dir" : { "type" : "boolean" }, "mtime" : { "type" : "date" }, "path" : { "type" : "keyword" }, "repo" : { "type" : "keyword" }, "size" : { "type" : "long" }, "suffix" : { "type" : "keyword" } } } }' ``` -------------------------------- ### View Seafile Installation Directory Structure Source: https://manual.seafile.com/latest/setup_binary/installation Displays the file hierarchy of the Seafile installation directory using the tree command. ```bash $ tree -L 2 /opt/seafile . ├── seafile-license.txt ├── python-venv # you will not see this directory if you use ubuntu 22/debian 10 │   ├── bin │   ├── include │   ├── lib │   ├── lib64 -> lib │   └── pyvenv.cfg ├── seafile-pro-server-13.0.10 │   ├── check_init_admin.py │   ├── index_op.py │   ├── migrate-repo.py │   ├── migrate-repo.sh │   ├── migrate.py │   ├── migrate.sh │ ├── migrate_ldapusers.py │   ├── parse_seahub_db.py │   ├── pro │   ├── remove-objs.py │   ├── remove-objs.sh │   ├── reset-admin.sh │   ├── run_index_master.sh │   ├── run_index_worker.sh │   ├── runtime │   ├── seaf-fsck.sh │   ├── seaf-fuse.sh │   ├── seaf-gc.sh │   ├── seafile │   ├── seafile-background-tasks.sh │   ├── seafile-monitor.sh │   ├── seafile.sh │   ├── seahub │   ├── seahub.sh │   ├── setup-seafile-mysql.py │   ├── setup-seafile-mysql.sh │   ├── setup-seafile.sh │   ├── sql │   └── upgrade └── seafile-pro-server_13.0.10_x86-64_Ubuntu.tar.gz ``` -------------------------------- ### Download Configuration Files Source: https://manual.seafile.com/latest/setup/cluster_deploy_with_docker Fetch the required environment and compose files for the cluster setup. ```bash wget -O .env https://manual.seafile.com/13.0/repo/docker/cluster/env wget https://manual.seafile.com/13.0/repo/docker/cluster/seafile-server.yml ``` -------------------------------- ### Install ClamAV Daemon and Freshclam Source: https://manual.seafile.com/latest/extension/virus_scan_with_clamav Install the ClamAV daemon and freshclam service using apt-get for binary-based Seafile deployments. ```bash apt-get install clamav-daemon clamav-freshclam ``` -------------------------------- ### Start Seafile Server Components Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x?q= Run these commands in the Seafile 12.0.x folder to start the Seafile server (seaf-server) and the Seahub web interface. ```shell ./seafile.sh start # starts seaf-server ./seahub.sh start # starts seahub ``` -------------------------------- ### AWS S3 Backend Configuration Example Source: https://manual.seafile.com/latest/setup/setup_with_s3 Example configuration for AWS S3, specifying the region and using v4 signature. This setup requires three distinct backend configurations for commit, fs, and block objects. ```ini [commit_object_backend] name = s3 bucket = my-commit-objects key_id = your-key-id key = your-secret-key use_v4_signature = true aws_region = eu-central-1 use_https = true [fs_object_backend] name = s3 bucket = my-fs-objects key_id = your-key-id key = your-secret-key use_v4_signature = true aws_region = eu-central-1 use_https = true [block_backend] name = s3 bucket = my-block-objects key_id = your-key-id key = your-secret-key use_v4_signature = true aws_region = eu-central-1 use_https = true ``` -------------------------------- ### Example .env configuration content Source: https://manual.seafile.com/latest/setup_binary/installation Template for the .env file including database, protocol, and cache settings. ```text JWT_PRIVATE_KEY= SEAFILE_SERVER_PROTOCOL=https SEAFILE_SERVER_HOSTNAME=seafile.example.com SEAFILE_MYSQL_DB_HOST= SEAFILE_MYSQL_DB_PORT=3306 SEAFILE_MYSQL_DB_USER=seafile SEAFILE_MYSQL_DB_PASSWORD= SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=seahub_db ## Cache ### options: redis (recommend), memcached CACHE_PROVIDER=redis ### Redis REDIS_HOST='' REDIS_PORT=6379 REDIS_PASSWORD= ### Memcached MEMCACHED_HOST='' MEMCACHED_PORT=11211 ``` -------------------------------- ### Check Seafevents Log for Metadata Tasks Source: https://manual.seafile.com/latest/extension/metadata-server Example log output indicating that the metadata index worker and slow task handlers have started successfully. ```text [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.index_worker:134 refresh_lock refresh_thread Starting refresh locks [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_0 starting update metadata work [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_1 starting update metadata work [2025-02-23 06:08:05] [INFO] seafevents.repo_metadata.slow_task_handler:61 worker_handler slow_task_handler_thread_2 starting update metadata work ``` -------------------------------- ### Download and Edit Configuration Source: https://manual.seafile.com/latest/setup/helm_chart_single_node Fetch the default values file and open it for customization. ```bash wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/13.0/pro.yaml nano my-values.yaml ``` ```bash wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/13.0/ce.yaml nano my-values.yaml ``` -------------------------------- ### Run Elasticsearch Docker Container Source: https://manual.seafile.com/latest/setup_binary/installation Starts the Elasticsearch container in detached mode, mapping port 9200, configuring it as a single node, enabling memory locking, disabling security for initial setup, and setting up persistent storage. The container will restart automatically if it stops. ```bash sudo docker run -d \ --name es \ -p 9200:9200 \ -e "discovery.type=single-node" -e "bootstrap.memory_lock=true" \ -e "ES_JAVA_OPTS=-Xms2g -Xmx2g" -e "xpack.security.enabled=false" \ --restart=always \ -v /opt/seafile-elasticsearch/data:/usr/share/elasticsearch/data \ -d elasticsearch:8.15.0 ``` -------------------------------- ### Custom User Search Function Source: https://manual.seafile.com/latest/config/seahub_settings_py Defines a custom function to modify user search results, for example, to limit searches to users within the same institution. This function must be placed in `{seafile install path}/conf/seahub_custom_functions/__init__.py` and named `custom_search_user`. Requires Seafile version 6.2 or later. ```python import os import sys current_path = os.path.dirname(os.path.abspath(__file__)) seahub_dir = os.path.join(current_path, \ '../../seafile-server-latest/seahub/seahub') sys.path.append(seahub_dir) from seahub.profile.models import Profile def custom_search_user(request, emails): institution_name = '' username = request.user.username profile = Profile.objects.get_profile_by_user(username) if profile: institution_name = profile.institution inst_users = [p.user for p in Profile.objects.filter(institution=institution_name)] filtered_emails = [] for email in emails: if email in inst_users: filtered_emails.append(email) return filtered_emails ``` -------------------------------- ### Verify Frontend Node Logs Source: https://manual.seafile.com/latest/setup/cluster_deploy_with_docker Example output indicating a successful startup of the frontend node. ```text *** Running /etc/my_init.d/01_create_data_links.sh... *** Booting runit daemon... *** Runit started as PID 20 *** Running /scripts/enterpoint.sh... 2024-11-21 03:02:35 Nginx ready 2024-11-21 03:02:35 This is an idle script (infinite loop) to keep container running. --------------------------------- Seafile cluster frontend mode --------------------------------- Starting seafile server, please wait ... Seafile server started Done. Starting seahub at port 8000 ... Seahub is started Done. ``` -------------------------------- ### Install xmlsec1 Package Source: https://manual.seafile.com/latest/config/saml2 Install the xmlsec1 package for binary deployments. This is not needed for Docker deployments. Also installs dnsutils for multi-tenancy. ```bash apt update apt install xmlsec1 apt install dnsutils # For multi-tenancy feature ``` -------------------------------- ### Enable and Start Memcached Service Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x?q= Enable the memcached service to start automatically on boot and start it immediately. This is often required for caching in Seafile. ```bash systemctl enable --now memcached ``` -------------------------------- ### Upgrade Script List Output Source: https://manual.seafile.com/latest/upgrade/upgrade?q= Example output showing available upgrade script files. ```text ... upgrade_5.0_5.1.sh upgrade_5.1_6.0.sh upgrade_6.0_6.1.sh ``` ```text ... upgrade/upgrade_5.1_6.0.sh upgrade/upgrade_6.0_6.1.sh upgrade/upgrade_6.1_6.2.sh ``` -------------------------------- ### Install Python Development Headers and Libraries Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_11.0.x On Ubuntu 20.04/22.04, install necessary Python development headers and LDAP libraries before installing Python packages. ```bash sudo apt-get update sudo apt-get install -y python3-dev ldap-utils libldap2-dev ``` -------------------------------- ### SeaDrive Silent Installation Command Source: https://manual.seafile.com/latest/config/auto_login_seadrive Install SeaDrive silently using msiexec with quiet and no-restart options. Requires administrator privileges and generates an installation log. ```batch msiexec /i seadrive.msi /quiet /qn /log install.log ``` -------------------------------- ### Install Seafile Chart Source: https://manual.seafile.com/latest/setup/helm_chart_single_node Add the Helm repository and deploy the Seafile chart. ```bash helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo helm upgrade --install seafile seafile/pro --version 13.0 --namespace seafile --create-namespace --values my-values.yaml ``` ```bash helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo helm upgrade --install seafile seafile/ce --version 13.0 --namespace seafile --create-namespace --values my-values.yaml ``` -------------------------------- ### Install Python Dependencies via Pip Source: https://manual.seafile.com/latest/setup_binary/installation Installs required Python packages into the active virtual environment. This command should be run after activating the venv to avoid system-wide installation. ```bash pip3 install --timeout=3600 boto3 oss2 twilio configparser pytz \ sqlalchemy==2.0.* pymysql==1.1.* jinja2 django-pylibmc pylibmc psd-tools lxml \ django==5.2.* cffi==1.17.1 future==1.0.* mysqlclient==2.2.* captcha==0.7.* django_simple_captcha==0.6.* \ pyjwt==2.10.* djangosaml2==1.11.* pysaml2==7.5.* pycryptodome==3.23.* python-ldap==3.4.* pillow==11.3.* pillow-heif==1.0.* cairosvg==2.8.* scikit-learn==1.7.* ``` -------------------------------- ### Start Seafile Server Components Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x Execute the startup scripts for the Seafile server and Seahub web interface. ```bash ./seafile.sh start # starts seaf-server ./seahub.sh start # starts seahub ``` -------------------------------- ### Install Seafile Python Libraries Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_11.0.x Install or upgrade required Python libraries for Seafile 11.0 using pip3. Ensure you are using root or sudo mode for system-wide installation. ```bash sudo pip3 install future==0.18.* mysqlclient==2.1.* pillow==10.2.* s sqlalchemy==2.0.18 captcha==0.5.* django_simple_captcha==0.6.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.4.3 ``` -------------------------------- ### Install Nginx for Load Balancing Source: https://manual.seafile.com/latest/setup/cluster_deploy_with_docker Install Nginx on the host machine to set up a load balancing service for the Seafile cluster. This command updates package lists and installs Nginx. ```bash sudo apt update sudo apt install nginx ``` -------------------------------- ### Prepare index-server directories Source: https://manual.seafile.com/latest/extension/distributed_indexing Create the necessary directory structure for index-server nodes. ```bash mkdir -p /opt/seafile-data/seafile/conf mkdir -p /opt/seafile ``` -------------------------------- ### Enable Services at Boot Source: https://manual.seafile.com/latest/setup_binary/start_seafile_at_system_bootup Commands to enable the configured services to start automatically at system boot. ```bash sudo systemctl enable seafile.service sudo systemctl enable seahub.service sudo systemctl enable seafile-client.service # optional ``` -------------------------------- ### Check Initialization Logs Source: https://manual.seafile.com/latest/setup/helm_chart_cluster View the startup logs to verify the cluster initialization process. ```bash Defaulted container "seafile-backend" out of: seafile-backend, set-ownership (init) *** Running /etc/my_init.d/01_create_data_links.sh... *** Booting runit daemon... *** Runit started as PID 15 *** Running /scripts/enterpoint.sh... 2025-02-13 08:58:35 Nginx ready 2025-02-13 08:58:35 This is an idle script (infinite loop) to keep container running. --------------------------------- Seafile cluster backend mode --------------------------------- [2025-02-13 08:58:35] Now running setup-seafile-mysql.py in auto mode. Checking python on this machine ... verifying password of user root ... done --------------------------------- This is your configuration --------------------------------- server name: seafile server ip/domain: 10.0.0.138 seafile data dir: /opt/seafile/seafile-data fileserver port: 8082 database: create new ccnet database: ccnet_db seafile database: seafile_db seahub database: seahub_db database user: seafile Generating seafile configuration ... done Generating seahub configuration ... ---------------------------------------- Now creating seafevents database tables ... ---------------------------------------- ---------------------------------------- Now creating ccnet database tables ... ---------------------------------------- ---------------------------------------- Now creating seafile database tables ... ---------------------------------------- ---------------------------------------- Now creating seahub database tables ... ---------------------------------------- ----------------------------------------------------------------- Your seafile server configuration has been finished successfully. ----------------------------------------------------------------- [2025-02-13 08:58:36] Updating version stamp Start init Init success ``` -------------------------------- ### Install Python dependencies Source: https://manual.seafile.com/latest/develop/server Install required Python packages and upgrade pip. ```bash apt-get install -y python3 python3-dev python3-pip python3-setuptools python3-ldap python3 -m pip install --upgrade pip pip3 install pytz jinja2 Django==5.2.* django-statici18n==2.3.* django_webpack_loader==1.7.* django_picklefield==3.1 django_formtools==2.4 django_simple_captcha==0.6.* djangosaml2==1.11.* djangorestframework==3.14.* python-dateutil==2.8.* pyjwt==2.10.* pycryptodome==3.23.* python-cas==1.6.* pysaml2==7.5.* requests==2.28.* requests_oauthlib==1.3.* future==1.0.* gunicorn==20.1.* mysqlclient==2.2.* qrcode==7.3.* pillow==11.3.* pillow-heif==1.0.* chardet==5.1.* cffi==1.17.1 captcha==0.7.* openpyxl==3.0.* Markdown==3.4.* bleach==5.0.* python-ldap==3.4.* sqlalchemy==2.0.* redis mock pytest pymysql==1.1.* configparser pylibmc django-pylibmc nose exam splinter pytest-django psd-tools lxml cairosvg==2.8.* ``` -------------------------------- ### Start Seafile Server on Kubernetes Source: https://manual.seafile.com/latest/setup/k8s_single_node Apply the Seafile Kubernetes YAML configurations to deploy the server. Ensure the namespace 'seafile' is used for management. ```bash kubectl apply -f /opt/seafile-k8s-yaml/ -n seafile ``` -------------------------------- ### Download Seafile Pro configuration files Source: https://manual.seafile.com/latest/setup/migrate_ce_to_pro_with_docker Use wget to fetch the required environment and configuration files for the Pro edition. ```bash wget -O .env https://manual.seafile.com/13.0/repo/docker/pro/env wget https://manual.seafile.com/13.0/repo/docker/pro/seafile-server.yml wget https://manual.seafile.com/13.0/repo/docker/pro/elasticsearch.yml ``` -------------------------------- ### FileNotFoundError Example Source: https://manual.seafile.com/latest/develop/translation Example of the error message encountered during static file collection. ```text FileNotFoundError: [Errno 2] No such file or directory: '/opt/seafile/seafile-server-latest/seahub/frontend/build' ``` -------------------------------- ### Install Python Libraries for Ubuntu 22.04 / Debian 11 Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x?q= Installs required Python libraries for Seafile on Ubuntu 22.04 or Debian 11. Use root or sudo mode for system-wide installation. ```bash sudo pip3 install future==1.0.* mysqlclient==2.1.* pillow==10.4.* sqlalchemy==2.0.* pillow_heif==0.18.0 \ gevent==24.2.* captcha==0.6.* django_simple_captcha==0.6.* djangosaml2==1.9.* \ pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.2.0 ``` -------------------------------- ### Install Python libraries Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_13.0.x?q= Install required Python packages system-wide using pip3. ```bash pip3 install --timeout=3600 boto3 oss2 twilio configparser pytz \ sqlalchemy==2.0.* pymysql==1.1.* jinja2 django-pylibmc pylibmc redis django-redis psd-tools lxml \ django==5.2.* cffi==1.17.1 future==1.0.* mysqlclient==2.2.* captcha==0.7.* django_simple_captcha==0.6.* \ pyjwt==2.10.* djangosaml2==1.11.* pysaml2==7.5.* pycryptodome==3.23.* python-ldap==3.4.* pillow==11.3.* pillow-heif==1.0.* cairosvg==2.8.* scikit-learn==1.7.* ``` -------------------------------- ### Install Seafile Helm Chart Source: https://manual.seafile.com/latest/setup/helm_chart_cluster Add the repository and deploy the Seafile cluster. ```bash helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo helm upgrade --install seafile seafile/cluster --version 13.0 --namespace seafile --create-namespace --values my-values.yaml ``` -------------------------------- ### Start ClamAV Daemon Service Source: https://manual.seafile.com/latest/extension/virus_scan_with_clamav Start the ClamAV daemon service using systemctl. ```bash systemctl start clamav-daemon ``` -------------------------------- ### Install Python and Dependencies for Debian 12 Source: https://manual.seafile.com/latest/setup_binary/installation Installs Python 3 and essential development libraries for Debian 12. It also sets up a Python virtual environment and installs Seafile dependencies using pip. ```bash sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip python3-ldap python3-rados libmariadb-dev-compat libmemcached-dev ldap-utils libldap2-dev libsasl2-dev pkg-config python3.13-venv 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 Python Libraries (Ubuntu 22.04 / Debian 11) Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x Installs required Python libraries for Seafile 12.0 on Ubuntu 22.04 or Debian 11. Use root or sudo mode for system-wide installation. ```bash sudo pip3 install future==1.0.* mysqlclient==2.1.* pillow==10.4.* sqlalchemy==2.0.* pillow_heif==0.18.0 \ gevent==24.2.* captcha==0.6.* django_simple_captcha==0.6.* djangosaml2==1.9.* \ pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 python-ldap==3.2.0 ``` -------------------------------- ### Build libsearpc Source: https://manual.seafile.com/latest/develop/osx Steps to build the libsearpc library. Navigate to the directory, run autogen.sh, configure with specific options, and then compile and install. ```bash $ cd seafile-workspace/libsearpc/ $ ./autogen.sh $ ./configure --disable-compile-demo --enable-compile-universal=yes $ make $ make install ``` -------------------------------- ### Install Python Libraries (Ubuntu 24.04 / Debian 12) Source: https://manual.seafile.com/latest/upgrade/upgrade_notes_for_12.0.x Installs required Python libraries for Seafile 12.0 on Ubuntu 24.04 or Debian 12. Use root or sudo mode for system-wide installation. ```bash sudo pip3 install future==1.0.* mysqlclient==2.2.* pillow==10.4.* sqlalchemy==2.0.* pillow_heif==0.18.0 \ gevent==24.2.* captcha==0.6.* django_simple_captcha==0.6.* djangosaml2==1.9.* \ pysaml2==7.3.* pycryptodome==3.20.* cffi==1.17.0 python-ldap==3.4.* ``` -------------------------------- ### Install Python and Dependencies for Ubuntu/Debian Source: https://manual.seafile.com/latest/setup_binary/installation Installs Python 3 and essential development libraries for Ubuntu 24.04 or Debian 13. It also sets up a Python virtual environment and installs Seafile dependencies using pip. ```bash sudo apt-get install -y python3 python3-dev python3-setuptools python3-pip python3-ldap python3-rados libmysqlclient-dev libmemcached-dev ldap-utils libldap2-dev python3.12-venv default-libmysqlclient-dev build-essential pkg-config 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 boto3 oss2 twilio configparser pytz sqlalchemy==2.0.* pymysql==1.1.* jinja2 django-pylibmc pylibmc psd-tools lxml django==5.2.* cffi==1.17.1 future==1.0.* mysqlclient==2.2.* captcha==0.7.* django_simple_captcha==0.6.* pyjwt==2.10.* djangosaml2==1.11.* pysaml2==7.5.* pycryptodome==3.23.* python-ldap==3.4.* pillow==11.3.* pillow-heif==1.0.* cairosvg==2.8.* scikit-learn==1.7.* ``` -------------------------------- ### Download index-server configuration files Source: https://manual.seafile.com/latest/extension/distributed_indexing Fetch the required Docker Compose and environment files for the index-server. ```bash cd /opt/seafile wget https://manual.seafile.com/13.0/repo/docker/index-server/index-server.yml wget -O .env https://manual.seafile.com/13.0/repo/docker/index-server/env ``` -------------------------------- ### Start seaf-server Source: https://manual.seafile.com/latest/develop/server Initiates the Seafile server process. Specify the configuration directory, data directory, and log file path. ```bash seaf-server -F /root/dev/conf -d /root/dev/seafile-data -l /root/dev/logs/seafile.log >> /root/dev/logs/seafile.log 2>&1 & ``` -------------------------------- ### Start index-server nodes Source: https://manual.seafile.com/latest/extension/distributed_indexing Launch the index-server containers using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Install lxml dependency Source: https://manual.seafile.com/latest/changelog/server-changelog Required command to install the lxml library manually after upgrading to Seafile 9.0.7. ```bash pip3 install lxml ``` -------------------------------- ### Download Thumbnail Server Configuration Files Source: https://manual.seafile.com/latest/extension/thumbnail-server Use wget to download the necessary configuration files for the thumbnail server. Ensure you are in the desired directory for deployment. ```bash wget https://manual.seafile.com/13.0/repo/docker/thumbnail-server/thumbnail-server.yml wget -O .env https://manual.seafile.com/13.0/repo/docker/thumbnail-server/env ``` -------------------------------- ### Directory Layout Example Source: https://manual.seafile.com/latest/upgrade/upgrade?q= Expected directory structure after extracting a new Seafile server version. ```text seafile -- seafile-server-5.1.0 -- seafile-server-6.1.0 -- ccnet -- seafile-data ``` ```text seafile -- seafile-server-6.1.0 -- seafile-server-6.2.0 -- ccnet -- seafile-data ```