Setting up BloatFE

What is BloatFE?

BloatFE is a web frontend for Mastodon API compatible software (Mastodon, Pleroma and probably some others that I'm unaware of.)

What are the benefits of BloatFE compared to PleromaFE?

BloatFE is rendered on the server side and requires no Javascript (although there's so called fluoride mode that includes some basic JS functionalities). On the other hand, PleromaFE is pretty much purely Javascript and is rendered in browser (try it yourself, execute curl https://shitpisscum.mooo.com/ and see what you get). This means it's much lighter and can run on machines with much lower specs than required for PleromaFE and it can also work with a lot of "obsolete" browsers that don't support certain Javascript functions required for running PleromaFE.

"Quick" setup guide

A few notes about my setup

Getting your machine ready

In order to run BloatFE on your machine (my machine is running Ubuntu but this should work on any Linux distro) you need the following:

You also need TCP ports 80 and 443 accessible so if you're using any firewall (which honestly you should on any internet connected machine) don't forget about that.

Installing make

sudo apt install make should do the job

Installing go

This part requires a web browser so if you're doing this on a server wiithout and graphical desktop you'll need another machine. The installation itself goes like this:

  1. Open https://go.dev/doc/install in a web browser. Under "2. Go install." select Linux.
  2. There should be a button labeled "Download Go for Linux" above. Right click it and copy the link
  3. Go back to your terminal. cd ~ to go to your home directory. Execute curl -OL https://go.dev/dl/go1.18.4.linux-amd64.tar.gz replacing the link with the one you copied in the previous step.
  4. Run sudo tar -C /usr/local -xvf go1.18.4.linux-amd64.tar.gz again replacing the file name with the onje you just downloaded
Go should be set up now

Installing nginx

sudo apt install nginx should install nginx and create a systed service. Then sudo systemctl enable nginx to make it start at boot and sudo systemctl enable nginx to start it.

Installig Bloat

Now the fun part:

  1. Clone the git repo into /tmp/bloat git clone git://git.freespeechextremist.com/bloat /tmp/bloat
  2. Navigate to /tmp/bloat cd /tmp/bloat
  3. grep -vn '^#' bloat.conf not sure what this one does
  4. Build the source make
  5. Perform a system wide install with sudo make install

Config

  1. Copy the config file to /etc cp /tmp/bloat/bloat.conf /etc/bloat.conf
  2. Open the config file you just copied sudo vim /etc/bloat or whatever text editor you're using, put vim here because I'm a masochist
  3. Perform a system wide install with sudo make install
  4. Under listen_address you can change the port or leave the default one
  5. Under client_website put the domain you're going to host it on. In my case it's https://bloatpisscum.mooo.com
  6. IMPORTANT PART: Put /etc/bloat in front of database_path, templates_path and static_directory, so you end up with database_path=/tmp/bloat/database, templates_path=/tmp/bloat/templates and static_directory=/tmp/bloat/static
  7. After saving the edited config file, delete the database folder with sudo rm -r /tmp/bloat/database/*

Try starting Bloat by simply running bloat. It should say something like listening on [WHATEVER]. Kill it with CTRL+C

Systemd service

You should create a systemd service to run it in backround but me and a few other people had no idea how to make it work so I came up with a less elegant but much simpler solution:

nginx reverse proxy

  1. Create the folder for your domain's so called server block sudo mkdir -p /var/www/bloatpisscum.mooo.com/html (out your domain instead of course)
  2. To avoid permission denied issues execute the following commands: sudo chown -R $USER:$USER /var/www/bloatpisscum.mooo.com/html and then sudo chmod -R 755 /var/www/bloatpisscum.mooo.com
  3. Now create the server bloack file with sudo vim /etc/nginx/sites-available/bloatpisscum.mooo.com. Content of the file should be the following:
    server {
        listen 80;
    	server_name bloatpisscum.mooo.com www.bloatpisscum.mooo.com;
        location / {
            proxy_pass http://127.0.0.1:12345/;
        }
    }
    		
    Replace the server_name doamin with your domain and port in proxy_pass with the one you set in listening_address inside bloat.conf file.
  4. Create a symlink sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
  5. To avoid a possible hash bucket memory problem that can arise from adding additional server names, it is necessary to adjust a single value in the /etc/nginx/nginx.conf file. Open the file sudo vim /etc/nginx/nginx.conf Find the server_names_hash_bucket_size directive and remove the # symbol to uncomment the line. If you are using nano, you can quickly search for words in the file by pressing CTRL and w.
  6. Not sure what exactly the previous step does, copied it from another tutorial
  7. Check whether you fucked up nginx with sudo nginx -t If it doesn't throw any errors start it sudo systemctl restart nginx

TLS/SSL

  1. Install certbot with nginx plugin sudo apt install certbot python3-certbot-nginx
  2. stop nginx systemctl stop nginx
  3. Run it sudo certbot --nginx -d bloatpisscum.mooo.com It should ask you for your email
  4. If it didn't throw any errors start nginx again systemctl start nginx

If everything went well you should be able to access BloatFE from any web browser

A quick note about Let's Encrypt certificates: they expire after 90 days. In this configuration certbot should renew them automatically but since it's been less that 90 days since I set it up I can't confirm whether it works. I'll make sure to update this page after it does or does not get renewed. If your domain is close to expiration Let's Encrypt will email you. If that happens you can easily renew your certificate manually, just stop nginx, run sudo certbot renew and start nginx again.


← Back to ShitPissCum Services home