Skip to content

Takeout#5707

Draft
Tristan-C789 wants to merge 11 commits into
cs3org:feat/takeoutfrom
Tristan-C789:feat/takeout
Draft

Takeout#5707
Tristan-C789 wants to merge 11 commits into
cs3org:feat/takeoutfrom
Tristan-C789:feat/takeout

Conversation

@Tristan-C789

Copy link
Copy Markdown

CERNBox Takeout

Users currently have no convenient, self-service way to obtain a full, offline copy of everything they store in their CERNBox personal space. This is needed for personal backups, offboarding (e.g. leaving CERN), and data-access requests. "Takeout" lets a user trigger an export from the web interface; the system packages their space into one or more archives asynchronously, stores them in a pre-configured EOS location, and notifies the user by email with download links when the export is ready. Exports expire automatically after a configurable retention period.

Features

This PR mplements the core takeout logic as a Reva background job. Given a user, a max archive size, and a format, the job collects the contents of the user's personal space, packages them into one or more archives of the requested format, splitting output so that no single archive exceeds the configured max size, and uploads the artifact(s) to a pre-configured EOS folder.

It exposes two HTTP endpoints: one to create a new takeout job (taking max size and format), and one to get the status of the current/last takeout for the authenticated user. The create endpoint enforces one active job per user, if a takeout is already running, it returns the existing job rather than starting a new one. The status endpoint returns the job state and, when completed, the download link(s) and expiry. In particular:

  • POST endpoint creates a takeout for the authenticated user with body {max_archive_size, format}; unsupported size/format is rejected with a clear error.
  • If the user already has an active takeout, the create endpoint returns the existing job's id/status instead of starting a second one.
  • GET status endpoint returns the current state (none / queued / running / completed / failed) and progress if available.
  • When completed, the status response includes the download link(s) and expiry time.
  • When failed, the status response includes an error/cause indication.

@update-docs

update-docs Bot commented Jul 10, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@diocas diocas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check the archiver code, but I have the impression that this is a copy of it. Didn't we discuss that we would integrate the current archive code in the takeout, so that we only set the logic in a single place? The advantage of the takeout would be the possibility to keep track of error instead of just killing the connection. And the fact that we can chunk, but maybe we can achieve a single logic for both (infinite chunk size would have the same output as the archiver, no?)

Comment thread pkg/takeout/cleanup/cleanup.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go

return gw.Flush()
})
if err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we ignore/skip errors with files and write them (the error) to a file (that the user can check)?

Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go Outdated
Comment thread pkg/takeout/takeout.go
Comment thread internal/http/services/takeout/takeout.go Outdated
Comment thread internal/http/services/takeout/takeout.go
Comment thread internal/http/services/takeout/takeout.go Outdated
Comment thread internal/http/services/takeout/takeout.go
if err != nil {
return errors.Wrap(err, "cleanup: could not get takeout containers")
}
if containerRes.Status.Code != rpc.Code_CODE_OK {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should never be the case, but make sure ContainerRes.Status != nil, otherwise you get a panic.

Comment thread pkg/takeout/takeout.go
Comment thread pkg/takeout/takeout.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants