FAQ for pod maintainers

From diaspora* project wiki
Revision as of 18:58, 19 July 2013 by Jhass (talk | contribs)

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 the IRC.

Installation

Do you have a detailed installation guide?

Yes. Check it out! It will probably be more up-to-date than this page, in general. Also, feel free to look at the Installation guides page for OS-specific/service-specific help.

What ports does Diaspora need open for communication?

Since we recommend running on HTTPS you should only need to open the standard port for it: 443. You should have a reverse proxy listening there that forwards the requests to the application server that Diaspora starts, on port 3000 by default. You can use your existing Nginx or Apache to do that. While we don't recommend that, you can run on plain HTTP with its standard port 80 too. Just never let Diaspora listen on these ports directly. You don't need to open the application server port, 3000, it's for internal communication only.

Can I use Apache to run Diaspora?

Yes, Diaspora is a standard Rails application, so you can run it with Passenger. Though common setup is to use a reverse proxy configuration. You should definitively read this brief explanation of Diasporas components before attempting such a setup.

I installed Diaspora on my machine, went to http://localhost:3000 and signed up. But my friends can't add me!

You signed up with "localhost" which is not a valid external address. You first need an externally-accessible address - either a domain name or an IP address. Once you have that working, you need to clear your database (`$ bundle exec rake db:drop db:create db:schema:load`) and re-register coming in on the outside URL. Note that if your externally accessible address changes, you need to start over. Diaspora is designed as a server application running all day and night.

I get 'command not found' if I run bundle install

Make sure RVM is loaded and the correct Ruby version and gemset are activated. The output of the rvm info and gem env commands can be helpful in that. Run gem install bundler to reassure bundler is actually installed.

If you don't use RVM, a common issue is that Debian based distributions, this includes Ubuntu, don't add gem executables to the search path. Read up on the PATH environment variable on how to solve that.

How do I get past the sign in page to create a new account?

To create a new account, go to http://yourdiasporainstance.com/users/sign_up (replacing yourdiasporainstance.com with the the host name of your pod).

I installed Diaspora on my machine, but when I load the site there are no images and the layout looks horrible!

You most likely started Diaspora in production mode and accessed the application server directly and not through your reverse proxy. In production mode we expect your reverse proxy to serve the static content since it does a way better job at it than anybody else. If you did access Diaspora through a reverse proxy make sure it has no configuration issues, has the public/ directory as document root and looks up if requested files are found there before directing the request to the application server.

Also make sure you ran bundle exec rake assets:precompile.

If you need to workaround this requirement you can turn environment.assets.serve to true in config/diaspora.yml.

There are no uploaded images on my pod

First make sure other static content is working, as described in the previous question. We embed uploaded images with their full URL, this has to do with the way Diaspora makes sure your images can be seen by users on other pods. A common problem here is that environment.url in config/diaspora.yml, from which construct the full URL, is set to an incorrect value.

I can't find anybody on another pod / I am receiving posts but nobody is receiving mine

Make sure to initially search by their full Diaspora ID. Check that your Sidekiq worker is running. Check Sidekiqs retry queue for error messages. Check that the environement.certificate_authorities setting is correct.

I can't find myself from another pod / I am not receiving any posts but everybody is receiving mine

Check that your SSL setup is correct, this test gives a good indication. Make sure it's all green, no yellow, no red.

I'm getting the warning "... in production without Sidekiq workers"

Sidekiq is the backend we use for processing background jobs. Normally, Sidekiq is spawned as a separate process, but in this case you have configured Diaspora to run the jobs in the same process as the application. This is normally used for development or testing purposes, but if used in production, it can bring major performance penalties. Thus you should always run Sidekiq in its own process, by setting environment.single_process_mode to false in your config/diaspora.yml and starting the Sidekiq process with

RAILS_ENV=production bundle exec sidekiq

In case you are using script/server to start Diaspora, then you don't have to manually start the workers! This is already done by the script.

Upgrading

Out of dateOut of date:This section's accuracy may be compromised due to out-of-date information. Please help improve the page by updating it. There may be additional information on the talk page.

Is there anything I should do before upgrading my installation?

Yes, read our |note for updating.

How do I roll back my installation if an update breaks it?

First of try to get help to fix your installation, as always the IRC should be helpful here.

To roll back, just do: git checkout ref Where ref is the identifier of the commit to go back to. It's a long string of letters and numbers. You can find the ref by doing a git log, eyeballing the commit dates, and figuring out where you were before you pulled. Of course it's best if you keep track of that ref before you update.

You can also checkout a particular version with git checkout v0.1.1.0, replacing the version of course.

After that just do the same procedure as if you made an update.

What if there were database migrations in the code I am rolling back?

Then you also need to roll those back separately. You need to do this before you roll back the code. Look in the db/migrate directory and figure out which files are new since the last time you pulled - i.e., which migration your database should be on. They are in timestamp order in that directory. Then do: bundle exec rake db:rollback and look at the output. It will tell you which migration you are now on. It rolls back one each time you run it. Run it until you're on the right migration and then roll back the code as described above.

Also be aware that database rollbacks can fail - they depend on the migration author writing the correct code to roll back. So in this case it's generally much easier to seek for help to fix your setup.

General

Out of dateOut of date:This section's accuracy may be compromised due to out-of-date information. Please help improve the page by updating it. There may be additional information on the talk page.

Will a pod eventually receive federated posts that it misses while being offline/down?

Currently no, there are no retries, though we'd like to add that at some point.

What do I do about all these PGErrors, like disconnects and SSL problems?

If you are running Diaspora with PostgreSQL, beware that having the ssl setting turned on in the PostgreSQL config has been causing problems for several people. We recommend turning it off unless you know what you're doing.

I've got my pod running. How do I disable outside logins?

Change registrations_closed in config/application.yml from false to true, and then restart the server.

How do I back up the database?

From the command line type:

mysqldump -u <mysql username> -p diaspora_development > backup.sql

Enter your mysql password when prompted for it. Replace _development with _production if you're running the production environment.

What's up with assets/jammit/js-runtime?

The recent update to Rails 3.1 made it possible for us to use the included asset compilation mechanism and therefore drop the requirement for jammit and a Java environment. The new method requires a JavaScript runtime like Node.js or TheRubyRacer to be installed, though. See the [Installation-Guides specific distribution guides] for how to install them. After one of them has been installed, you can compile the assets by running bundle exec rake assets:precompile

See the installation guide for more detailed instructions on how to handle assets.

I am on PPC (e.g. old iMac) and want to use it for serving Diaspora, but there is no ExecJS compatible JS runtime

One thing you could do, assuming you have another PC that will run Node. Precompile your assets on that machine (using bundle exec rake assets:precompile) and then check them into git before you deploy to the PPC box. The Javascript runtime is only really needed for precompiling assets and shouldn't be loaded at all in the actual production environment. You may need to use git add public/assets -f to force git to check them in, since I think that directory is in .gitignore. (from #3429)

What are roles and how do I use them?

We switched from statically configured 'special' user accounts in the config file to a role system, which lets us change role assignments without having to restart the server. In order to convert your current config to the new roles you can import them by going to the rails console in the production environment by running the following command in your diaspora directory:

RAILS_ENV=production rails c

In case you want to assign roles to other users, you can do so by running these commands:

u = User.find_by_email("user@email.com")
Role.add_admin(u.person)      # to add as admin, or
Role.add_spotlight(u.person)  # to add as 'community spotlight'

# NOTE: the 'beta' role has been removed
Role.add_beta(u.person)       # to add as 'beta' user

When you are done, you can exit the console with

quit

What if my question isn't answered here?

IRC Channels

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 or mIRC for Windows.

Mailing lists

We have two mailing lists, both Google groups. They tend to have a slightly different audience than the IRC channels, so if you can't get your question answered in IRC, you can try here.