Federation logger: Difference between revisions

From diaspora* project wiki
m (MrZYX moved page Federation Logger to Federation logger: naming policy)
(Redirected page to Federation)
 
Line 1: Line 1:
{{Out of date}}
#REDIRECT [[Federation]]
 
The Federation logger is a tool that outputs the high-level federation events (like sending a status message or photos) to be able to see, what is going on “behind the scenes”. So, if you have a test environment for Diasproa set up, you can help us test and improve federation.
 
There is also a [screencast], if you prefer to listen instead of reading ;)
 
== Preparation ==
 
(All commands assume you are running them in the diaspora root directory.)
 
To get the federation test environment set up, you have to copy the blocks containing the configuration in <tt>config/database.yml.example</tt> and <tt>config/application.yml.example</tt> to your actual config files in <tt>config/database.yml</tt> and <tt>config/application.yml</tt>. Just paste the snippets at the bottom of the corresponding file.
 
==== config/database.yml ====
 
<pre class="yaml">integration1:
  &lt;&lt;: *common
  database: diaspora_integration1
integration2:
  &lt;&lt;: *common
  database: diaspora_integration2</pre>
==== config/application.yml ====
 
<pre class="yaml">integration1:
  &lt;&lt;: *defaults
  pod_url: &quot;http://localhost:3001/&quot;
  serve_static_assets: true
 
integration2:
  &lt;&lt;: *defaults
  pod_url: &quot;http://localhost:3002/&quot;
  serve_static_assets: true</pre>
Next, you have to run a rake command, that will set up the two databases and prepare the tables. (This will take a while…)
 
<pre>$ bundle exec rake db:integration:prepare</pre>
When that is done, you have to delete the <tt>public/.well-known</tt> directory (if it exists), because you will be running two servers from the same code base and this directory contains cached data that would normally contain the hostname of the server which is important for server-to-server user discovery, but in this case it has to go.
 
<pre>$ rm -rI public/.well-known</pre>
 
== Starting ==
 
Now, we’re going to start the servers. By running the following command you should see two redis servers, two workers and two application servers spinning up for the federation test environment. (Again, this will take some time and a lot of RAM…)
 
<pre>$ bundle exec foreman start -f FederationProcfile</pre>
After everything has started up, you can open two browsers (yes, either two different ones, or two windows of the same, with one in the ‘incognito’ mode. That’s because you need two different sessions…), and open them on <tt>http://localhost:3001/</tt> and <tt>http://localhost:3002/</tt> and register a new user on each of them … you will have to remember which user is on which server. When that is done, you can search the user from one server with the user on the other server and connect them by adding them to each others aspects.
 
This alone should have already triggered our federation logger. You can check it out by looking at the logfile.
 
<pre>$ tail -f log/federation_logger.log</pre>
== Party ==
 
That’s it. You should now be able to log federation events and - if something goes wrong - provide log files from both ends for superior debugging.
 
Althoug we’re now able to do some basic logging of events between servers, this is not by far a complete tool that does everything. You are very welcome to improve upon the setup process or the behaviour by submitting [[Pull_Request_Guidelines|pull requests]].
 
And as always, if anything goes wrong or you need help, join us on [[How_We_Communicate#IRC|IRC]] or post on our [[How_We_Communicate#Mailing_Lists|mailing list]].
 
[[Category:Developers]]
[[Category:Federation]]
[[Category:Github transfer done]]

Latest revision as of 01:57, 16 August 2017

Redirect to: