Page MenuHomekolab.org

Chwala - seafile driver not using cache
Open, 40Public

Description

I enabled the cache in config.inc.php Roundcubemail,

$config['fileapi_seafile_cache'] = 'db';
$config['fileapi_seafile_cache_ttl'] = '14d';

but the cache is never created in the DB.

I noticed that Roundcube requires the $_SESSION['user_id'] to be set in order to create a cache:

rcube::get_cache
...
if (!isset($this->caches[$name]) && ($userid = $this->get_user_id())) {
        $this->caches[$name] = new rcube_cache($type, $userid, $name, $ttl, $packed);
}

The seafile driver doesn't set the _SESSION['user_id'] and never gets a cache to fill / read.
However the kolab_file_storage sets the $_SESSION variables.

Do I miss something ? How can I fix this ?

Kind regards,
Arnaud

Details

Ticket Type
Task

Event Timeline

Arnaud created this task.Apr 12 2017, 10:20 AM

What is your config (only fileapi_* options)? When user logs into Chwala kolab driver is used to authenticate the user, so the user_id should be set in session.

root@xxx:/etc/roundcubemail# cat config.inc.php | grep fileapi

$config['fileapi_manticore'] = 'http://' . $_SERVER['HTTP_HOST'] . ':8080';
$config['fileapi_backend'] = 'seafile';
$config['fileapi_seafile_host'] = "https://files.xxxx.com";
$config['fileapi_seafile_ssl_verify_peer'] = false;
$config['fileapi_seafile_ssl_verify_host'] = false;
$config['fileapi_seafile_cache'] = 'db';
$config['fileapi_seafile_cache_ttl'] = '14d';
$config['fileapi_seafile_debug'] = false;

Ok. This is what the original sample config says:

// Main files source, backend driver which handles
// authentication and configuration of Chwala
// Note: Currently only 'kolab' is supported
$config['fileapi_backend'] = 'kolab';

So, this is not supported. Even if we implement this, it might be hard to use the Roundcube cache, because it requires ID of the user from users table.

ok. I followed the doc:
https://kolabsys.com/howtos/use-seafile-with-chwala.html

"Using Seafile as an exclusive storage mechanism"

Is the second part of the doc supported ?
"Using Seafile as an add-on to the existing Kolab storage"

The doc shows a few parameters:

  1. $config['fileapi_seafile_host'] = "files.example.com";

--> but the dialog box "add external storage" requires a server hostname...

  1. $config['fileapi_seafile_cache'] = '14d';

--> aren't the cache parameters more like:

$config['fileapi_seafile_cache'] = 'db' 
$config['fileapi_seafile_cache_ttl']  ='14d'