Database
...
MongoDB
Examples of authorization sett...

Setting up authorization in Docker

11min

Back up and clear MongoDB data

Creating a backup

Go to the root directory of Passwork:

Shell


Run the backup script:

Shell


Clearing collections and data

Stop and delete the passwork_db container:

Shell


Clear previously created MongoDB collections and data:

Shell


Create a MongoDB user and start the container

Creating a user

Edit and complete the .env variable file. Insert the following lines and specify your values:

Shell


You can't use characters in MongoDB — .,@,$,:,%,",',/,\,| in the username and password, as this may cause malfunctions in the connection of the application server to MongoDB.

Starting the container

Start the passwork_db container:

Shell


Check the running container:

Shell


Restore from backups and connectPasswork

Restoring databases

Run the restore script:

Shell


Specify the created backup from step one:

Shell


Verify connection to MongoDB with authorisation:

Shell


Setting up and connecting Passwork with authorization

You need to edit the [mongo] section of Passwork configuration file at /<passwork>/conf/keys/config.ini and specify the login and password of the created user:

Shell


Save the changes and refresh the Passwork page to test the connection with MongoDB authorisation.