This guide walks you through setting up the local MingSec system.
MingSec currently only runs on Windows, but it may be used on Mac/Linux with some adjustments.
- Python 3.8 or higher
- A Dropbox account (if you don’t already have one)
- (Recommended) GitBash (Some bash commands will look different if you are not using GitBash)
- (Optional) A Linux device for a second camera
- (Optional) Firebase account for notifications (if using the Kotlin notification app)
Create and activate a virtual environment for Python:
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
venv\Scripts\activateInstall the required Python packages from requirements.txt:
pip install -r requirements.txt- Sign in to your Dropbox account.
- Create a new Dropbox app by following the instructions here.
- Note down the following credentials:
APP_KEYAPP_SECRETREFRESH_TOKEN
- (Optional) If you plan to use separate credentials for read/write operations, create another app with appropriate permissions.
- If you decide to use one application, use the same credentials for both apps in the .env file
Generate a .env file in the local folder with the following command:
winpty python dot_env_generator.pyThen, open the .env file and replace the placeholder values with your own credentials, including the Dropbox APP_KEY, APP_SECRET, and REFRESH_TOKEN.
If you’re using a second camera connected to a Linux device, copy the external folder from your MingSec project directory to the target device. You can place the folder wherever is convenient, but make sure to update the EXTERNAL_DEVICE_PATH in your .env file to reflect the correct location.
If you're not using a second camera, you can skip this step.
- Create a Firebase project in the Firebase Console.
- For help with setting up a Firebase project, click here
- Generate the
service-account-file.jsonfile for your project:
- Go to the Firebase Console: Open your web browser and navigate to the Firebase Console.
- Select your project: From the project list, select the project for which you need the service account file.
- Open Project Settings: Click on the gear icon next to "Project Overview" in the top left corner and select "Project settings" from the dropdown menu.
- Navigate to Service Accounts: In the Project settings, click on the "Service accounts" tab.
- Generate a new private key:
- Click the "Generate new private key" button.
- A confirmation dialog will appear. Click "Generate Key".
- Download the JSON file: The JSON file containing your service account credentials will be downloaded to your computer.
- Rename this file to
ming_sec_firebase.jsonand save it in theLocalfolder (the same folder asmain.py). - Open the
.envfile and update theFIREBASE_PROJECT_ID(You can find your project id in theming_sec_firebase.jsonfile)
You can get the
NOTIFICATION_DEVICE_TOKENfrom the Kotlin app later.
Run the following command to start MingSec:
winpty python main.py