Table des matières

Import des données via GN2PG

Notes

Relancer un import GN2PG interrompu

Principes pour les données transmises

Mise à jour de l'installation de Gn2Pg

Installer le Dashboard Gn2Pg

Fichier Nginx par défaut

server {
    listen [::]:80 ipv6only=on;
    listen 80;
 
    server_name gn2pg.<domaine-sinp>;
    root /home/geonat/www/gn2pg/public;
 
    satisfy any;
    allow <ip-v4-srv-web>;
    deny  all;
    auth_basic "Zone restreinte";
    auth_basic_user_file /etc/nginx/.htpasswd;
 
    location /<source> {
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
        proxy_buffering off;
 
        proxy_read_timeout 30s;
        proxy_connect_timeout 10s;
        proxy_pass http://127.0.0.1:<source-port>;# ATTENTION : ne rien mettre après le port pour que le chemin complet soit passé à Gunicorn
    }
}

Fichier Logrotate de Gn2Pg

/var/log/gn2pg/*.log {
    su geonat geonat
    daily
    rotate 8
    size 100M
    create
    compress
    postrotate
    systemctl reload gn2pg || true
    endscript
}

Fichier Systemd de Gn2Pg

[Unit]
Description=GN2PG-<source>
After=network.target
#After=postgresql.service

[Service]
Type=simple
User=geonat
Group=geonat
WorkingDirectory=/home/geonat/www/gn2pg/<source>/
Environment=GUNICORN_PROC_NAME=gn2pg
Environment=GUNICORN_NUM_WORKERS=4
Environment=GUNICORN_PORT=5001
Environment=GUNICORN_TIMEOUT=30
Environment=GUNICORN_LOG_FILE=/var/log/gn2pg/gn2pg-gunicorn.log
Environment=GUNICORN_LOG_LEVEL=info
EnvironmentFile=-/home/geonat/www/gn2pg/<source>/environ
ExecStart=/home/geonat/www/gn2pg/<source>/.venv/bin/gunicorn gn2pg.app.app:create_app() \
                --name "${GUNICORN_PROC_NAME}" --workers "${GUNICORN_NUM_WORKERS}" \
                --bind "${GUNICORN_HOST}:${GUNICORN_PORT}" --timeout="${GUNICORN_TIMEOUT}" \
                --log-file "${GUNICORN_LOG_FILE}" --log-level "${GUNICORN_LOG_LEVEL}"
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=10
TimeoutStopSec=5
PrivateTmp=true
StandardOutput=append:/var/log/gn2pg/gn2pg-<source>.log
StandardError=inherit

[Install]
WantedBy=multi-user.target

Exemple de contenu pour index.html

<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Gn2Pg Dashboards Biodiv'AURA</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <style>
      .bi {
        vertical-align: -.125em;
        fill: currentColor;
      }
    </style>
  </head>
  <body>
    <svg xmlns="http://www.w3.org/2000/svg" class="d-none">
      <symbol id="arrow-right-short" viewBox="0 0 16 16">
        <path fill-rule="evenodd" d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z"/>
      </symbol>
    </svg>
    <div class="container my-5">
      <div class="p-5 text-center bg-body-tertiary rounded-3">
        <img src="logo-orb.png" alt="ORB AURA"/>
        <img src="/lpo/img/src_gn2pg.png" />
        <h1 class="text-body-emphasis">Gn2Pg dashboards</h1>
        <p class="col-lg-8 mx-auto fs-5 text-muted">
          Accès aux interfaces des dashboards de Gn2Pg.
        </p>
        <div class="d-inline-flex gap-2 mb-5">
          <a class="d-inline-flex align-items-center btn btn-primary btn-lg px-4 rounded-pill" href="/lpo">
            LPO
            <svg class="bi ms-2" width="24" height="24"><use xlink:href="#arrow-right-short"/></svg>
          </a>
          <a class="d-inline-flex align-items-center btn btn-primary btn-lg px-4 rounded-pill" href="/flavia">
            Flavia
            <svg class="bi ms-2" width="24" height="24"><use xlink:href="#arrow-right-short"/></svg>
          </a>
        </div>
      </div>
    </div>
 
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
  </body>
</html>