bastion 0.55.3
ci / personal-data (push) Successful in 5s
ci / test (push) Successful in 3m51s
ci / fuzz (push) Successful in 2m55s

This commit is contained in:
Privatae
2026-10-25 23:16:45 +00:00
parent 77b7853ae1
commit 8822d5df85
136 changed files with 8638 additions and 1641 deletions
+6 -5
View File
@@ -7,12 +7,13 @@ import (
"fmt"
"os"
"path/filepath"
"sync/atomic"
)
// runGuardFile holds the "one running bastion" lock for the life of this
// process. It is a package var so the handle is never collected and the lock is
// never released while we are still serving.
var runGuardFile *os.File
// process. It is a package-level holder so the handle is never collected and
// the lock is never released while we are still serving.
var runGuardFile atomic.Pointer[os.File]
// guardSingleRun refuses to start a SECOND bastion on this machine.
//
@@ -100,8 +101,8 @@ func guardSingleRun() error {
"your hosts, and a second would fight it for the same local ports.\n"+
" Nothing is wrong: you can close this window.\n"+
" If you believe the running one is dead, stop it (Task Manager → "+
"privatae-bastion.exe) and run this again."))
"privatae-bastion.exe) and run this again"))
}
runGuardFile = f
runGuardFile.Store(f)
return nil
}