From 6cb45eaa62e34d16fdc016a266646589597860af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 18 Mar 2025 08:44:57 +0100 Subject: [PATCH 1/2] Fix traversing thrash items --- pkg/storage/fs/posix/trashbin/trashbin.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/storage/fs/posix/trashbin/trashbin.go b/pkg/storage/fs/posix/trashbin/trashbin.go index 1ab3cf60bfc..b4cf1165327 100644 --- a/pkg/storage/fs/posix/trashbin/trashbin.go +++ b/pkg/storage/fs/posix/trashbin/trashbin.go @@ -188,22 +188,21 @@ func (tb *Trashbin) ListRecycle(ctx context.Context, spaceID string, key, relati var originalPath string var ts *typesv1beta1.Timestamp - if key != "" { + if key != "" && relativePath == "" { // this is listing a specific item/folder - base = filepath.Join(base, key+".trashitem", relativePath) + base = filepath.Join(base, key+".trashitem") var err error originalPath, ts, err = tb.readInfoFile(trashRoot, key) if err != nil { return nil, err } - originalPath = filepath.Join(originalPath, relativePath) fi, err := os.Stat(base) if err != nil { return nil, err } item := &provider.RecycleItem{ - Key: filepath.Join(key, relativePath), + Key: key, Size: uint64(fi.Size()), Ref: &provider.Reference{ ResourceId: &provider.ResourceId{ @@ -221,6 +220,15 @@ func (tb *Trashbin) ListRecycle(ctx context.Context, spaceID string, key, relati item.Type = provider.ResourceType_RESOURCE_TYPE_FILE } return []*provider.RecycleItem{item}, nil + } else if key != "" { + // this is listing a specific item/folder + base = filepath.Join(base, key+".trashitem", relativePath) + var err error + originalPath, ts, err = tb.readInfoFile(trashRoot, key) + if err != nil { + return nil, err + } + originalPath = filepath.Join(originalPath, relativePath) } items := []*provider.RecycleItem{} From a438677628ff357b617ea96d4fe2c3d81474ca9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 18 Mar 2025 10:37:50 +0100 Subject: [PATCH 2/2] Remove github actions definitions --- .github/workflows/changelog.yml | 29 ---------------------- .github/workflows/docker.yml | 44 --------------------------------- .github/workflows/lint.yml | 22 ----------------- .github/workflows/release.yml | 24 ------------------ 4 files changed, 119 deletions(-) delete mode 100644 .github/workflows/changelog.yml delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index 2ebd4712096..00000000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Check Changelog -on: - pull_request: - paths-ignore: - - ".github/**" - - "Makefile" - - "tools/**" - - "docs/**" - - "tests/**" - - ".drone.star" - - ".drone.env" - - ".fossa.yml" - - ".gitignore" - - ".gitmodules" - - "go.mod" - - "go.sum" - -jobs: - check-changelog: - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: Setup Go environment - uses: actions/setup-go@v3.3.0 - with: - go-version-file: go.mod - - name: Check changelog - run: make check-changelog PR=${{ github.event.pull_request.number }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 8249de8a88e..00000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build Docker -on: - push: - branches: - - "edge" - tags: - - "*" - pull_request: - workflow_dispatch: - -jobs: - docker: - runs-on: self-hosted - strategy: - matrix: - include: - - tag: reva:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }} - file: Dockerfile.reva - - tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }} - file: Dockerfile.revad - - tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}-eos - file: Dockerfile.revad-eos - - tag: revad:${{ ((github.ref_type == 'tag') && github.ref_name) || 'edge' }}-ceph - file: Dockerfile.revad-ceph - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub - uses: docker/login-action@v2 - if: ${{ github.event_name != 'pull_request' }} - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build ${{ ((github.event_name != 'pull_request') && 'and push') || '' }} ${{ matrix.tag }} - uses: docker/build-push-action@v3 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - file: ${{ matrix.file }} - tags: ${{ ((github.event_name != 'pull_request') && format('{0}/{1}', vars.DOCKERHUB_ORGANIZATION, matrix.tag)) || '' }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index eb2e2eb3750..00000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Lint -on: - pull_request: - paths-ignore: - - "go.mod" - - "go.sum" - push: - workflow_dispatch: - -jobs: - lint: - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: Setup Go environment - uses: actions/setup-go@v4 - with: - go-version-file: go.mod - check-latest: true - - name: Run linters - run: make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 707c928b9f0..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Release -on: - push: - tags: - - "*" - -jobs: - release: - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Go environment - uses: actions/setup-go@v3.3.0 - with: - go-version-file: go.mod - - name: Make distribution - run: make dist VERSION=${{ github.ref_name }} GIT_COMMIT=${{ github.sha }} GO_VERSION=$(go version | awk '{print $3}') - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: "dist/*" - body_path: "changelog/NOTE.md"