mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-20 13:38:11 +02:00
acces distant : le tunnel jean-link tourne aussi hors systemd (macOS/Windows)
linkServiceCtl/linkServiceActive etaient Linux-only : sur un Mac le token etait bien enregistre mais rien ne composait jamais le tunnel, d'ou le message << service arrete >> permanent. Hors Linux on lance desormais 'jean link serve' en processus detache suivi par un fichier PID (spawnDetached/pidAlive/killTree, nouvelles primitives par plateforme). - le mode app relance le tunnel au demarrage si une cle est enregistree - nouvelle route POST /api/link/start + bouton << demarrer le tunnel >> dans le panneau, visible quand le lien est configure mais arrete
This commit is contained in:
1 parent
9787923879
commit
075a05ebaa
9 files changed
+214
-7
No files matched your search
@@ -63,6 +63,21 @@ func handleLinkConnect(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// handleLinkStart (POST /api/link/start) : (re)démarre le worker de lien sans
|
||||
// repasser par la popup de connexion — le token est déjà enregistré. Utile quand
|
||||
// le tunnel est tombé, ou sur un poste sans systemd où personne ne le relance.
|
||||
func handleLinkStart(w http.ResponseWriter, r *http.Request) {
|
||||
if readLinkToken() == "" {
|
||||
sendJSON(w, http.StatusBadRequest, map[string]any{"error": "aucune clé de liaison enregistrée"})
|
||||
return
|
||||
}
|
||||
if err := linkServiceCtl("restart"); err != nil {
|
||||
sendJSON(w, http.StatusInternalServerError, map[string]any{"error": err.Error(), "active": linkServiceActive()})
|
||||
return
|
||||
}
|
||||
sendJSON(w, http.StatusOK, map[string]any{"ok": true, "active": linkServiceActive()})
|
||||
}
|
||||
|
||||
// handleLinkDisconnect (POST /api/link/disconnect) : arrête le service et oublie
|
||||
// la clé (équivalent `jean link stop` + `jean link logout`).
|
||||
func handleLinkDisconnect(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in new issue
Block a user