CI e installatore: commenti degli script in inglese (#43)
La regola del progetto è «codice e commenti in inglese; interfaccia, documenti e messaggi in italiano», e gli script di .gitea/ (script e flussi), di installer/ e docker/entrypoint.sh avevano ancora i commenti in italiano (decisione di Alberto del 29 novembre 2026). Cambiano solo i commenti: i messaggi che una persona legge (echo, ::warning::, ::error::, nomi dei passi, note della release) restano in italiano e nessun comando cambia. I programmi awk e gli script finti delle prove erano già in inglese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f48384b7d4
commit
009e7d6710
18 files changed
+496
-495
No files matched your search
@@ -1,21 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Prova dell'immagine appena costruita, sul demone Docker del runner. Ogni contenitore gira SENZA RETE
|
||||
# (--network none): Febe non può raggiungere alcun sito, tanto meno Instagram (regola 1), e il controllo di salute
|
||||
# passa dalla rete interna del contenitore.
|
||||
# Ogni contenitore porta l'etichetta febe.ci.prova=<esecuzione>, messa qui con «docker run --label» e mai in
|
||||
# un'immagine: è il segno con cui pulizia-docker.sh riconosce un contenitore di prova, insieme al nome
|
||||
# febe-prova-<esecuzione>. Le etichette febe.ci.* dell'immagine non bastano: Docker le copia in ogni contenitore, anche
|
||||
# in un Febe vero avviato da un'immagine pubblicata.
|
||||
# Test of the image just built, on the runner's Docker daemon. Every container runs WITHOUT NETWORK (--network none):
|
||||
# Febe cannot reach any site, let alone Instagram (rule 1), and the health check goes through the container's
|
||||
# internal network.
|
||||
# Every container carries the label febe.ci.prova=<esecuzione>, set here with «docker run --label» and never in an
|
||||
# image: it is the mark by which pulizia-docker.sh recognises a test container, together with the name
|
||||
# febe-prova-<esecuzione>. The febe.ci.* labels of the image are not enough: Docker copies them into every container,
|
||||
# even into a real Febe started from a published image.
|
||||
#
|
||||
# .gitea/scripts/prova-immagine.sh <immagine> [esecuzione]
|
||||
#
|
||||
# 1. Chromium della distribuzione risponde e i criteri di Febe (niente password salvate) sono al loro posto;
|
||||
# 2. la lingua it_IT.UTF-8 è generata;
|
||||
# 3. il contenitore parte come dice la guida (profilo seccomp di Febe, password dell'interfaccia, PUID/PGID
|
||||
# predefiniti), il controllo di salute dell'immagine diventa «healthy» e «febe --controllo-salute» risponde;
|
||||
# 4. il processo 1 è Febe (niente tini) e nel contenitore non restano processi orfani da raccogliere;
|
||||
# 5. allo stop si ferma da solo, entro i 30 secondi che la guida concede.
|
||||
# La password è casuale, vive solo nell'ambiente del client Docker e non si stampa mai.
|
||||
# 1. the distribution's Chromium answers and the Febe policies (no saved passwords) are in place;
|
||||
# 2. the it_IT.UTF-8 locale is generated;
|
||||
# 3. the container starts as the guide says (Febe's seccomp profile, interface password, default PUID/PGID), the
|
||||
# image's health check becomes «healthy» and «febe --controllo-salute» answers;
|
||||
# 4. process 1 is Febe (no tini) and no orphan processes are left in the container to be reaped;
|
||||
# 5. on stop it stops by itself, within the 30 seconds the guide allows.
|
||||
# The password is random, lives only in the Docker client's environment and is never printed.
|
||||
set -euo pipefail
|
||||
|
||||
immagine="${1:?Indica quale immagine provare.}"
|
||||
@@ -24,8 +24,8 @@ radice="$(git rev-parse --show-toplevel)"
|
||||
etichette=(--label "febe.ci.prova=$esecuzione")
|
||||
nome="febe-prova-$esecuzione"
|
||||
|
||||
# Toglie il contenitore di prova di questa esecuzione (anche quello di un tentativo precedente), ma solo se porta il
|
||||
# segno della prova: un contenitore con lo stesso nome e senza segno resta, e «docker run --name» si ferma.
|
||||
# Removes the test container of this run (also the one of an earlier attempt), but only if it carries the test mark:
|
||||
# a container with the same name and without the mark stays, and «docker run --name» stops.
|
||||
togli() {
|
||||
local segno
|
||||
segno=$(docker container inspect -f '{{index .Config.Labels "febe.ci.prova"}}' "$nome" 2> /dev/null) || return 0
|
||||
@@ -52,7 +52,7 @@ docker run -d --name "$nome" --network none "${etichette[@]}" \
|
||||
--stop-timeout 30 -e FEBE_PASSWORD "$immagine" > /dev/null
|
||||
unset FEBE_PASSWORD
|
||||
|
||||
# Il primo controllo di salute dell'immagine arriva 30 secondi dopo l'avvio (HEALTHCHECK --interval=30s): fino a 3 minuti.
|
||||
# The image's first health check comes 30 seconds after the start (HEALTHCHECK --interval=30s): up to 3 minutes.
|
||||
stato=""
|
||||
for _ in $(seq 1 36); do
|
||||
if [[ "$(docker inspect -f '{{.State.Running}}' "$nome")" != "true" ]]; then
|
||||
@@ -77,16 +77,16 @@ fi
|
||||
echo "salute: healthy, e febe --controllo-salute risponde"
|
||||
|
||||
echo "== Processo 1 e processi orfani"
|
||||
# Senza tini il processo 1 è Febe, e il runtime .NET da processo 1 raccoglie anche i figli di Chromium rimasti orfani.
|
||||
# Un processo appena finito può restare «zombie» per un istante: conta solo uno che resta tale per 10 secondi.
|
||||
# Without tini process 1 is Febe, and the .NET runtime as process 1 also reaps the orphaned children of Chromium.
|
||||
# A process that has just ended may stay a «zombie» for an instant: only one that stays so for 10 seconds counts.
|
||||
primo="$(docker exec "$nome" cat /proc/1/comm)"
|
||||
if [[ "$primo" != "febe" ]]; then
|
||||
echo "Il processo 1 del contenitore è «$primo» invece di febe. Registro:" >&2
|
||||
docker logs --tail 80 "$nome" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
# I numeri dei processi zombie figli del processo 1, ordinati: quelli che tocca a lui raccogliere (gli orfani finiscono
|
||||
# lì). Uno sparito durante la lettura non conta.
|
||||
# The ids of the zombie processes that are children of process 1, sorted: the ones it has to reap (orphans end up
|
||||
# there). One that vanishes while being read does not count.
|
||||
orfani_zombie='for f in /proc/[0-9]*/status; do
|
||||
awk '\''$1 == "State:" { z = $2 } $1 == "Pid:" { p = $2 } $1 == "PPid:" { q = $2 } END { if (z == "Z" && q == 1) print p }'\'' "$f" 2> /dev/null
|
||||
done'
|
||||
|
||||
Reference in new issue
Block a user