Skip to content

Commit 0c04340

Browse files
committed
Add MailDev container to development setup and update MailSettingsDto validation
1 parent 1302188 commit 0c04340

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,25 @@ dbs: ## Start databases
114114
--health-retries=3 \
115115
--health-cmd="redis-cli ping || exit 1" \
116116
redis || true
117+
@docker run -d --rm \
118+
--name $(BASE_NAME)-maildev \
119+
--platform $(PLATFORM) \
120+
--network dev \
121+
-p 1080:1080 \
122+
-p 1025:1025 \
123+
maildev/maildev || true
117124
@docker exec -it $(BASE_NAME)-mongodb mongosh --eval "rs.initiate({_id: \"rs0\", members: [{_id: 0, host: \"$(BASE_NAME)-mongodb\"}]})" || true
118125

119126
stop: ## Stop the container
120127
@docker stop $(APP_NAME) || true
121128
@docker stop $(BASE_NAME)-mongodb || true
122129
@docker stop $(BASE_NAME)-redis || true
130+
@docker stop $(BASE_NAME)-maildev || true
123131

124132
stop-dbs: ## Stop databases
125133
@docker stop $(BASE_NAME)-mongodb || true
126134
@docker stop $(BASE_NAME)-redis || true
135+
@docker stop $(BASE_NAME)-maildev || true
127136

128137

129138
run-test: ## Run tests

src/settings/_dto/mail.settings.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IsEmail, IsString, IsUrl } from 'class-validator';
22
import { ApiProperty } from '@nestjs/swagger';
33

44
export class MailSettingsDto {
5-
@IsUrl({ protocols: ['smtp', 'smtps'], require_protocol: true })
5+
@IsUrl({ protocols: ['smtp', 'smtps'], require_protocol: true, require_tld: false })
66
@ApiProperty({ example: 'smtp://smscsim.smpp.org:25', description: 'Serveur SMTP', type: String })
77
public host: string = 'smtp://localhost:25';
88

0 commit comments

Comments
 (0)