Add clipboard monitoring functionality to the agent. Implement clipboard event logging, including text and image capture, with support for retention policies. Update API to allow file deletion and enhance web interface for file management. Add tests for clipboard operations.
This commit is contained in:
@@ -166,3 +166,18 @@ func UploadTarget(root, dir, filename string) (string, error) {
|
||||
}
|
||||
return target, nil
|
||||
}
|
||||
|
||||
func RemovePath(root, raw string) error {
|
||||
path, err := AllowedPath(root, raw, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if info.IsDir() {
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
return os.Remove(path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user