fix(release): 正式版本 - 修复 SSRF 与 Quality checks,发布 v1.6.6.1
This commit is contained in:
1 parent
ede6cc1e70
commit
ea6676f449
21 files changed
+1303
-338
No files matched your search
@@ -24,7 +24,7 @@ func newProjectSettingsTestService(t *testing.T) (*Service, *gorm.DB) {
|
||||
&model.Shot{}, &model.ShotArtifact{}, &model.VoiceProfile{},
|
||||
&model.Task{}, &model.TaskLog{}, &model.Result{},
|
||||
&model.CreationRun{}, &model.CreationSubmission{},
|
||||
&model.CloudAgentResourceLease{}, &model.Tool{},
|
||||
&model.CloudAgentResourceLease{}, &model.Tool{}, &model.WorkbenchTool{},
|
||||
&model.Announcement{}, &model.AnnouncementImageDraft{},
|
||||
); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
@@ -101,9 +101,9 @@ const taskWorkerConcurrency = 3
|
||||
const taskLogPayloadLimit = 4000
|
||||
|
||||
type CreateTaskRequest struct {
|
||||
creationPrepare *creationTaskPreparation
|
||||
admission *taskAdmission
|
||||
workbenchKind string
|
||||
creationPrepare *creationTaskPreparation
|
||||
admission *taskAdmission
|
||||
workbenchKind string
|
||||
// callerHoldsStorageMu 只给已经持有 Service.storageMu 的内部调用设置。
|
||||
// 文件容量检查不能再锁一次,否则审批改参数会自锁。
|
||||
callerHoldsStorageMu bool
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
func TestWorkbenchKindFromTaskInputRequiresWorkbenchMetadataAndMatchingTaskType(t *testing.T) {
|
||||
input := map[string]any{
|
||||
"mode": "image",
|
||||
"mode": "image",
|
||||
"metadata": map[string]any{"source": "workbench", "workbenchKind": "image"},
|
||||
}
|
||||
if got := workbenchKindFromTaskInput(input, "canvas_image"); got != model.WorkbenchKindImage {
|
||||
|
||||
@@ -455,13 +455,13 @@ func resolveOutboundHostWithPolicy(ctx context.Context, host string, allowPrivat
|
||||
failure.Reason = kernel.ReasonUpstreamDNSFailed
|
||||
return nil, failure
|
||||
}
|
||||
// if !allowPrivateHost {
|
||||
// for _, ip := range addresses {
|
||||
// if blockedOutboundIP(ip) {
|
||||
// return nil, BadAuthRequest("不允许访问本机、内网或链路本地地址")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if !allowPrivateHost {
|
||||
for _, ip := range addresses {
|
||||
if blockedOutboundIP(ip) {
|
||||
return nil, BadAuthRequest("不允许访问本机、内网或链路本地地址")
|
||||
}
|
||||
}
|
||||
}
|
||||
return addresses, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -10,14 +10,27 @@ type TaskPage struct {
|
||||
}
|
||||
|
||||
func (r *Repository) WorkbenchTasks(userID, kind string, activeOnly bool, cursor string, limit int) (TaskPage, error) {
|
||||
if limit < 1 || limit > 100 { limit = 30 }
|
||||
if kind != model.WorkbenchKindImage && kind != model.WorkbenchKindVideo { return TaskPage{}, nil }
|
||||
if limit < 1 || limit > 100 {
|
||||
limit = 30
|
||||
}
|
||||
if kind != model.WorkbenchKindImage && kind != model.WorkbenchKindVideo {
|
||||
return TaskPage{}, nil
|
||||
}
|
||||
query := r.db.Model(&model.Task{}).Where("user_id = ? AND workbench_kind = ?", userID, kind)
|
||||
if activeOnly { query = query.Where("status IN ?", []model.TaskStatus{model.TaskStatusQueued, model.TaskStatusRunning}) }
|
||||
if cursor != "" { query = query.Where("id < ?", cursor) }
|
||||
if activeOnly {
|
||||
query = query.Where("status IN ?", []model.TaskStatus{model.TaskStatusQueued, model.TaskStatusRunning})
|
||||
}
|
||||
if cursor != "" {
|
||||
query = query.Where("id < ?", cursor)
|
||||
}
|
||||
var tasks []model.Task
|
||||
if err := query.Order("created_at desc, id desc").Limit(limit + 1).Find(&tasks).Error; err != nil { return TaskPage{}, err }
|
||||
if err := query.Order("created_at desc, id desc").Limit(limit + 1).Find(&tasks).Error; err != nil {
|
||||
return TaskPage{}, err
|
||||
}
|
||||
page := TaskPage{Tasks: tasks}
|
||||
if len(tasks) > limit { page.Tasks = tasks[:limit]; page.NextCursor = page.Tasks[len(page.Tasks)-1].ID }
|
||||
if len(tasks) > limit {
|
||||
page.Tasks = tasks[:limit]
|
||||
page.NextCursor = page.Tasks[len(page.Tasks)-1].ID
|
||||
}
|
||||
return page, nil
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
const yingshiSkillID = "yingshi-drama-workshop"
|
||||
const yingshiPythonTreeSHA256 = "15b6dbe0a6fad34e37694bc394428159bb18f438dc56971ba2055620079a037c"
|
||||
const yingshiPythonTreeSHA256 = "731838b084b3efbfda806378e5a6a2a83a0bf2040f8c627c29b88d32c904ff88"
|
||||
|
||||
var pythonScriptCommand = regexp.MustCompile("(?i)^\\s*(?:\\$\\s*)?(?:python(?:3(?:\\.\\d+)?)?|py(?:\\s+-3(?:\\.\\d+)?)?)\\s+[^`\\n]*(?:\\.py\\b|-m\\s+wfkit)")
|
||||
var machineSpecificPath = regexp.MustCompile(`(?i)(?:[a-z]:\\|\\\\[^\\]+\\|/(?:Users|home|private/Users)/|~/)`)
|
||||
|
||||
Reference in new issue
Block a user