diff --git a/README.md b/README.md index dce7f8d..162f4e1 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,7 @@ Please report any security vulnerabilities using GitHub's security tab on the re - [Linux](https://docs.mongodb.com/manual/administration/install-on-linux/) 2. Run `npm i`. if this doesn't work run it with --force 3. Run `npm run dev` to start the server in development mode. + +## Deployment + +1. idk man follow [this](https://www.mongodb.com/docs/manual/administration/security-checklist/#std-label-security-checklist) diff --git a/api/db/UMTests.js b/api/db/UMTests.js index 4de91f0..76693b8 100644 --- a/api/db/UMTests.js +++ b/api/db/UMTests.js @@ -1,11 +1,15 @@ const UserManager = require('./UserManager'); const colors = require('colors'); + +const understands = process.argv.includes("-u") || + process.argv.includes("--understands"); + async function tests() { const manager = new UserManager(); await manager.init(); - await manager.reset(true); + await manager.reset(understands); //////////////////// // Create account // @@ -229,6 +233,7 @@ async function tests() { return true; } + (async () => { let result = await tests(); if (result) { diff --git a/api/db/UserManager.js b/api/db/UserManager.js index 53fddb3..6fdff48 100644 --- a/api/db/UserManager.js +++ b/api/db/UserManager.js @@ -37,7 +37,9 @@ class UserManager { this.db = this.client.db('pm_userdata'); this.users = this.db.collection('users'); this.reports = this.db.collection('reports'); + this.projects = this.db.collection('projects'); this.uploadsDisabled = false; + return true; } /** @@ -56,7 +58,7 @@ class UserManager { */ async reset(understands = false) { if (!understands) { - if (prompt("This deletes ALL USER DATA. Are you sure? (y/n) ") !== "y") + if (prompt("This deletes ALL USER DATA. Are you sure? (Y/n) ") === "n") return; } await this.users.deleteMany({});