bigbluebutton / greenlight

A really simple end-user interface for your BigBlueButton server.
GNU Lesser General Public License v3.0
791 stars 3.8k forks source link

delete recordings after X hours/days #5871

Open Atlas780 opened 3 months ago

Atlas780 commented 3 months ago

We want to allow users to record and download their meetings, but the meetings need to be deleted after 24 hours or so. We initially wanted to implement the script found in BBB's documentation: https://docs.bigbluebutton.org/administration/customize/#delete-recordings-older-than-n-days The problem with that is that greenlight doesn't get the info that the recordings got deleted and still shows them. This results in errors when you try to do anything with them or try to delete the user. We haven't found a way to automatically delete the recordings from greenlight and don't feel comfortable to let a script manipulate the database manually.

A feature where we could set the recordings to autodelete after X hours/days would be very nice. This could be in the admin interface, a parameter in the .env file or even a rake task that we could use. Whatever is easiest for you to implement.

Ithanil commented 3 months ago

I think executing bundle exec rake server_recordings_sync inside your GL3 container should get rid of deleted recordings. Didn't use the task in a long while though.

Atlas780 commented 3 months ago

We tried using that and it ran withour errors, but the recording didn't get deleted in the database and was still visible on the frontend. We guessed that the command just isn't supposed to work that way. We looked into the code of the rake command and it seems like it only adds new recordings and doesn't remove old ones. Maybe this can be changed.

Atlas780 commented 3 months ago

We found that there is a greenlight api which has a function to handle recordings: app/controllers/api/v1/recordings_controller.rb We tried using that, but we can't get it to work. We always get a 200 response with a copyright disclaimer and some HTML code (also with /rooms or /users; see below for example). Is there a way to access the API to archive the deletion? Does anyone maybe know how to work with the API from outside the container?

<!--BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.-->

<!--Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).-->

<!--This program is free software; you can redistribute it and/or modify it under the-->
<!--terms of the GNU Lesser General Public License as published by the Free Software-->
<!--Foundation; either version 3.0 of the License, or (at your option) any later-->
<!--version.-->

<!--Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY-->
<!--WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A-->
<!--PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.-->

<!--You should have received a copy of the GNU Lesser General Public License along-->
<!--with Greenlight; if not, see <http://www.gnu.org/licenses/>.-->

<!DOCTYPE html>
<html>
  <head>
    <title>BigBlueButton</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <!-- Open Graph Attributes -->
    <meta property="og:title" content="BigBlueButton" />
    <meta property="og:description" content="Learn using BigBlueButton, the trusted open-source web conferencing solution that enables seamless virtual collaboration and online learning experiences." />
    <meta property="og:image" content="http://localhost:5050/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxrTXpobU5EZzRPQzFsWmpCaUxUUmxZVEF0T0dRMVppMWxZMk14T0RobE1qSTJZV1FHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--80116532e6654ec7275beb7fc2722568ac12198f/Logo_RGB_SchwarzRot_100mm.jpg" />

    <meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="do_wg9gxE03PI0t3sAxIeHVT_wFmIuf3LXeu1f6yu_lOcyyqPxqn121MD9kx4XwjyOwyLA_J717bEZU_dvbDJA" />

    <link rel="stylesheet" href="/assets/application-95fe5627b1b0864f5dcc8a485987804dc0ed07c6fa8fcfb302b3ebb477ddb5cb.css" />
    <script src="/assets/main-0f5251de722e16a7972de5b3e9f38b6a0232da5afc74f1c64559007921324e92.js" defer="defer"></script>
  </head>

  <body>
    <!--BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.-->

<!--Copyright (c) 2022 BigBlueButton Inc. and by respective authors (see below).-->

<!--This program is free software; you can redistribute it and/or modify it under the-->
<!--terms of the GNU Lesser General Public License as published by the Free Software-->
<!--Foundation; either version 3.0 of the License, or (at your option) any later-->
<!--version.-->

<!--Greenlight is distributed in the hope that it will be useful, but WITHOUT ANY-->
<!--WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A-->
<!--PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.-->

<!--You should have received a copy of the GNU Lesser General Public License along-->
<!--with Greenlight; if not, see <http://www.gnu.org/licenses/>.-->

<div id="root"></div>

  </body>
</html>
Ithanil commented 3 months ago

We found that there is a greenlight api which has a function to handle recordings: app/controllers/api/v1/recordings_controller.rb We tried using that, but we can't get it to work. We always get a 200 response with a copyright disclaimer and some HTML code (also with /rooms or /users; see below for example). Is there a way to access the API to archive the deletion? Does anyone maybe know how to work with the API from outside the container?

....

Well, that's the internal API that the JavaScript frontend code uses to communicate with the backend. While there certainly likely is a way to abuse it with a valid access token from a session cookie, it is not meant to be used as an external API.

farhatahmad commented 2 months ago

Correct server_recordings_sync doesn't delete everything (tho it probably should). If you use the Resync Recordings button under Server Rooms, the should work, but must be done on a per room basis. We should probably update the rake task to do that