|
|
(4 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| 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.
| | #REDIRECT [[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:
| |
| <<: *common
| |
| database: diaspora_integration1
| |
| integration2:
| |
| <<: *common
| |
| database: diaspora_integration2</pre>
| |
| ==== config/application.yml ====
| |
| | |
| <pre class="yaml">integration1:
| |
| <<: *defaults
| |
| pod_url: "http://localhost:3001/"
| |
| serve_static_assets: true
| |
| | |
| integration2:
| |
| <<: *defaults
| |
| pod_url: "http://localhost:3002/"
| |
| 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-use-IRC|IRC]] or post on our [[How-to-use-the-Mailing-Lists|mailing list]].
| |
| | |
| [[Category:Developers]]
| |
| [[Category:Federation]]
| |