This commit is contained in:
2026-06-02 07:34:09 +02:00
parent d927afbb87
commit b3f0a2eecc
9 changed files with 261 additions and 69 deletions
+61 -13
View File
@@ -25,7 +25,7 @@ PI_OPTS := \
--hidden-import cryptography.hazmat.primitives.asymmetric.x25519 \
--collect-submodules PyQt6
.PHONY: all linux windows release install run run-admin icon clean help
.PHONY: all linux windows release install install-gnome uninstall-gnome run run-admin icon reset-password clean help
# ── Cible par défaut ────────────────────────────────────────────────────────
all: linux
@@ -85,12 +85,57 @@ release: clean linux
@mv $(DIST)/$(APP) $(DIST)/$(APP)-$(VERSION)-linux-x86_64
@echo " 📦 Release → $(DIST)/$(APP)-$(VERSION)-linux-x86_64"
# ── Installation GNOME (utilisateur local, sans sudo) ────────────────────────
INSTALL_BIN := $(HOME)/.local/bin
INSTALL_ICON := $(HOME)/.local/share/icons/hicolor/256x256/apps
INSTALL_APPS := $(HOME)/.local/share/applications
install-gnome: linux
@echo ""
@echo " 🐧 Installation de WGSecure pour GNOME…"
@mkdir -p $(INSTALL_BIN) $(INSTALL_ICON) $(INSTALL_APPS)
@cp $(DIST)/$(APP) $(INSTALL_BIN)/$(APP)
@chmod +x $(INSTALL_BIN)/$(APP)
@echo " ✅ Binaire → $(INSTALL_BIN)/$(APP)"
@cp $(ICON) $(INSTALL_ICON)/$(APP).png
@echo " ✅ Icône → $(INSTALL_ICON)/$(APP).png"
@printf '[Desktop Entry]\nType=Application\nName=WGSecure\nComment=WireGuard GUI avec MFA TOTP\nExec=%s\nIcon=%s\nCategories=Network;Security;\nStartupWMClass=wgsecure\nTerminal=false\n' \
"$(INSTALL_BIN)/$(APP)" "$(APP)" \
> $(INSTALL_APPS)/$(APP).desktop
@echo " ✅ Lanceur → $(INSTALL_APPS)/$(APP).desktop"
@gtk-update-icon-cache -f -t $(HOME)/.local/share/icons/hicolor 2>/dev/null || true
@update-desktop-database $(INSTALL_APPS) 2>/dev/null || true
@echo ""
@echo " 🎉 Installation terminée. WGSecure est disponible dans le menu GNOME."
@echo ""
uninstall-gnome:
@echo " 🗑️ Désinstallation de WGSecure…"
@rm -f $(INSTALL_BIN)/$(APP)
@rm -f $(INSTALL_ICON)/$(APP).png
@rm -f $(INSTALL_APPS)/$(APP).desktop
@gtk-update-icon-cache -f -t $(HOME)/.local/share/icons/hicolor 2>/dev/null || true
@update-desktop-database $(INSTALL_APPS) 2>/dev/null || true
@echo " ✅ WGSecure désinstallé"
# ── Dépendances Python ────────────────────────────────────────────────────────
install:
$(PYTHON) -m pip install -r requirements.txt
$(PYTHON) -m pip install pyinstaller
@echo " ✅ Dépendances installées"
# ── Réinitialisation du mot de passe administrateur ──────────────────────────
reset-password:
@echo ""
@echo " ⚠️ Réinitialisation du mot de passe administrateur WGSecure…"
@$(PYTHON) -c "\
import sys; sys.path.insert(0,'.');\
from app.core.config import Config;\
cfg = Config();\
cfg.set_admin_password('');\
print(' ✅ Mot de passe supprimé — accès admin sans restriction au prochain démarrage.')"
@echo ""
# ── Lancer l'application ─────────────────────────────────────────────────────
run:
DISPLAY=:0 $(PYTHON) $(SRC)
@@ -109,16 +154,19 @@ clean:
# ── Aide ─────────────────────────────────────────────────────────────────────
help:
@echo ""
@echo " ╔════════════════════════════════════════════╗"
@echo " ║ 🛡️ WGSecure v$(VERSION) — Makefile "
@echo " ╠════════════════════════════════════════════╣"
@echo " ║ make install Installe les dépendances ║"
@echo " ║ make linux Binaire Linux (onefile) ║"
@echo " ║ make windows Binaire Windows (Wine) ║"
@echo " ║ make release Linux + nommage release ║"
@echo " ║ make setup-wine Python Windows dans Wine ║"
@echo " ║ make run Lance l'application ║"
@echo " ║ make run-admin Lance en mode admin ║"
@echo " ║ make clean Supprime les artefacts ║"
@echo " ╚════════════════════════════════════════════╝"
@echo " "
@echo " 🛡 WGSecure v$(VERSION) Makefile "
@echo " "
@echo " make install Installe les dépendances "
@echo " make linux Binaire Linux (onefile) "
@echo " make windows Binaire Windows (Wine) "
@echo " make release Linux + nommage release "
@echo " make setup-wine Python Windows dans Wine "
@echo " make install-gnome Installe dans GNOME "
@echo " make uninstall-gnome Désinstalle de GNOME "
@echo " make reset-password Supprime le MDP admin "
@echo " make run Lance l'application "
@echo " make run-admin Lance en mode admin "
@echo " make clean Supprime les artefacts "
@echo " "
@echo ""