Features Not Shown In Release Notes

Some of the features not included in last couple of release notes that others might find useful.

Since version 7.0.9, you can force a full user to log in with a two factor authentication.

The prerequisite is that the administrator should ‘enable two factor authentication’ in the ‘System Admin -> Settings’ page.

Then you can add the following configuration information to the configuration file.

ENABLE_FORCE_2FA_TO_ALL_USERS = True

Add custom navigation
Since Pro 7.0.9, Seafile supports adding some custom navigation entries to the home page for quick access. This requires you to add the following configuration information to the conf/seahub_settings.py configuration file:
CUSTOM_NAV_ITEMS = [
{‘icon’: ‘sf2-icon-star’,
‘desc’: ‘Custom navigation 1’,
‘link’: ‘https://www.seafile.com
},
{‘icon’: ‘sf2-icon-wiki-view’,
‘desc’: ‘Custom navigation 2’,
‘link’: ‘https://download.seafile.com/published/seafile-manual/home.md
},
{‘icon’: ‘sf2-icon-wrench’,
‘desc’: ‘Custom navigation 3’,
‘link’: ‘http://www.example.com
},
]

Note: The icon field currently only supports icons in Seafile that begin with sf2-icon.
Then restart the seahub service to take effect.
Once you log in to the Seafile system homepage again, you will see the new navigation entry under the Tools navigation bar on the left.

Migrating large number of objects
If you have millions of objects in the storage (especially fs objects), it may take quite long time to migrate all objects. More than half of the time is spent on checking whether an object exists in the destination storage. Since Pro edition 7.0.8, a feature is added to speed-up the checking.
Before running the migration script, please set this env variable:
export OBJECT_LIST_FILE_PATH=/path/to/object/list/file

3 files will be created: /path/to/object/list/file.commit,/path/to/object/list/file.fs, /path/to/object/list/file.blocks.
When you run the script for the first time, the object list file will be filled with existing objects in the destination. Then, when you run the script for the second time, it will load the existing object list from the file, instead of querying the destination. And newly migrated objects will also be added to the file. During migration, the migration process checks whether an object exists by checking the pre-loaded object list, instead of asking the destination, which will greatly speed-up the migration process.
It’s suggested that you don’t interrupt the script during the “fetch object list” stage when you run it for the first time. Otherwise the object list in the file will be incomplete.
Another trick to speed-up the migration is to increase the number of worker threads and size of task queue in the migration script. You can modify the nworker and maxsize variables in the following code:
class ThreadPool(object):

def init(self, do_work, nworker=20):
self.do_work = do_work
self.nworker = nworker
self.task_queue = Queue.Queue(maxsize = 2000)

The number of workers can be set to relatively large values, since they’re mostly waiting for I/O operations to finished.