SmoothDenis
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
26 additions and
4 deletions
-
docker/compose/fluent.conf
-
docker/compose/local-auditlog-compose.yml
-
weed/s3api/s3api_object_handlers_delete.go
-
weed/s3api/s3err/audit_fluent.go
|
|
@ -0,0 +1,8 @@ |
|
|
|
<source> |
|
|
|
@type forward |
|
|
|
port 24224 |
|
|
|
</source> |
|
|
|
|
|
|
|
<match **> |
|
|
|
@type stdout # Output logs to container's stdout (visible via `docker logs`) |
|
|
|
</match> |
|
|
@ -19,7 +19,9 @@ services: |
|
|
|
depends_on: |
|
|
|
- fluent |
|
|
|
fluent: |
|
|
|
image: fluent/fluentd:v1.14 |
|
|
|
image: fluent/fluentd:v1.17 |
|
|
|
volumes: |
|
|
|
- ./fluent.conf:/fluentd/etc/fluent.conf |
|
|
|
ports: |
|
|
|
- 24224:24224 |
|
|
|
#s3tests: |
|
|
|
|
|
@ -32,12 +32,23 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
target := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object)) |
|
|
|
dir, name := target.DirAndName() |
|
|
|
|
|
|
|
var auditLog *s3err.AccessLog |
|
|
|
|
|
|
|
if s3err.Logger != nil { |
|
|
|
auditLog = s3err.GetAccessLog(r, http.StatusNoContent, s3err.ErrNone) |
|
|
|
} |
|
|
|
|
|
|
|
err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { |
|
|
|
|
|
|
|
if err := doDeleteEntry(client, dir, name, true, false); err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
if auditLog != nil { |
|
|
|
auditLog.Key = name |
|
|
|
s3err.PostAccessLog(*auditLog) |
|
|
|
} |
|
|
|
|
|
|
|
if s3a.option.AllowEmptyFolder { |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
@ -3,12 +3,13 @@ package s3err |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"github.com/fluent/fluent-logger-golang/fluent" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" |
|
|
|
"net/http" |
|
|
|
"os" |
|
|
|
"time" |
|
|
|
|
|
|
|
"github.com/fluent/fluent-logger-golang/fluent" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" |
|
|
|
) |
|
|
|
|
|
|
|
type AccessLogExtend struct { |
|
|
|