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:
Alby96andClaude Opus 5.5 committed 2026-11-29 12:03:13 +01:00
1 parent f48384b7d4
commit 009e7d6710
18 files changed
+496 -495

No files matched your search

+30 -30
View File
@@ -1,29 +1,29 @@
#!/usr/bin/env bash
# Costruzione dell'immagine Docker di Febe con il builder buildx dell'esecuzione (docker-container), sempre con gli
# stessi argomenti e le stesse etichette: la costruzione che si pubblica esce intera dalla cache di quella che si è
# provata e scansionata, quindi gli strati sono gli stessi.
# Builds the Febe Docker image with the buildx builder of the run (docker-container), always with the same arguments
# and the same labels: the build that is published comes entirely from the cache of the one that was tested and
# scanned, so the layers are the same.
#
# costruisci-immagine.sh builder <registro> il builder buildx dell'esecuzione (BUILDER), con il
# driver docker-container e la configurazione di
# buildkit che dice che il registro di casa risponde in
# HTTP (al posto di docker/setup-buildx-action, un'azione
# JavaScript); lo toglie pulizia-docker.sh esecuzione
# costruisci-immagine.sh archivio <file.tar> <nome locale> archivio dell'immagine, per docker load e per Trivy
# costruisci-immagine.sh pubblica <nome:etichetta>... spinta sul registro REGISTRY da buildx, con
# REGISTRO_UTENTE e REGISTRO_TOKEN in una configurazione
# del client solo sua, tolta alla fine; il demone non
# parla mai con il registro (proverebbe HTTPS)
# costruisci-immagine.sh builder <registro> the buildx builder of the run (BUILDER), with the
# docker-container driver and the buildkit configuration
# that says the home registry answers in HTTP (instead
# of docker/setup-buildx-action, a JavaScript action);
# pulizia-docker.sh esecuzione removes it
# costruisci-immagine.sh archivio <file.tar> <nome locale> archive of the image, for docker load and for Trivy
# costruisci-immagine.sh pubblica <nome:etichetta>... push to the REGISTRY registry by buildx, with
# REGISTRO_UTENTE and REGISTRO_TOKEN in a client
# configuration of its own, removed at the end; the
# daemon never talks to the registry (it would try HTTPS)
#
# L'immagine è un manifest semplice, senza attestazioni (--provenance=false --sbom=false). Con le attestazioni, che
# buildx aggiunge da sé, sarebbe un indice: Gitea tiene ogni manifest figlio come una versione a sé, sha256:… senza
# etichetta, con la configurazione e gli strati, e togliere dal registro un'etichetta :sha- toglierebbe solo l'indice.
# Con un manifest semplice gli strati stanno nella versione dell'etichetta, e la pulizia del registro li libera davvero.
# The image is a plain manifest, without attestations (--provenance=false --sbom=false). With the attestations, which
# buildx adds by itself, it would be an index: Gitea keeps every child manifest as a version of its own, sha256:…
# without a tag, with the configuration and the layers, and removing a :sha- tag from the registry would remove only
# the index. With a plain manifest the layers belong to the tag's version, and the registry cleanup really frees them.
#
# Variabili richieste: BUILDER, VERSIONE, GIT_COMMIT, FLUSSO (verifica o rilascio), ESECUZIONE (gitea.run_id).
# Le etichette febe.ci.* dicono quale flusso, esecuzione, ramo e commit hanno costruito l'immagine. Non servono alla
# pulizia: stanno anche nelle immagini pubblicate e Docker le copia in ogni contenitore creato da quelle, anche in un
# Febe vero. Per questo qui non si mette mai febe.ci.prova, il segno dei soli contenitori di prova (prova-immagine.sh):
# lo controlla PipelineTests.
# Required variables: BUILDER, VERSIONE, GIT_COMMIT, FLUSSO (verifica or rilascio), ESECUZIONE (gitea.run_id).
# The febe.ci.* labels say which workflow, run, branch and commit built the image. They are not used by the cleanup:
# they are also in the published images and Docker copies them into every container created from those, even in a
# real Febe. That is why febe.ci.prova, the mark of test containers only (prova-immagine.sh), is never set here:
# PipelineTests checks it.
set -euo pipefail
modo="${1:?Indica il modo: builder, archivio o pubblica.}"
@@ -32,11 +32,11 @@ cd "$(git rev-parse --show-toplevel)"
if [[ "$modo" == builder ]]; then
registro="${1:?Indica il registro, per esempio 192.168.30.23:3000.}"
# Solo un nome di host (o un indirizzo) con la porta: il valore finisce in un file TOML.
# Only a host name (or an address) with the port: the value ends up in a TOML file.
[[ "$registro" =~ ^[A-Za-z0-9.-]+(:[0-9]+)?$ ]] || { echo "Registro non valido: «$registro»." >&2; exit 2; }
configurazione="${RUNNER_TEMP:-/tmp}/buildkitd-${BUILDER:?}.toml"
printf '[registry."%s"]\n http = true\n insecure = true\n' "$registro" > "$configurazione"
# --buildkitd-config da buildx 0.13; prima si chiamava --config.
# --buildkitd-config since buildx 0.13; before, it was called --config.
opzione=--buildkitd-config
aiuto=$(docker buildx create --help 2> /dev/null) || true
[[ "$aiuto" == *--buildkitd-config* ]] || opzione=--config
@@ -69,11 +69,11 @@ case "$modo" in
etichette+=(-t "$nome")
done
# Le credenziali in una configurazione del client tutta nostra, solo per questa spinta e poi tolta: quella del
# runner non si tocca mai (niente jq per modificarla, nessuna credenziale che resti nella sua cartella). buildx le
# passa al builder; il demone non c'entra (proverebbe HTTPS). Del client originale restano i plugin, i contesti e
# il contesto corrente; i builder buildx li trova con BUILDX_CONFIG. Il nome è fisso per l'esecuzione, così il passo
# «Pulizia (sempre)» la toglie anche dopo un'interruzione che salta la trap.
# The credentials in a client configuration entirely our own, only for this push and then removed: the runner's
# one is never touched (no jq to modify it, no credential left in its folder). buildx passes them to the builder;
# the daemon is not involved (it would try HTTPS). From the original client we keep the plugins, the contexts and
# the current context; the buildx builders are found through BUILDX_CONFIG. The name is fixed for the run, so the
# «Pulizia (sempre)» step removes it even after an interruption that skips the trap.
originale="${DOCKER_CONFIG:-$HOME/.docker}"
configurazione="${RUNNER_TEMP:-/tmp}/febe-docker-${ESECUZIONE}"
rm -rf "$configurazione"
@@ -88,7 +88,7 @@ case "$modo" in
[[ "$contesto" =~ ^[A-Za-z0-9][A-Za-z0-9_.+-]*$ ]] || contesto=""
fi
credenziali=$(printf '%s:%s' "$REGISTRO_UTENTE" "$REGISTRO_TOKEN" | base64 -w0)
# Solo caratteri di base64, e il registro controllato sopra: il JSON si scrive senza bisogno di escape.
# Only base64 characters, and the registry checked above: the JSON is written without any need for escapes.
[[ "$credenziali" =~ ^[A-Za-z0-9+/]+=*$ ]] || { echo "Credenziali del registro non codificabili." >&2; exit 2; }
(
umask 077