mirror of https://github.com/allinssl/allinssl
parent
60f0e1b53c
commit
5bc248ce4b
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue