Skip to content

Commit d8c5a71

Browse files
committed
fix: correct smtp port for local and prod
1 parent 1e26e2f commit d8c5a71

File tree

12 files changed

+65
-58
lines changed

12 files changed

+65
-58
lines changed

.devcontainer/.env.production.local.example

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ PORT=3000
33
FRONTEND_URL=http://localhost:3000
44

55
DATABASE_URL=postgresql://admin_pg:password@postgres:5432/express-hybrid-auth-api-local-prod-db
6+
# Use the Docker service name 'postgres' as the host because the app runs inside a container.
7+
# Port 5432 is the default PostgreSQL port inside the container.
8+
# From the host machine (local Node.js), you would connect to localhost:5433 because of the port mapping in docker-compose.yml.
69

710
GOOGLE_CLIENT_ID=
811
GOOGLE_CLIENT_SECRET=
@@ -14,11 +17,13 @@ GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback
1417

1518
NODE_ENV=development
1619

17-
REDIS_PORT=6379
18-
REDIS_HOST=redis # using redis service name because the app will run in a container so localhost is not correct
20+
REDIS_PORT=6379
21+
REDIS_HOST=redis # Use the Docker service name 'redis' because the app runs inside a container.
22+
# 'localhost' would point to the container itself, not the Redis container.
1923

20-
SMTP_HOST=smtp4dev
21-
SMTP_PORT=2525
24+
SMTP_HOST=smtp4dev # Docker service name for smtp4dev container
25+
SMTP_PORT=25 # Container's SMTP port (25).
26+
# Use port 25 here because inside the container, Docker networking connects directly to smtp4dev's internal port.
2227

2328
SESSION_SECRET="QeWMItONAv+x6AmdOJ2D5O1h/d//DjO5bpmjz6O0AOnxfc7Q4OlHYeXxX2HE6l0N2zEMZTAYmmRc8Z50UAFPHA=="
2429
ACCESS_TOKEN_SECRET="F9HHTuGGzVhbzB6rMoTLRVlZu7RhsicD6iF00xDn5K4UIlHtkcecz1bMyDRaewfjTUqmoTH6UWN22Bf7qymGBg=="

.devcontainer/docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
image: rnwood/smtp4dev
4444
ports:
4545
- '5000:80' # Web UI
46-
- '2525:2525' # SMTP server
46+
- '2525:25' # SMTP server (Host 2525 -> Container 25 (SMTP))
4747
restart: unless-stopped
4848
environment:
4949
- Logging__LogLevel__Default=Information

.devcontainer/docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ services:
6464
image: rnwood/smtp4dev
6565
ports:
6666
- '5000:80'
67-
- '2525:2525'
67+
- '2525:25' # SMTP server (Host 2525 -> Container 25 (SMTP))
6868
restart: unless-stopped
6969
environment:
7070
- Logging__LogLevel__Default=Information

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PORT=3001
1+
PORT=3000
22
FRONTEND_URL=http://localhost:3000
33

44
DEBUG_LOG=true

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"editor.formatOnSave": true,
3-
"editor.defaultFormatter": "esbenp.prettier-vscode"
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
44
}

badges/coverage.svg

Lines changed: 9 additions & 9 deletions
Loading

manual-route-tests/2fa-confirm-recover.http

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2+
@port = 3000
3+
24
### Valid token
35

4-
POST http://localhost:3000/2fa/confirm-recover
6+
POST http://localhost:{{port}}/2fa/confirm-recover
57
content-type: application/json
68

