🌛 First commit

This commit is contained in:
2025-12-29 17:55:42 -05:00
parent 87bad9b704
commit b4bce043d9
20 changed files with 852 additions and 0 deletions

107
stacks/seafile/README.md Normal file
View File

@@ -0,0 +1,107 @@
# Seafile Stack
Seafile 13 Pro with SeaDoc, SeaSearch, Notification Server, and Metadata Server.
## Services
| Service | Port | Description |
|---------|------|-------------|
| seafile | 8098:80 | Main Seafile server |
| seadoc | 8888:80 | Document collaboration |
| notification-server | 8083:8083 | Real-time notifications |
| seafile-md-server | 8084:8084 | Metadata server |
| seasearch | 4080:4080 | Full-text search |
| seafile-mysql | - | MariaDB database |
| seafile-redis | - | Redis cache |
## Configuration Files
Copy these to `/mnt/user/appdata/seafile/` before deploying:
- `seahub_settings.py` - Seahub configuration
- `seafile.conf` - Seafile server configuration
## NGINX Proxy Manager Setup
### fileserver.rishighan.com
Create HTTPS proxy with this Advanced config:
```nginx
location / {
proxy_pass http://192.168.1.75:8098;
proxy_read_timeout 310s;
proxy_http_version 1.1;
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-Proto $scheme;
proxy_set_header Connection "upgrade";
client_max_body_size 0;
}
rewrite ^/seafdav$ /seafdav/ permanent;
location /sdoc-server/ {
proxy_pass http://192.168.1.75:8888/;
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;
client_max_body_size 100m;
}
location /socket.io {
proxy_pass http://192.168.1.75:8888;
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;
}
```
### notification.rishighan.com
Create separate HTTPS proxy pointing to `192.168.1.75:8083`
## Migration from VM
1. Stop Seafile on VM:
```bash
ssh rishi@192.168.1.112
cd /opt/seafile && docker compose down
```
2. Create directories:
```bash
mkdir -p /mnt/user/appdata/seafile/{data,db-data,seadoc-data,seasearch-data}
```
3. Copy data:
```bash
rsync -avP rishi@192.168.1.112:~/seafile/data/ /mnt/user/appdata/seafile/data/
rsync -avP rishi@192.168.1.112:~/seafile/db-data/ /mnt/user/appdata/seafile/db-data/
```
4. Copy config files:
```bash
cp seahub_settings.py /mnt/user/appdata/seafile/
cp seafile.conf /mnt/user/appdata/seafile/
```
5. Update NPM proxies to point to 192.168.1.75 instead of 192.168.1.112
6. Deploy stack via Portainer
## Notes
- Notifications only work for shared library events between users
- SeaDoc requires the `/sdoc-server/` and `/socket.io` proxy locations
- WebDAV is enabled on port 8080 at `/seafdav`

View File

