Update README.md
This commit is contained in:
parent
b3dcbb1bf6
commit
7d9727ab18
122
README.md
122
README.md
|
@ -1,12 +1,132 @@
|
|||
# Service STATUS
|
||||
|
||||
Service d'information sur l'état des service du Chalec, le chaton de Libre en communs, basé sur le logiciel libre TinyStatus : https://github.com/bderenzo/tinystatus
|
||||
|
||||
Équipe : neox + Cpm.
|
||||
Anciennement : n/a.
|
||||
|
||||
Date création : octobre 2022.
|
||||
|
||||
|
||||
# Installation
|
||||
|
||||
## Prérequis système
|
||||
|
||||
Vérifier que le fichier `/etc/hosts.deny` ne bloque pas les connexions ssh :
|
||||
```
|
||||
#sshd: ALL
|
||||
```
|
||||
|
||||
## NGinx
|
||||
|
||||
Installer les paquets :
|
||||
```
|
||||
apt-get install nginx python3-certbot-nginx
|
||||
```
|
||||
|
||||
Ouvrir les ports http (80) et https (443) :
|
||||
```
|
||||
ufw allow 'Nginx HTTP'
|
||||
ufw allow 'Nginx HTTPS'
|
||||
ufw allow 444
|
||||
```
|
||||
|
||||
Configurer a minima le site web dans `/etc/nginx/sites-available/status.chalec.org` :
|
||||
```
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name status.chalec.org;
|
||||
|
||||
access_log /var/log/nginx/status.chalec.org-access.log;
|
||||
error_log /var/log/nginx/status.chalec.org-error.log;
|
||||
}
|
||||
```
|
||||
|
||||
Activer la configuration :
|
||||
```
|
||||
cd /etc/nginx/sites-enabled/
|
||||
ln -s ../sites-available/status.chalec.org
|
||||
```
|
||||
|
||||
Vérifier que c'est bon et recharger :
|
||||
```
|
||||
nginx -t && systemctl reload nginx
|
||||
```
|
||||
|
||||
Configurer le certificat SSl :
|
||||
```
|
||||
certbot --nginx
|
||||
```
|
||||
|
||||
Créer un fichier générique `cat /etc/nginx/statoolinfos.conf` qui sera includé plus tard :
|
||||
```
|
||||
location /.well-known/statoolinfos/
|
||||
{
|
||||
types
|
||||
{
|
||||
text/plain properties;
|
||||
}
|
||||
|
||||
alias /srv/statoolinfos/well-known/statoolinfos/;
|
||||
autoindex on;
|
||||
}
|
||||
```
|
||||
|
||||
Mettre beau le fichier `/etc/nginx/sites-enabled/status.chalec.org` :
|
||||
```
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name status.chalec.org;
|
||||
|
||||
access_log /var/log/nginx/status.chalec.org-access.log;
|
||||
error_log /var/log/nginx/status.chalec.org-error.log;
|
||||
|
||||
#return 302 https://$host$request_uri;
|
||||
return 302 https://status.chalec.org$request_uri;
|
||||
}
|
||||
|
||||
server
|
||||
{
|
||||
set_real_ip_from 192.169.1.1;
|
||||
real_ip_header proxy_protocol;
|
||||
listen [::]:443 ssl;
|
||||
listen 444 ssl proxy_protocol;
|
||||
|
||||
server_name status.chalec.org;
|
||||
|
||||
access_log /var/log/nginx/status.chalec.org-access.log;
|
||||
error_log /var/log/nginx/status.chalec.org-error.log;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/status.chalec.org/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/status.chalec.org/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||
|
||||
# StatoolInfos.
|
||||
include /etc/nginx/statoolinfos.conf;
|
||||
|
||||
root /var/www/status.chalec.org;
|
||||
location = /
|
||||
{
|
||||
index index.html;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Vérifier que c'est bon et recharger :
|
||||
```
|
||||
nginx -t && systemctl reload nginx
|
||||
```
|
||||
|
||||
## Déploiement de l'application
|
||||
|
||||
Prodécure de référence : https://github.com/bderenzo/tinystatus#setup
|
||||
|
||||
Créer le dossier web cible :
|
||||
|
@ -28,7 +148,7 @@ http4, 200, Chalec website, https://www.chalec.org/
|
|||
http6, 200, Chalec website, https://www.chalec.org/
|
||||
```
|
||||
|
||||
Programmer un cron dans /etc/cron.d/tinystatus:
|
||||
Programmer un cron dans `/etc/cron.d/tinystatus` :
|
||||
```
|
||||
1 * * * * root /srv/tinystatus/tinystatus > /var/www/status.chalec.org/index.html
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue