diff --git a/manual/config/env.md b/manual/config/env.md index adb129ac..c943c225 100644 --- a/manual/config/env.md +++ b/manual/config/env.md @@ -45,7 +45,7 @@ INIT_S3_SECRET_KEY= # pro edition only CLUSTER_INIT_MODE=true # cluster only CLUSTER_INIT_MEMCACHED_HOST= # cluster only CLUSTER_INIT_ES_HOST= # cluster only -CLUSTER_INIT_ES_PORT= # cluster only +CLUSTER_INIT_ES_PORT=9200 # cluster only CLUSTER_MODE=frontend # cluster only @@ -114,7 +114,7 @@ NOTIFICATION_SERVER_VOLUME=/opt/notification-data - `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 is `true`. When the configuration file is generated, ***be sure to set this item to `false`***. - `CLUSTER_INIT_MEMCACHED_HOST`: (only valid in pro edition at deploying first time). Cluster Memcached host. (If your Memcached server dose not use port `11211`, please modify the [seahub_settings.py](./seahub_settings_py.md) and [seafile.conf](./seafile-conf.md)). - `CLUSTER_INIT_ES_HOST`: (only valid in pro edition at deploying first time). Your cluster Elasticsearch server host. -- `CLUSTER_INIT_ES_PORT`: (only valid in pro edition at deploying first time). Your cluster Elasticsearch server port. +- `CLUSTER_INIT_ES_PORT`: (only valid in pro edition at deploying first time). Your cluster Elasticsearch server port. Default is `9200`. - `CLUSTER_MODE`: Seafile service node type, i.e., `frontend` (default) or `backend` ## S3 storage backend configurations (only valid in pro edition at deploying first time) diff --git a/manual/docker/cluster/env b/manual/docker/cluster/env index be0f25d8..a4cd684c 100644 --- a/manual/docker/cluster/env +++ b/manual/docker/cluster/env @@ -15,7 +15,7 @@ SEAFILE_MYSQL_DB_PASSWORD= CLUSTER_INIT_MODE=true # if you have the configurations file, please set to false CLUSTER_INIT_MEMCACHED_HOST= # only valid in config init CLUSTER_INIT_ES_HOST= # only valid in config init -CLUSTER_INIT_ES_PORT= # only valid in config init +CLUSTER_INIT_ES_PORT=9200 # only valid in config init CLUSTER_MODE=frontend # backend for backend node diff --git a/manual/docker/cluster/seafile-server.yml b/manual/docker/cluster/seafile-server.yml index 0158be09..a8111979 100644 --- a/manual/docker/cluster/seafile-server.yml +++ b/manual/docker/cluster/seafile-server.yml @@ -18,7 +18,7 @@ services: - CLUSTER_INIT_MODE=${CLUSTER_INIT_MODE:-false} - CLUSTER_INIT_MEMCACHED_HOST=${CLUSTER_INIT_MEMCACHED_HOST:-} - CLUSTER_INIT_ES_HOST=${CLUSTER_INIT_MEMCACHED_HOST:-} - - CLUSTER_INIT_ES_PORT=${CLUSTER_INIT_ES_PORT:-} + - CLUSTER_INIT_ES_PORT=${CLUSTER_INIT_ES_PORT:-9200} - CLUSTER_MODE=${CLUSTER_MODE:-frontend} - TIME_ZONE=${TIME_ZONE:-UTC} - INIT_S3_STORAGE_BACKEND_CONFIG=${INIT_S3_STORAGE_BACKEND_CONFIG:-false} diff --git a/manual/extension/libreoffice_online.md b/manual/extension/libreoffice_online.md index 5da1c4bd..018dcd90 100644 --- a/manual/extension/libreoffice_online.md +++ b/manual/extension/libreoffice_online.md @@ -10,6 +10,24 @@ Since Seafile Professional edition 6.0.0, you can integrate Seafile with Collabo Otherwise, you can follow the [official document](https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html#code-docker-image) to deploy CollaboraOnline server on a separate host. Then you should follow [here](#Libreoffice-server-on-a-separate-host) to configure `seahub_settings.py` to enable online office. +!!! note + To integrate *LibreOffice* with Seafile, you have to enable **HTTPS** in your Seafile server: + + === "Deploy in Docker" + + Modify `.env` file: + + ```sh + SEAFILE_SERVER_PROTOCOL=https + ``` + + === "Deploy from binary packages" + + Please follow the links to enable https: + + - [Nginx](../setup_binary/https_with_nginx.md) + - [Apache](../setup_binary/https_with_apache.md) + Download the `collabora.yml` ```sh @@ -33,10 +51,11 @@ COLLABORA_ENABLE_FILE_LOGGING=false # use file logs or not, see FQA Add following config option to seahub_settings.py: + ``` python OFFICE_SERVER_TYPE = 'CollaboraOffice' ENABLE_OFFICE_WEB_APP = True -OFFICE_WEB_APP_BASE_URL = 'http{s}://seafile.example.com:6232/hosting/discovery' +OFFICE_WEB_APP_BASE_URL = 'https://seafile.example.com:6232/hosting/discovery' # Expiration of WOPI access token # WOPI access token is a string used by Seafile to determine the file's diff --git a/manual/extension/only_office.md b/manual/extension/only_office.md index f7d31197..eb73efa1 100644 --- a/manual/extension/only_office.md +++ b/manual/extension/only_office.md @@ -6,16 +6,6 @@ Seafile supports [OnlyOffice](https://www.onlyoffice.com/) to view/edit office f You can deploy OnlyOffice to the same machine as Seafile (only support deploying with [Docker](../setup/setup_pro_by_docker.md) with sufficient cores and RAM) using the `onlyoffice.yml` provided by Seafile according to this document, or you can deploy it to a different machine according to [OnlyOffice official document](https://github.com/ONLYOFFICE/Docker-DocumentServer). -## Generate JWT-Token (shared secret) - -> From Seafile 12.0, OnlyOffice's JWT verification will be forced to enable - -Secure communication between Seafile and OnlyOffice is granted by a shared secret. You can get the JWT secret by following command - -```shell -pwgen -s 40 1 -``` - ## Deployment of OnlyOffice Download the `onlyoffice.yml` @@ -40,6 +30,13 @@ ONLYOFFICE_PORT=6233 ONLYOFFICE_JWT_SECRET= ``` +!!! note + From Seafile 12.0, OnlyOffice's JWT verification will be forced to enable. Secure communication between Seafile and OnlyOffice is granted by a shared secret. You can get the JWT secret by following command + + ```shell + pwgen -s 40 1 + ``` + Also modify `seahub_settings.py` ```py @@ -49,7 +46,8 @@ ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', ONLYOFFICE_JWT_SECRET = '' ``` -> By default OnlyOffice will use port **6233** used for communication between Seafile and Document Server, You can modify the bound port by specifying `ONLYOFFICE_PORT`, and port in the term `ONLYOFFICE_APIJS_URL` in `seahub_settings.py` has been modified together. +!!! tip + By default OnlyOffice will use port **6233** used for communication between Seafile and Document Server, You can modify the bound port by specifying `ONLYOFFICE_PORT`, and port in the term `ONLYOFFICE_APIJS_URL` in `seahub_settings.py` has been modified together. ### Advanced: Custom settings of OnlyOffice @@ -101,7 +99,8 @@ docker-compose down docker-compose up -d ``` -After the installation process is finished, visit this page to make sure you have deployed OnlyOffice successfully: `http{s}://{your Seafile server's domain or IP}:6233/welcome`, you will get **Document Server is running** info at this page. +!!! success + After the installation process is finished, visit this page to make sure you have deployed OnlyOffice successfully: `http{s}://{your Seafile server's domain or IP}:6233/welcome`, you will get **Document Server is running** info at this page. ## FAQ diff --git a/manual/extension/setup_seadoc.md b/manual/extension/setup_seadoc.md index 6427d81c..fd06d55a 100644 --- a/manual/extension/setup_seadoc.md +++ b/manual/extension/setup_seadoc.md @@ -31,9 +31,16 @@ Here is the workflow when a user open sdoc file in browser ## Deployment method -SeaDoc has the following deployment methods: +SeaDoc has the following deployment methods with different situations: -=== "SeaDoc and Seafile docker are deployed on the same host" +- **Situation 1**: Deploy SeaDoc server with the same host as Seafile Server deploy in single-node docker mode + +- **Situation 2**: Deploy SeaDoc server on: + - A new host + - Same host with Seafile server cluster (frontend node) + - Same host with Seafile server deploy from binary packages + +=== "Situation 1" Download the `seadoc.yml` and integrate SeaDoc in Seafile docker. ```shell @@ -48,7 +55,7 @@ SeaDoc has the following deployment methods: ENABLE_SEADOC=true SEADOC_SERVER_URL=https://example.seafile.com/sdoc-server ``` -=== "Deploy SeaDoc on a new host" +=== "Situation 2" Download and modify the `.env` and `seadoc.yml` files. @@ -70,7 +77,117 @@ SeaDoc has the following deployment methods: | `SEAFILE_SERVER_PROTOCOL`| http or https | !!! note - Please bind SeaDoc server url and ip in the load balance(or reverse proxy) configuration after starting SeaDoc server + By default, SeaDoc server listens to port `80`. If SeaDoc is deployed on the same machine as Seafile server (including deploying from binary packages and Seafile cluster mode), you need to change the **listening port of SeaDoc server** or **set up a proxy** for SeaDoc server. + + === "Modify listening port" + + Modify `seadoc.yml` + + ```yml + services: + seadoc: + ... + ports: + - ":80" + ... + ``` + + Now your `SEADOC_SERVER_URL` should be: + ``` + {SEAFILE_SERVER_PROTOCOL}://{SEAFILE_SERVER_HOSTNAME}: + ``` + === "set up a proxy" + + Modify `seafile.nginx.conf` + + === "Seafile cluster" + + ``` + location /sdoc-server/ { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS; + add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type"; + if ($request_method = 'OPTIONS') { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS; + add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type"; + return 204; + } + + proxy_pass http://sdoc-server:80/; + proxy_redirect off; + 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-Host $server_name; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 100m; + } + + location /socket.io { + proxy_pass http://sdoc-server:80; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_redirect off; + + proxy_buffers 8 32k; + proxy_buffer_size 64k; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + } + ``` + + === "Seafile deploy from binary packages" + + ``` + location /sdoc-server/ { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS; + add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type"; + if ($request_method = 'OPTIONS') { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS; + add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type"; + return 204; + } + + proxy_pass http://127.0.0.1:80/; + proxy_redirect off; + 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-Host $server_name; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 100m; + } + + location /socket.io { + proxy_pass http://127.0.0.1:80; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_redirect off; + + proxy_buffers 8 32k; + proxy_buffer_size 64k; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + } + ``` + + Now your `SEADOC_SERVER_URL` should be: + ``` + {SEAFILE_SERVER_PROTOCOL}://{SEAFILE_SERVER_HOSTNAME}/sdoc-server/ + ``` diff --git a/manual/setup/cluster_deploy_with_docker.md b/manual/setup/cluster_deploy_with_docker.md index 6af04507..85c16274 100644 --- a/manual/setup/cluster_deploy_with_docker.md +++ b/manual/setup/cluster_deploy_with_docker.md @@ -39,7 +39,7 @@ We assume you have already deployed memcache, MariaDB, ElasticSearch in separate 4. Modify the [variables](../config/env.md) in `.env` (especially the terms like `<...>`). !!! tip - If you have already deployed AWS 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). + 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. Start the Seafile docker @@ -49,9 +49,65 @@ We assume you have already deployed memcache, MariaDB, ElasticSearch in separate $ docker compose up -d ``` - Because CLUSTER_INIT_MODE is true in the `.env` file, Seafile docker will be started in init mode and generate configuration files. + !!! success "Cluster init mode" + + Because CLUSTER_INIT_MODE is true in the `.env` file, Seafile docker will be started in init mode and generate configuration files. As the results, you can see the following lines if you trace the Seafile container (i.e., `docker logs seafile`): + + ```log + --------------------------------- + This is your configuration + --------------------------------- + + server name: seafile + server ip/domain: seafile.example.com + + 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 ... + + + + ----------------------------------------------------------------- + Your seafile server configuration has been finished successfully. + ----------------------------------------------------------------- + + run seafile server: ./seafile.sh { start | stop | restart } + run seahub server: ./seahub.sh { start | stop | restart } + + ----------------------------------------------------------------- + If you are behind a firewall, remember to allow input/output of these tcp ports: + ----------------------------------------------------------------- + + port of seafile fileserver: 8082 + port of seahub: 8000 + + When problems occur, Refer to + + https://download.seafile.com/published/seafile-manual/home.md + + for information. + + + [2024-11-21 02:22:37] Updating version stamp + Start init + + Init success + + ``` + +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: -6. 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) @@ -68,13 +124,47 @@ We assume you have already deployed memcache, MariaDB, ElasticSearch in separate - `INIT_S3_KEY_ID` - `INIT_S3_SECRET_KEY` -8. Restart the container to start the service in frontend node +8. (Optional) You can follow [here](../extension/setup_seadoc.md#deployment-method) to deploy SeaDoc server (please refer ***Situation 2***). And then modify `SEADOC_SERVER_URL` in your `.env` file + +9. Restart the container to start the service in frontend node ```sh docker compose down docker compose up -d ``` + !!! success "Frontend node starts successfully" + + After executing the above command, you can trace the logs of container `seafile` (i.e., `docker logs seafile`). You can see the following message if the frontend node starts successfully: + + ```logs + *** 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 ... + License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users + Seafile server started + + Done. + + Starting seahub at port 8000 ... + + Seahub is started + + Done. + ``` + ### Deploy seafile backend node 1. Create the mount directory @@ -98,8 +188,37 @@ We assume you have already deployed memcache, MariaDB, ElasticSearch in separate ```sh docker compose up -d ``` + + !!! success "Backend node starts successfully" + + After executing the above command, you can trace the logs of container `seafile` (i.e., `docker logs seafile`). You can see the following message if the backend node starts successfully: + + ```logs + *** Running /etc/my_init.d/01_create_data_links.sh... + *** Booting runit daemon... + *** Runit started as PID 21 + *** Running /scripts/enterpoint.sh... + 2024-11-21 03:11:59 Nginx ready + 2024-11-21 03:11:59 This is an idle script (infinite loop) to keep container running. + + --------------------------------- + + Seafile cluster backend mode + + --------------------------------- + + + 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. + + Starting seafile background tasks ... + Done. + ``` -## Deployment load balance (Optional) +## Deploy load balance (Optional) ### Install HAproxy and Keepalived services