FAQ for developers: Difference between revisions

From diaspora* project wiki
No edit summary
 
(35 intermediate revisions by 15 users not shown)
Line 1: Line 1:
We've started adding questions that we see a lot to this page, but it doesn't cover everything.
We've started adding questions that we see a lot to this page, but it doesn't cover everything.
If you have other questions, the best way to get an answer quickly is to visit us in IRC.  
If you have other questions, the best way to get an answer quickly is to visit us in IRC (Internet Relay Chat).  
You might think, "IRC? For real? Is this 1994 again?"
IRC is a large decentralized chat network that predates the World Wide Web. The bulk of the first wave of open source software (read: Linux) was developed using IRC as a communication channel. This continues to be the case today.


Yes. I mean, '''no!''' Just think of IRC as the open-source equivalent of a Campfire that developers sit around. ''Links to IRC channels and mailing lists are at the bottom of this page.''
If you are new to open source development, IRC works like subscription services such as Campfire and Slack, which are like fancy front ends for IRC. ''Links to IRC channels and mailing lists are at the bottom of this page.''


== How do I get the latest source? ==
== How do I get the latest source? ==
Line 13: Line 13:
Install any updates to gems:
Install any updates to gems:


     bundle install
     bin/bundle install --full-index
 
   


== How do I reset the database to a totally clean state? ==
== How do I reset the database to a totally clean state? ==


 
     bin/rake db:drop db:create db:migrate
     rake db:drop
    rake db:create
    rake db:schema:load
 


== How do I get debug information? ==
== How do I get debug information? ==
Line 31: Line 25:
     tail -f log/development.log
     tail -f log/development.log


to watch the log in development mode.  
to watch the log in development mode.
 
== How do I add services for a user? ==
 
First enable the services in <tt>config/diaspora.yml</tt>. Then use the rails console:
 
    bin/rails c
    irb(main):001:0> User.where(username: "YOURUSERNAME").first.services << Service.initialize_from_omniauth({"provider" => "SERVICETOENABLE", "uid" => 2, "info" => {"nickname" => "NICKNAME"}, "credentials" => {"token" => "token", "secret" => "not_so_much"}})


where <tt>YOURUSERNAME</tt> is your diaspora* username (not the complete handle), <tt>SERVICETOENABLE</tt> is <tt>facebook</tt>, <tt>tumblr</tt>, <tt>twitter</tt> or <tt>wordpress</tt> and <tt>NICKNAME</tt> is a nickname you want to have for that service.


== I have found an issue with federation, how can I debug it? ==
== I have found an issue with federation, how can I debug it? ==


We actually provide a special configuration for testing server-to-server communication, which produces logs that contain only the events around federation. It involves spinning up two Diaspora* instances which you can use to recreate realistic circumstances and the logs of both sides are recorded into a single file.   
We actually provide a special configuration for testing server-to-server communication, which produces logs that contain only the events around federation. It involves spinning up two Diaspora* instances which you can use to recreate realistic circumstances and the logs of both sides are recorded into a single file.   
See [[/Developers/Federation Logger | Federation Logger]]
See [[Federation_Logger | Federation Logger]]
 
== What tools will I need to do development? ==
 
You can write Ruby, JavaScript and template/styling markup with any editor, just use your favourite one that works best for you.
 
