loading...empty;done;/diaspora/:-uriDiaspora* Ruby Tutorial | iNET.elastic Dev Docs

How to Install Diaspora*

Diaspora* is an open-source user-owned distributed social network with more than 1 million accounts all over the world. It consists of separate nodes named podes. Each pode operates a copy of the Diaspora software and represents a personal web-server.

So, let’s find out how to create your own Diaspora* pode with the help of PaaS.

Create an Environment

1. Log in to the platform dashboard using your credentials.

2. Press Create environment button. In the opened environment topology wizard navigate to the Ruby programming language tab. Pick the following nodes:

  • Apache application server
  • MySQL database
  • Redis data structure server

Then state the resources limits for the chosen nodes. Finally, enter name for your environment (e.g. diaspora-network), and click Create button.

environment wizard

3. After about a minute your new environment will appear at the dashboard.

environment for Diaspora created

Diaspora* Deployment

1. Navigate to the Diaspora GitHub repository. There change the branch to master and click Download ZIP button.

download Diaspora zip

You will be offered to save .zip archive with the latest Diaspora* stable version.

2. Then navigate back to the platform dashboard and upload this archive with the help of Deployment manager.

upload Diaspora archive

3. Then press Deploy to.. button next to the diaspora-master.zip package. In the opened window choose test deployment type and click Deploy.

deploy Diaspora application

Note: In order to run Diaspora* in production mode you need to have certificate authorities (CA) certificates installed at your server.

4. The process of deployment can take some time, so be patient, please. Finally, you’ll see a new test context listed for Apache.

Diaspora application deployed

Database Configurations

1. Press Open in Browser button next to the MySQL node in your environment.

open MySQL in browser

2. In the opened browser tab log in using the MySQL credentials you’ve received while environment creation and navigate to the SQL section.

database admin SQL tab

3. You’ll see an empty form for SQL request executing. Enter the following line there and click Go in order to create a new database named diaspora_test.

1
CREATE DATABASE diaspora_test CHARACTER SET utf8;

create Diaspora database

4. After that open the platform dashboard again and press Config button for Apache application server.

Apache config button

5. In the opened configuration manager navigate to the webroot > config folder, find database.yml.example file and copy its content.

database yml example

6. Then create new database.yml file in the same (config) folder and paste the copied strings to it.

crerate database yml

7. Now it’s necessary to set up the connection between your application and MySQL database.

Find the section for MySQL configurations. Specify your MySQL host (URL to your database without http://) and credentials you’ve received while environment creation in username and password strings.

configure database connection

Don’t forget to Save the changes made.

Application Server and Redis Configurations

1. Press Config button for Apache application server again.

Apache config button

2. Navigate to the webroot > config folder and create a new diaspora.yml file there. Then find diaspora.yml.example configuration file in the same folder, copy its content, and paste it into the newly created file.

create diaspora yml

3. After that navigate to the configuration section in this file and change the following values:

  • find the #url: “https://example.org/" string and paste your environment’s URL instead of https://example.org/ value (you can find it by pressing Open in Browser button for your environment and copying URL in the address bar).

configure environment URL

  • scroll a bit lower and find the settings for remote Redis connection in the same file:
1
2
3
4
5
6
## URL for a remote redis.     
## Don't forget to restrict the IP access!     
## Leave it commented out for the default (localhost)     
#redis: 'redis://exmaple_host'     
#redis: 'redis://username:password@host:6379/0'     
#redis: 'unix:///tmp/redis.sock'    

Delete the # symbol from the #redis: ‘redis://username:password@host:6379/0’ line. Then substitute the values in this parameter with your own data, received via email after the environment creation.

Redis credentials email

Change username and password values to the credentials for admin access to your Redis node. The same story with the host word: substitute it with the DNS address you can find in this letter.

configure Redis connection

  • finally, locate the #require_ssl: true line and change the true value to false

set SSL config false

It’s time to Save the changes.

4. Then navigate to the application.rb file, located in the same config folder. Find #config.i18n.default_locale = :de string and change its value to :en.

set default locale English

Don’t forget to press the Save button in the panel above.

5. After that find the defaults.yml file (still in the config folder). At the #142-144 lines (or about it) you can see the following lines:

1
2
3
4
 i_am_a_dummy: # Remove if you add an actual override
test:
 environment:
   url: 'http://localhost:9887/'

dummy URL override

Please, delete the line started with i_am_a_dummy string, and change an url parameter’s value to the host url of your environment (it can be seen in the e-mail you’ve got earlier or by pressing the Open in Browser button next to your environment and copying URL in the address bar).

You should get something like following:

URL override to environment

Save the changes.

6. Finally, create new rake_deploy file in the webroot folder. Enter the following strings there:

1
2
3
db:create
db:schema:load
assets:precompile

configure rake deploy

7. Press Save button one more time and Restart the Apache node in order to apply all the configurations you’ve made.

Note: The first restart of the server after applying new settings can take some time, please, be patient.

Apache restart button

8. Now you can press Open in Browser button for your environment and start working with your own Diaspora* application hosted.

Diaspora start page

Enjoy!

What’s next?