Skip to content

Commit

Permalink
fix: add additional smtp and service startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ontehfritz committed Dec 17, 2024
1 parent f887c40 commit 6378546
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ confidential values should use proper secrets management.
| GOOGLE_CLIENT_ID | The google client id to use for google authentication | string | 651882111548-0hrg7e4o90q1iutmfn02qkf9m90k3d3g.apps.googleusercontent.com | No | | |
| SERVICE_MODE | The service mode to run in only used for CI and tests | string | test | No |

nano /etc/systemd/system/bulwark-auth.service
1 change: 1 addition & 0 deletions src/Bulwark.Auth/.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EMAIL_SMTP_PORT=1025
EMAIL_SMTP_USER=user
EMAIL_SMTP_PASS=pass
EMAIL_SMTP_SECURE=false
EMAIL_SMTP_AUTH=false
VERIFICATION_URL=https://localhost:3000/verify
FORGOT_PASSWORD_URL=https://localhost:3000/reset-password
MAGIC_LINK_URL=https://localhost:3000/magic-link
Expand Down
2 changes: 2 additions & 0 deletions src/Bulwark.Auth/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class AppConfig
public string EmailSmtpUser { get; }
public string EmailSmtpPass { get; }
public bool EmailSmtpSecure { get; }
public bool EmailAuth { get; }
public string VerificationUrl { get; }
public string ForgotPasswordUrl { get; }
public string EmailFromAddress { get; }
Expand Down Expand Up @@ -57,6 +58,7 @@ public AppConfig()
EmailSmtpUser = Environment.GetEnvironmentVariable("EMAIL_SMTP_USER") ?? String.Empty;
EmailSmtpPass = Environment.GetEnvironmentVariable("EMAIL_SMTP_PASS") ?? String.Empty;
EmailSmtpSecure = Environment.GetEnvironmentVariable("EMAIL_SMTP_SECURE")?.ToLower() == "true";
EmailAuth = Environment.GetEnvironmentVariable("EMAIL_SMTP_AUTH")?.ToLower() == "true";
}

VerificationUrl = Environment.GetEnvironmentVariable("VERIFICATION_URL") ??
Expand Down
10 changes: 10 additions & 0 deletions src/Bulwark.Auth/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:80"
},
"Https": {
"Url": "https://0.0.0.0:443"
}
}
},
"AllowedHosts": "*"
}
12 changes: 12 additions & 0 deletions src/Bulwark.Auth/bulwark-auth.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=bulwark-auth
After=multi-user.target

[Service]
WorkingDirectory=/root/Bulwark.Auth/src/Bulwark.Auth/bin/Release/net8.0
User=root
Group=root
ExecStart=/root/Bulwark.Auth/src/Bulwark.Auth/bin/Release/net8.0/start.sh

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions src/Bulwark.Auth/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd "$(dirname "$0")" # Change to the directory of the script (or binary)
exec dotnet Bulwark.Auth.dll "$@"

0 comments on commit 6378546

Please sign in to comment.