Merge pull request #16562 from antobinary/sec-2

refactor: tweaks on recording-imex to get it to run locally
This commit is contained in:
Anton Georgiev 2023-01-25 14:39:49 -05:00 committed by GitHub
commit d79c1127d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 11 deletions

0
bbb-common-web/docker-clean.sh Normal file → Executable file
View File

0
bbb-common-web/psql.sh Normal file → Executable file
View File

View File

@ -5,6 +5,7 @@ import java.util.Objects;
@Entity
@Table(name = "metadata")
public class Metadata {
@Id

4
bbb-recording-imex/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
logs/
src/metadata
src/metadata-export/*

View File

@ -5,16 +5,30 @@ Imports and parses recording metadata.xml files and stores the data in a Postgre
## How to use
0. Ensure the required software is installed
- Install `docker` (if you're using `docker-dev` development environment for BBB this is already installed)
- You would either need to add your user to the docker group or you might have to prepend your docker-compose command with `sudo `
```
sudo usermod -aG docker `whoami`
sudo reboot
```
- Install `docker compose` - a sample set of steps are listed below but could likely be installed in a different way too:
- `sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose`
- `sudo chmod +x /usr/local/bin/docker-compose`
- `docker-compose --version`
- Note that you do _not_ need to install Postgres DB on your own
1. In bbb-common-web
- Edit the .env file and set the environment variables
- Run the hibernate.cfg script to generate the hibernate config file
- Run "docker-compose up" to start up the docker container containing the Postgresql database
- `cd bbb-common-web`
- Edit the `./.env` file and set the environment variables (the default values should work fine)
- Run the `./hibernate.cfg.sh` script to generate the hibernate config file
- Run `docker-compose up` to start up the docker container containing the Postgresql database
- Interact with the database using the psql script
2. In bbb-recording-imex
- Unit tests for parsing and persisting recording metadata can be found in src/test/java/org/bigbluebutton/recording/
- Edit the "metadataDirectory" variables in the test files to point to where the recording metadata can be found
- Run the unit tests using the command "mvn test"
- Use the deploy.sh script to compile the program
- Edit the `metadataDirectory` variables in the test files to point to where the recording metadata can be found. The default value "metadata" refers to `./src/metadata` and should work too.
- Run the unit tests using the command `mvn test`
- Use the `deploy.sh` script to compile the program
- Run the program with the recording-imex.sh script found in ~/usr/local/bin
- Use the --help option to see the usage

View File

@ -21,7 +21,7 @@ public class RecordingImportHandlerTest {
@Test
@DisplayName("RecordIDs should be properly parsed")
public void testParseRecordId() {
String metadataDirectory = "metadata";
String metadataDirectory = "src/metadata";
String[] entries = new File(metadataDirectory).list();
Set<String> ids = new HashSet<>();

View File

@ -17,7 +17,7 @@ public class RecordingStoreTest {
private static final Logger logger = LoggerFactory.getLogger(RecordingStoreTest.class);
private String metadataDirectory = "metadata";
private String metadataDirectory = "src/metadata";
private final RecordingImportHandler importHandler = RecordingImportHandler.getInstance();
private final RecordingExportHandler exportHandler = RecordingExportHandler.getInstance();
private DataStore dataStore;
@ -68,7 +68,7 @@ public class RecordingStoreTest {
@Order(3)
public void testExportRecording() {
dataStore = DataStore.getInstance();
String metadataDirectory = "metadata-export";
String metadataDirectory = "src/metadata-export";
exportHandler.exportRecordings(metadataDirectory);

View File

@ -6,7 +6,7 @@ sudo service bbb-web stop
grails assemble
mkdir exploded && cd exploded
jar -xvf ../build/libs/bigbluebutton-0.10.0.war
cp ../run-prod.sh .
if [ ! -d /usr/share/bbb-web-old ] ; then
sudo cp -R /usr/share/bbb-web /usr/share/bbb-web-old
echo "A backup was saved in /usr/share/bbb-web-old"
@ -26,4 +26,5 @@ cd ..
sudo rm -r exploded
sudo service bbb-web start
echo 'starting service bbb-web'
echo 'starting service bbb-web'