注意: 企业版是付费产品,安装使用前请联系我们销售
服务器配置要求
最低要求
-
2 核 4GB 内存
推荐配置
-
4 核 8GB 内存
快速开始
下载SeaTable镜像
拉取 SeaTable 镜像
docker pull docker.seafile.top/seafileltd/seatable-enterprise:{tag}
下载
docker-compose.yml 和 .env 文件
我们建议您在
/opt/seatable
中安装 SeaTable,先创建目录。
mkdir /opt/seatable
将示例文件下载到
/opt/seatable
, 然后根据您的环境修改 .env 文件, 需要修改以下字段
-
SeaTable 的镜像标签(SEATABLE_IMAGE)
-
SeaTable 数据的卷目录(SEATABLE_VOLUMES)
-
MySQL 数据的卷目录(SEATABLE_MYSQL_VOLUMES)
-
MySQL 的 root 的密码(INIT_SEATABLE_MYSQL_ROOT_PASSWORD,仅用于初始化,首次启动后可以移除)
-
SeaTable 所使用的 MySQL 的用户名(SEATABLE_MYSQL_DB_USER)
-
SeaTable 所使用的 MySQL 的密码(SEATABLE_MYSQL_DB_PASSWORD)
-
传输协议(SEATABLE_SERVER_PROTOCOL),http 或者 https
-
主机名(SEATABLE_SERVER_HOSTNAME),域名或者你的服务器的外部 IP
-
JWT 私钥(JWT_PRIVATE_KEY),用于 SeaTable 组件间通信,可以通过 pwgen 命令生成(如 pwgen -s 40 1)
-
时区(TIME_ZONE 可选)
-
管理员账户邮箱(SEATABLE_ADMIN_EMAIL)
-
管理员账户密码(SEATABLE_ADMIN_PASSWORD)
-
许可证文件(SEATABLE_LICENSE)
添加许可证文件(seatable-license.txt)
我们建议您将许可证文件放到
/opt/seatable/seatable-license.txt
并检查.env 文件中的配置项。
注意:没有许可证文件,SeaTable 程序无法运行。
启动SeaTable服务器
使用以下命令启动 SeaTable 服务器
docker compose up -d
注意:您应该在带有
docker-compose.yml
的目录中运行上述命令。
接下来,您可以通过网站访问 SeaTable。
注意!!!如果表格加载的时候显示 Network error
用 Chrome 的 debug 模式看看哪个网络请求出错。一般是环境变量中的 URL 相关的配置项没有写对。
这是因为 SeaTable 服务器是由多个组件构成的。必须通过环境变量来告诉不同的组件它服务的外部 URL 是什么。
配置文件中的配置只在首次启动的时候从 docker-compose 中读取和写入。如果你之后修改了地址,需要手工修改配置文件。
主要是下面四个地址:
DTABLE_SERVER_URL = 'https://seatable.yourdomain.com/dtable-server/'
DTABLE_SOCKET_URL = 'https://seatable.yourdomain.com/'
# 供用户访问SeaTable服务器的 dtable web的URL
DTABLE_WEB_SERVICE_URL = 'https://seatable.yourdomain.com/'
# 文件服务器URL
FILE_SERVER_ROOT = 'https://seatable.yourdomain.com/seafhttp/'
修改后别忘了重启服务
docker exec -d seatable /shared/seatable/scripts/seatable.sh stop
docker exec -d seatable /shared/seatable/scripts/seatable.sh start
更多配置选项
部署 Https
使用 LetsEncrypt SSL 证书
如果您在 “.env” 中将 SEATABLE_SERVER_LETSENCRYPT 设置为 True,SEATABLE_SSL_PORT 设置为 443,则容器将自动为您请求一个 Letsencrypt 签名的 SSL 证书。
例如
SEATABLE_SERVER_LETSENCRYPT=True
SEATABLE_SSL_PORT=443
SEATABLE_SERVER_PROTOCOL=https
注意:由于 Nginx 配置文件仅在首次运行容器时自动生成,因此最好在首次执行 docker compose up -d 命令之前将 SEATABLE_SERVER_LETSENCRYPT 设置为 True。
使用自己的 SSL 证书
添加您自己的 SSL 证书
-
将 SSL 证书文件上传到 SeaTable 数据目录: /您的 SeaTable 数据卷目录/ssl/
-
将 ccnet.conf,dtable_web_settings.py 和 dtable_server_config.json 中每个 SERVER_URL 的 “ http” 更改为 “ https”。
-
重新启动 SeaTable 服务: docker exec -it seatable /shared/seatable/scripts/seatable.sh restart
-
重启 Memcached 服务: docker restart seatable-memcached
-
修改 Nginx 配置文件: /您的 SeaTable 数据卷目录/seatable/conf/nginx.conf
-
重新加载 Nginx 配置文件: docker exec -it seatable /usr/sbin/nginx -s reload
例如
server {
if ($host = example.seatable.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name example.seatable.com;
return 404;
}
server {
server_name example.seatable.com;
listen 443 ssl;
ssl_certificate /shared/ssl/<your-ssl.cer>;
ssl_certificate_key /shared/ssl/<your-ssl.key>;
proxy_set_header X-Forwarded-For $remote_addr;
......
高级设置
所有配置文件都
在
/您的 SeaTable 数据卷目录/seatable/conf/
下
。
-
seafile: /您的 SeaTable 数据卷目录/seatable/conf/seafile.conf
-
dtable-web: /您的 SeaTable 数据卷目录/seatable/conf/dtable_web_settings.py
-
dtable-server: /您的 SeaTable 数据卷目录/seatable/conf/dtable_server_config.json
-
dtable-events: /您的 SeaTable 数据卷目录/seatable/conf/dtable-events.conf
-
dtable-db: /您的 SeaTable 数据卷目录/seatable/conf/dtable-db.conf
-
nginx: /您的 SeaTable 数据卷目录/seatable/conf/nginx.conf
修改后,您需要重新启动 SeaTable 服务器。
docker compose down
docker compose up -d
SeaTable 目录结构
与宿主机共享的Volume
容器中的
/shared
目录是和宿主机共享的卷 /opt/seatable/seatable-data,这里存放需要持久化的数据。
-
/opt/seatable/seatable-data/seatable: 这是 SeaTable 服务器配置和数据的目录。
-
/opt/seatable/seatable-data/nginx-logs: 这是 Nginx 日志的目录。
-
/opt/seatable/seatable-data/ssl: 这是 SSL 证书的目录。
日志
SeaTable 日志位于 docker 容器中的
/shared/seatable/logs
下,或者位于运行 docker 的服务器中的
/opt/seatable/seatable-data/seatable/logs
下。
Nginx 日志位于运行 docker 容器中的
/shared/nginx-logs
或者位于运行 docker 的服务器中的
/opt/seatable/seatable-data/nginx-logs
下。
常见问题
更多问题见:
如果由于某种原因安装失败,如何从干净状态重新开始?
只需删除目录
/opt/seatable
,然后重新开始即可。
LetsEncrypt SSL 证书将要过期
如果证书没有自动更新,需要执行命令
/templates/renew_cert.sh
以手动更新证书。
SEATABLE_SERVER_LETSENCRYPT=false 改为 true
在使用 HTTP 一段时间后,若想改为 HTTPS,则需要移走并备份 nginx.conf。
mv /opt/seatable/seatable-data/seatable/conf/nginx.conf /opt/seatable/seatable-data/seatable/conf/nginx.conf.bak
执行以下命令申请证书。
docker exec seatable /templates/seatable.sh init
您还需要手动将其他配置文件中的 http 改为 https,并重启 SeaTable。
docker compose down
docker compose up -d
docker exec -d seatable /shared/seatable/scripts/seatable.sh start
如果曾经改动过旧的 nginx.conf,现在可以按照您想要的内容修改新的 nginx.conf,然后执行以下命令使 nginx 配置生效。
docker exec seatable nginx -s reload
Forbidden (403) CSRF verification failed. Request aborted.
在 dtable_web_settings.py 中添加配置(域名以
example.seatable.com
为例)。
CSRF_TRUSTED_ORIGINS = ['https://example.seatable.com']
检查 nginx.conf 中的
proxy_set_header Host
并修改为
$http_host
。
location / {
...
proxy_set_header Host $http_host;
...
在容器中重新加载 nginx 配置,并重启 SeaTable 服务
nginx -s reload
seatable.sh restart