mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 15:06:36 +08:00
feat: enhance path management and improve backup logic for certificate directory
This commit is contained in:
@@ -27,7 +27,8 @@ func printHelp() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
if !strings.HasSuffix(os.Args[0], ".test") {
|
||||
executableName := strings.ToLower(filepath.Base(os.Args[0]))
|
||||
if !strings.Contains(executableName, ".test") {
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
"mime/multipart"
|
||||
"math/big"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
@@ -213,6 +213,7 @@ func setupTestDB(t *testing.T) {
|
||||
t.Helper()
|
||||
dbPath := filepath.Join(t.TempDir(), "phase1.db")
|
||||
common.SQLitePath = dbPath
|
||||
common.AgentToken = "phase1-agent-token"
|
||||
if err := model.InitDB(); err != nil {
|
||||
t.Fatalf("failed to init db: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user