Owncloud well-known configuration



  • hello All,

    I am sorry but I did not quite understand how should I setup Davdroid in order to view/sync my Owncloud calendars.

    The first thing I tried is following this:
    https://davdroid.bitfire.at/configuration/owncloud/

    However, my browser the address:
    https://myip/owncloud/remote.php/caldav
    returns this error:

       This XML file does not appear to have any style information associated with it. The document tree is shown below.
      <d:error><s:sabredav-version>2.1.7</s:sabredav-version><s:exception>Sabre\DAV\Exception\NotImplemented</s:exception><s:message>There was no handler found for this "GET" method</s:message></d:error>
    

    In fact, my calendars are at a different address:
    https://myip/owncloud/index.php/apps/calendar/

    I also tried adding this line to .htaccess, but it did not work:
    Redirect /.well-known/caldav http://myip:port/owncloud/index.php/apps/calendar

    when I set Davdroid to
    https://myip:port/owncloud/index.php/apps/calendar
    I enter login info but get a "no calendars found" error.

    Can someone shed some light on this.

    Thanks in advance,

    -Gian



  • Try this as the calendar location, replace user specific information where needed. I attempted the wellknown settings a while ago, but did not get this to work. The following works for me on android with DAVdroid and in thunderbird with lightning extension.

    https://mypublicip:mynonstandardport/owncloud/remote.php/caldav/calendars/myusername/mycalendarname


  • developer

    The well-known URLs have to be configured as described in https://doc.owncloud.org/server/8.2/admin_manual/issues/index.html#service-discovery-label. Then you can use https://your-host-name without any path to create the account.



  • ok, I got it.

    I should have not ADDED the line

    Redirect /.well-known/caldav http://myip:port/owncloud/index.php/apps/calendar

    to .htaccess, but should have edited the same file adding owncloud to the lines as follows:

    RewriteRule ^.well-known/carddav /owncloud/remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /owncloud/remote.php/caldav/ [R=301,L]

    Then the correct address line is:
    https://myip:port/owncloud/remote.php/caldav

    This works for me.

    Thank you so much for your kind help.

    -Gian



  • @gian I think my attempt was not successful long ago for the same reason yours was not. I took the instructions from the server admin manual literal as you did. The DAVdroid faq and your post help get my well-know config setup correctly. I wonder why the guide is so misleading? One more thing. I thought the benefit of setting up the well-known config was so you did not have to setup contacts and calendars as two separate accounts. Am I confused or is my setup still not correct? I have to enter calendar, then contacts as two separate accounts in davdroid setup.



  • I have got the same problem. I installed owncloud in a subdirectory so my adress to owncloud is https://domain.de/owncloud
    I have already modified the two needed lines in the .htaccess file:
    RewriteRule ^.well-known/carddav /owncloud/remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /owncloud/remote.php/caldav/ [R=301,L]
    When I type the URL in a webbrowser I get redirectet. When I use Davdroid with https://domain.de/owncloud/ it says there are no calendars or contacts found.
    So I have to add a davdroid account for my calendars and an account for my contacts typing in the full adress (for calendars: https://domain.de/owncloud/remote.php/caldav and for contacts: https://domain.de/owncloud/remote.php/carddav )

    If I install owncloud in a subdomain like https://oc.domain.de and also use https://oc.domain.de in davdroid then davdroid immediately finds my calendars and contacts so I can add them with one davdroid account and thats what I want to have.

    So I guess Davdroid is looking for the false adress when using owncloud in a subdirectory.

    The rest of my rewrite rules (just to be sure):
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^.well-known/host-meta /owncloud/public.php?service=host-meta [QSA,L]
    RewriteRule ^.well-known/host-meta.json /owncloud/public.php?service=host-meta-json [QSA,L]
    RewriteRule ^.well-known/carddav /owncloud/remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /owncloud/remote.php/caldav/ [R=301,L]
    RewriteRule ^apps/calendar/caldav.php /owncloud/remote.php/caldav/ [QSA,L]
    RewriteRule ^apps/contacts/carddav.php /owncloud/remote.php/carddav/ [QSA,L]
    RewriteRule ^remote/(.) /owncloud/remote.php [QSA,L]
    RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.
    - [R=404,L]
    RewriteRule ^(.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
    </IfModule>
    Here are my records: 0_1456782402372_davdroid-debug616227045.txt

    If I get the records right, then davdroid is looking for
    [trace] --> OPTIONS https://domain.de/owncloud/ HTTP/1.1
    but shouldn't this adress rather be
    [trace] --> OPTIONS https://domain.de/owncloud/.well-known/carddav HTTP/1.1
    and
    [trace] --> OPTIONS https://domain.de/owncloud/.well-known/caldav HTTP/1.1
    because otherwise a redirect in the .htaccess redirects the query to the false adress:
    [trace] Location: https://domain.de/owncloud/index.php/apps/files/

    As a workaround I could create a .htaccess in my root with the following content:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
    RewriteRule ^.well-known/host-meta /owncloud/public.php?service=host-meta [QSA,L]
    RewriteRule ^.well-known/host-meta.json /owncloud/public.php?service=host-meta-json [QSA,L]
    RewriteRule ^.well-known/carddav /owncloud/remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /owncloud/remote.php/caldav/ [R=301,L]
    </IfModule>

    This works because davdroid tries to find the owncloud calendar and contacts in https://domain.de after it didn't find anything in https://domain.de/owncloud/


Log in to reply
 

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.