Recopie initiale

This commit is contained in:
Iwan Clement
2018-05-21 13:03:35 +02:00
commit 3f39bfa01d
319 changed files with 1543 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# Must go to /etc/apt/sources.list.d
deb http://CT-cen-repo/apt/debian/9/amd64/latest stretch main

View File

@@ -0,0 +1,4 @@
# https://anystack.xyz/how-to-install-mastodon-ubuntu/
#psql -c "CREATE USER admin WITH PASSWORD 'test101';"
psql -c "CREATE USER mastodon CREATEDB;" && exit 0
exit 200

View File

@@ -0,0 +1,19 @@
# https://anystack.xyz/how-to-install-mastodon-ubuntu/
#!/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

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# https://anystack.xyz/how-to-install-mastodon-ubuntu/
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
if true; then
apt-get install -y redis-server redis-tools postgresql postgresql-contrib || exit 2
fi
if true; then
adduser --disabled-password --disabled-login --gecos "" mastodon || exit 3
chmod +r Install*.sh;chmod +x Install*.sh || exit 4
if [ -e ./Install-Mastodon-CreatePSQL-User.sh ]
then
# Creation de l'utilisateur Postgresql postgres
cp -f Install-Mastodon-CreatePSQL-User.sh /tmp || exit 5
chmod 644 /tmp/Install*.sh || exit 6
chmod +x /tmp/Install*.sh || exit 7
su - postgres -c /tmp/Install-Mastodon-CreatePSQL-User.sh || exit 8
rm -f /tmp/Install*.sh
else
exit 9
fi
fi
if true; then
sed -i '/^local.*postgres.*peer$/a host all all 127.0.0.1/32 ident' /etc/postgresql/9.?/main/pg_hba.conf || exit 10
apt-get -y install pidentd || exit 11
systemctl enable pidentd || exit 12
systemctl start pidentd || exit 13
systemctl restart postgresql || exit 14
apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev || exit 15
apt-get install -y libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev || exit 16
apt-get install -y libgdbm3 libgdbm-dev || exit 17
fi
if true; then
cp -f Install-Mastodon-Phase3.sh Install-Mastodon-Phase4.sh /home/mastodon || exit 18
chown -R mastodon /home/mastodon || exit 19
chmod +x /home/mastodon/Install*.sh
su - mastodon -c ./Install-Mastodon-Phase3.sh || exit 20
su - mastodon -c ./Install-Mastodon-Phase4.sh || exit 21
fi

View File

@@ -0,0 +1,9 @@
#!/bin/bash
# https://anystack.xyz/how-to-install-mastodon-ubuntu/
echo "Phase 3: Preparation de l\'environnement"
cd $HOME
git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv || exit 101
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.bashrc
echo 'eval "$(rbenv init -)"' >> $HOME/.bashrc
source $HOME/.bashrc
exit 0

View File

