.env¶
The .env file specifies the components used by a Docker-based Seafile deployment and the environment variables required by each component. Kubernetes deployments use seafile-env.yaml for non-sensitive values and the seafile-secret Secret for passwords and keys; see the Kubernetes single-node guide.
Seafile-docker configurations¶
Components configurations¶
COMPOSE_FILE:.ymlfiles for components of Seafile-docker, each.ymlmust be separated by the symbol defined inCOMPOSE_PATH_SEPARATOR. The core components are involved inseafile-server.ymlandcaddy.ymlwhich must be taken in this term.COMPOSE_PATH_SEPARATOR: The symbol used to separate the.ymlfiles in termCOMPOSE_FILE, default is ','.
Docker images configurations¶
SEAFILE_IMAGE: The image of Seafile server. Default isseafileltd/seafile-mc:14.0-latestfor the Community Edition andseafileltd/seafile-pro-mc:14.0-latestfor the Pro Edition.SEAFILE_DB_IMAGE: Database server image, default ismariadb:10.11.SEAFILE_REDIS_IMAGE: Redis server image, default isredis.SEAFILE_ELASTICSEARCH_IMAGE: Only valid in pro edition when using Elasticsearch instead of SeaSearch. The Elasticsearch image, default iselasticsearch:8.15.0.SEASEARCH_IMAGE: Only valid in pro edition. The SeaSearch image, default isseafileltd/seasearch:1.0-latest.SEAFILE_CADDY_IMAGE: Caddy server image, default islucaslorentz/caddy-docker-proxy:2.12-alpine.SEADOC_IMAGE: Only valid after integrating SeaDoc. SeaDoc server image, default isseafileltd/sdoc-server:2.0-latest.NOTIFICATION_SERVER_IMAGE: Notification server image, default isseafileltd/notification-server:14.0-latest.MD_IMAGE: Metadata server image, default isseafileltd/seafile-md-server:14.0-latest.NON_ROOT: Run Seafile container without a root user, default isfalse
Persistent Volume Configurations¶
BASIC_STORAGE_PATH: Base path for Docker persistent data, default is/opt.SEAFILE_VOLUME: The volume directory of Seafile data, default is/opt/seafile-data.SEAFILE_MYSQL_VOLUME: The volume directory of MySQL data, default is/opt/seafile-mysql/db.SEAFILE_CADDY_VOLUME: The volume directory of Caddy data used to store certificates obtained from Let's Encrypt's, default is/opt/seafile-caddy.SEAFILE_ELASTICSEARCH_VOLUME: Only valid in pro edition when using Elasticsearch instead of SeaSearch. The volume directory of Elasticsearch data, default is/opt/seafile-elasticsearch/data.SS_DATA_PATH: Only valid in pro edition. The volume directory of SeaSearch data, default is/opt/seasearch-data.SEADOC_VOLUME: Only valid after integrating SeaDoc. The volume directory of SeaDoc server data, default is/opt/seadoc-data.
MySQL configurations¶
SEAFILE_MYSQL_DB_HOST: The host address of Mysql, default is the pre-defined service namedbin Seafile-docker instance.SEAFILE_MYSQL_DB_PORT: The port of Mysql, default is3306.INIT_SEAFILE_MYSQL_ROOT_PASSWORD: (Only required on first deployment) Therootpassword of MySQL.SEAFILE_MYSQL_DB_USER: The user of MySQL (database-usercan be found inconf/seafile.conf).SEAFILE_MYSQL_DB_PASSWORD: The userseafilepassword of MySQL.SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: The name of Seafile database name, default isseafile_dbSEAFILE_MYSQL_DB_CCNET_DB_NAME: The name of ccnet database name, default isccnet_dbSEAFILE_MYSQL_DB_SEAHUB_DB_NAME: The name of seahub database name, default isseahub_db
Database character set
Since Seafile 14.0, the Docker deployment creates the Seafile databases with the utf8mb4 character set, and configures connection_charset = utf8mb4 in seafile.conf. This ensures proper storage of special characters such as Emoji.
Cache configurations¶
CACHE_PROVIDER: The type of cache server used for Seafile. The available options areredisandmemcached. Since Seafile 13, it is recommended to useredisas the cache service to support new features, andmemcachedwill no longer be integrated into Seafile Docker by default. Default isredis
Redis configurations¶
This part of configurations is only valid in CACHE_PROVIDER=redis:
REDIS_HOST: Redis server host, default isredisREDIS_PORT: Redis server port, default is6379REDIS_PASSWORD: Redis server password.
Memcached configurations¶
This part of configurations is only valid in CACHE_PROVIDER=memcached:
MEMCACHED_HOST: Memcached server host, default ismemcachedMEMCACHED_PORT: Memcached server port, default is11211
Seafile-server configurations¶
JWT_PRIVATE_KEY: JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters, generate example:pwgen -s 40 1SEAFILE_SERVER_HOSTNAME: Seafile server hostname or domainSEAFILE_SERVER_PROTOCOL: Seafile server protocol (http or https)TIME_ZONE: Time zone (defaultUTC)INIT_SEAFILE_ADMIN_EMAIL: Admin usernameINIT_SEAFILE_ADMIN_PASSWORD: Admin passwordENABLE_GO_FILESERVER: Use the Go fileserver (trueorfalse), default istrue.ENABLE_SEAFDAV: Enable the WebDAV server (trueorfalse), default isfalse. See WebDAV extension.SEAFDAV_WORKERS: The number of WebDAV worker processes, default is5.SEAFILE_LOG_TO_STDOUT: Log to stdout instead of log files (trueorfalse), default isfalse.SEAFILE_DOCKER_VERBOSE: Enable verbose (debug) logging for the Seafile Docker entrypoint (trueorfalse), default isfalse.SEAFILE_SKIP_DB_UPGRADE: Skip the automatic database upgrade on startup (trueorfalse), default isfalse.CSRF_TRUSTED_ORIGINS: A list of trusted origins for CSRF protection, JSON string, example:["https://seafile.example.com", "https://seafile.com"].
Docker secrets
Instead of storing passwords in .env, you can load them from files with SEAFILE_SECRETS_FILE, MYSQL_PASSWORD_FILE, and REDIS_PASSWORD_FILE. See Use Docker compose secrets.
Search configurations (Pro)¶
ENABLE_SEARCH: Enable (true) or disable (false) the search service. Default istrue.SEARCH_ENGINE: Search engine to use:seasearchorelasticsearch. Default isseasearch.ENABLE_FULL_TEXT_SEARCH: Index document contents for full-text search. Applies to SeaSearch and Elasticsearch. Default istrue. Since Seafile Pro 13.0, this setting takes precedence overenable_full_text_searchinseafevents.conf.SEASEARCH_URL: SeaSearch URL reachable from the Seafile server. Required when using SeaSearch.SEASEARCH_TOKEN: Authorization token for the SeaSearch API. Required when using SeaSearch.- For additional SeaSearch service configuration in
.env, includingSS_STORAGE_TYPE,SS_MAX_OBJ_CACHE_SIZE, andSS_LOG_LEVEL, see the SeaSearch configuration reference. ELASTICSEARCH_SCHEME: Elasticsearch connection scheme. Default ishttp.ELASTICSEARCH_HOST: Elasticsearch host. Required when using Elasticsearch.ELASTICSEARCH_PORT: Elasticsearch port. Default is9200.ELASTICSEARCH_USER: Elasticsearch username.ELASTICSEARCH_PASSWORD: Elasticsearch password.
SeaDoc configurations (only valid after integrating SeaDoc)¶
ENABLE_SEADOC: Enable the SeaDoc server or not, default isfalse.SEADOC_SERVER_URL: Only valid inENABLE_SEADOC=true. External URL of Seadoc server (e.g., https://seafile.example.com/sdoc-server).
S3 storage backend configurations (pro)¶
SEAF_SERVER_STORAGE_TYPE: What kind of the Seafile data for storage. Available options aredisk(i.e., local disk),s3,multipleor left as empty (Seafile will read seafile.conf). (see the details of multiple storage backends)S3_COMMIT_BUCKET: S3 storage backend commit objects bucketS3_FS_BUCKET: S3 storage backend fs objects bucketS3_BLOCK_BUCKET: S3 storage backend block objects bucketS3_SS_BUCKET: S3 storage bucket for SeaSearch data (valid when service enabled)S3_MD_BUCKET: S3 storage bucket for metadata-sever data (valid when service available)S3_KEY_ID: S3 storage backend key IDS3_SECRET_KEY: S3 storage backend secret keyS3_USE_V4_SIGNATURE: Use the v4 protocol of S3 if enabled, default istrueS3_AWS_REGION: Region of your buckets (AWS only), default isus-east-1.S3_HOST: Host of your buckets (required when not use AWS).S3_USE_HTTPS: Use HTTPS connections to S3 if enabled, default istrueS3_PATH_STYLE_REQUEST: This option asks Seafile to use URLs likehttps://192.168.1.123:8080/bucketname/objectto access objects. In Amazon S3, the default URL format is in virtual host style, such ashttps://bucketname.s3.amazonaws.com/object. But this style relies on advanced DNS server setup. So most self-hosted storage systems only implement the path style format. Defaultfalse.S3_SSE_C_KEY: A string of 32 characters can be generated by openssl rand -base64 24. It can be any 32-character long random string. It's required to use V4 authentication protocol and https if you enable SSE-C.
Easier to configure S3 for Seafile and its components
Since Seafile Pro 13.0, in order to facilitate users to deploy Seafile's related extension components and other services in the future, a section will be provided in .env to store the S3 Configurations for Seafile and some extension components (such as SeaSearch, Metadata server). You can locate it with the title bar Storage configurations for S3.
S3 configurations in .env only support single S3 storage backend mode
The Seafile server only support configuring S3 in .env for single S3 storage backend mode (i.e., when SEAF_SERVER_STORAGE_TYPE=s3). If you would like to use other storage backend (e.g., Ceph, Swift) or other settings that can only be set in seafile.conf, please set SEAF_SERVER_STORAGE_TYPE to empty or delete it, and set MD_STORAGE_TYPE and SS_STORAGE_TYPE according to your configurations.
The S3 configurations only valid with at least one STORAGE_TYPE has specified to s3
The Docker Pro template provides three STORAGE_TYPE variables:
- SEAF_SERVER_STORAGE_TYPE
- MD_STORAGE_TYPE (see Metadata server)
- SS_STORAGE_TYPE (see SeaSearch)
The Docker cluster template provides SEAF_SERVER_STORAGE_TYPE only. Configure standalone extension services with their own environment files.
You have to specify at least one of them as s3 for the above configuration to take effect.
Notification server¶
ENABLE_NOTIFICATION_SERVER: Enable (true) or disable (false) notification feature for Seafile. Default isfalse.NOTIFICATION_SERVER_URL: Used to do the connection between client (i.e., user's browser) and notification server. Default ishttps://seafile.example.com/notification.INNER_NOTIFICATION_SERVER_URL: Used to do the connection between Seafile server and notification server. Default ishttp://notification-server:8083.
Metadata server¶
- For Metadata server service configuration in
.env, see the list of environment variables. ENABLE_METADATA_MANAGEMENT: Enable (true) or disable (false) metadata management. Default isfalse.INNER_METADATA_SERVER_URL: Metadata server URL reachable from the Seafile server container. Required when metadata management is enabled.MD_FILE_COUNT_LIMIT: The maximum number of files in a repository that the metadata feature allows. If the number of files in a repository exceeds this value, the metadata management function will not be enabled for the repository. For a repository with metadata management enabled, if the number of records in it reaches this value but there are still some files that are not recorded in metadata server, the metadata management of the unrecorded files will be skipped. Default is100000.
Kubernetes environment configuration¶
The Kubernetes seafile-env.yaml ConfigMap contains non-sensitive server configuration. In addition to the common server settings above, it defines SEAFILE_LOG_TO_STDOUT, SITE_ROOT, and SEAFILE_MYSQL_DB_PORT. Passwords and keys, including JWT_PRIVATE_KEY, SEAFILE_MYSQL_DB_PASSWORD, INIT_SEAFILE_ADMIN_PASSWORD, INIT_SEAFILE_MYSQL_ROOT_PASSWORD, REDIS_PASSWORD, S3_SECRET_KEY, and S3_SSE_C_KEY, belong in the seafile-secret Secret.
For Kubernetes cluster deployments, CLUSTER_INIT_MODE is configured in seafile-env.yaml; CLUSTER_SERVER and CLUSTER_MODE are set by the backend and frontend Deployment resources.
Cluster configurations¶
CLUSTER_INIT_MODE: (only valid in pro edition at deploying first time). Cluster initialization mode, in which the necessary configuration files for the service to run will be generated (but the service will not be started). If the configuration file already exists, no operation will be performed. The default value istrue. When the configuration file is generated, be sure to set this item tofalse.CLUSTER_SERVER: Defined incluster/seafile-server.yml, telling Seafile docker whether it is running in cluster mode. (It is used to replace cluster configuration in seafile.conf)CLUSTER_MODE: Seafile service node type, i.e.,frontend(default) orbackend.