For developers who have contributed to a diaspora* project owned repository with at least two successfully merged pull requests, you can request an open source project license for [https://www.jetbrains.com/ruby/index.html RubyMine] courtesy of ''JetBrains''. [mailto:team@diasporafoundation.org Send your request] for the license key - make sure to include details so that your contributions can be verified from commits. The license is valid for a year at a time.
 
If you use RubyMine, make sure to install the ''RuboCop'' plugin which will help you a lot to get the code styling right before pushing as a pull request.
 
If your are using Emacs, you can install [https://github.com/bbatsov/rubocop-emacs rubocop-mode] and [https://github.com/flycheck/flycheck flycheck] for the same functionality.
 
== Styleguides ==
 
Please keep in mind that the codebase hasn't been ported to the new style guide.
So if you touch some older code while contributing, please make sure to bring it in check
with our style guides.


You can find out more about the style guides [[Styleguide|here]] and [https://discourse.diasporafoundation.org/t/styleguides/467 on Discourse].


== What if my question isn't answered here? ==
== What if my question isn't answered here? ==


'''Wiki'''
Check other wiki pages in [[:Category:Developers]], particularly those listed on the [[Main Page]] under ''Developers''.


'''IRC Channels'''
'''IRC Channel'''


IRC is the best way to get an answer quickly. Click the link to the join the channel in a new  
IRC is the best way to get an answer quickly. Click the link to the join the channel in a new  
browser window. You can also download and use an IRC client such as  
browser window. You can also download and use an IRC client such as  
<a href="http://colloquy.info/" target="_blank">Colloquy</a> for OS X, [XChat](http://xchat.org/) for GNU/Linux or  
[http://colloquy.info/ Colloquy] for OS X, [http://xchat.org/ XChat] for GNU/Linux or  
<a href="http://www.mirc.com/" target="_blank">mIRC</a> for Windows.
[http://www.mirc.com/ mIRC] for Windows.
 
Join us at [https://web.libera.chat/?channel=#diaspora #diaspora on irc.libera.chat].
 
'''Discourse'''


* <a href="http://webchat.freenode.net/?channels=diaspora" target="_blank">#diaspora on irc.freenode.net</a> - general discussion and help for folks installing Diaspora
We have a [https://discourse.diasporafoundation.org/ Discourse instance]. It has a slightly different audience than the IRC channels,
* <a href="http://webchat.freenode.net/?channels=diaspora-dev" target="_blank">#diaspora-dev on irc.freenode.net</a> - discussion of the source code and help for new developer contributors
so if you can't get your question answered in IRC, you can try here. There is a [https://discourse.diasporafoundation.org/c/support/developer-support developer support category].
* <a href="http://webchat.freenode.net/?channels=diaspora-de" target="_blank">#diaspora-de on irc.freenode.net</a> - discussion in German.


'''Mailing lists'''
== FAQ for web developers ==


We have two mailing lists, both Google groups. They tend to have a slightly different audience than
If you're developing an external web site, and would like to know about adding diaspora related features to your site, you might want to look at the [[FAQ for web developers]].
the IRC channels, so if you can't get your question answered in IRC, you can try here.


* [Discussion list](http://groups.google.com/group/diaspora-discuss) - Google group for discussion of non-technical topics
[[Category:Developers]]
* [Development discussion list](http://groups.google.com/group/diaspora-dev) - Google group for discussion of installation, source code, and other technical topics
[[Category:Github transfer done]]

Latest revision as of 16:28, 27 May 2021

We've started adding questions that we see a lot to this page, but it doesn't cover everything. If you have other questions, the best way to get an answer quickly is to visit us in IRC (Internet Relay Chat). IRC is a large decentralized chat network that predates the World Wide Web. The bulk of the first wave of open source software (read: Linux) was developed using IRC as a communication channel. This continues to be the case today.

If you are new to open source development, IRC works like subscription services such as Campfire and Slack, which are like fancy front ends for IRC. Links to IRC channels and mailing lists are at the bottom of this page.

How do I get the latest source?

Pull the latest from github.

   git pull

Install any updates to gems:

   bin/bundle install --full-index

How do I reset the database to a totally clean state?

   bin/rake db:drop db:create db:migrate

How do I get debug information?

You can use the command

   tail -f log/development.log

to watch the log in development mode.

How do I add services for a user?

First enable the services in config/diaspora.yml. Then use the rails console:

   bin/rails c
   irb(main):001:0> User.where(username: "YOURUSERNAME").first.services << Service.initialize_from_omniauth({"provider" => "SERVICETOENABLE", "uid" => 2, "info" => {"nickname" => "NICKNAME"}, "credentials" => {"token" => "token", "secret" => "not_so_much"}})

where YOURUSERNAME is your diaspora* username (not the complete handle), SERVICETOENABLE is facebook, tumblr, twitter or wordpress and NICKNAME is a nickname you want to have for that service.

I have found an issue with federation, how can I debug it?

We actually provide a special configuration for testing server-to-server communication, which produces logs that contain only the events around federation. It involves spinning up two Diaspora* instances which you can use to recreate realistic circumstances and the logs of both sides are recorded into a single file. See Federation Logger

What tools will I need to do development?

You can write Ruby, JavaScript and template/styling markup with any editor, just use your favourite one that works best for you.

For developers who have contributed to a diaspora* project owned repository with at least two successfully merged pull requests, you can request an open source project license for RubyMine courtesy of JetBrains. Send your request for the license key - make sure to include details so that your contributions can be verified from commits. The license is valid for a year at a time.

If you use RubyMine, make sure to install the RuboCop plugin which will help you a lot to get the code styling right before pushing as a pull request.

If your are using Emacs, you can install rubocop-mode and flycheck for the same functionality.

Styleguides

Please keep in mind that the codebase hasn't been ported to the new style guide. So if you touch some older code while contributing, please make sure to bring it in check with our style guides.

You can find out more about the style guides here and on Discourse.

What if my question isn't answered here?

Wiki

Check other wiki pages in Category:Developers, particularly those listed on the Main Page under Developers.

IRC Channel

IRC is the best way to get an answer quickly. Click the link to the join the channel in a new browser window. You can also download and use an IRC client such as Colloquy for OS X, XChat for GNU/Linux or mIRC for Windows.

Join us at #diaspora on irc.libera.chat.

Discourse

We have a Discourse instance. It has a slightly different audience than the IRC channels, so if you can't get your question answered in IRC, you can try here. There is a developer support category.

FAQ for web developers

If you're developing an external web site, and would like to know about adding diaspora related features to your site, you might want to look at the FAQ for web developers.