From 71e39eb65e8ce66f6fc91743499e4da11edaf2fb Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 28 Mar 2025 08:21:43 -0600 Subject: [PATCH] docker ignore, ignore tar file, commet mail controller, docker compose pentester --- .dockerignore | 6 ++++++ .gitignore | 4 ++++ docker-compose.pentest.yml | 32 ++++++++++++++++++++++++++++++++ src/mail/mail.controller.ts | 11 ++++++++--- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 docker-compose.pentest.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a328873 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +dist +.git +.env +*.log + diff --git a/.gitignore b/.gitignore index 4b56acf..15e67f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ + +*.tar + + # compiled output /dist /node_modules diff --git a/docker-compose.pentest.yml b/docker-compose.pentest.yml new file mode 100644 index 0000000..880f7b5 --- /dev/null +++ b/docker-compose.pentest.yml @@ -0,0 +1,32 @@ +version: '3.8' + +services: + mariadb: + image: mariadb:latest + container_name: mariadb-service + ports: + - "4101:3306" + environment: + MARIADB_ROOT_PASSWORD: mypass + MARIADB_DATABASE: ApiCorreos + volumes: + - mariadb_data:/var/lib/mysql + + api: + image: correos_api:v0 # <--- la imagen final (comprobada en el paso anterior) + container_name: nestjs-api + environment: + # Ajustar estas vars a tu conveniencia + db_host: mariadb + db_port: 3306 + db_username: root + db_password: mypass + db_database: ApiCorreos + PORT: 4100 + ports: + - "4100:4100" + depends_on: + - mariadb + +volumes: + mariadb_data: diff --git a/src/mail/mail.controller.ts b/src/mail/mail.controller.ts index 866a308..54aeee6 100644 --- a/src/mail/mail.controller.ts +++ b/src/mail/mail.controller.ts @@ -33,7 +33,12 @@ export class MailController { @Headers() headers:{password:string}, @Body() body: { to: string; subject: string; text: string; fecha_recibido: Date }) { - +/* + +// esta parte hay que rehacerla, se tiene que obtener la contraseña del sistema en base a la clave del sistema. +// debe de existir un modulo para crear contraseñas para las apis y administrar esas contraseñas + + if (!headers.password) { throw new UnauthorizedException('Header "Password" es requerido'); } @@ -42,12 +47,12 @@ export class MailController { if (!sistem) { throw new UnauthorizedException('Password incorrecto'); - } + } */ const { to, subject, text, fecha_recibido } = body; - const result = await this.mailService.sendMail(to, subject, text, fecha_recibido,sistem); + const result = await this.mailService.sendMail(to, subject, text, fecha_recibido,1); // sistem return result;