This commit is contained in:
2025-01-07 06:22:59 +00:00
parent c485423911
commit ce7253b4b1
15 changed files with 234 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
import express from "express";
import cors from 'cors';
import mongoose from 'mongoose';
import {vols} from "../../src/app/backup"
import {all_tools} from "../../src/app/urls"
//import {vols} from "../../src/app/backup"
//import {all_tools} from "../../src/app/urls"
import crypto from "crypto";
import bcrypt from "bcrypt"
import dotenv from "dotenv";
@@ -99,7 +99,7 @@ app.get("/seed-backup", async (req,res)=>{
// if (backupCount > 0) {
// res.send("Seed already done")
// }
BackupModel.create(vols)
// BackupModel.create(vols)
})
app.get("/", (req,res)=>{
@@ -184,8 +184,9 @@ function decryptPassword(encryptedPassword: string, iv: string) {
}
app.get("/api/seed-creds",async(req,res)=>{
const all_creds: ICreds[] = all_tools;
for (const cred of all_creds) {
// const all_creds: ICreds[] = all_tools;
const all_creds: ICreds[] = [];
for (const cred of all_creds) {
const { iv, encryptedPassword} = encryptPassword(cred.password)
const newCred =new CredsModel({
@@ -218,4 +219,4 @@ app.get("/api/secrets",async(req,res)=>{
const PORT = 3000;
app.listen(PORT,()=>{
console.log(`Server started on port ${PORT}`)
})
})