{"id":81,"date":"2019-06-25T20:25:51","date_gmt":"2019-06-25T20:25:51","guid":{"rendered":"https:\/\/online.osba.nl\/blog\/?p=81"},"modified":"2019-06-25T20:43:22","modified_gmt":"2019-06-25T20:43:22","slug":"fediverse-with-nextcloud-on-yunohost-part-ii-2","status":"publish","type":"post","link":"https:\/\/blog.osba.nl\/en\/2019\/06\/25\/fediverse-with-nextcloud-on-yunohost-part-ii-2\/","title":{"rendered":"Fediverse with Nextcloud\/nginX on Yunohost deel II"},"content":{"rendered":"\n<p>The result of <a href=\"https:\/\/online.osba.nl\/blog\/2019\/03\/17\/fediverse-with-nextcloud-on-yunohost-cloud-id-localhost\/\">part I <\/a>was being able to find users on the same system. Nice, but not the goal. Over the past weeks I spent some evenings glancing over the problem, hoping to read a post with a nice oneliner as a solution. No such luck.    <\/p>\n\n\n\n<p>Today I spent more time than I hoped, but did find part of the solution. The result is now that the webfinger testtool returns a result:<\/p>\n\n\n\n<p><a href=\"https:\/\/webfinger.net\/lookup\/?resource=wbk%40online.osba.nl\">https:\/\/webfinger.net\/lookup\/?resource=wbk%40online.osba.nl<\/a><\/p>\n\n\n\n<p>returns<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Request log\n\n18:20:13 Looking up WebFinger data for acct:wbk@online.osba.nl\n18:20:13 GET https:\/\/online.osba.nl\/.well-known\/webfinger?resource=acct%3Awbk%40online.osba.nl\n\nJSON Resource Descriptor (JRD)\n\n{\n  \"subject\": \"acct:wbk@online.osba.nl\",\n  \"links\": [\n    {\n      \"rel\": \"self\",\n      \"type\": \"application\/activity+json\",\n      \"href\": \"http:\/\/online.osba.nl\/nextcloud\/nextcloud\/index.php\/apps\/social\/@wbk\"\n    },\n    {\n      \"rel\": \"http:\/\/ostatus.org\/schema\/1.0\/subscribe\"\n    }\n  ]\n}<\/pre>\n\n\n\n<p>It used to return an error, 404, not found. <\/p>\n\n\n\n<p>More details are at the <a href=\"https:\/\/forum.yunohost.org\/t\/rewrites-to-well-known-get-redirected-to-sso-portal-nextcloud-social\/8182\">Yunohost forum<\/a>, but the important bit is the configuration and where to put it. The config file is the Nginx-configuration at <\/p>\n\n\n\n<p><code>  \/etc\/nginx\/conf.d\/online.osba.nl.conf<\/code><\/p>\n\n\n\n<p>There are two servers defined, one on port 80 and one on port 443. The first one had a preconfigured redirect, while there was none in the secure section. That was strange, but it didn&#8217;t raise any alarms with me. It turns out that the redirect has to be available over TSL as well, and that it has to be a combined redirect\/rewrite. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Redirect, because it is forwarded from .well-known\/webfinger to <a rel=\"noreferrer noopener\" href=\"https:\/\/online.osba.nl\/nextcloud\/public.php?service=webfinger&amp;resource=acct%3Awbk%40online.osba.nl\" target=\"_blank\">nextcloud\/public.php?service=webfinger<\/a>. <\/li><li>Rewrite, because it is to be rewritten from webfinger?resource=acct%3Awbk%40online.osba.nl to <a rel=\"noreferrer noopener\" href=\"https:\/\/online.osba.nl\/nextcloud\/public.php?service=webfinger&amp;resource=acct%3Awbk%40online.osba.nl\" target=\"_blank\">public.php?service=webfinger&amp;resource=acct%3Awbk%40online.osba.nl<\/a> .<\/li><\/ul>\n\n\n\n<p>The combined stanza looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location = \/.well-known\/webfinger {\n  rewrite ^ https:\/\/online.osba.nl\/nextcloud\/public.php?service=webfinger&amp;$1 last; # $1 will use the first parameter (?resource=\u2026)\n}<\/code><\/pre>\n\n\n\n<p>Put this bit between the include-stanza&#8217;s and the log-definitions. <\/p>\n\n\n\n<p>Even though the test at webfinger.org succeeds, I have no such succes when contacting this Nextcloud from a Nextcloud on another Yunohost. <\/p>\n\n\n\n<p>To be continued&#8230;<\/p>\n<p class=\"wpf_wrapper\"><a class=\"print_link\" href=\"\" target=\"_blank\">Print this entry<\/a><\/p><!-- .wpf_wrapper -->","protected":false},"excerpt":{"rendered":"<p>The result of part I was being able to find users on the same system. Nice, but not the goal. Over the past weeks I spent some evenings glancing over the problem, hoping to read a post with a nice oneliner as a solution. No such luck. Today I spent more time than I hoped, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.osba.nl\/en\/2019\/06\/25\/fediverse-with-nextcloud-on-yunohost-part-ii-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fediverse with Nextcloud\/nginX on Yunohost deel II&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"61","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[2,3,4],"tags":[],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-nextcloud","category-social","category-yunohost","en-US"],"_links":{"self":[{"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":3,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/posts\/81\/revisions\/85"}],"wp:attachment":[{"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.osba.nl\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}