Skip to content

Commit

Permalink
docker: remove even more unnecessary env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Aug 29, 2024
1 parent 63069ae commit f321633
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 22 deletions.
14 changes: 3 additions & 11 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SMTP_HOST=
# Example: 465
SMTP_PORT=
# Description: The FROM email address when sending out emails. Must be an email address under your control otherwise sending will fail. Most times it is the same email address as the SMTP_USERNAME.
# Required: yes
# Required: no
# Example: support@notesnook.com
NOTESNOOK_SENDER_EMAIL=
# Description: The reply-to email is used whenever a user is replying to the email you sent. You can use this to set a different reply-to email address than the one you used to send the email.
Expand All @@ -49,18 +49,10 @@ TWILIO_AUTH_TOKEN=
# Example: VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TWILIO_SERVICE_SID=

# Description: This is the public domain for the Authentication server. It can also be the IP address if you don't own a domain name. The domain/IP must be accessible from wherever you are running the Notesnook clients.
# Required: yes
# Example: api.notesnook.com
NOTESNOOK_SERVER_DOMAIN=
# Description: This is the public domain for the Authentication server. It can also be the IP address if you don't own a domain name. The domain/IP must be accessible from wherever you are running the Notesnook clients.
# Description: This is the public domain for the Authentication server. It can also be the IP address if you don't own a domain name. The domain/IP must be accessible from wherever you are running the Notesnook clients. Used for generating email confirmation & password reset URLs.
# Required: yes
# Example: auth.streetwriters.co
IDENTITY_SERVER_DOMAIN=
# Description: This is the public domain for the Authentication server. It can also be the IP address if you don't own a domain name. The domain/IP must be accessible from wherever you are running the Notesnook clients.
# Required: yes
# Example: events.streetwriters.co
SSE_SERVER_DOMAIN=
IDENTITY_SERVER_DOMAIN=localhost:8264

# Description: Add the origins for which you want to allow CORS. Leave it empty to allow all origins to access your server. If you want to allow multiple origins, seperate each origin with a comma.
# Required: no
Expand Down
5 changes: 1 addition & 4 deletions Streetwriters.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Constants
public static string SMTP_HOST => Environment.GetEnvironmentVariable("SMTP_HOST");
public static string SMTP_PORT => Environment.GetEnvironmentVariable("SMTP_PORT");
public static string SMTP_REPLYTO_EMAIL => Environment.GetEnvironmentVariable("SMTP_REPLYTO_EMAIL");
public static string NOTESNOOK_SENDER_EMAIL => Environment.GetEnvironmentVariable("NOTESNOOK_SENDER_EMAIL");
public static string NOTESNOOK_SENDER_EMAIL => Environment.GetEnvironmentVariable("NOTESNOOK_SENDER_EMAIL") ?? Environment.GetEnvironmentVariable("SMTP_USERNAME");

public static string NOTESNOOK_APP_HOST => Environment.GetEnvironmentVariable("NOTESNOOK_APP_HOST");
public static string NOTESNOOK_API_SECRET => Environment.GetEnvironmentVariable("NOTESNOOK_API_SECRET");
Expand All @@ -55,7 +55,6 @@ public class Constants
// Server discovery
public static int NOTESNOOK_SERVER_PORT => int.Parse(Environment.GetEnvironmentVariable("NOTESNOOK_SERVER_PORT") ?? "80");
public static string NOTESNOOK_SERVER_HOST => Environment.GetEnvironmentVariable("NOTESNOOK_SERVER_HOST");
public static string NOTESNOOK_SERVER_DOMAIN => Environment.GetEnvironmentVariable("NOTESNOOK_SERVER_DOMAIN");
public static string NOTESNOOK_CERT_PATH => Environment.GetEnvironmentVariable("NOTESNOOK_CERT_PATH");
public static string NOTESNOOK_CERT_KEY_PATH => Environment.GetEnvironmentVariable("NOTESNOOK_CERT_KEY_PATH");

Expand All @@ -67,7 +66,6 @@ public class Constants

