From 9e9cfe814845f9c6a864522d332aea35a29fc94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwan=20Cl=C3=A9ment?= Date: Sun, 6 May 2018 14:01:46 +0200 Subject: [PATCH] Premier jet des scripts d'installation de l'instance Mastodon --- files/Install-Mastodon-CratePSQL-User.sh | 2 ++ files/Install-Mastodon-Phase1.sh | 18 ++++++++++++++++++ files/Install-Mastodon-Phase2.sh | 22 ++++++++++++++++++++++ files/Install-Mastodon-Phase3.sh | 0 4 files changed, 42 insertions(+) create mode 100644 files/Install-Mastodon-CratePSQL-User.sh create mode 100644 files/Install-Mastodon-Phase1.sh create mode 100644 files/Install-Mastodon-Phase2.sh create mode 100644 files/Install-Mastodon-Phase3.sh diff --git a/files/Install-Mastodon-CratePSQL-User.sh b/files/Install-Mastodon-CratePSQL-User.sh new file mode 100644 index 0000000..2133cb3 --- /dev/null +++ b/files/Install-Mastodon-CratePSQL-User.sh @@ -0,0 +1,2 @@ +#psql -c "CREATE USER admin WITH PASSWORD 'test101';" +psql -c "CREATE USER mastodon CREATEDB;" diff --git a/files/Install-Mastodon-Phase1.sh b/files/Install-Mastodon-Phase1.sh new file mode 100644 index 0000000..b055ec3 --- /dev/null +++ b/files/Install-Mastodon-Phase1.sh @@ -0,0 +1,18 @@ +#!/bin/bash +#set -x + +# Check if it is a Ubuntu host +/usr/bin/lsb_release -d|cut -d ":" -f 2|grep -i ubuntu|grep "16.04" 1>/dev/null +if [ $? == 0 ] +then + echo "C'est bien une Ubuntu" +else + exit 1 +fi + +apt-get update || exit 2 + +curl -sL https://deb.nodesource.com/setup_6.x | bash - || exit 3 + +apt-get install imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev nodejs -y || exit 4 +npm install -g yarn || exit 5 diff --git a/files/Install-Mastodon-Phase2.sh b/files/Install-Mastodon-Phase2.sh new file mode 100644 index 0000000..148c738 --- /dev/null +++ b/files/Install-Mastodon-Phase2.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if it is a Ubuntu host +/usr/bin/lsb_release -d|cut -d ":" -f 2|grep -i ubuntu|grep "16.04" 1>/dev/null +if [ $? == 0 ] +then + echo "C'est bien une Ubuntu" +else + exit 1 +fi + +apt-get install -y redis-server redis-tools postgresql postgresql-contrib || exit 2 +sed -i '/^local.*postgres.*peer$/a host all all 127.0.0.1/32 ident' /etc/postgresql/9.?/main/pg_hba.conf || exit 3 +apt-get -y install pidentd && sudo systemctl enable pidentd && sudo systemctl start pidentd || exit 4 +systemctl restart postgresql || exit 5 +apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev || exit 6 +apt-get install -y libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev || exit 7 +apt-get install -y libgdbm3 libgdbm-dev || exit 8 +adduser -m --disabled-password --disabled-login mastodon || exit 9 +cp Install-Mastodon-Phase3.sh /home/mastodon +chown -R mastodon:mastodon /home/mastodon +su - mastodon -C Install-Mastodon-Phase3.sh diff --git a/files/Install-Mastodon-Phase3.sh b/files/Install-Mastodon-Phase3.sh new file mode 100644 index 0000000..e69de29