Integrate Owncloud or Seafile?



  • @alec said:

    I never installed Seafile server, but connecting to seacloud.cc service works for me. Hmm... $config['fileapi_seafile_host'] = 'http://localhost'; does not look correct to me. Also, you have the debug option, use it.

    The SeaFile server is running on the same host. If I am not missing something then http://localhost should be a valid value for $config['fileapi_seafile_host'].

    May I ask you to provide me with the (analogous) values that you entered into the ADD STORAGE form? I want to be sure that I am at least not stupidly entering the wrong values.


  • Kolabian

    Maybe the option name is misleading, but Chwala connects to SeaFile server over HTTP API, so it has to be real location. From the source code I see that http:// prefix there is not valid. So, in your case it might be 'example.org:8000'. Note that https:// prefix will be added automatically.



  • @alec said:

    Maybe the option name is misleading, but Chwala connects to SeaFile server over HTTP API, so it has to be real location. From the source code I see that http:// prefix there is not valid. So, in your case it might be 'example.org:8000'. Note that https:// prefix will be added automatically.

    I changed $config['fileapi_seafile_host'] to the value you suggested and tried to add the storage using the following values:

    /var/log/chwala/errors:

    [23-Feb-2016 11:32:19,348700 +0100]: <0pdhvmda> PHP Error: Curl error: I/O operation timed out in /usr/share/pear/HTTP/Request2/Adapter/Curl.php on line 149 (POST /chwala//api/?method=folder_create)
    

    The response of this POST is:

    {
        reason:"Unable to authenticate user",
        status:"ERROR",
        code:580
    }
    

    Any ideas?


  • Kolabian

    Enable seafile conversation debugging and check Chwala logs to see what's going on. Check SeaFile error log.



  • I was not sure what you were meaning by telling me to

    Enable seafile conversation debugging

    so I tried to understand what Chwala was doing when told to add the storage. In /var/log/chwala/console I found the following POST which I could not successfully replicate:

    [23-Feb-2016 12:04:13,311100 +0100]: <0pdhvmda> SeaFile POST: https://example:8000/api2/auth-token/, POST: {"username":"john.doe@example.org","password":"*"}
    

    In fact since I had not configured SSL anywhere, I was quite surprised to find https:// in the URI and therefore replaced it. The resulting request (curl -d 'username=john.doe@example.org&password=<password>' 'http://example.org:8000/api2/auth-token/') succeeded and returned

    {"token": "720fb3ad95cf29137a774a905152517912385661"}
    

    which looked promising to me. You told me to

    Note that https:// prefix will be added automatically.

    but Is there a possibility to use http:// instead? I want to successfully configure the whole system before securing it in order to be able to distinguish which problems are related to SSL and which of them are not.


  • Kolabian

    This is hardcoded here https://git.kolab.org/diffusion/C/browse/master/lib/drivers/seafile/seafile_api.php;1bb096e2a2fa64e63746f23df5326cfc52b59f3c$86 I suppose we could modify the code to accept the protocol prefix in host option. For now you can just change the code.



  • That would be awesome! ;-)


  • Kolabian



  • Your changes seem to be correct, however $config['host'] is modified elsewhere and reaches your code without the http://. The URI therefore gets prepended the unwanted https://.


Log in to reply