Diaspora* Tutorial

How to Install Diaspora*

Diaspora* is an open-source, user-owned distributed social network. It is made up of independently operated servers called pods. This guide shows how to deploy your own Diaspora* pod on the platform using Ruby, MySQL, and Redis.

Create Environment

  1. Log in to the platform dashboard.
  2. Click Create Environment.
  3. Open the Ruby tab in the topology wizard.
  4. Add the following nodes:
    • Apache application server
    • MySQL database
    • Redis data structure server
  5. Set the resource limits for the selected nodes.
  6. Enter an environment name, for example diaspora-network, and click Create.

After the environment is created, it appears in the dashboard with the Apache, MySQL, and Redis layers.

Diaspora* Deployment

  1. Open the official Diaspora* GitHub repository.
  2. Select the master branch and download the project as a ZIP archive.
  3. Return to the platform dashboard and upload the archive through Deployment Manager.
  4. Click Deploy to… beside the uploaded archive.
  5. Select the target Ruby/Apache environment and deploy the application.
Production SSL: the source guide notes that a production deployment requires certificate-authority certificates on the application server.

The deployment process may take some time. When it finishes, the application context appears under the Apache node.

Database Configuration

Open Config for the Apache application server and navigate to the application config directory.

  1. Find database.yml.example.
  2. Copy its contents.
  3. Create a new database.yml file in the same directory.
  4. Paste the copied configuration into the new file.
  5. Find the MySQL configuration section and replace the connection values with the database information supplied for your environment.

Use your database hostname without the http:// prefix, together with the MySQL username and password received when the environment was created.

mysql:
  adapter: mysql2
  host: "YOUR_MYSQL_HOST"
  username: "YOUR_MYSQL_USERNAME"
  password: "YOUR_MYSQL_PASSWORD"

Save the updated database.yml file.

Application Server and Redis Configuration

In the same application config folder, create diaspora.yml from the supplied diaspora.yml.example file.

Set the Environment URL

Find the application URL setting and replace the sample value with the URL of your environment. The environment URL can be obtained through Open in Browser in the dashboard.

url: "https://YOUR_ENVIRONMENT_URL/"

Configure Remote Redis

Find the remote Redis configuration block and enable the connection string that contains a username, password, host, and port.

## URL for a remote redis.
## Don't forget to restrict the IP access!
## Leave it commented out for the default (localhost)
#redis: 'redis://example_host'
redis: 'redis://username:password@host:6379/0'
#redis: 'unix:///tmp/redis.sock'

Replace the sample values with the Redis connection information supplied by the platform.

Security: restrict Redis access appropriately rather than exposing the Redis service publicly.

Update the Test Environment URL

In the test configuration section, remove the dummy marker and replace the localhost URL with your actual environment URL.

test:
  environment:
    url: 'https://YOUR_ENVIRONMENT_URL/'

Deployment Configuration

Create a file named rake_deploy in the application webroot and add the following deployment tasks:

db:create
db:schema:load
assets:precompile

Save the file, then restart the Apache node to apply all changes.

First restart: the first Apache restart after applying the Diaspora* configuration may take longer than usual.

Expected Result

After Apache restarts successfully, click Open in Browser for the environment. The Diaspora* start page should load, allowing you to continue setting up and using your own hosted Diaspora* pod.

Important Notes

  • The documented topology uses Apache, MySQL, and Redis under the Ruby environment type.
  • Create database.yml and diaspora.yml from the supplied example files.
  • Use the actual environment URL instead of the sample URL values.
  • Use the remote Redis credentials supplied for the Redis node.
  • The rake_deploy file initializes the database schema and precompiles application assets.
  • The source workflow is a legacy-style Diaspora* deployment and may depend on the application version being used.