@@ -0,0 +1,49 @@
#!/bin/bash
set -x
# Let's install ruby 2.5.0
echo Phase 4: Installation de Ruby
rm -rf $HOME/.rbenv/plugins/ruby-build 2>/dev/null
git clone https://github.com/rbenv/ruby-build.git $HOME/.rbenv/plugins/ruby-build || exit 301
cd $HOME/.rbenv || exit 302
rbenv install 2.5.0 || exit 303
rbenv global 2.5.0 || exit 304
ruby -v
cd
git clone https://github.com/tootsuite/mastodon.git live || exit 305
cd live || exit 306
git checkout $(git tag | tail -n 1) || exit 307
echo "gem: --no-document" > ~/.gemrc || exit 308
gem install bundler --no-ri || exit 309
echo Launch the installation
bundle install --deployment --without development test || exit 310
yarn install || exit 311
cp .env.production.sample .env.production || exit 312
echo "# Service dependencies" >>.env.production
echo REDIS_HOST=localhost >>.env.production
echo REDIS_PORT=6379 >>.env.production
echo DB_HOST=/var/run/postgresql >>.env.production
echo DB_USER=mastodon >>.env.production
echo DB_NAME=mastodon_production >>.env.production
echo DB_PASS= >>.env.production
echo DB_PORT=5432 >>.env.production
echo "# E-mail configuration" >>.env.production
echo SMTP_SERVER=smtp.mailgun.org >>.env.production
echo SMTP_PORT=587 >>.env.production
echo SMTP_LOGIN=postmaster@mg.familleclement.space >>.env.production
echo SMTP_PASSWORD=cbac685af990620014a4455522bb8e0e-db1f97ba-6379cdaa >>.env.production
echo SMTP_FROM_ADDRESS=noreply@mastodon.lescorpsdereve.space >>.env.production
echo "# Federation" >>.env.production
echo LOCAL_DOMAIN=mastodon.lescorpsdereve.space >>.env.production
echo LOCAL_HTTPS=false >>.env.production
RAILS_ENV=production bundle exec rails db:setup || exit 313
RAILS_ENV=production bundle exec rails assets:precompile || exit 314
exit 0

View File

@@ -0,0 +1,3 @@
#!/bin/bash
dnf install -y http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

10
files/NoSwap.ps1 Normal file
View File

@@ -0,0 +1,10 @@
# https://stackoverflow.com/questions/37813441/powershell-script-to-set-the-size-of-pagefile-sys
# PowerShell Script to set the size of pagefile.sys
$computersys = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges;
$computersys.AutomaticManagedPagefile = $False;
$computersys.Put();
$pagefile = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name like '%pagefile.sys'";
$pagefile.InitialSize = 0;
$pagefile.MaximumSize = 0;
$pagefile.Put();

View File

@@ -0,0 +1,8 @@
[MySaltstack]
name=My SaltStack latest Release Channel for RHEL/CentOS $releasever
baseurl=http://CT-cen-repo/yum/redhat/7/$basearch/latest/
skip_if_unavailable=True
gpgcheck=1
gpgkey=http://CT-cen-repo/yum/redhat/7/$basearch/latest/SALTSTACK-GPG-KEY.pub
enabled=1
enabled_metadata=1

View File

@@ -0,0 +1,8 @@
#!/bin/bash
#URLROOT="https://github.com/atom/atom/releases/download/v1.24.0"
#LEPKG="atom.x86_64.rpm"
#cd /tmp && wget -q -t 5 -T 5 -w 5 -4 -nd "$URLROOT/$LEPKG" && dnf install -y /tmp/$LEPKG && exit 0
rpm --import https://packagecloud.io/AtomEditor/atom/gpgkey && sh -c 'echo -e "[Atom]\nname=Atom Editor\nbaseurl=https://packagecloud.io/AtomEditor/atom/el/7/\$basearch\nenabled=1\ngpgcheck=0\nrepo_gpgcheck=1\ngpgkey=https://packagecloud.io/AtomEditor/atom/gpgkey" > /etc/yum.repos.d/atom.repo' && \
dnf install atom -y && exit 0
exit 1

View File

@@ -0,0 +1,2 @@
#!/bin/bash
curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get -y update && apt-get install -y nodejs

8
files/elk.repo Normal file
View File

@@ -0,0 +1,8 @@
[MyELK]
name=My ElasticSearch Repository
baseurl=http://CT-cen-repo/elk
skip_if_unavailable=True
gpgcheck=1
gpgkey=http://CT-cen-repo/elk/GPG-KEY-elasticsearch
enabled=1
enabled_metadata=1

2
files/install_nodered.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
npm install -g --unsafe-perm node-red

2
files/minion.conf Normal file
View File

@@ -0,0 +1,2 @@
master: alassaut.chickenkiller.com
master_port: 44506

1
files/test.tmp Normal file
View File

@@ -0,0 +1 @@
# Fichier de test à recopier.