79
{
@@ -11,7 +13,7 @@ content-type: application/json
1113

1214
### Used token
1315

14-
POST http://localhost:3000/2fa/confirm-recover
16+
POST http://localhost:{{port}}/2fa/confirm-recover
1517
content-type: application/json
1618

1719
{
@@ -21,7 +23,7 @@ content-type: application/json
2123

2224
### Expired token
2325

24-
POST http://localhost:3000/2fa/confirm-recover
26+
POST http://localhost:{{port}}/2fa/confirm-recover
2527
content-type: application/json
2628

2729
{
@@ -30,7 +32,7 @@ content-type: application/json
3032

3133
### Not found token
3234

33-
POST http://localhost:3000/2fa/confirm-recover
35+
POST http://localhost:{{port}}/2fa/confirm-recover
3436
content-type: application/json
3537

3638
{

manual-route-tests/login.http

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
@port = 3000
2+
13
### Valid credentials
2-
GET http://localhost:3000/csrf/token
4+
GET http://localhost:{{port}}/csrf/token
35
content-type: application/json
46

57
### Valid credentials
6-
POST http://localhost:3000/auth/login
8+
POST http://localhost:{{port}}/auth/login
79
x-csrf-token: 170691e9ce54052ddca950de19347c36006d47dd9ad66ba8f8e5504d896a336c159877eaa22b3296fada395791765f6225fc1b667125c85f1555a5f4509c2465760793bf49e194256f03738f426a861c27c7f060bd58378159de3df3454dbab6ffc38fe15e10b730c9439aef90ba1a1b5c5f68636d54488498301053f21ee8f2
810
content-type: application/json
911

@@ -13,7 +15,7 @@ content-type: application/json
1315
}
1416

1517
#### Invalid email
16-
POST http://localhost:3000/auth/login
18+
POST http://localhost:{{port}}/auth/login
1719
content-type: application/json
1820

1921
{
@@ -23,7 +25,7 @@ content-type: application/json
2325

2426

2527
#### Invalid password
26-
POST http://localhost:3000/auth/login
28+
POST http://localhost:{{port}}/auth/login
2729
content-type: application/json
2830

2931
{
@@ -33,7 +35,7 @@ content-type: application/json
3335

3436

3537
#### Invalid password
36-
POST http://localhost:3000/auth/login
38+
POST http://localhost:{{port}}/auth/login
3739
content-type: application/json
3840

3941
{

manual-route-tests/signup.http

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

2+
@port = 3000
3+
24
### Good password
3-
POST http://localhost:3000/auth/signup
5+
POST http://localhost:{{port}}/auth/signup
46
content-type: application/json
57

68
{
@@ -12,7 +14,7 @@ content-type: application/json
1214
}
1315

1416
### Password must contain at least one digit
15-
POST http://localhost:3000/auth/signup
17+
POST http://localhost:{{port}}/auth/signup
1618
content-type: application/json
1719

1820
{
@@ -24,7 +26,7 @@ content-type: application/json
2426
}
2527

2628
### Password must contain at most 100 characters
27-
POST http://localhost:3000/auth/signup
29+
POST http://localhost:{{port}}/auth/signup
2830
content-type: application/json
2931

3032
{
@@ -36,7 +38,7 @@ content-type: application/json
3638
}
3739

3840
### Password must contain at least 8 characters
39-
POST http://localhost:3000/auth/signup
41+
POST http://localhost:{{port}}/auth/signup
4042
content-type: application/json
4143

4244
{
@@ -48,7 +50,7 @@ content-type: application/json
4850
}
4951

5052
### Password must contain at least one special character
51-
POST http://localhost:3000/auth/signup
53+
POST http://localhost:{{port}}/auth/signup
5254
content-type: application/json
5355

5456
{
@@ -60,7 +62,7 @@ content-type: application/json
6062
}
6163

6264
### First name must be at least 1 character
63-
POST http://localhost:3000/auth/signup
65+
POST http://localhost:{{port}}/auth/signup
6466
content-type: application/json
6567

6668
{
@@ -72,7 +74,7 @@ content-type: application/json
7274
}
7375

7476
### First name must be at most 30 characters
75-
POST http://localhost:3000/auth/signup
77+
POST http://localhost:{{port}}/auth/signup
7678
content-type: application/json
7779

7880
{
@@ -84,7 +86,7 @@ content-type: application/json
8486
}
8587

8688
### Last name must be at least 1 characters
87-
POST http://localhost:3000/auth/signup
89+
POST http://localhost:{{port}}/auth/signup
8890
content-type: application/json
8991

9092
{
@@ -96,7 +98,7 @@ content-type: application/json
9698
}
9799

98100
### Last name must be at most 30 characters
99-
POST http://localhost:3000/auth/signup
101+
POST http://localhost:{{port}}/auth/signup
100102
content-type: application/json
101103

102104
{
@@ -108,7 +110,7 @@ content-type: application/json
108110
}
109111

110112
### Invalid email address
111-
POST http://localhost:3000/auth/signup
113+
POST http://localhost:{{port}}/auth/signup
112114
content-type: application/json
113115

114116
{
@@ -120,7 +122,7 @@ content-type: application/json
120122
}
121123

122124
### Invalid role
123-
POST http://localhost:3000/auth/signup
125+
POST http://localhost:{{port}}/auth/signup
124126
content-type: application/json
125127

126128
{

manual-route-tests/verify-signup.http

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2+
@port = 3000
3+
24
### Valid token
35

4-
POST http://localhost:3000/auth/verify-signup
6+
POST http://localhost:{{port}}/auth/verify-signup
57
content-type: application/json
68

79
{
@@ -11,7 +13,7 @@ content-type: application/json
1113

1214
### Used token
1315

14-
POST http://localhost:3000/auth/verify-signup
16+
POST http://localhost:{{port}}/auth/verify-signup
1517
content-type: application/json
1618

1719
{
@@ -21,7 +23,7 @@ content-type: application/json
2123

2224
### Expired token
2325

24-
POST http://localhost:3000/auth/verify-signup
26+
POST http://localhost:{{port}}/auth/verify-signup
2527
content-type: application/json
2628

2729
{
@@ -30,7 +32,7 @@ content-type: application/json
3032

3133
### Not found token
3234

33-
POST http://localhost:3000/auth/verify-signup
35+
POST http://localhost:{{port}}/auth/verify-signup
3436
content-type: application/json
3537

3638
{

0 commit comments

Comments
 (0)