From d49bf77b98e5d02822d3990f92668944f879ad16 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Wed, 26 Feb 2020 00:17:18 +0100
Subject: [PATCH] Improve Pleroma source setup script.

---
 buster/setup_scripts/setup_pleroma_source.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/buster/setup_scripts/setup_pleroma_source.sh b/buster/setup_scripts/setup_pleroma_source.sh
index 4f7989c..6c0d153 100755
--- a/buster/setup_scripts/setup_pleroma_source.sh
+++ b/buster/setup_scripts/setup_pleroma_source.sh
@@ -22,17 +22,26 @@ certbot --nginx --agree-tos --redirect --no-eff-email -m "${mail}" -d "${domain}
 rm /etc/nginx/sites-enabled/default
 
 # Prepare user.
-adduser --system --shell  /bin/false --home /opt/pleroma pleroma
+adduser --system --group --shell /bin/false --home /opt/pleroma pleroma
 
 # TODO: integrate this into apt-mark/pleroma
-apt -y install elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-ssh erlang-xmerl build-essential
+apt -y install build-essential #elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-ssh erlang-xmerl build-essential
+# Not listed by doc.
+apt -y install wget #erlang-inets erlnag-erlware-commons
+
+wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
+dpkg -i /tmp/erlang-solutions_1.0_all.deb
+apt update
+apt -y install elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-ssh erlang-xmerl
 
 mkdir -p /opt/pleroma
 chown -R pleroma:pleroma /opt/pleroma
 su pleroma -s $SHELL -lc 'git clone -b develop https://git.pleroma.social/pleroma/pleroma /opt/pleroma'
+su pleroma -s $SHELL -lc 'mix local.hex --force'
+su pleroma -s $SHELL -lc 'mix local.rebar --force'
 su pleroma -s $SHELL -lc 'mix deps.get'
 su pleroma -s $SHELL -lc "mix pleroma.instance gen \
-'--output /etc/pleroma/config.exs \
+--output /etc/pleroma/config.exs \
 --output-psql /tmp/setup_db.psql \
 --domain ${domain} \
 --instance-name plom-roma \
-- 
2.30.2