Deploiement VPS : unites utilisateur, script deployer-vps.sh, Caddy weather.gastinel.me
- deploiement/ : unites reelles (EnvironmentFile=%h/.config/meteo-collecte/env, MC_PUBLIC=/srv/weather.gastinel.me, MC_DIRECT_COMPAT a cote de direct.json, pas dessus). Minuteur inchange (hh:x4, hh:x9), non active. - deploy/deployer-vps.sh : copie sans ecraser var/, sauvegardes .avant-deploiement-1017, env cree vide (600), --config et --publier de controle sans appel reseau ; --activer seulement si conditions reunies. - deploy/appliquer-caddy-meteo.sh : bloc weather.gastinel.me (/data/* lecture seule, CORS), sauvegarde Caddyfile.avant-meteo-1017, validate, reload, retour arriere. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
314c2cc12e
révision
fdcca5bccc
6 fichiers modifiés
+303
-143
Aucun fichier ne correspond à votre recherche
@@ -1,34 +1,35 @@
|
||||
"""Contrôles statiques des fichiers systemd d'exemple (pas de systemd sous Windows : rien n'est installé)."""
|
||||
import datetime as dt
|
||||
import re
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from meteo_collecte.infoclimat import type_passage
|
||||
from tests.aide import t
|
||||
|
||||
DOSSIER = Path(__file__).resolve().parent.parent / "deploiement"
|
||||
|
||||
|
||||
class TestUnites(unittest.TestCase):
|
||||
def test_minuteur_aligne_sur_les_passages(self):
|
||||
texte = (DOSSIER / "meteo-collecte.timer").read_text(encoding="utf-8")
|
||||
m = re.search(r"^OnCalendar=\*:(\d\d)/(\d+)$", texte, re.M)
|
||||
self.assertIsNotNone(m)
|
||||
depart, pas = int(m.group(1)), int(m.group(2))
|
||||
minutes = list(range(depart, 60, pas))
|
||||
self.assertEqual(minutes, [4, 9, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59])
|
||||
genres = [type_passage(t(12, 0) + dt.timedelta(minutes=x)) for x in minutes]
|
||||
self.assertEqual(genres, ["principal", "rattrapage"] * 6)
|
||||
|
||||
def test_service_sans_secret_ni_sudo(self):
|
||||
texte = (DOSSIER / "meteo-collecte.service").read_text(encoding="utf-8")
|
||||
actif = [l for l in texte.splitlines() if l and not l.startswith("#")]
|
||||
self.assertTrue(any(l.startswith("ExecStart=") and "meteo_collecte.ordonnanceur" in l for l in actif))
|
||||
for l in actif:
|
||||
self.assertNotRegex(l, r"(?i)MC_JETON_INFOCLIMAT=|MC_CLE_ROMMA=|token=|apikey=|sudo")
|
||||
self.assertIn("EnvironmentFile=-", texte)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
"""Contrôles statiques des fichiers systemd d'exemple (pas de systemd sous Windows : rien n'est installé)."""
|
||||
import datetime as dt
|
||||
import re
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from meteo_collecte.infoclimat import type_passage
|
||||
from tests.aide import t
|
||||
|
||||
DOSSIER = Path(__file__).resolve().parent.parent / "deploiement"
|
||||
|
||||
|
||||
class TestUnites(unittest.TestCase):
|
||||
def test_minuteur_aligne_sur_les_passages(self):
|
||||
texte = (DOSSIER / "meteo-collecte.timer").read_text(encoding="utf-8")
|
||||
m = re.search(r"^OnCalendar=\*:(\d\d)/(\d+)$", texte, re.M)
|
||||
self.assertIsNotNone(m)
|
||||
depart, pas = int(m.group(1)), int(m.group(2))
|
||||
minutes = list(range(depart, 60, pas))
|
||||
self.assertEqual(minutes, [4, 9, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59])
|
||||
genres = [type_passage(t(12, 0) + dt.timedelta(minutes=x)) for x in minutes]
|
||||
self.assertEqual(genres, ["principal", "rattrapage"] * 6)
|
||||
|
||||
def test_service_sans_secret_ni_sudo(self):
|
||||
texte = (DOSSIER / "meteo-collecte.service").read_text(encoding="utf-8")
|
||||
actif = [l for l in texte.splitlines() if l and not l.startswith("#")]
|
||||
self.assertTrue(any(l.startswith("ExecStart=") and "meteo_collecte.ordonnanceur" in l for l in actif))
|
||||
for l in actif:
|
||||
self.assertNotRegex(l, r"(?i)MC_JETON_INFOCLIMAT=|MC_CLE_ROMMA=|token=|apikey=|sudo")
|
||||
self.assertIn("EnvironmentFile=%h/.config/meteo-collecte/env", texte)
|
||||
self.assertNotIn("EnvironmentFile=-", texte)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur