2024-06-19 20:48:03 +02:00
# Status - page de statut de l'infrastructure de Libre en Communs
Basé sur le logiciel statping-ng
## Installation
2024-06-19 20:48:25 +02:00
Instructions : [https://statping-ng.github.io/install.html ](https://statping-ng.github.io/install.html )
2024-06-19 20:46:55 +02:00
2024-06-19 20:55:21 +02:00
### Installation du binaire
En root :
```
curl -o- -L https://raw.githubusercontent.com/statping-ng/statping-ng/stable/install.sh | bash
```
### Configuration
2024-06-20 18:12:42 +02:00
Créer l'utilisateur postgresql :
```
apt install postgresql
sudo -u postgres createuser -P statping
sudo -u postgres createdb -O statping statping
```
2024-06-19 20:55:21 +02:00
Création du service systemd dans `/etc/systemd/system/statping-ng.service` :
```
[Unit]
Description=Statping Server
After=network.target
After=systemd-user-sessions.service
After=network-online.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/statping
WorkingDirectory=/usr/local/bin
[Install]
WantedBy=multi-user.target
```
Recharger systemd :
```
systemctl daemon-reload
systemctl enable statping-ng.service
systemctl start statping-ng
```
2024-06-19 20:57:06 +02:00
### Personnalisation
2024-06-19 20:55:21 +02:00
2024-06-19 20:57:06 +02:00
Installer SASS :
```
apt install ruby-sass -y
```
2024-06-19 20:55:21 +02:00
2024-06-20 14:14:19 +02:00
Changer le CSS via l'interface [https://status.libre-en-communs.org/dashboard/settings ](https://status.libre-en-communs.org/dashboard/settings ).
Variables :
2024-06-20 13:58:26 +02:00
```
/* Index Page */
$background-color: #EAEAEA ;
$container-color: #fefff9 ;
$text-color: #2d3842 ;
$max-width: 1012px;
$title-color: #00adff ;
$description-color: #ef998f ;
$subtitle-color: #747474 ;
$mobile-card-shadow: 2px 3px 10px #b7b7b7 ;
$group-list-background: #FFFBEE ;
$group-list-title: #00adff ;
$navbar-color: #2d3842 ;
$navbar-background: #ffffff ;
$input-background: #fdfdfd ;
$input-color: #4e4e4e ;
$input-border: 1px solid #c9c9c9 ;
$day-success-background: #e9e9e9 ;
$day-error-background: #d50a0a ;
/* Status Container */
$card-background: #FFFBEE ;
$card-border: 1px solid rgba(76, 76, 76, 0.12);
$card-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.08);
$service-title: #00adff ;
$service-title-size: 1.8rem;
$service-stats-color: #4f4f4f ;
$service-description-color: #fff ;
$service-stats-size: 2.3rem;
$service-card-height: 480px;
/* Button Colors */
2024-06-20 14:14:19 +02:00
$success-color: green;
$danger-color: #d50a0a ;
$primary-color: #51829B ;
2024-06-20 13:58:26 +02:00
/* Footer Settings */
$footer-text-color: #b0b0b0 ;
2024-06-20 14:14:19 +02:00
$nav-tab-color: #ef998f ;
2024-06-20 13:58:26 +02:00
$footer-display: block;
/* Global Settings */
$global-border-radius: 0.2rem;
/* Mobile Settings */
$sm-background-color: #fcfcfc ;
$sm-border-radius: 0rem;
/* Mobile Service Container */
$sm-service-background: #ffffff ;
$sm-padding: 0;
$sm-service-stats-size: 1.5rem;
```
2024-06-20 14:14:19 +02:00
### Services
Importer depuis [https://status.libre-en-communs.org/dashboard/settings ](https://status.libre-en-communs.org/dashboard/settings ) le fichier [statping.json ](./statping.json ).
2024-09-18 08:53:17 +02:00
# Nettoyage (purge) quotidien de postgres
2024-06-19 20:55:21 +02:00
2024-09-18 08:53:17 +02:00
Ajouter la commande d'exécution quotidienne cron (tous les jours à 0h00) pour
nettoyer les anciennes valeurs datant de plus de 20 jours. 3 commandes sont
exécutées dans un seul appel de postgres
```
crontab -e
# Dans le fichier, ajouter :
0 0 * * * sudo -u postgres psql -d statping -c "DELETE FROM failures WHERE created_at < NOW () - INTERVAL ' 20 days '; DELETE FROM hits WHERE created_at < NOW () - INTERVAL ' 20 days '; VACUUM FULL ;"
```
2024-06-19 20:55:21 +02:00