Difference between revisions of "Diaspora"

From ArchWiki
Jump to: navigation, search
(Prerequisites: added required libmysqlclient (gem mysql2 won't build without it))
m (HTTPS)
 
(34 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Networking]]
+
[[Category:Web server]]
[http://www.joindiaspora.com/ Diaspora] is the privacy aware, personally controlled, do-it-all, open source social network.
+
[[ja:Diaspora]]
 +
{{Related articles start}}
 +
{{Related|Mastodon}}
 +
{{Related articles end}}
  
On November 23, 2010 was [http://blog.joindiaspora.com/2010/11/23/private-alpha-released.html announced] that Diaspora is in [http://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha private alpha] phase.
+
[https://www.diasporafoundation.org/ Diaspora] is the privacy aware, personally controlled, do-it-all, open source social network.
 +
 
 +
On November 23, 2010 was [http://blog.joindiaspora.com/2010/11/23/private-alpha-released.html announced] that Diaspora is in [[wikipedia:Software_release_life_cycle#Alpha|private alpha]] phase.
 +
 
 +
Since August 27, 2012 Diaspora is ruled by the community ([http://blog.diasporafoundation.org/2012/08/27/announcement-diaspora-will-now-be-a-community-project.html announcement]).
  
 
== Prerequisites ==
 
== Prerequisites ==
* [https://aur.archlinux.org/packages.php?ID=43565 ruby-headers]
 
* [https://wiki.archlinux.org/index.php/Java Java]
 
* [https://www.archlinux.org/packages/extra/i686/libmysqlclient/ libmysqlclient]
 
  
 +
* Since Diaspora can run on [[MySQL]] and [[PostgreSQL]] you need to decide which one you want to use. Install one of them and set it up.
 +
* Diaspora starts a so called appserver, on port 3000 by default, which serves the dynamic contents. You need a reverse proxy to handle the static content and that forwards requests it can't handle to the appserver. Typical tools for that are [[Apache]] or [[Nginx]].
 +
* You'll also need the usual tools to build packages from the AUR.
 +
* And {{AUR|ruby2.2}} and {{AUR|ruby2.2-bundler}} from the AUR.
 +
 +
== Installation ==
 +
 +
Install {{AUR|diaspora-mysql}} or {{AUR|diaspora-postgresql}} from the AUR.
 +
 +
Now edit  {{ic|/etc/webapps/diaspora/database.yml}} and fill out the needed values. Then edit {{ic|/etc/webapps/diaspora/diaspora.yml}} and change at least the url setting to the URL your installation will be reachable under (the one served by your reverse proxy). You can change the port the appserver will listen on under the server section. By default Diaspora requires a SSL setup, you can disable that with the require_ssl setting.
 +
 +
Ensure your database is running and then switch to the diaspora user:
 +
$ su - diaspora
 +
 +
Create the database and initialize the schema:
 +
$ bin/bundle exec rake db:create db:schema:load
 +
If the user you specified in the database.yml file can't create databases leave the 'db:create' out and create a database named diaspora_production by hand.
 +
 +
You can now switch back to your regular user and start '''diaspora''' [[systemd]] service.
  
Install gems
+
The static content your reverse proxy needs to serve will be available under {{ic|/usr/share/webapps/diaspora/public/}}
$ sudo gem install mysql2
 
$ sudo gem install bundle
 
  
== Installation ==
+
== Updating ==
  
=== Install Diaspora ===
+
Updating is very analogous. Obtain the newest version of the package and build it, just like in the installation instructions. Watch for .pacnew files and review the changes. Also read the [https://github.com/diaspora/diaspora/blob/master/Changelog.md changelog] over at Diaspora. Then again ensure the database is running and switch to the diaspora user:
Since diaspora does not have a stable version, you can install it with the [https://aur.archlinux.org/packages.php?ID=40859 development package] in the [[AUR|Arch User Repository (AUR)]].
+
  $ su - diaspora
  
=== Diaspora Postinstallation ===
+
And update the database schema:
create the configuration files and make changes according to your system needs
+
  $ bin/bundle exec rake db:migrate
$ cd /usr/share/webapps/diaspora
 
$ cp config/application.yml.example config/application.yml
 
$ cp config/database.yml.example config/database.yml
 
$ cp config/script_server_config.yml.example config/script_server_config.yml
 
  
Use Bundler to install Diaspora application
+
Exit and restart '''diaspora''' systemd service.
$ bundle install
 
  
=== Create Database ===
+
If you notice [https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers#I_installed_diaspora.2A_on_my_machine.2C_but_when_I_load_the_site_there_are_no_images_and_the_layout_looks_horrible.21 missing icons or layout issues] after restarting the service, switch to the diaspora user again and run:
Edit the Rakefile
 
$ cd /usr/share/webapps/diaspora
 
$ vi Rakefile
 
  
To fix the error "uninitialized constant Rake::DSL" add the line
+
  $ bin/bundle exec rake assets:precompile
require 'rake/dsl_definition'
 
right before
 
require 'rake'
 
  
create the database and it's content using
+
Once more, exit and restart '''diaspora''' systemd service.
$ rake db:drop:all
 
$ rake db:create
 
$ rake db:migrate
 
  
=== Run Diaspora ===
+
== Add yourself as an admin ==
  
*To run Diaspora:
+
Switch to the diaspora user and start the Rails console:
$ sudo /etc/rc.d/diaspora start
+
  $ su - diaspora
Then access http://localhost:3000/ to see the diaspora main page.
+
  $ bin/bundle exec rails console production
  
*To stop Diaspora:
+
Then run the following command, replacing ''user'' with your username (only lowercase characters):
$ sudo /etc/rc.d/diaspora stop
+
  Role.add_admin User.where(username: "user").first.person
  
*(Optional) To start Diaspora automatically at boot, add the diaspora daemon in your /etc/rc.conf file:
+
You can exit the Rails console by pressing {{ic|Ctrl+d}}.
DAEMONS=(... diaspora ...)
 
  
*(Optional) To populate the database with sample users:
+
== Troubleshooting ==
$ cd /opt/diaspora
 
$ sudo -u diaspora GEM_HOME=/opt/diaspora-gems rake db:seed:dev
 
Then access http://localhost:3000/ and login with user 'tom' and password 'evankorth'.
 
  
==Troubleshooting==
+
=== GDM login screen with Diaspora ===
  
===GDM login screen with diaspora===
 
 
GDM will insert the user diaspora in its login window because it currently considers the id range 500-1000 as normal users while Arch considers this range for system users as defined in /etc/login.defs. GDM does that probably to keep legacy normal users working.
 
GDM will insert the user diaspora in its login window because it currently considers the id range 500-1000 as normal users while Arch considers this range for system users as defined in /etc/login.defs. GDM does that probably to keep legacy normal users working.
To exclude this user from the login window, add this 'Exclude' line in your /etc/gdm/custom.conf file:
+
To exclude this user from the login window, add this 'Exclude' line in your {{ic|/etc/gdm/custom.conf}} file:
 +
 
 
  [greeter]
 
  [greeter]
 
  Exclude=diaspora
 
  Exclude=diaspora
  
==More Resources==
+
== See also ==
*[http://github.com/diaspora/diaspora Diaspora git]
+
 
 +
* https://github.com/diaspora/diaspora

Latest revision as of 06:40, 6 August 2017

Diaspora is the privacy aware, personally controlled, do-it-all, open source social network.

On November 23, 2010 was announced that Diaspora is in private alpha phase.

Since August 27, 2012 Diaspora is ruled by the community (announcement).

Prerequisites

  • Since Diaspora can run on MySQL and PostgreSQL you need to decide which one you want to use. Install one of them and set it up.
  • Diaspora starts a so called appserver, on port 3000 by default, which serves the dynamic contents. You need a reverse proxy to handle the static content and that forwards requests it can't handle to the appserver. Typical tools for that are Apache or Nginx.
  • You'll also need the usual tools to build packages from the AUR.
  • And ruby2.2AUR and ruby2.2-bundlerAUR from the AUR.

Installation

Install diaspora-mysqlAUR or diaspora-postgresqlAUR from the AUR.

Now edit /etc/webapps/diaspora/database.yml and fill out the needed values. Then edit /etc/webapps/diaspora/diaspora.yml and change at least the url setting to the URL your installation will be reachable under (the one served by your reverse proxy). You can change the port the appserver will listen on under the server section. By default Diaspora requires a SSL setup, you can disable that with the require_ssl setting.

Ensure your database is running and then switch to the diaspora user:

$ su - diaspora

Create the database and initialize the schema:

$ bin/bundle exec rake db:create db:schema:load

If the user you specified in the database.yml file can't create databases leave the 'db:create' out and create a database named diaspora_production by hand.

You can now switch back to your regular user and start diaspora systemd service.

The static content your reverse proxy needs to serve will be available under /usr/share/webapps/diaspora/public/

Updating

Updating is very analogous. Obtain the newest version of the package and build it, just like in the installation instructions. Watch for .pacnew files and review the changes. Also read the changelog over at Diaspora. Then again ensure the database is running and switch to the diaspora user:

 $ su - diaspora

And update the database schema:

 $ bin/bundle exec rake db:migrate

Exit and restart diaspora systemd service.

If you notice missing icons or layout issues after restarting the service, switch to the diaspora user again and run:

 $ bin/bundle exec rake assets:precompile

Once more, exit and restart diaspora systemd service.

Add yourself as an admin

Switch to the diaspora user and start the Rails console:

 $ su - diaspora
 $ bin/bundle exec rails console production

Then run the following command, replacing user with your username (only lowercase characters):

 Role.add_admin User.where(username: "user").first.person

You can exit the Rails console by pressing Ctrl+d.

Troubleshooting

GDM login screen with Diaspora

GDM will insert the user diaspora in its login window because it currently considers the id range 500-1000 as normal users while Arch considers this range for system users as defined in /etc/login.defs. GDM does that probably to keep legacy normal users working. To exclude this user from the login window, add this 'Exclude' line in your /etc/gdm/custom.conf file:

[greeter]
Exclude=diaspora

See also