diff --git a/g9-migration/journal.md b/g9-migration/journal.md index e00e164..b2f8155 100644 --- a/g9-migration/journal.md +++ b/g9-migration/journal.md @@ -165,3 +165,4 @@ | 2026-10-13 19:42 | E3 | switch 10G SKS7300 | port SFP+ Delta éteint par reset usine → G9 isolé (IPv6 link-local seul) ; câble remplacé par RJ45 Delta↔switch (1G) | G9 visible ; SSH switch (admin, telnet) dispo pour remettre les VLANs 10G (untagged trunk uplink) à faire | re-câbler SFP+ + réactiver port fibre Delta | | 2026-10-13 20:00 | E4 | **openfox.folzocorp.fr** ajouté au Caddy .27 | Besoin utilisateur : suivre la config depuis son téléphone | reverse_proxy → 192.168.1.11:10369 ; cert LE émis ; 200 via LAN (.27) ET WAN (IP publique) ; fix mount stale = `compose up -d --force-recreate caddy` (rsync du Caddyfile ne suffit pas, inode monté) | retirer le block + recreate | | 2026-10-13 20:30 | 4 | secrets PhotoPrism **644→600** (finding vérification) | Dossier 755/fichiers 644 = lisibles par tout utilisateur local (03b pose 644, 07d faisait chmod 755) | `chmod 700 secrets` + `chmod 600 secrets/*` sur .24 (admin/dbpass/rootpass/photoprism.env tous 600 root) ; conteneurs up intacts (env chargés au start, db lit /run/secrets en root) ; 07d corrigé (chmod 700 + sh -c 600) | chmod 644 (inverser, non recommandé) | +| 2026-10-13 21:00 | 4 | secrets PhotoPrism — durcissement complété (review) | Finding : la copie kit .24 restait 644 | chmod 700/600 appliqué aux DEUX chemins sur .24 : /data/docker/photoprism/secrets ET /home/folzo/g9-migration/compose/photoprism/secrets (ls vérifié 700 root + fichiers 600) ; 07d = boucle sur les 2 chemins + `find -maxdepth 1 -type f -exec` (robuste dotfiles/dossier vide) + commentaire de convention (600 = root-only, ne pas copier vers briques entrypoint non-root, 03b garde 644 voulu) | re-chmod 644 (non recommandé) | diff --git a/g9-migration/scripts/07d-migrate-photoprism.sh b/g9-migration/scripts/07d-migrate-photoprism.sh index 18a65b5..0165b5f 100755 --- a/g9-migration/scripts/07d-migrate-photoprism.sh +++ b/g9-migration/scripts/07d-migrate-photoprism.sh @@ -116,7 +116,12 @@ log "=== 4/5 STACK + SECRETS ===" rsync -a --info=stats1 -e "$RSH_G9" --exclude "secrets" "$KIT_DIR/compose/$BRIQUE/" "$G9_USER@$G9_HOST:$KIT_ON_G9/compose/$BRIQUE/" rsync -a -e "$RSH_G9" "$KIT_DIR/scripts/03b-secrets.sh" "$G9_USER@$G9_HOST:$KIT_ON_G9/scripts/" $SSH_G9 "sudo bash $KIT_ON_G9/scripts/03b-secrets.sh >/dev/null" -$SSH_G9 "sudo rsync -a $KIT_ON_G9/compose/$BRIQUE/ $G9_DIR/ && sudo chmod 700 $G9_DIR/secrets && sudo sh -c 'chmod 600 $G9_DIR/secrets/*'" +$SSH_G9 "sudo rsync -a $KIT_ON_G9/compose/$BRIQUE/ $G9_DIR/" +# 600 root = valable uniquement si le conteneur lit /run/secrets EN ROOT ou via env_file compose (photoprism/mariadb). +# NE PAS copier ce pattern vers les briques à entrypoint non-root (n8n uid1000, Nextcloud www-data → 644 voulu, voir 03b). +for d in "$G9_DIR" "$KIT_ON_G9/compose/$BRIQUE"; do + $SSH_G9 "sudo chmod 700 $d/secrets && sudo find $d/secrets -maxdepth 1 -type f -exec chmod 600 {} +" +done $SSH_G9 "sudo chown -R 999:999 $G9_DIR/db && sudo chmod 750 $G9_DIR/db" # PhotoPrism n'accepte pas les *_FILE : env_file construit à partir des secrets (600, root, hors git). $SSH_G9 "sudo sh -c 'umask 077; { echo PHOTOPRISM_ADMIN_PASSWORD=\$(cat $G9_DIR/secrets/admin); echo PHOTOPRISM_DATABASE_PASSWORD=\$(cat $G9_DIR/secrets/dbpass); } > $G9_DIR/secrets/photoprism.env' && sudo chown root:root $G9_DIR/secrets/photoprism.env"