@@ -0,0 +1,163 @@
networks:
seafile-net:
name: seafile-net
driver: bridge
services:
db:
image: mariadb:10.11
container_name: seafile-mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
volumes:
- /mnt/user/appdata/seafile/db-data:/var/lib/mysql
networks:
- seafile-net
healthcheck:
test: ["CMD", "sh", "-c", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD"]
interval: 20s
start_period: 30s
timeout: 5s
retries: 10
redis:
image: redis:latest
container_name: seafile-redis
restart: unless-stopped
networks:
- seafile-net
seafile:
image: seafileltd/seafile-pro-mc:13.0.6-testing
container_name: seafile
restart: unless-stopped
ports:
- 8098:80
environment:
- SEAFILE_MYSQL_DB_HOST=db
- SEAFILE_MYSQL_DB_PORT=3306
- SEAFILE_MYSQL_DB_USER=seafile
- SEAFILE_MYSQL_DB_PASSWORD=${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
- TIME_ZONE=Etc/UTC
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME}
- SEAFILE_SERVER_PROTOCOL=https
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY}
- ENABLE_SEADOC=true
- SEADOC_SERVER_URL=https://${SEAFILE_SERVER_HOSTNAME}/sdoc-server
- CACHE_PROVIDER=redis
- REDIS_HOST=redis
- REDIS_PORT=6379
- INNER_NOTIFICATION_SERVER_URL=http://notification-server:8083
- NOTIFICATION_SERVER_URL=${NOTIFICATION_SERVER_URL}
volumes:
- /mnt/user/appdata/seafile/data:/shared
- /mnt/user/appdata/seafile/seahub_settings.py:/shared/seafile/conf/seahub_settings.py
- /mnt/user/appdata/seafile/seafile.conf:/shared/seafile/conf/seafile.conf
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
networks:
- seafile-net
seadoc:
image: seafileltd/sdoc-server:2.0.3-testing
container_name: seadoc
restart: unless-stopped
ports:
- 8888:80
environment:
- DB_HOST=db
- DB_PORT=3306
- DB_USER=seafile
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD}
- DB_NAME=seahub_db
- TIME_ZONE=Etc/UTC
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY}
- SEAHUB_SERVICE_URL=https://${SEAFILE_SERVER_HOSTNAME}
volumes:
- /mnt/user/appdata/seafile/seadoc-data:/shared
depends_on:
db:
condition: service_healthy
networks:
- seafile-net
notification-server:
image: seafileltd/notification-server:13.0.0-testing
container_name: notification-server
restart: unless-stopped
ports:
- 8083:8083
environment:
- SEAFILE_MYSQL_DB_HOST=db
- SEAFILE_MYSQL_DB_PORT=3306
- SEAFILE_MYSQL_DB_USER=seafile
- SEAFILE_MYSQL_DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD}
- SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db
- SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY}
- SEAFILE_LOG_TO_STDOUT=true
volumes:
- /mnt/user/appdata/seafile/data/seafile/logs:/shared/seafile/logs
depends_on:
db:
condition: service_healthy
networks:
- seafile-net
seafile-md-server:
image: seafileltd/seafile-md-server:13.0.6-testing
container_name: seafile-md-server
restart: unless-stopped
ports:
- 8084:8084
environment:
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY}
- SEAFILE_MYSQL_DB_HOST=db
- SEAFILE_MYSQL_DB_PORT=3306
- SEAFILE_MYSQL_DB_USER=seafile
- SEAFILE_MYSQL_DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD}
- SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db
- MD_PORT=8084
- MD_STORAGE_TYPE=s3
- S3_MD_BUCKET=seafile-md
- S3_KEY_ID=${S3_KEY_ID}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_AWS_REGION=us-east-1
- S3_HOST=s3.amazonaws.com
- S3_USE_HTTPS=true
- S3_USE_V4_SIGNATURE=true
- CACHE_PROVIDER=redis
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- /mnt/user/appdata/seafile/data:/shared
depends_on:
db:
condition: service_healthy
networks:
- seafile-net
seasearch:
image: seafileltd/seasearch:1.0.1-testing
container_name: seafile-seasearch
restart: unless-stopped
ports:
- 4080:4080
environment:
- SS_MAX_OBJ_CACHE_SIZE=10GB
- SS_STORAGE_TYPE=disk
- SS_LOG_TO_STDOUT=true
- SS_LOG_LEVEL=info
volumes:
- /mnt/user/appdata/seafile/seasearch-data:/opt/seasearch/data
networks:
- seafile-net

View File

@@ -0,0 +1,11 @@
[metadata]
enabled = true
metadata_server_url = http://seafile-md-server:8084
[fileserver]
port=8082
[webdav]
enabled = true
port = 8080
share_name = /seafdav

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
SECRET_KEY = "4m!e0kb5yabjx50h@)wg^96wt$m^9d(=%zs_y%c@vwtn#vz6ob"
TIME_ZONE = 'America/Chicago'
# Seafile URLs
FILE_SERVER_ROOT = 'https://fileserver.rishighan.com/seafhttp'
CSRF_TRUSTED_ORIGINS = ['https://fileserver.rishighan.com']
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SeaDoc
DOC_PREVIEW_SERVER = 'https://fileserver.rishighan.com/sdoc-server'
# Notifications
NOTIFICATION_SERVER_URL = 'https://notification.rishighan.com'
ENABLE_NOTIFICATIONS = True
# Metadata Server (Extended Properties)
ENABLE_METADATA_MANAGEMENT = True
METADATA_SERVER_URL = 'http://seafile-md-server:8084'
# OnlyOffice
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = True
ONLYOFFICE_APIJS_URL = 'https://office.rishighan.com/web-apps/apps/api/documents/api.js'
ONLYOFFICE_JWT_SECRET = 'secret123'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods', 'csv')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')
ONLYOFFICE_FORCE_SAVE = True
OFFICE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024

7
stacks/seafile/stack.env Normal file
View File

@@ -0,0 +1,7 @@
MYSQL_ROOT_PASSWORD=dexter
SEAFILE_MYSQL_DB_PASSWORD=dexter
SEAFILE_SERVER_HOSTNAME=fileserver.rishighan.com
JWT_PRIVATE_KEY=Qo4s8XissWnJx6gIORcggOaU69ObAa3W84jC05yv
NOTIFICATION_SERVER_URL=https://notification.rishighan.com
S3_KEY_ID=AKIAQP5UUFQPMDXWPW4O
S3_SECRET_KEY=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