{"action":"created","comment":{"url":"https://api.github.com/repos/tootsuite/documentation/pulls/comments/113042540","pull_request_review_id":34402517,"id":113042540,"diff_hunk":"@@ -0,0 +1,85 @@\n+Using a different domain name for Mastodon and the users it serves\n+==================================================================\n+\n+Mastodon users are primarily identified by a `user@example.org` handle, and you might want\n+this identifier to be the same as your email or jabber account, for instance.\n+However, in this case, you are almost certainly serving some web content on https://example.org already,\n+and you might want to use another domain (say `social.example.org`) for Mastodon itself.\n+\n+Luckily, there is support in Mastodon for that, but it might be tricky to set up, and any error\n+might *prevent you from federating with other instances*.\n+\n+This guide attempts to explain the different mechanisms involved in such a setup, walk you through the configuration,\n+and warn you about possible federation issues. It also assumes you have already read the [Production guide](Production-guide.md).\n+\n+## Account identifiers\n+\n+It is important to understand that for federation purposes, a user in Mastodon has two unique identifiers associated:\n+- A webfinger `acct:` URI, used for discovery and as a verifiable global name for the user across Mastodon instances.\n+  In our example, our account's `acct:` URI is `user@example.org`\n+- An author/actor URI, used in every other aspect of federation. This is the way in which users are identified in\n+  OStatus, the underlying protocol used for federation with other Mastodon instances.\n+  In our case, it is `https://social.example.org/users/user`.\n+  It is not strictly required to be an URL, but they are in Mastodon's case to ease discovery of unknown remote accounts.\n+\n+Both account identifiers are unique and required for Mastodon.\n+*An important risk if you set up your Mastodon instance incorrectly is to create two users (with different `acct:` URIs) with conflicting author/actor URIs*.\n+\n+## Webfinger\n+\n+As said earlier, each Mastodon user has an `acct:` URI, which is used for discovery and authentication.\n+When you add `@user@example.org`, a webfinger query is performed. This is done in two steps:\n+1. Querying `https://example.org/.well-known/host-meta` (where the domain of the URL matches the domain part of the `acct:` URI)\n+   to get information on how to perform the query.\n+   This file will indeed contain a URL template of the form `https://somedomain.org/.well-known/webfinger?resource={uri}` that\n+   will be used in the second step.\n+2. Fill the returned template with the `acct:` URI to be queried and perform the query:\n+   `https://somedomain.org/.well-known/webfinger?resource=acct:user@example.org`\n+\n+## Configuring your Mastodon instance\n+\n+*DO NOT ATTEMPT TO CONFIGURE YOUR INSTANCE THIS WAY IF YOU DID NOT UNDERSTAND THE ABOVE*\n+\n+Also, make sure to check the known issues below.\n+\n+### Configuring Mastodon itself\n+\n+Mastodon has a two configuration variables in `.env.production` to enable using different domains for your users and Mastodon itself.\n+Those two variables are `LOCAL_DOMAIN` and `WEB_DOMAIN`. When the latter is not set, it defaults to the value of\n+`LOCAL_DOMAIN`.\n+\n+*Be extra careful when configuring your Mastodon instance, as changing `LOCAL_DOMAIN` without changing `WEB_DOMAIN`\n+may cause remote instances to register different accounts with the same author/actor URI, which will result in federation issues!*\n+\n+- `LOCAL_DOMAIN` is the domain for which your Mastodon instance has authority, it is the domain used in the `acct:` URI.\n+  In our example, `LOCAL_DOMAIN` would be set to `example.org`.\n+- `WEB_DOMAIN` is the domain used for any URL generated for your instance, including the author/actor URIs.\n+  In our case, that would be `social.example.org`.\n+\n+### Configuring domain.org\n+\n+Now, you have Mastodon running at `https://social.example.org` as well as a website at `https://example.org`.\n+If you recall how webfinger queries work, the first step is to query `https://example.org/.well-known/host-meta`,\n+which will contain an URL template.\n+\n+Therefore, the easiest way to configure domain.org is to redirect `/.well-known/host-meta` to social.example.org.\n+\n+With nginx, it would be as simple as adding:\n+\n+```nginx\n+location /.well-known/host-meta {\n+       return 301 https://social.example.org/.well-known/host-meta;","path":"Running-Mastodon/Serving_a_different_domain.md","position":71,"original_position":71,"commit_id":"2d3fbb83728fa759a68ca8da24bd754dd4e1574b","original_commit_id":"2d3fbb83728fa759a68ca8da24bd754dd4e1574b","user":{"login":"ThibG","id":384364,"avatar_url":"https://avatars1.githubusercontent.com/u/384364?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibG","html_url":"https://github.com/ThibG","followers_url":"https://api.github.com/users/ThibG/followers","following_url":"https://api.github.com/users/ThibG/following{/other_user}","gists_url":"https://api.github.com/users/ThibG/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibG/subscriptions","organizations_url":"https://api.github.com/users/ThibG/orgs","repos_url":"https://api.github.com/users/ThibG/repos","events_url":"https://api.github.com/users/ThibG/events{/privacy}","received_events_url":"https://api.github.com/users/ThibG/received_events","type":"User","site_admin":false},"body":"Indeed.","created_at":"2017-04-24T20:03:55Z","updated_at":"2017-04-24T20:03:55Z","html_url":"https://github.com/tootsuite/documentation/pull/149#discussion_r113042540","pull_request_url":"https://api.github.com/repos/tootsuite/documentation/pulls/149","_links":{"self":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/comments/113042540"},"html":{"href":"https://github.com/tootsuite/documentation/pull/149#discussion_r113042540"},"pull_request":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/149"}}},"pull_request":{"url":"https://api.github.com/repos/tootsuite/documentation/pulls/149","id":117338552,"html_url":"https://github.com/tootsuite/documentation/pull/149","diff_url":"https://github.com/tootsuite/documentation/pull/149.diff","patch_url":"https://github.com/tootsuite/documentation/pull/149.patch","issue_url":"https://api.github.com/repos/tootsuite/documentation/issues/149","number":149,"state":"open","locked":false,"title":"Create Serving_a_different_domain.md","user":{"login":"ThibG","id":384364,"avatar_url":"https://avatars1.githubusercontent.com/u/384364?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibG","html_url":"https://github.com/ThibG","followers_url":"https://api.github.com/users/ThibG/followers","following_url":"https://api.github.com/users/ThibG/following{/other_user}","gists_url":"https://api.github.com/users/ThibG/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibG/subscriptions","organizations_url":"https://api.github.com/users/ThibG/orgs","repos_url":"https://api.github.com/users/ThibG/repos","events_url":"https://api.github.com/users/ThibG/events{/privacy}","received_events_url":"https://api.github.com/users/ThibG/received_events","type":"User","site_admin":false},"body":"Add extensive documentation for WEB_DOMAIN, as the feature is ill-documented and may be confusing.","created_at":"2017-04-24T19:24:38Z","updated_at":"2017-04-24T20:03:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed95f1b8ab6d9b5a6b293fbca3e3ee91141b8d9e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tootsuite/documentation/pulls/149/commits","review_comments_url":"https://api.github.com/repos/tootsuite/documentation/pulls/149/comments","review_comment_url":"https://api.github.com/repos/tootsuite/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tootsuite/documentation/issues/149/comments","statuses_url":"https://api.github.com/repos/tootsuite/documentation/statuses/2d3fbb83728fa759a68ca8da24bd754dd4e1574b","head":{"label":"ThibG:patch-1","ref":"patch-1","sha":"2d3fbb83728fa759a68ca8da24bd754dd4e1574b","user":{"login":"ThibG","id":384364,"avatar_url":"https://avatars1.githubusercontent.com/u/384364?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibG","html_url":"https://github.com/ThibG","followers_url":"https://api.github.com/users/ThibG/followers","following_url":"https://api.github.com/users/ThibG/following{/other_user}","gists_url":"https://api.github.com/users/ThibG/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibG/subscriptions","organizations_url":"https://api.github.com/users/ThibG/orgs","repos_url":"https://api.github.com/users/ThibG/repos","events_url":"https://api.github.com/users/ThibG/events{/privacy}","received_events_url":"https://api.github.com/users/ThibG/received_events","type":"User","site_admin":false},"repo":{"id":89274414,"name":"documentation","full_name":"ThibG/documentation","owner":{"login":"ThibG","id":384364,"avatar_url":"https://avatars1.githubusercontent.com/u/384364?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibG","html_url":"https://github.com/ThibG","followers_url":"https://api.github.com/users/ThibG/followers","following_url":"https://api.github.com/users/ThibG/following{/other_user}","gists_url":"https://api.github.com/users/ThibG/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibG/subscriptions","organizations_url":"https://api.github.com/users/ThibG/orgs","repos_url":"https://api.github.com/users/ThibG/repos","events_url":"https://api.github.com/users/ThibG/events{/privacy}","received_events_url":"https://api.github.com/users/ThibG/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThibG/documentation","description":"Full documentation repository for Mastodon","fork":true,"url":"https://api.github.com/repos/ThibG/documentation","forks_url":"https://api.github.com/repos/ThibG/documentation/forks","keys_url":"https://api.github.com/repos/ThibG/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThibG/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThibG/documentation/teams","hooks_url":"https://api.github.com/repos/ThibG/documentation/hooks","issue_events_url":"https://api.github.com/repos/ThibG/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/ThibG/documentation/events","assignees_url":"https://api.github.com/repos/ThibG/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/ThibG/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/ThibG/documentation/tags","blobs_url":"https://api.github.com/repos/ThibG/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThibG/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThibG/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThibG/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThibG/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/ThibG/documentation/languages","stargazers_url":"https://api.github.com/repos/ThibG/documentation/stargazers","contributors_url":"https://api.github.com/repos/ThibG/documentation/contributors","subscribers_url":"https://api.github.com/repos/ThibG/documentation/subscribers","subscription_url":"https://api.github.com/repos/ThibG/documentation/subscription","commits_url":"https://api.github.com/repos/ThibG/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThibG/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThibG/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThibG/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThibG/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/ThibG/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThibG/documentation/merges","archive_url":"https://api.github.com/repos/ThibG/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThibG/documentation/downloads","issues_url":"https://api.github.com/repos/ThibG/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/ThibG/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/ThibG/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/ThibG/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThibG/documentation/labels{/name}","releases_url":"https://api.github.com/repos/ThibG/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/ThibG/documentation/deployments","created_at":"2017-04-24T18:35:42Z","updated_at":"2017-04-24T17:42:01Z","pushed_at":"2017-04-24T19:24:26Z","git_url":"git://github.com/ThibG/documentation.git","ssh_url":"git@github.com:ThibG/documentation.git","clone_url":"https://github.com/ThibG/documentation.git","svn_url":"https://github.com/ThibG/documentation","homepage":"https://github.com/tootsuite/mastodon","size":34746,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tootsuite:master","ref":"master","sha":"fe8b87e97899f9e7f6054276e3d8f4dad87997ac","user":{"login":"tootsuite","id":24979032,"avatar_url":"https://avatars0.githubusercontent.com/u/24979032?v=3","gravatar_id":"","url":"https://api.github.com/users/tootsuite","html_url":"https://github.com/tootsuite","followers_url":"https://api.github.com/users/tootsuite/followers","following_url":"https://api.github.com/users/tootsuite/following{/other_user}","gists_url":"https://api.github.com/users/tootsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/tootsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tootsuite/subscriptions","organizations_url":"https://api.github.com/users/tootsuite/orgs","repos_url":"https://api.github.com/users/tootsuite/repos","events_url":"https://api.github.com/users/tootsuite/events{/privacy}","received_events_url":"https://api.github.com/users/tootsuite/received_events","type":"Organization","site_admin":false},"repo":{"id":87725017,"name":"documentation","full_name":"tootsuite/documentation","owner":{"login":"tootsuite","id":24979032,"avatar_url":"https://avatars0.githubusercontent.com/u/24979032?v=3","gravatar_id":"","url":"https://api.github.com/users/tootsuite","html_url":"https://github.com/tootsuite","followers_url":"https://api.github.com/users/tootsuite/followers","following_url":"https://api.github.com/users/tootsuite/following{/other_user}","gists_url":"https://api.github.com/users/tootsuite/gists{/gist_id}","starred_url":"https://api.github.com/users/tootsuite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tootsuite/subscriptions","organizations_url":"https://api.github.com/users/tootsuite/orgs","repos_url":"https://api.github.com/users/tootsuite/repos","events_url":"https://api.github.com/users/tootsuite/events{/privacy}","received_events_url":"https://api.github.com/users/tootsuite/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tootsuite/documentation","description":"Full documentation repository for Mastodon","fork":false,"url":"https://api.github.com/repos/tootsuite/documentation","forks_url":"https://api.github.com/repos/tootsuite/documentation/forks","keys_url":"https://api.github.com/repos/tootsuite/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tootsuite/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tootsuite/documentation/teams","hooks_url":"https://api.github.com/repos/tootsuite/documentation/hooks","issue_events_url":"https://api.github.com/repos/tootsuite/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/tootsuite/documentation/events","assignees_url":"https://api.github.com/repos/tootsuite/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/tootsuite/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/tootsuite/documentation/tags","blobs_url":"https://api.github.com/repos/tootsuite/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tootsuite/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tootsuite/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/tootsuite/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tootsuite/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/tootsuite/documentation/languages","stargazers_url":"https://api.github.com/repos/tootsuite/documentation/stargazers","contributors_url":"https://api.github.com/repos/tootsuite/documentation/contributors","subscribers_url":"https://api.github.com/repos/tootsuite/documentation/subscribers","subscription_url":"https://api.github.com/repos/tootsuite/documentation/subscription","commits_url":"https://api.github.com/repos/tootsuite/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/tootsuite/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/tootsuite/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/tootsuite/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/tootsuite/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/tootsuite/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tootsuite/documentation/merges","archive_url":"https://api.github.com/repos/tootsuite/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tootsuite/documentation/downloads","issues_url":"https://api.github.com/repos/tootsuite/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/tootsuite/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/tootsuite/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/tootsuite/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tootsuite/documentation/labels{/name}","releases_url":"https://api.github.com/repos/tootsuite/documentation/releases{/id}","deployments_url":"https://api.github.com/repos/tootsuite/documentation/deployments","created_at":"2017-04-09T17:07:21Z","updated_at":"2017-04-24T17:42:01Z","pushed_at":"2017-04-24T19:24:39Z","git_url":"git://github.com/tootsuite/documentation.git","ssh_url":"git@github.com:tootsuite/documentation.git","clone_url":"https://github.com/tootsuite/documentation.git","svn_url":"https://github.com/tootsuite/documentation","homepage":"https://github.com/tootsuite/mastodon","size":34746,"stargazers_count":253,"watchers_count":253,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":167,"mirror_url":null,"open_issues_count":28,"forks":167,"open_issues":28,"watchers":253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/149"},"html":{"href":"https://github.com/tootsuite/documentation/pull/149"},"issue":{"href":"https://api.github.com/repos/tootsuite/documentation/issues/149"},"comments":{"href":"https://api.github.com/repos/tootsuite/documentation/issues/149/comments"},"review_comments":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/149/comments"},"review_comment":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tootsuite/documentation/pulls/149/commits"},"statuses":{"href":"https://api.github.com/repos/tootsuite/documentation/statuses/2d3fbb83728fa759a68ca8da24bd754dd4e1574b"}}}}
{"actor":{"display_login":"ThibG"}}