Skip to content

Commit 18dfb95

Browse files
authored
Merge pull request #1 from modl-gg/prod-test-1
Prod test 1
2 parents 90cb1d5 + 0777763 commit 18dfb95

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Build (Pull Request)"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches:
7+
- main
8+
- dev
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '23'
22+
23+
- name: Install root dependencies
24+
run: npm install
25+
26+
- name: Install client dependencies
27+
run: |
28+
cd client
29+
npm install
30+
31+
- name: Run build
32+
run: npm run build

.github/workflows/deploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
ssh ${{ secrets.SERVER_USER }}@${{ secrets.STAGING_IP }} << 'EOF'
2626
cd /home/modl/modl-admin
27-
git pull origin main
27+
git pull origin dev
2828
npm install
2929
cd client
3030
npm install

server/services/EmailService.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ class EmailService {
1414
private transporter: nodemailer.Transporter;
1515

1616
constructor() {
17+
const smtpPort = Number(process.env.SMTP_PORT) || 25;
18+
const emailAuth = {
19+
user: process.env.SMTP_USERNAME,
20+
pass: process.env.SMTP_PASSWORD
21+
};
1722
this.transporter = nodemailer.createTransport({
18-
host: process.env.SMTP_HOST || 'localhost',
19-
port: parseInt(process.env.SMTP_PORT || '25'),
20-
secure: false, // Use TLS
21-
auth: undefined, // No auth for local postfix
23+
host: process.env.SMTP_HOST || "localhost", // Assuming postfix is running on localhost
24+
port: smtpPort,
25+
secure: false, // true for 465, false for other ports
2226
tls: {
23-
rejectUnauthorized: false
24-
}
27+
rejectUnauthorized: false // Allow self-signed certificates
28+
},
29+
auth: (emailAuth.user && emailAuth.pass) ? emailAuth : undefined
2530
});
2631
}
2732

0 commit comments

Comments
 (0)