mirror of
/repos/dotTiddlywiki.git
synced 2025-12-30 07:31:33 +01:00
76 lines
1.8 KiB
Plaintext
76 lines
1.8 KiB
Plaintext
created: 20171106140502612
|
|
creator: user
|
|
modified: 20171108122139230
|
|
modifier: user
|
|
tags:
|
|
title: provision monolith
|
|
type: text/vnd.tiddlywiki
|
|
|
|
```bash
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
set -x
|
|
apt-get update
|
|
apt-get autoremove -y
|
|
apt-get upgrade -y
|
|
(echo "Europe/Amsterdam" | tee /etc/timezone ; dpkg-reconfigure --frontend noninteractive tzdata)
|
|
locale-gen nl_NL.UTF-8
|
|
locale-gen en_US.UTF-8
|
|
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_MONETARY=nl_NL.UTF-8
|
|
export LANG=en_US.UTF-8
|
|
export LC_ALL=en_US.UTF-8
|
|
export LANGUAGE=en_US.UTF-8
|
|
export LC_MONETARY=nl_NL.UTF-8
|
|
apt-get install -y vim rsync htop byobu nmap curl ntp git \
|
|
python-dev libxml2-dev libxslt-dev python-pip sudo wget \
|
|
unattended-upgrades stunnel iptables-persistent
|
|
dpkg-reconfigure unattended-upgrades
|
|
apt-get install -y software-properties-common
|
|
wget -qO- https://get.docker.com/ | sh
|
|
|
|
#curl -L "https://github.com/docker/compose/releases/download/1.11.1/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
|
|
#chmod +x /usr/local/bin/docker-compose
|
|
|
|
pip install --upgrade pip
|
|
pip install --upgrade docker-compose
|
|
|
|
# make www-data user have homedir and use that account to manage all staging installs
|
|
|
|
mkdir -p /home/www
|
|
usermod -m -d /home/www www-data || true
|
|
usermod -s /bin/bash www-data || true
|
|
|
|
# www-data in docker groep
|
|
|
|
usermod -aG sudo www-data
|
|
usermod -aG docker www-data
|
|
|
|
# alles lees/schrijfbaar www-data groep
|
|
|
|
chmod -R g+w /home/www
|
|
|
|
# SSH
|
|
mkdir -p /home/www/.ssh
|
|
chmod 700 /home/www/.ssh
|
|
cp /root/.ssh/authorized_keys /home/www/.ssh
|
|
|
|
# certbot-auto
|
|
|
|
#cd /home/www
|
|
#wget https://dl.eff.org/certbot-auto
|
|
#chmod a+x certbot-auto
|
|
#./certbot-auto || true
|
|
|
|
|
|
chown -R www-data:www-data /home/www
|
|
|
|
|
|
#export EDITOR=vi
|
|
#visudo
|
|
|
|
# /ect/sudoers
|
|
# Allow members of group sudo to execute any command
|
|
# %sudo ALL=(ALL:ALL) NOPASSWD:ALL
|
|
```
|