Seafile: разверни свой аналог облачного диска
Содержание:
- 4.1.6 (2015/04/21)
- Seafile fileserver configuration
- Large file uploads
- Feature List
- 4.2.1 (2015/05/14)
- After Install
- Prepare Ubuntu
- Best Seafile alternative – FileCloud
- Install
- 3.1.6 (2014/09/19)
- Установка сервера.
- 2.0.0
- 1.8
- 1.7
- 1.6
- 1.5
- Support
- SeafDAV Configuration
- Deployment via SUBDOMAIN
- Заметки[править]
- Maintenance
- Pricing of Pro Edition license (annual subscription)
- Постановка задачи
4.1.6 (2015/04/21)
-
add overlay icon to show sync status at the library level
-
add an option to enable/disable explorer extension support
-
add finder sync extension (need OSX 10.10.x)
-
fix the broken hide-the-dock option in some cases
-
fix the bug that we have two title bar for some desktop environment
-
Update shibboleth support
-
Pop notifications when new versions of cached files uploaded
-
Add a save_as action
-
Improve file browser’s UI
-
Fix a rare case of login failure by using complex password, a regression from 4.1.0
-
Fix a rare case of program crash when changing accounts
-
Update avatars automatically
-
More miscellaneous fixes
Seafile fileserver configuration
The configuration of seafile fileserver is in the section of the file
Since Community Edition 6.2 and Pro Edition 6.1.9, you can set the number of worker threads to server http requests. Default value is 10, which is a good value for most use cases.
Change upload/download settings.
After a file is uploaded via the web interface, or the cloud file browser in the client, it needs to be divided into fixed size blocks and stored into storage backend. We call this procedure «indexing». By default, the file server uses 1 thread to sequentially index the file and store the blocks one by one. This is suitable for most cases. But if you’re using S3/Ceph/Swift backends, you may have more bandwidth in the storage backend for storing multiple blocks in parallel. We provide an option to define the number of concurrent threads in indexing:
When users upload files in the web interface (seahub), file server divides the file into fixed size blocks. Default blocks size for web uploaded files is 1MB. The block size can be set here.
When users upload files in the web interafece, file server assigns an token to authorize the upload operation. This token is valid for 1 hour by default. When uploading a large file via WAN, the upload time can be longer than 1 hour. You can change the token expire time to a larger value.
You can download a folder as a zip archive from seahub, but some zip software
on windows doesn’t support UTF-8, in which case you can use the «windows_encoding»
settings to solve it.
Large file uploads
Tip for uploading very large files (> 4GB): By default Nginx will buffer large request body in temp file. After the body is completely received, Nginx will send the body to the upstream server (seaf-server in our case). But it seems when file size is very large, the buffering mechanism dosen’t work well. It may stop proxying the body in the middle. So if you want to support file upload larger for 4GB, we suggest you install Nginx version >= 1.8.0 and add the following options to Nginx config file:
location /seafhttp { ... ... proxy_request_buffering off; }
If you have WebDAV enabled it is recommended to add the same:
location /seafdav { ... ... proxy_request_buffering off; }
Feature List
Category | Feature | Community Edition | Professional Edition |
---|---|---|---|
File Share/Sync | Multi-platform File Sync | ||
Mobile Clients | |||
Virtual Drive Clients | |||
Share libraries with Groups/Users | |||
Version Control | |||
Public Link | |||
Selective Sync sub-folder | |||
File locking | |||
Fine-grained folder permission | |||
Doc/PPT/Excel Online Preview | |||
User Management | Authenticate against LDAP/AD | ||
Syncing LDAP/AD Users and Groups | |||
Single Sign On with ADFS | |||
Single Sign On with Shibboleth | |||
Role based Account Management | |||
Audit & Security | Remote Wipe | ||
Two factor authentication | |||
Audit Log | |||
Antivirus Integration | |||
Platform & Integration | WebDAV/FUSE | ||
Full text file search | |||
Microsoft Office Online Server Integration | |||
Online GC | |||
Scalability/HA | |||
AWS S3/Ceph RADOS |
4.2.1 (2015/05/14)
-
Fix «Waiting for synchronization» problem
-
Fixed encoding problem in the explorer extension
-
Prefer home for seafile data dir when it is on the largest drive
-
Adopt preconfigure directory for initialization if any
-
Adopt preconfigure server addr for adding accounts if any
-
Open current repo worktree when clicking ballon message
-
Fix some memory leaks
-
Description is no longer required when creating repositories
-
Fix webview url for server version >= 4.2.0
-
redesign the event list in activity tab (pro)
-
Fix window focus when creating repository from drag and drop
-
filebrowser: fix sorting column kind for non-English users
-
network: disable weak ciphers explicitly
-
Fix a issue synced subfolders are not shown when client starts
-
Remember the used server addresses for convenience
-
Fix the ssl handshake errors with custom CA seafile servers
After Install
Before you start the server, you should update the file created during installation. See the note here. You’ll see the file in the tree listing at the end of the previous step. You need to find these lines:
# default localhost:8000bind = "127.0.0.1:8000"
Change the line to have address .
# default localhost:8000bind = "0.0.0.0:8000"
If you fail to make this change you will get “connection refused” when you try to connect remotely to the server.
Now we can start the Seafile server and verify that it works. We can also start the Seahub web interface.
$ cd seafile-server-latest$ ./seafile.sh start$ ./seahub.sh start
Next, you should connect to the Seahub server at (or the appropriate port if you changed it). You should really use a graphical browser to do this, and I did this from the Pi itself.
You should stop these in the opposite order that you start them.
$ ./seahub.sh stop$ ./seafile.sh stop
I set up a script in to automatically start everything when the machine boots, following the instructions for “For other Debian based Linux” in the GitBook chapter on starting Seafile at system bootup.
I created the file with the following content.
#!/bin/sh### BEGIN INIT INFO# Provides: seafile-server# Required-Start: $local_fs $remote_fs $network# Required-Stop: $local_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Starts Seafile Server# Description: starts Seafile Server### END INIT INFO# Change the value of "user" to your linux user nameuser=pi# Change the value of "script_path" to your path of seafile installationseafile_dir=/data/b/seafilescript_path=${seafile_dir}/seafile-server-latestseafile_init_log=${seafile_dir}/logs/seafile.init.logseahub_init_log=${seafile_dir}/logs/seahub.init.log# Change the value of fastcgi to true if fastcgi is to be usedfastcgi=false# Set the port of fastcgi, default is 8000. Change it if you need different.fastcgi_port=8000case "$1" in start) sudo -u ${user} ${script_path}/seafile.sh start >> ${seafile_init_log} if ; then sudo -u ${user} ${script_path}/seahub.sh start-fastcgi ${fastcgi_port} >> ${seahub_init_log} else sudo -u ${user} ${script_path}/seahub.sh start >> ${seahub_init_log} fi ;; restart) sudo -u ${user} ${script_path}/seafile.sh restart >> ${seafile_init_log} if ; then sudo -u ${user} ${script_path}/seahub.sh restart-fastcgi ${fastcgi_port} >> ${seahub_init_log} else sudo -u ${user} ${script_path}/seahub.sh restart >> ${seahub_init_log} fi ;; stop) sudo -u ${user} ${script_path}/seafile.sh $1 >> ${seafile_init_log} sudo -u ${user} ${script_path}/seahub.sh $1 >> ${seahub_init_log} ;; *) echo "Usage: /etc/init.d/seafile {start|stop|restart}" exit 1 ;;esac
Next, enable it as follows.
$ sudo chmod +x /etc/init.d/seafile-server$ sudo update-rc.d seafile-server defaults
Reboot. The Seafile server should be started automatically. You should be able to start a client and log in.
Seafile success!
Prepare Ubuntu
-
Update the system:
-
Create a standard user account with root privileges. As an example, we’ll call the user sfadmin:
-
Log out of your Linode’s root user account and back in as sfadmin:
-
You should now be logged into your Linode as sfadmin. Use our guide to harden SSH access.
-
Set up UFW rules. UFW is Ubuntu’s iptables controller which makes setting up firewall rules a little easier. For more info on UFW, see our guide Configure a Firewall with UFW. Set the allow rules for SSH and HTTP(S) access with:
Then check the status of your rules and list them numerically:
The output should be:
-
Set the Linode’s hostname. We’ll call it seafile as an example:
-
Add the new hostname to . The second line in the file should look like this:
- /etc/hosts
-
-
On first boot, your Linode’s timezone will be set to UTC. Changing this is optional, but if you wish, use:
Best Seafile alternative – FileCloud
Looking for a better Seafile alternative? FileCloud is the best Enterprise file sync and share platform with high performance and reliability. FileCloud can be run on windows server, supports synchronization of files with Windows client, can be hosted on premise or online. FileCloud is a better sync platform compared to Seafile and much more secure as well.
FileCloud and Seafile features
FileCloud gives you more control over your data and much more security compliant features. Just like Seafile, FileCloud also provides cross platform file sync, mobile file access via android and ios, network drive client, permission controls, file versioning, multiple security levels, backup and data recovery and much more. FileCloud provides much more control with features like full text search, federated search, ransomware protection, powerful admin, superior user interface and better customer support than Seafile as the best alternative to Seafile.
Advantages over Seafile for your Business
FileCloud offers customization to use your own logo and custom login screen. We also offer large file support and unlimited client/ partner accounts, you can run FileCloud on your own domain and have 100% control of your data. Seafile is a good file share and sync platform but, it misses on features like LDAP and Active Directory, which are provided in FileCloud with all necessary Seafile features making it the best alternative to Seafile
FileCloud workflow features
Do you require advanced workflow capabilities to power your enterprise needs? With FileCloud, you get role-based access, powerful admin reports, meta data management, control file/folder access, control user groups and assign appropriate file restrictions when needed. You can also allow remote access to existing Windows File servers preserving user NTFS permissions. Secure your data with Two-Factor authentication, encryption protocols and automatic anti-virus scanning. Also get smart notifications, file locking and design custom workflows. FileCloud gives you the power to manage and control your enterprise data smartly and efficiently.
FileCloud also has integration support with many external applications unlike Seafile and provides you with anything and everything you need as a Seafile alternative file sharing platform. Read through our happy customer stories to know why they love Filecloud
Install
Run the install script.
$ cd seafile-server_*$ ./setup-seafile.sh
The script will check the dependencies (that should have been handled in step one above). You then need to answer some questions.
- Pick a name for the server. Mine is . No particular reason.
- Specify the server’s IP address. My home network supports name resolution, so I just used the hostname of my Pi. If you use an IP address make it reserved on your DHCP server so that you get the same IP address every time.
- I used created above to store my Seafile data.
- I used the recommended port of .
At the end of this, I had the following files and folders (a few omitted here by ). Note the symbolic link to the folder containing the distribution.
$ tree -L 2.├── ccnet│ ├── GroupMgr│ ├── misc│ ├── mykey.peer│ ├── OrgMgr│ ├── PeerMgr│ └── seafile.ini├── conf│ ├── ccnet.conf│ ├── gunicorn.conf│ ├── seafdav.conf│ ├── seafile.conf│ └── seahub_settings.py├── installed│ └── seafile-server_7.0.5_stable_pi.tar.gz├── seafile-data│ ├── library-template│ └── seafile.db├── seafile-server-7.0.5│ ├── check_init_admin.py│ ├── reset-admin.sh│ ├── runtime│ ├── seaf-fsck.sh│ ├── seaf-fuse.sh│ ├── seaf-gc.sh│ ├── seafile│ ├── seafile.sh│ ├── seahub│ ├── seahub.sh│ ├── setup-seafile-mysql.py│ ├── setup-seafile-mysql.sh│ ├── setup-seafile.sh│ ├── sql│ └── upgrade├── seafile-server-latest -> seafile-server-7.0.5├── seahub-data│ └── avatars└── seahub.db
3.1.6 (2014/09/19)
-
Add option to sync MSOffice/Libreoffice template files
-
Add back choosing the «Seafile» directory when install Seafile client.
-
Add option to change the address of a server
-
Add menu item for open logs directory
-
Add option for hide dock icon
-
Show read-only icon for read-only libraries
-
Show detailed information if SSL certification is not valid
-
Do not show «Seafile was closed unexpectedly» message when turning down of Windows
-
Don’t refresh libraries/starred files when the window is not visible
-
Move local file to conflict file when syncing with existing folder
-
Add more log information when file conflicts happen
-
Fix sync error when deleting all files in a library
-
Fix not sync problem when adding a big file (>100M) and several small files together.
-
Fix Windows client doesn’t save advanced settings
Установка сервера.
Скачиваем и распаковываем последнюю версию Seafile сервера:
Переносим распакованную папку в нужное для вас место (я перенес просто в корень):
Переходим в папку и запускаем скрипт и отвечаем на вопросы установки:
В пункте «» указываем путь к папке, в которой будут храниться файловые библиотеки:
В пункте «» выбираем первый пункт:
Root пароль от MySQL это пароль от учетки root ОС.
Скрипт создаст отдельного пользователя MySQL.Базы можно создать предложенные по-умолчанию.
После успешной установки запускаем сервер и создаем пароль первого пользователя с правами администратора:
Служба :
Создаем файл:
Помещаем в файл:
Служба :
Создаем файл:
Помещаем в файл:
Активируем автозапускаемые службы:
Настройка Nginx.
Добавляем в файл:
Удаляем настройку по-умолчанию и активируем созданную конфигурацию сайта:
Перезагружаем сервер и подключаемся к нему через WEB-браузер по указанному в конфигурации Nginx адресу, авторизуясь учетной записью администратора. Переходим в управление системой — настройки и изменяем следующие параметры:
Перезапускаем сервер.
2.0.0
1.8
1.8.1
Fix a bug in indexing files
1.8.0
-
Skip chunking error
-
Improve local web interface
-
Remove link to official Seafile server
-
Ignore all temporary files created by Microsoft Office
-
Add French and Slovak translation
1.7
1.7.3
Fix a small syncing bug.
1.7.2
Fix a bug in un-syncing library. https://github.com/haiwen/seafile/issues/270
1.7.1
Fix selecting of Seafile directory
1.7.0
-
Enable selecting of Seafile directory
-
Enable setting of upload/download speed
-
Use encrypted transfer by default
-
Support ignore certain files by seafile-ignore.txt
1.6
1.6.2
Fix a bug in supporting directory names with accents
1.6.1
-
Prevent running of multiple seaf-daemon instance
-
Improve the efficiency of start-up GC for libraries in merge stage
-
Handle case-conflict files by renaming
1.6.0
-
Support symbolic links
-
clean logs
-
Do not re-download file blocks when restart Seafile during file syncing
-
Fix treating files as deleted when failed to create it due to reasons like disk full.
-
Fix several bugs when shutdown Seafile during some syncing operation.
1.5
1.5.3
-
Log the version of seafile client when start-up.
-
Fix a bug when simultaneously creating an empty folder with same name in server and client.
-
Always use IPv4 address to connect a server.
1.5.2
Fix a memory-access bug when showing «Auto merge by seafile system» in bubble
1.5.1
-
Fix a bug in initializing the config dir.
-
Improve the robustness of DNS looking-up.
Use standard DNS looking-up instead of libevent’s non-blocking version.
1.5.0
-
Add Seaf-cli
-
Check the correctness of password in the beginning of downloading a encrypted library.
-
Show detailed information in bubble
-
Enable change the server’s address in the client
-
Do not popup the browser when start up
-
Remove seafile-web.log
Support
We have two service levels: critical and non-critical. Critical issues and non-critical will be handled differently.
Phone, screen shares and conference calls are included in paid support plan.
Item | Critical | Non-Critical | Price/Year | Screen Shares | |
---|---|---|---|---|---|
Basic | — | — | — | ||
8/5 | 4 business hours | 1 business day | 2500$ | ||
12/5 | 4 business hours | 1 business day | 6000$ | ||
24/7 | 4 business hours | 1 business day | 20000$ |
If you don’t need a yearly prepaid support plan, we offer screen share and remote login support at 120 USD/hour. The support will be done by our core developers. For emergent issue, we can also work in out-of-office hours at 180 USD/hour.
If you need a local support, you can contact our partners.
SeafDAV Configuration
The configuration file is . If it is not created already, you can just create the file.
Every time the configuration is modified, you need to restart seafile server and nginx to make it take effect.
Your WebDAV client would visit the Seafile WebDAV server at
In the above config, the value of »’share_name»’ is changed to »’/seafdav»’, which is the address suffix you assign to seafdav server.
Add the following lines to your nginx seafile config file.
By default Nginx will buffer large request body in temp file. After the body is completely received, Nginx will send the body to the upstream server (seafdav in our case).
But it seems when file size is very large, the buffering mechanism dosen’t work well. It may stop proxying the body in the middle. So if you want to support file upload
larger for 4GB, we suggest you install Nginx version >= 1.8.0 and add to Nginx configuration.
Deployment via SUBDOMAIN
URL example: https://onlyoffice.domain.com
- Subdomain
- DNS record for subdomain
- SSL certificate (LE works also)
For a quick and easy installation, we suggest you use ONLYOFFICE/Docker-DocumentServer for a subdomain installation. Just follow the guide in the OnlyOffice documentation.
Test that DocumentServer is running via SUBDOMAIN
After the installation process is finished, visit this page to make sure you have deployed OnlyOffice successfully: , you will get Document Server is running info at this page.
Configure Seafile Server for SUBDOMAIN
Add the following config option to .
Then restart Seahub
When you click on a document you should see the new preview page.
Заметки[править]
Рекомендованная схема настройки:
https://seafile.example.com/ -> 127.0.0.1:8000 https://seafile.example.com/webdav -> 127.0.0.1:8082 https://seafile.example.com/seafhttp -> 127.0.0.1:8080
(предложена в пакете seafile-nginx)
Мобильные клиенты будут подключаться только по одному порту (80 или 443).
Старые клиенты для компьютера будут также использовать порты 12001 (seaf-server) и 10001 (ccnet) для синхронизации.
fuse работает только в read-only и не поддерживает шифрованные библиотеки.
webdav не поддерживает шифрованные библиотеки.
conf/seafdav.conf: enabled = true port = 8080 fastcgi = true share_name = /webdav seahub_settings.py # do not use separate 8002 port FILE_SERVER_ROOT = 'https://stog.etersoft.ru/seafhttp'
Чтобы webdav работал с русскими библиотеками, пришлось добавить в код:
class WsgiDAVApp(object): ... reload(sys) sys.setdefaultencoding("UTF-8");
В /etc/init.d надо пробросить ссылки на seafile.sh и seahub.sh для автозапуска сервисов.
Maintenance
Upgrading
First, stop each of your seafile server instances (repeat for example.org, foo.bar, etc.) as root:
# systemctl stop seafile-server@example.org
Upgrade AUR from the Arch User Repository.
Become the user the seafile server instances run as (following commands are to be executed as that user unless otherwise stated):
$ sudo -u seafile -s
Repeat the following for each seafile server instance:
- Change directory to the server instance’s ‘seafile-server’ subdirectory:
$ cd /srv/seafile/example.org/seafile-server
$ seahub-preupgrade
- Run the appropriate seafile/seahub upgrade script from the upgrade subdirectory:
-
- For a minor upgrade (x.y.a to x.y.b with a < b):
$ ./upgrade/minor-upgrade.sh
-
- For a major upgrade (x.y.a to z.w.b with x < z || y < w):
$ ./upgrade/upgrade_x.y_z.w.sh
- Repeat the steps for language mentioned in the installation guide
Lastly, start each of your seafile server instances again (repeat for example.org, foo.bar, etc.) as root:
# systemctl start seafile-server@example.org
Running Seafile GC
To release storage space held by unused blocks, you will want to run Seafile’s garbage collector.
Specifically, the GC program will remove:
- blocks belonging to nonexistent libraries
- out-dated blocks based on that library’s history length limits
First, make sure to shutdown the Seafile program on your server. For Professional Edition v.3.1.11 on, online GC operation is supported.
Now, to see how much garbage will be collected before making changes:
$ seafserv-gc -c /srv/seafile/example.org/ccnet -d /srv/seafile/example.org/seafile-data --dry-run
If the output looks okay, proceed to run the same command without the —dry-run argument.
Pricing of Pro Edition license (annual subscription)
Number of users | Price /Year (USD/EUR) | Price for Educational /Year (USD/EUR) |
---|---|---|
3 users | Free | Free |
9 users | $100 in Total | $100 in Total |
From 10 to 249 | $48 /User (€44) | $24 /User (€22) |
From 250 to 499 | $44 /User (€40) | $22 /User (€20) |
From 500 to 749 | $40 /User (€35) | $18 /User (€16) |
From 750 to 999 | $35 /User (€30) | $16 /User (€14) |
1000+ | Contact us | Contact us |
Note: $100 in total for 9 users is a special offer for small businesses. We also give 25% discount to public institutions.
Examples of the price calucation: if you have 15 users, the price is $48 * 15 = $720/year. If you have 250 users, the price is $44 * 250 = $11000/year.
Постановка задачи
Итак, нам нужен собственный сервис хранения данных в стиле Dropbox. Он должен работать под управлением Linux, иметь клиенты для всех популярных ОС, включая мобильные, обладать веб-интерфейсом, поддерживать версионность файлов и шифрование на стороне клиента. Также неплохо бы иметь поддержку многих юзеров/групп и возможность коллективной работы над файлами на тот случай, если мы захотим использовать его в корпоративной среде (а об этом мы тоже поговорим).
Порывшись в интернете и поинтересовавшись вопросом на форумах, мы заметим, что существует как минимум два проверенных временем продукта, полностью соответствующих данным требованиям. Это OwnCloud и Seafile. Оба открыты, оба построены на идеях Dropbox, оба поддерживают многих юзеров. Казалось бы, берем любой и не паримся. Однако не все так просто — между двумя проектами существенные архитектурные различия, которые делают OwnCloud далеко не лучшим выбором.
Главная проблема OwnCloud — это его требовательность к ресурсам. Сервер целиком написан на языке PHP, что делает его довольно громоздким, медлительным и жадным до ресурсов, особенно если говорить о потреблении оперативки. Seafile, в свою очередь, построен по модульному принципу, где написанное на Python веб-приложение используется исключительно для формирования веб-интерфейса и обработки запросов от клиентов, а за хранение и обмен файлами отвечают демоны, реализованные на языке си. Даже на RasPi эти компоненты создают настолько низкую нагрузку на систему, что о ней можно не задумываться (100 Мб памяти и ~5% процессора в домашней конфигурации с несколькими клиентами).
Вторая проблема — стабильность. Среди давних пользователей OwnCloud почти нет людей, кто не имел бы проблем с хранилищем. Проблемы начинаются с установки и продолжаются во время использования, а их диапазон простирается от несовместимости с базами данных до проблем с синхронизацией больших файлов. И хотя в последнее время ситуация существенно улучшилась, OwnCloud до сих пор нельзя назвать стабильным и безбажным продуктом. В противовес ему Seafile просто эталон надежности, развернуть который в целях домашнего использования может даже маленький ребенок, не поимев никаких проблем.
Кроме этого, Seafile обладает рядом черт, которых нет ни у OwnCloud, ни у других подобных решений. По своей сути Seafile не что иное, как система контроля версий Git (известна любому вменяемому программисту), оптимизированная для работы с большими бинарными файлами. Поэтому ей свойственна грамотно реализованная система версионности, которая допускает совместную работу над файлами с возможностью отследить, кто, что и когда исправил, а также возможность создания нескольких библиотек (репозиториев, в терминологии Git) с заданными настройками хранения версий. При этом каждая из библиотек может быть привязана к собственному каталогу на клиентской машине и синхронизирована независимо.
Все эти качества делают Seafile лучшим решением в области открытых Dropbox-подобных хранилищ, и именно о нем пойдет речь в следующих разделах статьи. Сразу оговорюсь, что я в курсе возможностей OwnCloud насчет совместного редактирования документов, онлайн-просмотра видео, интеграции с KDE и вкусностей веб-интерфейса, но эта статья посвящена хранению файлов, для коллективной работы есть множество других открытых и не очень инструментов помимо OwnCloud.