blob: fd80efe9ecd69c2ec928b4b93489d4f41a3b318e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# prepare os
#unzip -p <arm64_lite>.img | dd of=/dev/mmcblk0 conv=fsync bs=4M status=progress
#mount /dev/mmcblk0#p1 /mnt
#cd /mnt
#touch ssh
#add those lines to config.txt
disable_overscan=1
over_voltage=6
arm_freq=2147
gpu_freq=750
# update system
apt update
apt dist-upgrade
apt upgrade
apt autoremove
rpi-eeprom-update
# install tools
apt install tmux neovim ranger neofetch
#ssh-copy-id -i .ssh/id_rsa.pub pi@192.168.0.22
#passwd
#rfkill block bluetooth
# set ssh to accept only keys on localhost*
vim /etc/ssh/sshd_config
#add those lines
PermitRootLogin no
PasswordAuthentication no
service sshd restart
# install pihole & pivpn
curl -L https://install.pivpn.io | bash
curl -sSL https://install.pi-hole.net | bash
#change pihole password
pihole -a -p
# 80 -> 8080 lighttp
sed -i "s/80/8080/" /etc/lighttpd/lighttpd.conf
service lighttpd restart
# installing
apt install nginx certbot python3-certbot-nginx ufw fail2ban prosody coturn
# move default index page to /var/www/html/default
mkdir /var/www/html/default
mv /var/www/html/index* /var/www/html/default
sed -i "s/w\/html/w\/html\/default/" /etc/nginx/sites-available/default
service nginx restart
# configure nginx to prevent spam
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
limit_req zone=one;
# ufw & fail2ban
pivpn -d
vim /etc/default/ufw "disable ipv6"
ufw allow from 192.168.0.0/24
ufw allow from 10.8.0.0/24
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow XMPP
ufw enable
# certbot
certbot -d gajba.cf --nginx
certbot certonly -d chat.gajba.cf --nginx
# ovpns
pivpn add -n aleksa
# prosody
admins = { "aleksa@gajba.cf" }
VirtualHost "gajba.cf"
service prosody restart
sudo prosodyctl --root cert import /etc/letsencrypt/live/
sudo prosodyctl adduser aleksa@gajba.cf
# mail server
# in progress
# that's it
reboot
# testing
for i in {nginx,ufw,fail2ban,prosody}; do service $i status | grep Active; done
|