public static int SSE_SERVER_PORT => int.Parse(Environment.GetEnvironmentVariable("SSE_SERVER_PORT") ?? "80");
public static string SSE_SERVER_HOST => Environment.GetEnvironmentVariable("SSE_SERVER_HOST");
public static string SSE_SERVER_DOMAIN => Environment.GetEnvironmentVariable("SSE_SERVER_DOMAIN");
public static string SSE_CERT_PATH => Environment.GetEnvironmentVariable("SSE_CERT_PATH");
public static string SSE_CERT_KEY_PATH => Environment.GetEnvironmentVariable("SSE_CERT_KEY_PATH");

Expand All @@ -76,7 +74,6 @@ public class Constants
public static string MONGODB_DATABASE_NAME => Environment.GetEnvironmentVariable("MONGODB_DATABASE_NAME");
public static int SUBSCRIPTIONS_SERVER_PORT => int.Parse(Environment.GetEnvironmentVariable("SUBSCRIPTIONS_SERVER_PORT") ?? "80");
public static string SUBSCRIPTIONS_SERVER_HOST => Environment.GetEnvironmentVariable("SUBSCRIPTIONS_SERVER_HOST");
public static string SUBSCRIPTIONS_SERVER_DOMAIN => Environment.GetEnvironmentVariable("SUBSCRIPTIONS_SERVER_DOMAIN");
public static string SUBSCRIPTIONS_CERT_PATH => Environment.GetEnvironmentVariable("SUBSCRIPTIONS_CERT_PATH");
public static string SUBSCRIPTIONS_CERT_KEY_PATH => Environment.GetEnvironmentVariable("SUBSCRIPTIONS_CERT_KEY_PATH");
public static string[] NOTESNOOK_CORS_ORIGINS => Environment.GetEnvironmentVariable("NOTESNOOK_CORS")?.Split(",") ?? new string[] { };
Expand Down
3 changes: 0 additions & 3 deletions Streetwriters.Common/Servers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ public static string GetLocalIPv4()
#endif
public static Server NotesnookAPI { get; } = new(Constants.NOTESNOOK_CERT_PATH, Constants.NOTESNOOK_CERT_KEY_PATH)
{
Domain = Constants.NOTESNOOK_SERVER_DOMAIN,
Port = Constants.NOTESNOOK_SERVER_PORT,
Hostname = Constants.NOTESNOOK_SERVER_HOST,
Id = "notesnook-sync"
};

public static Server MessengerServer { get; } = new(Constants.SSE_CERT_PATH, Constants.SSE_CERT_KEY_PATH)
{
Domain = Constants.SSE_SERVER_DOMAIN,
Port = Constants.SSE_SERVER_PORT,
Hostname = Constants.SSE_SERVER_HOST,
Id = "sse"
Expand All @@ -116,7 +114,6 @@ public static string GetLocalIPv4()

public static Server SubscriptionServer { get; } = new(Constants.SUBSCRIPTIONS_CERT_PATH, Constants.SUBSCRIPTIONS_CERT_KEY_PATH)
{
Domain = Constants.SUBSCRIPTIONS_SERVER_DOMAIN,
Port = Constants.SUBSCRIPTIONS_SERVER_PORT,
Hostname = Constants.SUBSCRIPTIONS_SERVER_HOST,
Id = "subscription"
Expand Down
2 changes: 1 addition & 1 deletion Streetwriters.Identity/Services/EmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private async Task SendEmailAsync(string email, IEmailTemplate template, IClient
{
if (int.TryParse(Constants.SMTP_PORT, out int port))
{
await mailClient.ConnectAsync(Constants.SMTP_HOST, port, MailKit.Security.SecureSocketOptions.StartTls);
await mailClient.ConnectAsync(Constants.SMTP_HOST, port, MailKit.Security.SecureSocketOptions.Auto);
}
else
{
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ services:
"SMTP_PASSWORD"
"SMTP_HOST"
"SMTP_PORT"
"NOTESNOOK_SENDER_EMAIL"
"NOTESNOOK_SERVER_DOMAIN"
"IDENTITY_SERVER_DOMAIN"
"SSE_SERVER_DOMAIN"
"NOTESNOOK_APP_HOST"
)
Expand Down

0 comments on commit f321633

Please sign in to comment.