From b4dcac6c3a35f1b6e86d23ed4e1c9c7538848de8 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Sat, 5 Jul 2025 14:32:58 +0800 Subject: [PATCH 01/12] seadoc use inner network when deploy with seafile --- manual/extension/setup_seadoc.md | 1 - manual/repo/docker/seadoc.yml | 2 +- manual/repo/docker/seadoc/1.0/standalone/seadoc.yml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manual/extension/setup_seadoc.md b/manual/extension/setup_seadoc.md index 4ee58c42..caee3e7f 100644 --- a/manual/extension/setup_seadoc.md +++ b/manual/extension/setup_seadoc.md @@ -50,7 +50,6 @@ The easiest way to deployment SeaDoc is to deploy it with Seafile server on the COMPOSE_FILE='seafile-server.yml,caddy.yml,seadoc.yml' ENABLE_SEADOC=true - SEADOC_SERVER_URL=https://seafile.example.com/sdoc-server ``` 3. Start SeaDoc server server with the following command diff --git a/manual/repo/docker/seadoc.yml b/manual/repo/docker/seadoc.yml index a64374bc..060365fc 100644 --- a/manual/repo/docker/seadoc.yml +++ b/manual/repo/docker/seadoc.yml @@ -16,7 +16,7 @@ services: - TIME_ZONE=${TIME_ZONE:-Etc/UTC} - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty} - NON_ROOT=${NON_ROOT:-false} - - SEAHUB_SERVICE_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty} + - SEAHUB_SERVICE_URL=${SEAFILE_SERVICE_URL:-http://seafile} labels: caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty} caddy.@ws.0_header: "Connection *Upgrade*" diff --git a/manual/repo/docker/seadoc/1.0/standalone/seadoc.yml b/manual/repo/docker/seadoc/1.0/standalone/seadoc.yml index b375f6a9..604de3bc 100644 --- a/manual/repo/docker/seadoc/1.0/standalone/seadoc.yml +++ b/manual/repo/docker/seadoc/1.0/standalone/seadoc.yml @@ -16,7 +16,7 @@ services: - TIME_ZONE=${TIME_ZONE:-Etc/UTC} - NON_ROOT=${NON_ROOT:-false} - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty} - - SEAHUB_SERVICE_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty} + - SEAHUB_SERVICE_URL=${SEAFILE_SERVICE_URL:-${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}} networks: - seafile-net From 97853ab967c6605ccec511731db4838b652faf1a Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 9 Jul 2025 17:06:13 +0800 Subject: [PATCH 02/12] add override page 404 --- manual/404.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 manual/404.md diff --git a/manual/404.md b/manual/404.md new file mode 100644 index 00000000..fb9298fb --- /dev/null +++ b/manual/404.md @@ -0,0 +1,3 @@ +# 404 - Page Not Found or Remove Permanently + +The requested file was not found. If you are still using **https://manual.seafile.com/xxx/**, please move to [https://manual.seafile.com/latest/xxx/](https://manual.seafile.com/latest/xxx/) as this path has been deprecated. We apologize for the inconvenience caused. \ No newline at end of file From 7eaeddda35208f375f7197759732fa0e9b3f8d09 Mon Sep 17 00:00:00 2001 From: recanman <29310982+recanman@users.noreply.github.com> Date: Fri, 11 Jul 2025 03:51:59 +0000 Subject: [PATCH 03/12] fix typo in 12.0.x upgrade notes --- manual/upgrade/upgrade_notes_for_12.0.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/upgrade/upgrade_notes_for_12.0.x.md b/manual/upgrade/upgrade_notes_for_12.0.x.md index 9ed92ce6..06233c69 100644 --- a/manual/upgrade/upgrade_notes_for_12.0.x.md +++ b/manual/upgrade/upgrade_notes_for_12.0.x.md @@ -83,7 +83,7 @@ Note, you should install Python libraries system wide using root user or sudo mo ## Upgrade to 12.0 (for binary installation) -The following instruction is for binary package based installation. If you use Docker based installation, please see [*Updgrade Docker*](./upgrade_docker.md) +The following instruction is for binary package based installation. If you use Docker based installation, please see [*Upgrade Docker*](./upgrade_docker.md) ### 1) Clean database tables before upgrade From c05ab563ea00c1ef8fabb3add259270c9d0e94d3 Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:45:36 +0800 Subject: [PATCH 04/12] Add verify_client_blocks_after_sync option (#573) Co-authored-by: yangheran --- manual/config/seafile-conf.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manual/config/seafile-conf.md b/manual/config/seafile-conf.md index 52b37a37..be8e6a87 100644 --- a/manual/config/seafile-conf.md +++ b/manual/config/seafile-conf.md @@ -226,6 +226,14 @@ Since Seafile 11.0.7 Pro, you can ask file server to check virus for every file check_virus_on_web_upload = true ``` +Since Seafile 12.0.4, after the upload is completed by the client, seafile server will check whether the uploaded blocks are complete. Ii's enabled by default. + +``` +[fileserver] +# default is true +verify_client_blocks_after_sync = true +``` + ## Database configuration The configurations of database are stored in the `[database]` section. From d7eb166d9211dd1d7eb9012a09b11a56fd453490 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Mon, 14 Jul 2025 10:55:17 +0800 Subject: [PATCH 05/12] update k8s & helm deployment --- manual/repo/k8s/ce/seafile-deployment.yaml | 97 +---------- manual/repo/k8s/ce/seafile-env.yaml | 7 +- .../k8s/ce/seafile-persistentvolumeclaim.yaml | 5 +- manual/repo/k8s/ce/seafile-secret.yaml | 18 -- manual/repo/k8s/ce/seafile-service.yaml | 6 +- .../cluster/seafile-backend-deployment.yaml | 156 +----------------- manual/repo/k8s/cluster/seafile-env.yaml | 7 +- .../cluster/seafile-frontend-deployment.yaml | 81 +-------- .../seafile-persistentvolumeclaim.yaml | 5 +- manual/repo/k8s/cluster/seafile-secret.yaml | 21 --- manual/repo/k8s/cluster/seafile-service.yaml | 6 +- manual/repo/k8s/pro/seafile-deployment.yaml | 147 +---------------- manual/repo/k8s/pro/seafile-env.yaml | 7 +- .../pro/seafile-persistentvolumeclaim.yaml | 5 +- manual/repo/k8s/pro/seafile-secret.yaml | 21 --- manual/repo/k8s/pro/seafile-service.yaml | 6 +- manual/setup/cluster_deploy_with_k8s.md | 44 +++-- manual/setup/helm_chart_cluster.md | 14 +- manual/setup/helm_chart_single_node.md | 30 ++-- manual/setup/k8s_advanced_management.md | 4 +- manual/setup/k8s_single_node.md | 50 ++++-- 21 files changed, 143 insertions(+), 594 deletions(-) delete mode 100644 manual/repo/k8s/ce/seafile-secret.yaml delete mode 100644 manual/repo/k8s/cluster/seafile-secret.yaml delete mode 100644 manual/repo/k8s/pro/seafile-secret.yaml diff --git a/manual/repo/k8s/ce/seafile-deployment.yaml b/manual/repo/k8s/ce/seafile-deployment.yaml index 7e50644d..fc8347d3 100644 --- a/manual/repo/k8s/ce/seafile-deployment.yaml +++ b/manual/repo/k8s/ce/seafile-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile + namespace: seafile spec: replicas: 1 selector: @@ -15,97 +16,11 @@ spec: containers: - name: seafile image: seafileltd/seafile-pro-mc:12.0-latest - env: - - name: SEAFILE_SERVER_HOSTNAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_HOSTNAME - - name: SEAFILE_SERVER_PROTOCOL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_PROTOCOL - - name: TIME_ZONE - valueFrom: - configMapKeyRef: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/ce/seafile-env.yaml b/manual/repo/k8s/ce/seafile-env.yaml index 70d8c560..ef629121 100644 --- a/manual/repo/k8s/ce/seafile-env.yaml +++ b/manual/repo/k8s/ce/seafile-env.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" @@ -14,9 +15,9 @@ data: # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/ce/seafile-secret.yaml b/manual/repo/k8s/ce/seafile-secret.yaml deleted file mode 100644 index 8e949391..00000000 --- a/manual/repo/k8s/ce/seafile-secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" \ No newline at end of file diff --git a/manual/repo/k8s/ce/seafile-service.yaml b/manual/repo/k8s/ce/seafile-service.yaml index 9c5997ba..1e0695c6 100644 --- a/manual/repo/k8s/ce/seafile-service.yaml +++ b/manual/repo/k8s/ce/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-backend-deployment.yaml b/manual/repo/k8s/cluster/seafile-backend-deployment.yaml index ff5d6a33..edd90a96 100644 --- a/manual/repo/k8s/cluster/seafile-backend-deployment.yaml +++ b/manual/repo/k8s/cluster/seafile-backend-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile-backend + namespace: seafile spec: replicas: 1 selector: @@ -27,156 +28,11 @@ spec: value: "true" - name: CLUSTER_MODE value: "backend" - - name: SEAFILE_SERVER_HOSTNAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_HOSTNAME - - name: SEAFILE_SERVER_PROTOCOL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_PROTOCOL - - name: TIME_ZONE - valueFrom: - configMapKeyRef: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: CLUSTER_INIT_MODE - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_MODE - - name: CLUSTER_INIT_MEMCACHED_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_MEMCACHED_HOST - - name: CLUSTER_INIT_ES_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_ES_HOST - - name: CLUSTER_INIT_ES_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_ES_PORT - - name: INIT_S3_STORAGE_BACKEND_CONFIG - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_STORAGE_BACKEND_CONFIG - - name: INIT_S3_COMMIT_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_COMMIT_BUCKET - - name: INIT_S3_FS_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_FS_BUCKET - - name: INIT_S3_BLOCK_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_BLOCK_BUCKET - - name: INIT_S3_KEY_ID - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_KEY_ID - - name: INIT_S3_USE_V4_SIGNATURE - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_V4_SIGNATURE - - name: INIT_S3_AWS_REGION - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_AWS_REGION - - name: INIT_S3_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_HOST - - name: INIT_S3_USE_HTTPS - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_HTTPS - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_S3_SECRET_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_S3_SECRET_KEY - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/cluster/seafile-env.yaml b/manual/repo/k8s/cluster/seafile-env.yaml index f1c5be6f..6a25a724 100644 --- a/manual/repo/k8s/cluster/seafile-env.yaml +++ b/manual/repo/k8s/cluster/seafile-env.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" @@ -13,9 +14,9 @@ data: SEAFILE_SERVER_PROTOCOL: "http" # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml index d1b3cc35..e5f8aeb5 100644 --- a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml +++ b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile-frontend + namespace: seafile spec: replicas: 2 # change to your frontend service number, i.e., N_f selector: @@ -27,81 +28,11 @@ spec: value: "true" - name: CLUSTER_MODE value: "frontend" - - name: SEAFILE_SERVER_HOSTNAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_HOSTNAME - - name: SEAFILE_SERVER_PROTOCOL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_PROTOCOL - - name: TIME_ZONE - valueFrom: - configMapKeyRef: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret ports: - containerPort: 80 volumeMounts: diff --git a/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-secret.yaml b/manual/repo/k8s/cluster/seafile-secret.yaml deleted file mode 100644 index ef084e92..00000000 --- a/manual/repo/k8s/cluster/seafile-secret.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for Seafile admin - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - ## For S3 storage backend (only valid in INIT_S3_STORAGE_BACKEND_CONFIG = true) - INIT_S3_SECRET_KEY: "" \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-service.yaml b/manual/repo/k8s/cluster/seafile-service.yaml index f2accd22..4f48cc8e 100644 --- a/manual/repo/k8s/cluster/seafile-service.yaml +++ b/manual/repo/k8s/cluster/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile-frontend - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-deployment.yaml b/manual/repo/k8s/pro/seafile-deployment.yaml index 0edaea16..fc8347d3 100644 --- a/manual/repo/k8s/pro/seafile-deployment.yaml +++ b/manual/repo/k8s/pro/seafile-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile + namespace: seafile spec: replicas: 1 selector: @@ -15,147 +16,11 @@ spec: containers: - name: seafile image: seafileltd/seafile-pro-mc:12.0-latest - env: - - name: SEAFILE_SERVER_HOSTNAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_HOSTNAME - - name: SEAFILE_SERVER_PROTOCOL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_SERVER_PROTOCOL - - name: TIME_ZONE - valueFrom: - configMapKeyRef: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: INIT_S3_STORAGE_BACKEND_CONFIG - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_STORAGE_BACKEND_CONFIG - - name: INIT_S3_COMMIT_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_COMMIT_BUCKET - - name: INIT_S3_FS_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_FS_BUCKET - - name: INIT_S3_BLOCK_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_BLOCK_BUCKET - - name: INIT_S3_KEY_ID - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_KEY_ID - - name: INIT_S3_USE_V4_SIGNATURE - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_V4_SIGNATURE - - name: INIT_S3_AWS_REGION - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_AWS_REGION - - name: INIT_S3_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_HOST - - name: INIT_S3_USE_HTTPS - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_HTTPS - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_S3_SECRET_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_S3_SECRET_KEY - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/pro/seafile-env.yaml b/manual/repo/k8s/pro/seafile-env.yaml index 9cf8644b..ced53b42 100644 --- a/manual/repo/k8s/pro/seafile-env.yaml +++ b/manual/repo/k8s/pro/seafile-env.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" @@ -14,9 +15,9 @@ data: # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-secret.yaml b/manual/repo/k8s/pro/seafile-secret.yaml deleted file mode 100644 index 38124c70..00000000 --- a/manual/repo/k8s/pro/seafile-secret.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - ## For S3 storage backend (only valid in INIT_S3_STORAGE_BACKEND_CONFIG = true) - INIT_S3_SECRET_KEY: "" \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-service.yaml b/manual/repo/k8s/pro/seafile-service.yaml index 9c5997ba..1e0695c6 100644 --- a/manual/repo/k8s/pro/seafile-service.yaml +++ b/manual/repo/k8s/pro/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/setup/cluster_deploy_with_k8s.md b/manual/setup/cluster_deploy_with_k8s.md index 00528ef1..ae93f072 100644 --- a/manual/setup/cluster_deploy_with_k8s.md +++ b/manual/setup/cluster_deploy_with_k8s.md @@ -20,6 +20,19 @@ After installation, you need to start the k8s control plane service on each node !!! tip Although we recommend installing the *k8s control plane tool* on each node, it does not mean that we will use each node as a control plane node, but it is a necessary tool to create or join a K8S cluster. For details, please refer to the above [link](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/) about **creating or joining into a cluster**. +## Create namespace and secretMap + +```sh +kubectl create ns seafile + +kubectl create secret generic seafile-secret --namespace seafile \ +--from-literal=JWT_PRIVATE_KEY='' \ +--from-literal=DB_PASSWORD='' \ +--from-literal=DB_ROOT_PASSWD='' \ +--from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ +--from-literal=INIT_S3_SECRET_KEY='' +``` + ## Download K8S YAML files for Seafile cluster (without frontend node) ```sh @@ -43,7 +56,14 @@ In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which For futher configuration details, you can refer [the official documents](https://kubernetes.io/docs/tasks/configure-pod-container/). -## Modify `seafile-env.yaml` and `seafile-secret.yaml` +!!! tip "Use PV bound from a storage class" + If you would like to use automatically allocated persistent volume (PV) by a storage class, please modify `seafile-persistentvolumeclaim.yaml` and specify `storageClassName`. On the other hand, the PV defined by `seafile-persistentvolume.yaml` can be disabled: + + ```sh + rm /opt/seafile-k8s-yaml/seafile-persistentvolume.yaml + ``` + +## Modify `seafile-env.yaml` Similar to Docker-base deployment, Seafile cluster in K8S deployment also supports use files to configure startup progress, you can modify common [environment variables](./setup_pro_by_docker.md#downloading-and-modifying-env) by @@ -51,22 +71,6 @@ Similar to Docker-base deployment, Seafile cluster in K8S deployment also suppor nano /opt/seafile-k8s-yaml/seafile-env.yaml ``` -and sensitive information (e.g., password) by - -```sh -nano /opt/seafile-k8s-yaml/seafile-secret.yaml -``` - -!!! note "For `seafile-secret.yaml`" - To modify sensitive information (e.g., password), you need to convert the password into base64 encoding before writing it into the `seafile-secret.yaml` file: - - ```sh - echo -n '' | base64 - ``` - -!!! warning - For the fields marked with `<...>` are **required**, please make sure these items are filled in, otherwise Seafile server may not run properly. - ## Initialize Seafile cluster You can use following command to initialize Seafile cluster now (the Seafile's K8S resources will be specified in namespace `seafile` for easier management): @@ -138,7 +142,11 @@ Finally you can use the `tar -zcvf` and `tar -zxvf` commands to package the enti wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-frontend-deployment.yaml ``` -2. Modify `seafile-env.yaml`, and set `CLUSTER_INIT_MODE` to `false` (i.e., disable initialization mode) +2. Modify `seafile-env.yaml`, and set `CLUSTER_INIT_MODE` to `false` (i.e., disable initialization mode), then re-apply `seafile-env.yaml` again: + + ```sh + kubectl apply -f /opt/seafile-k8s-yaml + ``` 3. Run the following command to restart pods to restart Seafile cluster: diff --git a/manual/setup/helm_chart_cluster.md b/manual/setup/helm_chart_cluster.md index a38bea09..6256ec76 100644 --- a/manual/setup/helm_chart_cluster.md +++ b/manual/setup/helm_chart_cluster.md @@ -33,9 +33,9 @@ After installation, you need to start the k8s control plane service on each node ```sh kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' \ --from-literal=INIT_S3_SECRET_KEY='' ``` @@ -44,7 +44,7 @@ After installation, you need to start the k8s control plane service on each node 3. Download and modify the `my-values.yaml` according to your configurations. By the way, you can follow [here](./setup_pro_by_docker.md#downloading-and-modifying-env) for the details: ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/cluster.yaml nano my-values.yaml ``` @@ -65,7 +65,7 @@ After installation, you need to start the k8s control plane service on each node ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` !!! success After installing the chart, the cluster is going to initial progress, you can see the following message by `kubectl logs seafile- -n seafile`: @@ -146,7 +146,7 @@ After installation, you need to start the k8s control plane service on each node 5. After the first-time startup, you have to turn off (i.e., set `initMode` to `false`) in your `my-values.yaml`, then upgrade the chart: ```sh - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` !!! success @@ -286,7 +286,7 @@ After installation, you need to start the k8s control plane service on each node Finally you can upgrade your chart by: ```sh - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` ## Version control @@ -305,7 +305,7 @@ Seafile Helm Chart is designed to provide fast deployment and version control. Y 2. Download (optional) and modify the new `my-values.yaml` ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml nano my-values.yaml ``` diff --git a/manual/setup/helm_chart_single_node.md b/manual/setup/helm_chart_single_node.md index ef688215..c472bccf 100644 --- a/manual/setup/helm_chart_single_node.md +++ b/manual/setup/helm_chart_single_node.md @@ -27,21 +27,25 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile Pro" ```sh + kubectl create ns seafile + kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' \ --from-literal=INIT_S3_SECRET_KEY='' ``` === "Seafile CE" ```sh + kubectl create ns seafile + kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ - --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' ``` where the `JWT_PRIVATE_KEY` can be generate by `pwgen -s 40 1` @@ -51,7 +55,7 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile Pro" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/pro.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/pro.yaml nano my-values.yaml ``` @@ -59,7 +63,7 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile CE" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/ce.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/ce.yaml nano my-values.yaml ``` @@ -82,14 +86,14 @@ Please refer [here](./system_requirements.md) for the details of system requirem ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/pro --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/pro --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` === "Seafile CE" ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/ce --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/ce --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` After installing the chart, the Seafile pod should startup automaticlly. @@ -157,13 +161,13 @@ kubectl delete pods -n seafile $(kubectl get pods -n seafile -o jsonpath='{.item === "Seafile Pro" ```sh - helm upgrade --install seafile seafile/pro --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/pro --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` === "Seafile CE" ```sh - helm upgrade --install seafile seafile/ce --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/ce --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` ## Version control @@ -184,13 +188,13 @@ Seafile Helm Chart is designed to provide fast deployment and version control. Y === "Seafile Pro" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//pro.yaml nano my-values.yaml ``` === "Seafile CE" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//ce.yaml nano my-values.yaml ``` diff --git a/manual/setup/k8s_advanced_management.md b/manual/setup/k8s_advanced_management.md index 01a03eea..0bb1c684 100644 --- a/manual/setup/k8s_advanced_management.md +++ b/manual/setup/k8s_advanced_management.md @@ -35,10 +35,10 @@ kubectl delete pods -n seafile $(kubectl get pods -n seafile -o jsonpath='{.item ## K8S Gateway and HTTPS -Since the Ingress feature [is no longer supported](https://kubernetes.io/docs/concepts/services-networking/ingress/) in the new version of K8S (even the commonly used *Nginx-Ingress* will not be deployed after 1.24), this article will introduce how to use the new version of K8S feature [*K8S Gateway*](https://kubernetes.io/docs/concepts/services-networking/gateway/) to implement Seafile service exposure and load balancing. +Since the support of Ingress feature [is frozen](https://kubernetes.io/docs/concepts/services-networking/ingress/) in the new version of K8S, this article will introduce how to use the new version of K8S feature [*K8S Gateway*](https://kubernetes.io/docs/concepts/services-networking/gateway/) to implement Seafile service exposure and load balancing. !!! tip "Still use *Nginx-Ingress*" - If your K8S is still running with an old version, and still using *Nginx-Ingress*, you can follow [here](https://artifacthub.io/packages/helm/datamate/seafile#deploy-an-ingress-controller-ingress-nginx) to setup ingress controller and HTTPS. We sincerely thanks *Datamate* to give an example to this configuration. + If your K8S is still using *Nginx-Ingress*, you can follow [here](https://artifacthub.io/packages/helm/datamate/seafile#deploy-an-ingress-controller-ingress-nginx) to setup ingress controller and HTTPS. We sincerely thanks *Datamate* to give an example to this configuration. For the details and features about ***K8S Gateway***, please refer to the K8S [official document](https://kubernetes.io/docs/concepts/services-networking/gateway/#design-principles), you can simpily install it by diff --git a/manual/setup/k8s_single_node.md b/manual/setup/k8s_single_node.md index 2a6a06c7..40b47671 100644 --- a/manual/setup/k8s_single_node.md +++ b/manual/setup/k8s_single_node.md @@ -14,6 +14,32 @@ For persisting data using in the docker-base deployment, `/opt/seafile-data`, is By the way, we don't provide the deployment methods of basic services (e.g., **Memcached**, **MySQL** and **Elasticsearch**) and seafile-compatibility components (e.g., **SeaDoc**) for K8S in our document. If you need to install these services in K8S format, ***you can refer to the rewrite method of this document.*** +## Create namespace and secretMap + +=== "Seafile Pro" + + ```sh + kubectl create ns seafile + + kubectl create secret generic seafile-secret --namespace seafile \ + --from-literal=JWT_PRIVATE_KEY='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ + --from-literal=INIT_S3_SECRET_KEY='' + ``` +=== "Seafile CE" + + ```sh + kubectl create ns seafile + + kubectl create secret generic seafile-secret --namespace seafile \ + --from-literal=JWT_PRIVATE_KEY='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' + ``` + ## Down load the YAML files for Seafile Server === "Pro edition" @@ -26,7 +52,6 @@ By the way, we don't provide the deployment methods of basic services (e.g., **M wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-persistentvolumeclaim.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-service.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-env.yaml - wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-secret.yaml ``` === "Community edition" @@ -39,7 +64,6 @@ By the way, we don't provide the deployment methods of basic services (e.g., **M wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-persistentvolumeclaim.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-service.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-env.yaml - wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-secret.yaml ``` In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which mainly include about: @@ -49,9 +73,16 @@ In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which - `seafile-persistentVolume.yaml` for defining the location of a volume used for persistent storage on the host - `seafile-persistentvolumeclaim.yaml` for declaring the use of persistent storage in the container. +!!! tip "Use PV bound from a storage class" + If you would like to use automatically allocated persistent volume (PV) by a storage class, please modify `seafile-persistentvolumeclaim.yaml` and specify `storageClassName`. On the other hand, the PV defined by `seafile-persistentvolume.yaml` can be disabled: + + ```sh + rm /opt/seafile-k8s-yaml/seafile-persistentvolume.yaml + ``` + For futher configuration details, you can refer [the official documents](https://kubernetes.io/docs/tasks/configure-pod-container/). -## Modify `seafile-env.yaml` and `seafile-secret.yaml` +## Modify `seafile-env.yaml` Similar to Docker-base deployment, Seafile cluster in K8S deployment also supports use files to configure startup progress, you can modify common [environment variables](./setup_pro_by_docker.md#downloading-and-modifying-env) by @@ -59,19 +90,6 @@ Similar to Docker-base deployment, Seafile cluster in K8S deployment also suppor nano /opt/seafile-k8s-yaml/seafile-env.yaml ``` -and sensitive information (e.g., password) by - -```sh -nano /opt/seafile-k8s-yaml/seafile-secret.yaml -``` - -!!! note "For `seafile-secret.yaml`" - To modify sensitive information (e.g., password), you need to convert the password into base64 encoding before writing it into the `seafile-secret.yaml` file: - - ```sh - echo -n '' | base64 - ``` - !!! warning For the fields marked with `<...>` are **required**, please make sure these items are filled in, otherwise Seafile server may not run properly. From 6a1a4b9eeb7769d28c27c54828a4b2ed65281e7a Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Mon, 14 Jul 2025 11:20:46 +0800 Subject: [PATCH 06/12] set k8s deployment - SEAFILE_LOG_TO_STDOUT default true --- manual/repo/k8s/ce/seafile-env.yaml | 2 +- manual/repo/k8s/pro/seafile-env.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/repo/k8s/ce/seafile-env.yaml b/manual/repo/k8s/ce/seafile-env.yaml index ef629121..200bb05d 100644 --- a/manual/repo/k8s/ce/seafile-env.yaml +++ b/manual/repo/k8s/ce/seafile-env.yaml @@ -6,7 +6,7 @@ metadata: data: # for Seafile server TIME_ZONE: "UTC" - SEAFILE_LOG_TO_STDOUT: "false" + SEAFILE_LOG_TO_STDOUT: "true" SITE_ROOT: "/" ENABLE_SEADOC: "false" SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true diff --git a/manual/repo/k8s/pro/seafile-env.yaml b/manual/repo/k8s/pro/seafile-env.yaml index ced53b42..e06dd32b 100644 --- a/manual/repo/k8s/pro/seafile-env.yaml +++ b/manual/repo/k8s/pro/seafile-env.yaml @@ -6,7 +6,7 @@ metadata: data: # for Seafile server TIME_ZONE: "UTC" - SEAFILE_LOG_TO_STDOUT: "false" + SEAFILE_LOG_TO_STDOUT: "true" SITE_ROOT: "/" ENABLE_SEADOC: "false" SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true From 41f9769a9b9e3f08875b62db013d4cccf55de622 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Tue, 15 Jul 2025 15:29:48 +0800 Subject: [PATCH 07/12] fix: docker compose commands with specifying env path --- manual/setup/setup_ce_by_docker.md | 6 +++--- manual/setup/setup_pro_by_docker.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manual/setup/setup_ce_by_docker.md b/manual/setup/setup_ce_by_docker.md index 1aa4132a..edd058b7 100644 --- a/manual/setup/setup_ce_by_docker.md +++ b/manual/setup/setup_ce_by_docker.md @@ -65,7 +65,7 @@ docker compose up -d You must run the above command in the directory with the `.env`. If `.env` file is elsewhere, please run ```sh - docker compose -f /path/to/.env up -d + docker compose --env-file /path/to/.env up -d ``` !!! success @@ -167,12 +167,12 @@ To monitor container logs (from outside of the container), please use the follow # if the `.env` file is in current directory: docker compose logs --follow # if the `.env` file is elsewhere: -docker compose -f /path/to/.env logs --follow +docker compose --env-file /path/to/.env logs --follow # you can also specify container name: docker compose logs seafile --follow # or, if the `.env` file is elsewhere: -docker compose -f /path/to/.env logs seafile --follow +docker compose --env-file /path/to/.env logs seafile --follow ``` The Seafile logs are under `/shared/logs/seafile` in the docker, or `/opt/seafile-data/logs/seafile` in the server that run the docker. diff --git a/manual/setup/setup_pro_by_docker.md b/manual/setup/setup_pro_by_docker.md index e7ef0f2c..e1685023 100644 --- a/manual/setup/setup_pro_by_docker.md +++ b/manual/setup/setup_pro_by_docker.md @@ -97,7 +97,7 @@ docker compose up -d You must run the above command in the directory with the `.env`. If `.env` file is elsewhere, please run ```sh - docker compose -f /path/to/.env up -d + docker compose --env-file /path/to/.env up -d ``` !!! success From 65276a3c4a5ed70bc51b9ae455347959d91714fc Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Fri, 18 Jul 2025 17:50:32 +0800 Subject: [PATCH 08/12] Update upgrade_notes_for_12.0.x.md --- manual/upgrade/upgrade_notes_for_12.0.x.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manual/upgrade/upgrade_notes_for_12.0.x.md b/manual/upgrade/upgrade_notes_for_12.0.x.md index 06233c69..0d654cb6 100644 --- a/manual/upgrade/upgrade_notes_for_12.0.x.md +++ b/manual/upgrade/upgrade_notes_for_12.0.x.md @@ -37,7 +37,8 @@ Breaking changes * For security reason, WebDAV no longer support login with LDAP account, the user with LDAP account must generate a WebDAV token at the profile page * [File tags] The current file tags feature is deprecated. We will re-implement a new one in version 13.0 with a new general metadata management module. * For ElasticSearch based search, full text search of doc/xls/ppt file types are no longer supported. This enable us to remove Java dependency in Seafile side. - +* The search dialog now support loading more items when scroll down and the original separate detailed file search page is no longer used +* The right side panel is redesigned and the seldom used file comments feature in the panel is removed Deploying Seafile with binary package is now deprecated and probably no longer be supported in version 13.0. We recommend you to migrate your existing Seafile deployment to docker based. From 7b7f7ddcc8eba4b4d712f3b6eaf4163f0df6ff10 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 23 Jul 2025 12:05:16 +0800 Subject: [PATCH 09/12] update k8s deployment for cluster --- manual/setup/cluster_deploy_with_k8s.md | 1 - 1 file changed, 1 deletion(-) diff --git a/manual/setup/cluster_deploy_with_k8s.md b/manual/setup/cluster_deploy_with_k8s.md index ae93f072..fbf0d1e5 100644 --- a/manual/setup/cluster_deploy_with_k8s.md +++ b/manual/setup/cluster_deploy_with_k8s.md @@ -43,7 +43,6 @@ wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/s wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-service.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-env.yaml -wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-secret.yaml ``` From c059db74bfe6fded9c8cfc1b5c1fac0fc5910252 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 23 Jul 2025 14:16:25 +0800 Subject: [PATCH 10/12] update k8s deployment default image tag for ce --- manual/repo/k8s/ce/seafile-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/repo/k8s/ce/seafile-deployment.yaml b/manual/repo/k8s/ce/seafile-deployment.yaml index fc8347d3..1af2e58e 100644 --- a/manual/repo/k8s/ce/seafile-deployment.yaml +++ b/manual/repo/k8s/ce/seafile-deployment.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: seafile - image: seafileltd/seafile-pro-mc:12.0-latest + image: seafileltd/seafile-mc:12.0-latest envFrom: - configMapRef: name: seafile-env From f559bbbded3df0e54059f1069f20ed2e4f4914b6 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 23 Jul 2025 14:58:25 +0800 Subject: [PATCH 11/12] update 13.0 k8s deployment --- manual/repo/k8s/ce/seafile-deployment.yaml | 2 +- manual/repo/k8s/ce/seafile-secret.yaml | 21 ----------------- manual/repo/k8s/cluster/seafile-secret.yaml | 25 --------------------- manual/repo/k8s/pro/seafile-deployment.yaml | 2 +- manual/repo/k8s/pro/seafile-secret.yaml | 25 --------------------- 5 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 manual/repo/k8s/ce/seafile-secret.yaml delete mode 100644 manual/repo/k8s/cluster/seafile-secret.yaml delete mode 100644 manual/repo/k8s/pro/seafile-secret.yaml diff --git a/manual/repo/k8s/ce/seafile-deployment.yaml b/manual/repo/k8s/ce/seafile-deployment.yaml index 1af2e58e..640ab538 100644 --- a/manual/repo/k8s/ce/seafile-deployment.yaml +++ b/manual/repo/k8s/ce/seafile-deployment.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: seafile - image: seafileltd/seafile-mc:12.0-latest + image: seafileltd/seafile-mc:13.0-latest envFrom: - configMapRef: name: seafile-env diff --git a/manual/repo/k8s/ce/seafile-secret.yaml b/manual/repo/k8s/ce/seafile-secret.yaml deleted file mode 100644 index 8ecdc537..00000000 --- a/manual/repo/k8s/ce/seafile-secret.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - # for redis - REDIS_PASSWORD: "" \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-secret.yaml b/manual/repo/k8s/cluster/seafile-secret.yaml deleted file mode 100644 index 56e8fb2d..00000000 --- a/manual/repo/k8s/cluster/seafile-secret.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for Seafile admin - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - # For S3 storage backend (only valid in USE_S3_STORAGE = true) - S3_SECRET_KEY: "" - S3_SSE_C_KEY: "" - - # for redis - REDIS_PASSWORD: "" diff --git a/manual/repo/k8s/pro/seafile-deployment.yaml b/manual/repo/k8s/pro/seafile-deployment.yaml index fc8347d3..11d2ea21 100644 --- a/manual/repo/k8s/pro/seafile-deployment.yaml +++ b/manual/repo/k8s/pro/seafile-deployment.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: seafile - image: seafileltd/seafile-pro-mc:12.0-latest + image: seafileltd/seafile-pro-mc:13.0-latest envFrom: - configMapRef: name: seafile-env diff --git a/manual/repo/k8s/pro/seafile-secret.yaml b/manual/repo/k8s/pro/seafile-secret.yaml deleted file mode 100644 index db0f2941..00000000 --- a/manual/repo/k8s/pro/seafile-secret.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - # For S3 storage backend (only valid in USE_S3_STORAGE = true) - S3_SECRET_KEY: "" - S3_SSE_C_KEY: "" - - # for redis - REDIS_PASSWORD: "" \ No newline at end of file From c080e3aecf7f9bcc2706754a940c7a3b77eb6987 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 23 Jul 2025 15:00:15 +0800 Subject: [PATCH 12/12] fix: k8s mysql configs name --- manual/repo/k8s/ce/seafile-env.yaml | 6 +++--- manual/repo/k8s/cluster/seafile-env.yaml | 6 +++--- manual/repo/k8s/pro/seafile-env.yaml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manual/repo/k8s/ce/seafile-env.yaml b/manual/repo/k8s/ce/seafile-env.yaml index ba9a9ae2..48e485ce 100644 --- a/manual/repo/k8s/ce/seafile-env.yaml +++ b/manual/repo/k8s/ce/seafile-env.yaml @@ -13,9 +13,9 @@ data: # for database - DB_HOST: "" - DB_PORT: "3306" - DB_USER: "seafile" + SEAFILE_MYSQL_DB_HOST: "" + SEAFILE_MYSQL_DB_PORT: "3306" + SEAFILE_MYSQL_DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/cluster/seafile-env.yaml b/manual/repo/k8s/cluster/seafile-env.yaml index 75e54bd5..a2c17293 100644 --- a/manual/repo/k8s/cluster/seafile-env.yaml +++ b/manual/repo/k8s/cluster/seafile-env.yaml @@ -12,9 +12,9 @@ data: SEAFILE_SERVER_PROTOCOL: "http" # for database - DB_HOST: "" - DB_PORT: "3306" - DB_USER: "seafile" + SEAFILE_MYSQL_DB_HOST: "" + SEAFILE_MYSQL_DB_PORT: "3306" + SEAFILE_MYSQL_DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/pro/seafile-env.yaml b/manual/repo/k8s/pro/seafile-env.yaml index 3019eea6..3b16dd49 100644 --- a/manual/repo/k8s/pro/seafile-env.yaml +++ b/manual/repo/k8s/pro/seafile-env.yaml @@ -13,9 +13,9 @@ data: # for database - DB_HOST: "" - DB_PORT: "3306" - DB_USER: "seafile" + SEAFILE_MYSQL_DB_HOST: "" + SEAFILE_MYSQL_DB_PORT: "3306" + SEAFILE_MYSQL_DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db"