diff --git a/backend/internal/cert/deploy/ssh.go b/backend/internal/cert/deploy/ssh.go index 93f1b90..7fbe234 100644 --- a/backend/internal/cert/deploy/ssh.go +++ b/backend/internal/cert/deploy/ssh.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" "golang.org/x/crypto/ssh" - "path" "strconv" ) @@ -124,9 +123,13 @@ func DeploySSH(cfg map[string]any) error { default: return fmt.Errorf("参数错误:provider_id") } - dir, ok := cfg["path"].(string) + keyPath, ok := cfg["keyPath"].(string) if !ok { - return fmt.Errorf("参数错误:path") + return fmt.Errorf("参数错误:keyPath") + } + certPath, ok := cfg["keyPath"].(string) + if !ok { + return fmt.Errorf("参数错误:certPath") } beforeCmd, ok := cfg["beforeCmd"].(string) if !ok { @@ -152,8 +155,8 @@ func DeploySSH(cfg map[string]any) error { } // 自动创建多级目录 files := []RemoteFile{ - {Path: path.Join(dir, "cert.pem"), Content: certPem}, - {Path: path.Join(dir, "key.pem"), Content: keyPem}, + {Path: keyPath, Content: certPem}, + {Path: certPath, Content: keyPem}, } err = writeMultipleFilesViaSSH(providerConfig, files, beforeCmd, afterCmd) if err != nil { diff --git a/backend/middleware/auth.go b/backend/middleware/auth.go index 1dacb14..2ed0b69 100644 --- a/backend/middleware/auth.go +++ b/backend/middleware/auth.go @@ -3,7 +3,6 @@ package middleware import ( "ALLinSSL/backend/public" "encoding/gob" - "fmt" "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "net/http" @@ -28,18 +27,6 @@ func SessionAuthMiddleware() gin.HandlerFunc { now := time.Now() gob.Register(time.Time{}) last := session.Get("lastRequestTime") - var form struct { - Skip string `form:"skip"` - } - err := c.Bind(&form) - if err != nil { - fmt.Println(err) - } else { - if form.Skip == "1" { - c.Next() - return - } - } if routePath == public.Secure && session.Get("secure") == nil { // 访问安全入口,设置 session diff --git a/backend/migrations/init.go b/backend/migrations/init.go index ddda419..fc0e9e6 100644 --- a/backend/migrations/init.go +++ b/backend/migrations/init.go @@ -165,7 +165,6 @@ func init() { create_time TEXT, end_time TEXT, workflow_id TEXT not null - fail_reason TEXT, ); `) insertDefaultData(db, "users", "INSERT INTO users (id, username, password, salt) VALUES (1, 'xxxx', 'xxxxxxx', '&*ghs^&%dag');") diff --git a/script/allinssl.sh b/script/allinssl.sh index 6f8c22b..6a44e08 100644 --- a/script/allinssl.sh +++ b/script/allinssl.sh @@ -50,7 +50,7 @@ if [ $# -eq 0 ]; then fi function update_allinssl() { - local url="http://192.168.69.167:8888/down/Kuguq0edGNRA.tar.gz" + local url="https://download.allinssl.com/bin/allinssl.tar.gz" local target_dir="${WORK_DIR}" local temp_file=$(mktemp) local original_filename temp_file