Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] GDPR - Right to access and Data Portability #9906

Merged
merged 26 commits into from
Apr 21, 2018

Conversation

Hudell
Copy link
Contributor

@Hudell Hudell commented Feb 26, 2018

@RocketChat/core

Closes #9767
Closes #9768

This PR adds an option for users to download all their data stored in the servers, in either JSON or HTML format. This funcionality can be enabled by an admin through a new page on the administration center.

Administration Center

Once enabled, two new buttons will be added to the user's account page:
My Account

When the user clicks on one of those new buttons, the system will register the request on the new exportOperations collection. The server will then automatically export all the messages and attachments from every channel that the user has access to. When this operation is complete, the server will generate a zip file and send an email to the user with a download link.

Each button can only be used once per day. The download button will generate HTML files and the export button will generate JSON files.

@Hudell Hudell requested a review from rodrigok February 26, 2018 21:01
@Hudell Hudell added this to the 0.63.0 milestone Feb 26, 2018
return res.end();
}

const filePath = operation.generatedFile;
Copy link
Contributor

Choose a reason for hiding this comment

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

We are making a lot of assumptions about long term storage being available on the disk. Could we store the file on the file store provider already setup on the server?

Let's just imagine that this is in a docker container. If you write the file and then the container is restarted the file is gone. Mounting a directory is possible... But in some setups this is pretty difficult

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added GridFS, Amazon and Google Storage as options for the location of the generated file.

@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@RocketChat RocketChat deleted a comment Feb 27, 2018
@Hudell Hudell changed the title [NEW] GDPR - Right to access [NEW] GDPR - Right to access and Data Portability Mar 5, 2018
@theorenck theorenck modified the milestones: 0.63.0, 0.64.0 Apr 9, 2018
@Hudell Hudell removed the request for review from rodrigok April 17, 2018 14:22
@rodrigok rodrigok merged commit fee30ad into RocketChat:develop Apr 21, 2018
engelgabriel added a commit that referenced this pull request Apr 21, 2018
* 'develop' of github.com:RocketChat/Rocket.Chat:
  [NEW] Option to mute group mentions (@ALL and @here) (#10502)
  [NEW] GDPR - Right to access and Data Portability (#9906)
@rodrigok rodrigok mentioned this pull request Apr 28, 2018
@ghost
Copy link

ghost commented Apr 30, 2018

Just tried that but I get internal server error +

Exception while invoking method 'requestDataDownload' Error: ENOENT: no such file or directory, mkdir '/tmp/userData/HxSazvfL5T6vRHP8K'
    at Object.fs.mkdirSync (fs.js:885:18)
    at MethodInvocation.requestDataDownload (/opt/rocketchat-0.64.0/programs/server/app/app.js:10356:10)
    at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
    at MethodInvocation.methodsMap.(anonymous function) (/opt/rocketchat-0.64.0/programs/server/packages/rocketchat_lib.js:2186:28)
    at maybeAuditArgumentChecks (/opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:1877:12)
    at DDP._CurrentMethodInvocation.withValue (/opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:902:126)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:12)
    at DDPServer._CurrentWriteFence.withValue (/opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:902:98)
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1186:12)
    at Promise (/opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:902:46)
    at new Promise (<anonymous>:null:null)
    at Session.method (/opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:875:23)
    at /opt/rocketchat-0.64.0/programs/server/packages/ddp-server.js:754:85

@ghost
Copy link

ghost commented Apr 30, 2018

Creating /tmp/userData solves that. Hm.

@photoninger
Copy link

mkdir -p would avoid such errors

@Elvinra
Copy link

Elvinra commented May 17, 2018

On docker same problem, the user rocketchat don't have the permissions on tmp folder

  • little fix: Mount a volume on /tmp/userData, put chmod 777 on the host system

Real fix: update the dockerfile to create that folder and put the permissions to rocketchat user

@photoninger
Copy link

When are the exported files and zip files deleted?
Or do you depend on deleting everything in /tmp on reboot?

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.

6 participants