2021-11-16 21:06:50 +01:00
|
|
|
## Machine virtuelle TOOT
|
2021-10-03 13:54:35 +02:00
|
|
|
|
|
|
|
Cette machine est destinée à accueillir l'instance Mastodon de l'association.
|
|
|
|
|
|
|
|
### Matériel virtuel
|
|
|
|
|
2021-10-06 10:32:34 +02:00
|
|
|
CPU : 3
|
|
|
|
RAM : 2048 Mio
|
2021-10-03 13:54:35 +02:00
|
|
|
Stockage de masse : 50 Gio
|
|
|
|
|
|
|
|
### Logiciel
|
|
|
|
|
|
|
|
Système d'exploitation : Debian GNU/Linux-libre 11 (Bullseye)
|
|
|
|
Noyau : Linux-libre LTS (`linux-libre-lts` des dépôts https://linux-libre.fsfla.org)
|
|
|
|
Sécurités de la maintenance : `etckeeper`, `mollyguard`, `git`, `tig`, `screen`
|
|
|
|
Mail Transfer Agent : `postfix`
|
2021-10-06 10:32:34 +02:00
|
|
|
Base do donnée : PostgreSQL
|
|
|
|
Serveur Web: NGINX
|
2021-10-03 13:54:35 +02:00
|
|
|
|
|
|
|
### Caractéristiques notables
|
|
|
|
|
|
|
|
Domaine : toot.a-lec.org
|
|
|
|
Adresse ipv4 publique : 80.67.179.96
|
2021-11-16 19:39:34 +01:00
|
|
|
Adresse ipv4 interne : 192.169.1.173
|
|
|
|
Adresse ipv6 publique : 2001:910:1360::16a
|
2021-10-06 10:32:34 +02:00
|
|
|
|
|
|
|
### Comptes
|
2021-10-12 22:45:26 +02:00
|
|
|
|
|
|
|
Administrateur: admin
|
|
|
|
Modérateurs: neox, echolib
|
|
|
|
Ouverture de compte: tout membre de l'association
|
2021-10-06 10:32:34 +02:00
|
|
|
|
|
|
|
### Visibilité
|
2021-10-12 22:45:26 +02:00
|
|
|
|
2021-10-06 10:32:34 +02:00
|
|
|
Instance publique
|
2021-11-16 19:02:04 +01:00
|
|
|
|
|
|
|
#### Configuration réseau
|
|
|
|
|
|
|
|
##### /etc/network/interfaces
|
2021-11-16 23:36:03 +01:00
|
|
|
<details>
|
2021-11-16 19:02:04 +01:00
|
|
|
|
|
|
|
# The loopback network interface
|
|
|
|
auto lo
|
|
|
|
iface lo inet loopback
|
|
|
|
|
|
|
|
# The primary network interface
|
|
|
|
allow-hotplug enp1s0
|
|
|
|
iface enp1s0 inet dhcp
|
|
|
|
iface enp1s0 inet6 static
|
|
|
|
address 2001:910:1360::16a/128
|
|
|
|
gateway 2001:910:1360::
|
2021-11-16 19:32:55 +01:00
|
|
|
|
2021-11-16 23:36:03 +01:00
|
|
|
</details>
|
|
|
|
|
2021-11-16 19:32:55 +01:00
|
|
|
##### /etc/host.allow
|
|
|
|
|
|
|
|
sshd: 192.169.1.0/24, [2001:910:1360::]/48
|
|
|
|
|
|
|
|
##### /etc/host/deny
|
|
|
|
|
|
|
|
sshd: ALL
|
2021-11-16 19:49:02 +01:00
|
|
|
|
|
|
|
### Configuration MTA
|
|
|
|
|
|
|
|
#### /etc/postfix/transport
|
|
|
|
|
|
|
|
a-lec.org :
|
|
|
|
* discard:
|
|
|
|
|
|
|
|
#### /etc/postfix/virtual
|
|
|
|
|
|
|
|
@localhost admin@a-lec.org
|
2021-11-16 21:06:50 +01:00
|
|
|
@toot.a-lec.org admin@a-lec.org
|
|
|
|
|
|
|
|
### Configuration serveur web (nginx)
|
2021-11-16 23:36:03 +01:00
|
|
|
<details>
|
2021-11-16 21:06:50 +01:00
|
|
|
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
server_name toot.a-lec.org;
|
|
|
|
return 302 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl proxy_protocol default_server;
|
|
|
|
listen [::]:443 ssl http2 default_server;
|
|
|
|
server_name toot.a-lec.org;
|
|
|
|
|
|
|
|
set_real_ip_from 192.169.1.1;
|
|
|
|
real_ip_header proxy_protocol;
|
|
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/toot.a-lec.org/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/toot.a-lec.org/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.2;
|
|
|
|
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
ssl_session_cache shared:SSL:10m;
|
|
|
|
|
|
|
|
keepalive_timeout 70;
|
|
|
|
sendfile on;
|
|
|
|
client_max_body_size 0;
|
|
|
|
|
|
|
|
root /home/mastodon/live/public;
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
gzip_disable "msie6";
|
|
|
|
gzip_vary on;
|
|
|
|
gzip_proxied any;
|
|
|
|
gzip_comp_level 6;
|
|
|
|
gzip_buffers 16 8k;
|
|
|
|
gzip_http_version 1.1;
|
|
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000";
|
|
|
|
|
|
|
|
location / {
|
|
|
|
try_files $uri @proxy;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) {
|
|
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
|
|
try_files $uri @proxy;
|
|
|
|
}
|
|
|
|
|
|
|
|
location @proxy {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
|
|
proxy_set_header Proxy "";
|
|
|
|
proxy_pass_header Server;
|
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
|
|
|
tcp_nodelay on;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /api/v1/streaming {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
|
|
proxy_set_header Proxy "";
|
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:4000;
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
|
|
|
tcp_nodelay on;
|
|
|
|
}
|
|
|
|
|
|
|
|
error_page 500 501 502 503 504 /500.html;
|
|
|
|
}
|
2021-11-16 23:36:03 +01:00
|
|
|
</details>
|