No description
Find a file
2024-10-01 18:00:46 +02:00
backup Update README.md 2024-07-16 18:07:43 +02:00
check_users Create list_user.py 2024-07-16 18:58:16 +02:00
overleaf-network Create create.txt 2024-07-13 15:58:54 +02:00
overleafmongo Update compose.yaml 2024-07-21 16:41:06 +02:00
overleafnginx Update nginx.conf 2024-07-21 02:35:55 +02:00
overleafredis Update overleaf_update_5.0.x_5.1.0.md 2024-07-21 17:30:36 +02:00
overleafregister Update post.html 2024-07-15 16:50:08 +02:00
overleafserver Update compose.yaml 2024-10-01 18:00:46 +02:00
sso_test_server Update compose.yaml 2024-07-24 17:23:49 +02:00
check_docker.sh Create check_docker.sh 2024-07-16 17:15:40 +02:00
check_user_net_connections.sh Create check_user_net_connections.sh 2024-07-21 00:06:55 +02:00
LICENSE Update LICENSE 2024-07-21 16:55:15 +02:00
msmtprc Create msmtprc 2024-07-16 16:35:09 +02:00
README.md Update README.md 2024-07-16 16:36:24 +02:00

Pepare the Ubuntu VM:

apt update
apt upgrade

apt install git pkg-config libssl-dev curl mc argon2 ca-certificates net-tools

install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

chmod a+r /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get update

apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

echo "{" > /etc/docker/daemon.json
echo '  "iptables": false' >> /etc/docker/daemon.json 
echo "}" >> /etc/docker/daemon.json  

systemctl restart docker

sed -i -e 's/DEFAULT_FORWARD_POLICY="DROP"/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw
ufw reload
iptables -t nat -A POSTROUTING ! -o docker0 -s 172.18.0.0/16 -j MASQUERADE

ufw allow in on docker0
ufw route allow in on docker0
ufw route allow out on docker0

ufw allow 22
ufw allow 443
ufw enable

ufw status verbose

docker run hello-world

# Mail
# Add root to the /etc/alias file and add the msmtprc file to /etc
apt -y install msmtp msmtp-mta mailutils
vi /etc/msmtprc
chmod 644 /etc/msmtprc
touch /var/log/msmtp.log
chmod 666 /var/log/msmtp.log
# ln -s /usr/bin/msmtp /usr/sbin/sendmail

# echo "Test message" | mail -s "Test subject" root

Don't forget to set up the cron job for the backup:

crontab -e

0 0 * * * /bin/bash /root/backup/make_backup.sh