feat: enhance path management and improve backup logic for certificate directory

This commit is contained in:
ryan
2026-03-10 11:30:26 +08:00
parent 87ab1f8664
commit 2185326f2f
4 changed files with 51 additions and 9 deletions
+2 -1
View File
@@ -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()
}
+2 -1
View File
@@ -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)
}