setting up the waltuh.cyou's akkoma instance

i won't believe that someone would be interested on my fork. and to be frank, these modifications are mostly done just to fix the problems when using fedi as a third world country user.

our akkoma instance, fedinet.waltuh.cyou

this is absurd.

i will start by saying this: everything that you are going to use here will be completely experimental, so stability is NOT 100% guaranteed all while i'm trying my best on keeping the things as stable as possible.


system requirement

minimum requirements: – cpu core: 2 (1 will still work) – ram: 2 GB (1 GB will still work, but it's a real gamble) – SSD storage: 50 GB – fast af internet speed on server – probably shared unlimited bandwidth usage

recommended requirements: – cpu core: 4 (or more) – ram: 4 GB – SSD storage: 60 GB – same internet speed – same bandwidth usage


set up the akkoma

i won't recreate the entire akkoma manual because i have did it before, however it doesn't even mean that you need to follow that either. but, follow what's on akkoma docs first.

now, about the clone URL, you might clone this:

git clone https://akkoma.dev/Yonle/akkoma.git -b master /opt/akkoma

and then continue installation as usual.

however, in your prod.secret.exs, please make sure that you have this being set:

config :pleroma, :media_proxy,
  enabled: true,
  redirect_on_failure: true,
  base_url: "https://media.yourfedi.com"

config :pleroma, :media_preview_proxy,
  enabled: true

for frontend, please read this.

but i have an existing akkoma instance already

good news: it doesn't conflict to the upstream. so,

git remote set-url yonlemodif https://akkoma.dev/Yonle/akkoma.git
git pull yonlemodif master
git switch master

then, do the normal update task:

mix deps.get
env MIX_ENV=prod mix ecto.migrate

then, modify your prod.secret.exs to enable media proxy+media proxy preview just like above (or do it via admin fe), then configure frontend the same as above,

and restart your akkoma backend.


after you've got the akkoma properly running, now,

set up the mediaproxyoma+go-bwhero

there are many ways of setting up mediaproxyoma+go-bwhero. the easiest will be you running it with docker compose by first,

via docker compose (the easiest)

modify the docker-compose.yml with proper environment variables, as described on mediaproxyoma's README, then, just do this:

docker compose up

that's all.

manually, or via incus

if you're an admin that tries to not use docker on server like me, then,

apk add git nano go vips-dev vips-magick imagemagick ffmpeg pkgconf
git clone https://github.com/Yonle/mediaproxyoma
git clone https://github.com/Yonle/go-bwhero bwhero

for p in mediaproxyoma bwhero; do
  cd $p
  go build -o ../$p
  cd ..
done

doas mv mediaproxyoma bwhero /bin/

then, copy what's in mediaproxyoma/installation/init.d/* directory to /etc/init.d/, edit both /etc/init.d/mediaproxyoma and /etc/init.d/bwhero, then enable & run them.

cd mediaproxyoma
mv installation/init.d/* /etc/init.d/
nano /etc/init.d/bwhero
nano /etc/init.d/mediaproxyoma

service mediaproxyoma start
rc-update add mediaproxyoma

now, configure the reverse proxy

the reverse proxy that we will use here is caddy. you can use anything equivalent to it, but to be short, you can basically do the following.

this is the Caddyfile for: – akkoma listening at 127.0.0.1:4000 – mediaproxyoma listening at 127.0.0.1:8080

yourfedi.com {
  log {
    output file /var/log/caddy/akkoma.log
  }

  encode zstd gzip
  reverse_proxy 127.0.0.1:4000
}

media.yourfedi.com {
  @mediaproxy path /proxy/*
  @robots path /robots.txt

  log {
    output file /var/log/caddy/media_fedinet.log
  }

  handle @robots {
    header Content-Type text/plain
    respond "User-agent: *
Disallow: /"
  }

  handle @mediaproxy {
    reverse_proxy 127.0.0.1:8080 {
      transport http {
        response_header_timeout 32s
        read_timeout 32s
      }
    }
  }
}

optional, but SHOULD reduce your load A LOT

if you have a big storage space in your server host, i recommend you to setup a Varnish cache server. It's small, yet light & fast af.

you can check our setup here. Adjust it accordingly to your setup


closing

so, how is it feels?

i don't know what your real comments are, but if things feels smooth than before, then, good. welcome to the feeling that the third world country need.

that's it. bye.