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
+25
-24
@@ -1,24 +1,24 @@
|
||||
#!/bin/sh
|
||||
# Febe: avvio del contenitore (specifica §11).
|
||||
# Febe: container start (specification §11).
|
||||
#
|
||||
# Fa solo tre cose e poi cede il posto al server:
|
||||
# 1. crea, se mancano, il gruppo PGID e l'utente PUID (su Unraid 99 e 100, «nobody:users»);
|
||||
# 2. rende /dati di quell'utente (la prima volta, o se PUID/PGID sono cambiati) e gli fa preparare /dati/home;
|
||||
# 3. exec del server con setpriv, come quell'utente: il server avvia e sorveglia da sé Xvfb e Chromium.
|
||||
# Sempre exec, mai un processo figlio: il server prende il posto di questo script come processo 1 del contenitore
|
||||
# (niente tini), riceve SIGTERM da «docker stop» e, con il runtime .NET, raccoglie i processi rimasti orfani.
|
||||
# Nessun ciclo di sorveglianza qui: è il lavoro di Febe.Server (niente script di shell che facciano da supervisore).
|
||||
# /libreria non si cambia mai ricorsivamente (sono le foto di Alberto); /importa è in sola lettura e non si tocca;
|
||||
# di /esporta (le copie esterne, specifica §4.10) si assegna solo la radice, mai ricorsivamente, e solo se le copie
|
||||
# esterne sono dichiarate (FEBE_ESPORTA=1 o --esporta).
|
||||
# Se /dati non si può sistemare (disco di rete, permessi) si parte lo stesso: è Febe a spiegare il problema nella sua
|
||||
# pagina, invece di un contenitore che si riavvia senza dire perché.
|
||||
# It does only three things and then hands over to the server:
|
||||
# 1. creates, if missing, the group PGID and the user PUID (on Unraid 99 and 100, «nobody:users»);
|
||||
# 2. makes /dati owned by that user (the first time, or if PUID/PGID changed) and has it prepare /dati/home;
|
||||
# 3. execs the server with setpriv, as that user: the server starts and watches Xvfb and Chromium by itself.
|
||||
# Always exec, never a child process: the server takes the place of this script as process 1 of the container
|
||||
# (no tini), receives SIGTERM from «docker stop» and, with the .NET runtime, reaps the orphaned processes.
|
||||
# No watch loop here: that is the job of Febe.Server (no shell script acting as a supervisor).
|
||||
# /libreria is never changed recursively (it holds Alberto's photos); /importa is read only and is not touched;
|
||||
# of /esporta (the external copies, specification §4.10) only the root is assigned, never recursively, and only if
|
||||
# the external copies are declared (FEBE_ESPORTA=1 or --esporta).
|
||||
# If /dati cannot be fixed (network disk, permissions) it starts anyway: Febe explains the problem on its page,
|
||||
# instead of a container that restarts without saying why.
|
||||
set -eu
|
||||
|
||||
PUID="${PUID:-99}"
|
||||
PGID="${PGID:-100}"
|
||||
|
||||
# Già avviato come utente normale (docker run --user ...): niente da cambiare.
|
||||
# Already started as a normal user (docker run --user ...): nothing to change.
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
exec "$@"
|
||||
fi
|
||||
@@ -36,13 +36,13 @@ if ! getent passwd "${PUID}" >/dev/null 2>&1; then
|
||||
useradd -o -u "${PUID}" -g "${PGID}" -M -d /dati/home -s /usr/sbin/nologin febe
|
||||
fi
|
||||
|
||||
# /dati è dell'utente PUID, che dentro può mettere di tutto, anche collegamenti simbolici verso file del contenitore:
|
||||
# da root qui dentro non si scrive niente. L'unica cosa fatta da root è il cambio di proprietario, ricorsivo e senza
|
||||
# seguire i collegamenti (-R senza -H/-L: cambia il collegamento, mai ciò a cui punta). Il resto lo fa l'utente stesso.
|
||||
# /dati belongs to the PUID user, who can put anything in it, even symbolic links to files of the container: as root
|
||||
# nothing is written in there. The only thing done as root is the change of owner, recursive and without following
|
||||
# links (-R without -H/-L: it changes the link, never what it points to). The rest is done by the user itself.
|
||||
if mkdir -p /dati 2>/dev/null; then
|
||||
da_assegnare=""
|
||||
[ "$(stat -c '%u:%g' /dati)" = "${PUID}:${PGID}" ] || da_assegnare=1
|
||||
# Una /dati/home di un altro proprietario (un avvio precedente come root): conta solo una cartella vera.
|
||||
# A /dati/home with another owner (an earlier start as root): only a real folder counts.
|
||||
if [ -d /dati/home ] && [ ! -L /dati/home ] && [ "$(stat -c '%u:%g' /dati/home)" != "${PUID}:${PGID}" ]; then
|
||||
da_assegnare=1
|
||||
fi
|
||||
@@ -51,22 +51,23 @@ if mkdir -p /dati 2>/dev/null; then
|
||||
chown -R "${PUID}:${PGID}" /dati 2>/dev/null || echo "Febe: non riesco ad assegnare /dati a ${PUID}:${PGID}." >&2
|
||||
fi
|
||||
chmod 0750 /dati 2>/dev/null || true
|
||||
# La HOME di Chromium la crea e la chiude l'utente, con i suoi permessi.
|
||||
# Chromium's HOME is created and locked by the user, with its own permissions.
|
||||
setpriv --reuid="${PUID}" --regid="${PGID}" --init-groups sh -c 'mkdir -p /dati/home && chmod 0700 /dati/home' 2>/dev/null || true
|
||||
# Il profilo seccomp non sta più in /dati: Docker lo legge sul server alla creazione del contenitore, e in /dati
|
||||
# l'utente del contenitore potrebbe allentarlo. Si tiene fuori dal volume dei dati (docs/docker.md, «Sandbox»).
|
||||
# The seccomp profile no longer lives in /dati: Docker reads it on the server when the container is created, and in
|
||||
# /dati the container's user could loosen it. It is kept outside the data volume (docs/docker.md, «Sandbox»).
|
||||
if [ -e /dati/seccomp.json ] || [ -L /dati/seccomp.json ]; then
|
||||
echo "Febe: /dati/seccomp.json non si aggiorna più. Se --security-opt seccomp= indica quel file, sposta il profilo fuori dalla cartella dei dati (su Unraid /mnt/user/appdata/febe-seccomp.json): vedi docs/docker.md, «Sandbox»." >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Una cartella della libreria appena creata da Docker appartiene a root: solo quella, senza ricorsione.
|
||||
# A library folder just created by Docker belongs to root: only that folder, without recursion.
|
||||
if [ -d /libreria ] && [ "$(stat -c '%u' /libreria)" = "0" ]; then
|
||||
chown "${PUID}:${PGID}" /libreria 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# /esporta: solo la radice, mai ricorsivo, e solo se le copie esterne sono dichiarate (SPECIFICA §4.10). Dentro ci
|
||||
# sono file di Alberto copiati da Febe o messi da lui: non si cambiano mai. Febe non crea /esporta se manca.
|
||||
# /esporta: only the root, never recursive, and only if the external copies are declared (SPECIFICA §4.10). Inside
|
||||
# there are Alberto's files copied by Febe or put there by him: they are never changed. Febe does not create /esporta
|
||||
# if it is missing.
|
||||
case "${FEBE_ESPORTA:-}" in 1|true|sì|si|yes) esporta=1 ;; *) esporta= ;; esac
|
||||
case " $* " in *" --esporta "*) esporta=1 ;; esac
|
||||
if [ -n "$esporta" ] && [ -d /esporta ] && [ "$(stat -c '%u' /esporta)" = "0" ]; then
|
||||
|
||||
Reference in new issue
Block a user