Skip to content

Commit

Permalink
forgor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianyourgod committed Feb 24, 2024
1 parent 68d9558 commit 20ac636
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 6 additions & 1 deletion api/db/UMTests.js
Original file line number Diff line number Diff line change
@@ -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 //
Expand Down Expand Up @@ -229,6 +233,7 @@ async function tests() {
return true;
}


(async () => {
let result = await tests();
if (result) {
Expand Down
4 changes: 3 additions & 1 deletion api/db/UserManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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({});
Expand Down

0 comments on commit 20ac636

Please sign in to comment.