fix: sécurité — remote SSH + vérification GPG à l'installation
- Remote origin passé en SSH (token retiré de l'URL) - make install dépend de make verify (vérifie la signature GPG du dernier tag) - Sans tag signé : avertissement non bloquant (bootstrap) - Avec tag signé et clé invalide : erreur bloquante - DEVELOPER.md : instructions pour signer les tags de release - README.md : mention de l'import de clé GPG Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ DOC_SRC := $(wildcard local/share/doc/scripts-bash/*.md)
|
||||
MAN_PAGES := $(patsubst local/share/doc/scripts-bash/%.md,local/share/man/man1/%,$(DOC_SRC))
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
.PHONY: all build install uninstall clean
|
||||
.PHONY: all build install uninstall clean verify
|
||||
|
||||
## Cible par défaut : installe tout dans ~/.local/
|
||||
all: install
|
||||
@@ -33,8 +33,23 @@ local/share/man/man1/%: local/share/doc/scripts-bash/%.md
|
||||
pandoc -s $< -t man -o $@
|
||||
@echo " MAN $@"
|
||||
|
||||
## verify : vérifie la signature GPG du dernier tag avant d'installer
|
||||
verify:
|
||||
@tag=$$(git describe --tags --abbrev=0 2>/dev/null) || { \
|
||||
echo " GPG Avertissement : aucun tag signé trouvé — intégrité non vérifiée."; \
|
||||
echo " Importez la clé publique du développeur et vérifiez avec : git tag -v <tag>"; \
|
||||
exit 0; \
|
||||
}; \
|
||||
if git verify-tag "$$tag" 2>/dev/null; then \
|
||||
echo " GPG $$tag : signature valide"; \
|
||||
else \
|
||||
echo " GPG Erreur : signature invalide pour le tag $$tag"; \
|
||||
echo " Importez la clé publique du développeur avant d'installer."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
## install : déploie tout dans ~/.local/ (aucune dépendance externe)
|
||||
install:
|
||||
install: verify
|
||||
@[ -d "local/bin" ] || { echo "Erreur : lancer depuis la racine du projet scripts-bash"; exit 1; }
|
||||
@mkdir -p "$(INSTALL_BIN)" "$(INSTALL_MAN)" "$(INSTALL_DOC)" "$(INSTALL_YTDLL)/lib"
|
||||
@for f in $(SCRIPTS_SH); do \
|
||||
|
||||
Reference in New Issue
Block a user