jump to navigation

PleromaPi – Run your own distributed social network on RaspberryPi November 5, 2020

Posted by GuySoft in open source, programming, python.
Tags: ,
trackback
Pleroma Logo

Hey all,

The latest Raspeberry Pi I am releasing is a distro that lets you flash and run social network called Pleroma. Its part of a group federated social networks known as the Fediverse. There are about 4 million users to date, although this does not compare to the giants today, its enough that the software is fairly mature and it looks and feel like networks you know, and there are enough people to follow and get a decent feed to read. It also mean you can use it for different uses not covered by mainsteam social networks.

Requirements

  1. A domain name that redirects to your Raspsberry Pi – you need a domain name because communication from server-to-server happens on HTTPs, which needs a domain for the signature to work. And laso because usernames are in format @user@server.tld .
  2. Raspberry Pi prefrebly 3B+ , 4B and above.
  3. Pi should be connected to internet.

Setup

  1. Flash the PleromaPi image from official mirror (source code). Get the nightly build or latest stable release (at the moment the initlal release).
  2. Configure your WiFi by editing pleromapi-wpa-supplicant.txt at the root of the flashed card when using it like a flash drive
  3. Configure the Pleroma settings at
    /boot/docker-compose/pleroma/environments/pleroma/pleroma.env
    and set:
  4. # Make sure to use your specific domain and email, otherwise you won't get an HTTPs cerfificate ADMIN_EMAIL=admin@ops.pleroma.social NOTIFY_EMAIL=pleroma+admin@ops.pleroma.social DOMAIN=pleroma.gnethomelinux.com VIRTUAL_HOST=pleroma.gnethomelinux.com LETSENCRYPT_HOST=pleroma.gnethomelinux.com LETSENCRYPT_EMAIL=your_email_sent_to_letsencrypt@example.com
  5. Boot your Pi and make sure its connected to the internet. wait for it to pull the latest Pleroma docker container, it should take a while. You can SSH to it and make sure its all working in order. You can ssh to the hostname pleromapi.local, username and password like in rpios (pi/raspberry)
  6. Create an admin account by running:
    /home/pi/scripts/make_admin_user
  7. Wait a while, you can test if you have no domain name set if Plermoa is accessible by running:
    curl -k http://pleromapi.local -H "Host: ops.pleroma.social"
  8. You can change pleroma settings at /var/lib/pleroma/config.exs
    The data is saved there and its recommended you back it up once you are actually using the instance.
    In later versions I should be able to make the Pi auto-mount an external harddrive, and then you could store all the information there.

Source code is avilable here:
https://github.com/guysoft/PleromaPi
The docker-compose settings are forked on Pleroma’s gitlab:
https://git.pleroma.social/guysoft/pleroma-docker-compose/

Thats it! You should have a running Pleroma instance which is connected to the federated social network known as the Fediverse.

I would really value comments on how to improve this so it would be easy and hassle free to set up a social network instance.

Having your own node in the network mean you have full control on what is allowed to be posted, and what servers your Pi will allow to view. You can federate or defederate any content and you are not restricted to the current networks. So no more censorship, or moderate content you and people on your server don’t wish to see.

Comments»

1. chdedert - November 29, 2020

Iโ€™ll check this out soon. Iโ€™ve been trying to get Pleroma up and running. Iโ€™ll let you know how it goes.

2. Hiker - December 14, 2020

Thanks for that bit work.

But I couldn’t install it and found problems: “Nginx” and “/home/pi/scripts/make_admin_user” are missing and the docker installation makes different “/var/lib/pleroma/config.exs” files. Quite difficult to find the right one.

GuySoft - December 14, 2020

Hey,

0. What image are you using?

1. If you can report this in more depth at https://github.com/guysoft/PleromaPi/issues it would be great. It would help me figure out what needs to be fixed.

2. /home/pi/scripts/make_admin_user source is here: https://github.com/guysoft/PleromaPi/blob/devel/src/modules/pleromapi/filesystem/home/pi/scripts/make_admin_user
It should be there, what image did you use?

3. /var/lib/pleroma/config.exs source is at: https://git.pleroma.social/guysoft/pleroma-docker-compose/-/blob/devel/volumes/pleroma/config.exs

3. Hiker - December 14, 2020

Hi

2020-11-04_2020-08-20-pleromapi-buster-armhf-lite-0.1.0.zip can’t be un-zipped – gives an error

so I used
2020-11-04_2020-08-20-pleromapi-buster-arm64-lite-0.1.0.zip

Hiker - December 14, 2020

Oh, with arm64 version it’s running and the make_admin_user script is there.

So next question: Which password has this admin user?

GuySoft - December 14, 2020

make_admin_user is the script that creates the admin user and sets the password for it.

4. GuySoft - December 14, 2020

Thanks for the catch.
Could you try the nightly build I created at:
http://unofficialpi.org/Distros/PleromaPi/nightly-arm64/

Hiker - December 14, 2020

Can’t create the admin account

Continue? [n] ** (FunctionClauseError) no function clause matching in String.Break.trim_leading/1

The following arguments were given to String.Break.trim_leading/1:

# 1
:eof

(elixir) lib/elixir/unicode/properties.ex:288: String.Break.trim_leading/1
(elixir) lib/string.ex:1108: String.trim/1
lib/mix/tasks/pleroma/user.ex:63: Mix.Tasks.Pleroma.User.run/1
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6

5. GuySoft - December 15, 2020

1. Can you describe what you are providing as input?
2. Instead of running the script you can run:

Replace ${name} and ${email}

sudo docker exec pleroma /opt/pleroma/bin/pleroma_ctl user new “${name}” “${email}” –admin -y

This line is the one in the script. Its like the one in: https://docs-develop.pleroma.social/backend/installation/otp_en/

6. Hiker - December 15, 2020

Thanks. Yes in the meantime I could create the admin account, but with the script the password can’t be set and is set from Pleroma and unknown. With the change request URL I could change it and have access now.

Pleroma seems to connect to the Fediverse now and I could write a post and follow users on other instances. But I can’t store images and the avatar in profile isn’t stored.

GuySoft - December 15, 2020

Try check permissions of the upload folder. Run:

sudo chmod 777 /var/lib/pleroma/uploads
sudo chmod -R 777 /var/lib/pleroma/uploads/*

7. Hiker - December 15, 2020

Yes, first did the job.

Next problem: In admin panel everything is grayed out and I get the error message on top

Request failed with status code 400 – To use this endpoint you need to enable configuration from database

GuySoft - December 15, 2020

That is expected behavior from Pleroma, you need to permit configuration from the database. There is a cofig somewhere I am not next a computer to pull it out.

8. Hiker - December 16, 2020

Oh yes you are right – I missed that.

BTW Pleroma is now running quite well over here – thanks a lot for your quick support!

GuySoft - December 16, 2020

Cool, please star om github and share rhe project ๐Ÿ™‚ I think its the simplest way to get going and its biggest issue know is people knowing about it


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: