Ch. 4, Tickt: Principle of Least Privilege

I am now looking a this:

Chapter 4: Resiliency
Ticket: Principle of Least Privilege

I created a user with no problem, except that I don’t quite know what "Add Default Privileges" means. I just hope this is not important.

After this I read "modify the SRV connection string in your configuration".

Where are these "SRV connection string" and "configuration" ?
So that I can modify anything.

In Chapter 1 - Driver Setup look for Running the Application, this is where you did the original configuration.

I just had a look, but I only see Testing and Running the Application inside tickets.
Unless I was too quick to review the lectures… I don’t see anything inspiring to solve my problem.

In order for the application to use Atlas, you will need a file called .env to contain the connection information. In the mflix-js directory you can find two files, dotenv_unix (for Unix users) and dotenv_win (for Windows users).

Open the file for your chosen operating system and enter your Atlas SRV connection string as directed in the comment. This is the information the driver will use to connect. Make sure not to wrap your Atlas SRV connection between quotes:

MFLIX_DB_URI = mongodb+srv://…

It’s highly suggested you also change the SECRET_KEY to some very long, very random string. While this application is only meant for local use during this course, software has a strange habit of living a long time.

When you’ve edited the file, rename it to .env with the following command:

mv dotenv_unix .env # on Unix ren dotenv_win .env # on Windows

Note: Once you rename this file to .env , it will no longer be visible in Finder or File Explorer. However, it will be visible from Command Prompt or Terminal, so if you need to edit it again, you can open it from there:

vi .env # on Unix notepad .env # on Windows

In the mflix-js directory, run the following commands:

install MFlix dependencies npm install # start the MFlix application npm start

This will start the application. You can then access the MFlix application at http://localhost:5000/.

OK. Now I get it. Sorry I wasn’t looking at the right place.

1 Like