Contents

deafaspora.simons.earth

Why?

I decided to try to set up a diaspora* pod just to see if I could. I already have a few services running under Docker so I wanted to add this service to the pool. Why Docker? Well, mainly for reasons of portability. Should anything happen to the drive(s) or server that I have them running on, I can quickly restore the /var/lib/docker/volumes folder from the nightly backup on my Hetzner storage box. I can then clone the GitHub repo and Hey Presto, my services are back up and running.

I like the de-centralised operation of diaspora* and the idea that I can truly own my own data when it’s running from a box at home. I’ve embarked on a hopeful attempt to create an alternative social media experience for the Deaf community away from the horrors of Facebook and the like. I realise that this might be a fruitless attempt, as most people these days really don’t seem aware that there is an internet outside of Facebook, let alone realise that there’s a better alternative. Sadly, this is especially true of the local Deaf community.

First things

So I started with the repo (thank you, Brad Koehn!), edited the configs and fired it up. I use the HAProxy package on my pfSense router to take care of the SSL and reverse proxying. You may have to use nginX or Apache.

I read some more of the docs and made myself an admin and switched off further registrations. So far so good, but I then started to realise that running one’s own pod is a really lonely experience at the start! All the other pods are unknown to it and only one’s own posts are visible on the stream and public activity.

I thought this wasn’t going to be a problem, and the documentation infers that simply following hashtags will populate the feed with posts from all over containing these tags. Sadly, that’s not the case, but more of that later.

I noticed early on in the logs that the version of ruby in the container is out of date, and the diaspora* gem required version 2.6.6. Fixing this led me up a steep learning curve as I have no experience with either ruby or rails! I’ll show you what I did to get my container in a workable state. I’ll miss out all the mistakes I made, and hopefully you’ll see a set of steps to follow should you wish to do something similar. I’m glad I persevered, it was a fun adventure and now my pod is quite active.

Tweaking

To make alterations in the container, you need a privileged access console:

$ docker exec -u 0 -it <containerid> /bin/bash

Update the container:

# apt update

Install sudo to allow userdiasporato run stuff if necessary:

# apt install sudo

Install some editors:

# apt install vim nano

Install and configure sendmail so you can receive notifications by email:

# apt install sendmail

# sendmailconfig

Prepare to install ruby:

# apt install curl g++ gcc autoconf automake bison libc6-dev libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool libyaml-dev make pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev gpg

# gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

# curl -sSL https://get.rvm.io | bash -s stable

Adddiasporauser to the rvm group and set a password:

# usermod -aG rvm diaspora

# passwd diaspora

As user ‘diaspora’

$ source /etc/profile.d/rvm.sh

Install ruby as user:

$ rvm install ruby-2.6.6

Install all this extra ‘stuff’:

$ gem install bundler

$ bundle install

$ sudo apt install cmake(needed to install rugged 1.0.1)

$ gem install rugged -v '1.0.1'

$ bundle install --deployment --with "development test postgresql"(needed for following rake command)

$ bundle exec rake assets:precompile

Save your container

Now you want to save all these changes to your own diaspora* container. Issue a ‘docker-compose down’. Then do the following. You may have to run them as root if you haven’t added your user to the docker group.

$ docker commit <number> <yourcontainer>

$ docker images

$ docker tag <number-from-images-output> <your/repo>:<tag>

$ docker push <your/repo>:<tag>

Now you can change your docker-compose file to reflect the new image name and hopefully there won’t be an errors.

Caveats

As alluded to before, the docs are a bit misleading when they imply it’s easy to gain contacts through following hashtags.

I discovered that the only posts that show up containing followed hashtags are from people that are sharing with you and also used the same hashtag in a post.

Read that again. The inference is that all posts from all pods with that followed hashtag will show. That’s not the case. You have to have lots of people sharing with you.

That said, getting loads of shares is part of the experience and you get to learn interesting people to share with along the way. Over time your feed will grow.