feat: import Sea vHost single-server testing release

This commit is contained in:
canglan committed 2026-10-30 08:39:10 +08:00
commit 248badd33e
441 files changed
+63221

No files matched your search

@@ -0,0 +1,6 @@
package isolation
import("context";"net/http")
type FTPManager interface{DisconnectFTP(context.Context,ProjectSpec)error}
func(c *Client)DisconnectFTP(ctx context.Context,p ProjectSpec)error{return c.request(ctx,"/v1/ftp/disconnect",p,nil)}
func(Mock)DisconnectFTP(context.Context,ProjectSpec)error{return nil}
func(a Agent)disconnectFTP(w http.ResponseWriter,r *http.Request){p,ok:=a.decode(w,r);if !ok{return};root,e:=a.projectPath(p);if e!=nil||!managedWebHostPattern.MatchString(p.HostName)||requirePhysicalDirectory(root)!=nil{http.Error(w,"invalid managed identity",412);return};if e=disconnectFTPSessions(r.Context(),p.HostName);e!=nil{http.Error(w,"cannot disconnect FTP",422);return};w.WriteHeader(200)}