Update README.md
This commit is contained in:
parent
de3ea3e72f
commit
67adec8fcf
232
README.md
232
README.md
|
@ -6,12 +6,10 @@ Responsable : Christian Momon (@cpm)
|
||||||
|
|
||||||
Anciens responsables : n/a.
|
Anciens responsables : n/a.
|
||||||
|
|
||||||
# Site web
|
# Installation basique du site web
|
||||||
|
|
||||||
Actuellement, le site web est statique et généré par la moulinette `statoolinfos` toutes les heures.
|
Actuellement, le site web est statique et généré par la moulinette `statoolinfos` toutes les heures.
|
||||||
|
|
||||||
## Installation basique
|
|
||||||
|
|
||||||
Installer les paquets :
|
Installer les paquets :
|
||||||
```
|
```
|
||||||
apt-get install nginx python3-certbot-nginx
|
apt-get install nginx python3-certbot-nginx
|
||||||
|
@ -53,6 +51,20 @@ Configurer le certificat SSl :
|
||||||
certbot --nginx
|
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/stats.chalec.org` :
|
Mettre beau le fichier `/etc/nginx/sites-enabled/stats.chalec.org` :
|
||||||
```
|
```
|
||||||
server
|
server
|
||||||
|
@ -86,6 +98,9 @@ server
|
||||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||||
|
|
||||||
|
# StatoolInfos.
|
||||||
|
include /etc/nginx/statoolinfos.conf;
|
||||||
|
|
||||||
root /var/www/stats.chalec.org;
|
root /var/www/stats.chalec.org;
|
||||||
location = /
|
location = /
|
||||||
{
|
{
|
||||||
|
@ -99,14 +114,12 @@ Vérifier que c'est bon et recharger :
|
||||||
nginx -t && systemctl reload nginx
|
nginx -t && systemctl reload nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
# Service StatoolInfos
|
# Déploiement du générateur de site web
|
||||||
|
|
||||||
TODO
|
## Configuration /etc/hosts
|
||||||
|
|
||||||
# Configuration /etc/hosts
|
|
||||||
|
|
||||||
Le programme StatoolInfos va faire des requêtes web sur la vm donc il a besoin de la voir.
|
Le programme StatoolInfos va faire des requêtes web sur la vm donc il a besoin de la voir.
|
||||||
Pour éviter d'avoir un court-circuit proxy ipv4, modifier le fichier `/etc/hosts` pour déclarer stats.chalec.org en ipv6 local uniquement :
|
Pour éviter d'avoir un court-circuit proxy ipv4, modifier le fichier `/etc/hosts` pour déclarer stats.chalec.org en ipv6 locale uniquement :
|
||||||
```
|
```
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
127.0.1.1 stats
|
127.0.1.1 stats
|
||||||
|
@ -116,3 +129,206 @@ Pour éviter d'avoir un court-circuit proxy ipv4, modifier le fichier `/etc/host
|
||||||
ff02::1 ip6-allnodes
|
ff02::1 ip6-allnodes
|
||||||
ff02::2 ip6-allrouters
|
ff02::2 ip6-allrouters
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Configuration de Java
|
||||||
|
Java :
|
||||||
|
```
|
||||||
|
apt-get install openjdk-11-jre-headless
|
||||||
|
```
|
||||||
|
|
||||||
|
## Espace de travail
|
||||||
|
Dossiers de travail :
|
||||||
|
```
|
||||||
|
mkdir -p /srv/statoolinfos/{conf,inputs,well-known}
|
||||||
|
mkdir -p /srv/statoolinfos/well-known/statoolinfos/
|
||||||
|
ln -s /var/www/stats.chalec.org /srv/statoolinfos/www
|
||||||
|
```
|
||||||
|
|
||||||
|
Déployer les catégories : copier le dossier https://framagit.org/chatons/chatonsinfos/-/tree/master/StatoolInfos/categories dans `/srv/statoolinfos/inputs/`.
|
||||||
|
|
||||||
|
Créer un fichier de configuration pour le générateur :
|
||||||
|
```
|
||||||
|
# [Configuration]
|
||||||
|
conf.class=federation
|
||||||
|
conf.protocol=StatoolInfos-0.5
|
||||||
|
|
||||||
|
conf.crawl.input=https://stats.chalec.org/.well-known/statoolinfos/chalec.properties
|
||||||
|
conf.crawl.cache=/srv/statoolinfos/cache/
|
||||||
|
|
||||||
|
conf.htmlize.categories=/srv/statoolinfos/inputs/categories/categories.properties
|
||||||
|
conf.htmlize.input=https://stats.chalec.org/.well-known/statoolinfos/chalec.properties
|
||||||
|
conf.htmlize.directory=/srv/statoolinfos/www/
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le fichier `properties` de type `federation` nommé `/srv/statoolinfos/well-known/statoolinfos/chalec.properties` :
|
||||||
|
```
|
||||||
|
# [File]
|
||||||
|
file.class=federation
|
||||||
|
file.generator=Cpm
|
||||||
|
file.datetime=2022-01-12T02:24:35
|
||||||
|
file.protocol=StatoolInfos-0.4.0
|
||||||
|
|
||||||
|
# [Federation]
|
||||||
|
federation.name=Chalec
|
||||||
|
federation.description=Le chaton de Libre-en-communs
|
||||||
|
federation.website=https://www.chalec.org/
|
||||||
|
federation.logo=https://stats.chalec.org/.well-known/statoolinfos/chalec-logo.svg
|
||||||
|
federation.contact.url=
|
||||||
|
federation.contact.email=contact@chalec.org
|
||||||
|
federation.socialnetworks.mastodon=
|
||||||
|
federation.legal.url=
|
||||||
|
federation.guide.user=
|
||||||
|
federation.guide.technical=
|
||||||
|
federation.startdate=12/2021
|
||||||
|
federation.enddate=
|
||||||
|
|
||||||
|
# [Subs]
|
||||||
|
subs.infra=https://stats.chalec.org/.well-known/statoolinfos/infra.properties
|
||||||
|
subs.services=https://stats.chalec.org/.well-known/statoolinfos/services.properties
|
||||||
|
|
||||||
|
|
||||||
|
# [Metrics]
|
||||||
|
metrics.members.count.2021 = 2
|
||||||
|
metrics.members.in.2021 = 2
|
||||||
|
metrics.members.out.2021 = 0
|
||||||
|
|
||||||
|
metrics.members.count.2022 = 2
|
||||||
|
metrics.members.in.2022 = 0
|
||||||
|
metrics.members.out.2022 = 0
|
||||||
|
```
|
||||||
|
|
||||||
|
Vérifier la validé des valeurs et placer dans `/srv/statoolinfos/well-known/statoolinfos/` les images de logos nécessaires.
|
||||||
|
|
||||||
|
Créer le fichier `properties` de type `organization` nommé `/srv/statoolinfos/well-known/statoolinfos/infra.properties` :
|
||||||
|
```
|
||||||
|
# [File]
|
||||||
|
file.class=organization
|
||||||
|
file.generator=Cpm
|
||||||
|
file.datetime=2022-01-12T02:22:02.096451
|
||||||
|
file.protocol=StatoolInfos-0.5
|
||||||
|
|
||||||
|
# [Organization]
|
||||||
|
organization.name=Infra
|
||||||
|
organization.description=Les services d'infrastructure de Chalec
|
||||||
|
organization.website=https://www.chalec.org/
|
||||||
|
organization.logo=https://stats.chalec.org/.well-known/statoolinfos/chalec-infra-logo.svg
|
||||||
|
organization.status.level=ACTIVE
|
||||||
|
organization.status.description=En activité
|
||||||
|
organization.owner.name=Chalec
|
||||||
|
organization.owner.website=https://www.chalec.org/
|
||||||
|
organization.owner.logo=https://stats.chalec.org/.well-known/statoolinfos/alec-logo-carre.png
|
||||||
|
organization.contact.url=
|
||||||
|
organization.contact.email=contact@chalec.org
|
||||||
|
organization.socialnetworks.mastodon=
|
||||||
|
organization.legal.url=
|
||||||
|
organization.guide.user=
|
||||||
|
organization.guide.technical=
|
||||||
|
organization.startdate=12/2021
|
||||||
|
organization.enddate=
|
||||||
|
organization.memberof.chalec.status.level=IDLE
|
||||||
|
organization.memberof.chalec.status.description=
|
||||||
|
organization.memberof.chalec.startdate=01/10/2021
|
||||||
|
organization.memberof.chalec.enddate=
|
||||||
|
organization.country.name=France
|
||||||
|
organization.country.code=FR
|
||||||
|
|
||||||
|
# [Subs]
|
||||||
|
subs.stats.chalec.org=https://stats.chalec.org/.well-known/statoolinfos/stats.chalec.org.properties
|
||||||
|
subs.www.chalec.org=https://www.chalec.org/.well-known/statoolinfos/www.chalec.org.properties
|
||||||
|
```
|
||||||
|
Vérifier la validé des valeurs et placer dans `/srv/statoolinfos/well-known/statoolinfos/` les images de logos nécessaires.
|
||||||
|
|
||||||
|
Créer le fichier `properties` de type `federation` nommé `/srv/statoolinfos/well-known/statoolinfos/services.properties` :
|
||||||
|
```
|
||||||
|
# [File]
|
||||||
|
file.class=organization
|
||||||
|
file.generator=Cpm
|
||||||
|
file.datetime=2022-01-12T02:22:02.096451
|
||||||
|
file.protocol=StatoolInfos-0.5
|
||||||
|
|
||||||
|
# [Organization]
|
||||||
|
organization.name=Services au public
|
||||||
|
organization.description=Les services au public de Chalec
|
||||||
|
organization.website=https://www.chalec.org/
|
||||||
|
organization.logo=https://stats.chalec.org/.well-known/statoolinfos/chalec-services-logo.svg
|
||||||
|
organization.status.level=ACTIVE
|
||||||
|
organization.status.description=En activité
|
||||||
|
organization.owner.name=Chalec
|
||||||
|
organization.owner.website=https://www.chalec.org/
|
||||||
|
organization.owner.logo=https://www.chalec.org/.well-known/statoolinfos/chalec-logo-carre.png
|
||||||
|
organization.contact.url=
|
||||||
|
organization.contact.email=contact@chalec.org
|
||||||
|
organization.socialnetworks.mastodon=
|
||||||
|
organization.legal.url=
|
||||||
|
organization.guide.user=
|
||||||
|
organization.guide.technical=
|
||||||
|
organization.startdate=12/2021
|
||||||
|
organization.enddate=
|
||||||
|
organization.memberof.chalec.status.level=IDLE
|
||||||
|
organization.memberof.chalec.status.description=
|
||||||
|
organization.memberof.chalec.startdate=12/2021
|
||||||
|
organization.memberof.chalec.enddate=
|
||||||
|
organization.country.name=France
|
||||||
|
organization.country.code=FR
|
||||||
|
|
||||||
|
# [Subs]
|
||||||
|
subs.audio=https://audio.chalec.org/.well-known/statoolinfos/audio.chalec.org.properties
|
||||||
|
subs.libreverse=https://libreverse.chalec.org/.well-known/statoolinfos/libreverse.chalec.org.properties
|
||||||
|
```
|
||||||
|
|
||||||
|
Vérifier la validé des valeurs et placer dans `/srv/statoolinfos/well-known/statoolinfos/` les images de logos nécessaires.
|
||||||
|
|
||||||
|
Récupérer la dernièer version de StatoolInfos sur https://forge.devinsy.fr/devinsy/statoolinfos/releases. Puis placer dans `/srv/statoolinfos/bin/` les fichiers `statoolinfos.jar` et `statoolinfos.sh`. Faire un lien :
|
||||||
|
```
|
||||||
|
cd /srv/statoolinfos/bin/
|
||||||
|
ln -s statoolinfos.sh statoolinfos
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le script `/srv/statoolinfos/bin/crawl` :
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
./statoolinfos crawl ../conf/chalec.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le script `/srv/statoolinfos/bin/htmlize` :
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
./statoolinfos htmlize ../conf/chalec.conf
|
||||||
|
chmod -R go+rX ../www/
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le script `/srv/statoolinfos/bin/probe` :
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
./statoolinfos probe -previousday ../conf/
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le script `/srv/statoolinfos/bin/refresh` :
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
./probe
|
||||||
|
./crawl
|
||||||
|
./uptime
|
||||||
|
./htmlize
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le script `/srv/statoolinfos/bin/uptime` :
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(dirname "$0")
|
||||||
|
./statoolinfos uptime ../conf/chalec.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer le cron `/etc/cron.d/statoolinfos` :
|
||||||
|
```
|
||||||
|
4 * * * * root /srv/statoolinfos/bin/refresh >> /srv/statoolinfos/statoolinfos-cron.log
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue