From d3439db85b70c6432ffd07b08e8889c2dbd36313 Mon Sep 17 00:00:00 2001 From: Sonoko Mizuki Date: Sat, 22 Apr 2023 16:27:45 +0900 Subject: [PATCH] Set defualt value of AWS_REGION --- docs/SETTINGS.md | 2 +- email/email.go | 3 --- sql/settings.sql | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/SETTINGS.md b/docs/SETTINGS.md index 72fe502..d3909a9 100644 --- a/docs/SETTINGS.md +++ b/docs/SETTINGS.md @@ -26,7 +26,7 @@ Here are the descriptions of values available to use in the `settings` table: | AWS_SES_ID | | Amazon Web Services - Simple Email Service - access id | | AWS_SES_SECRET | | Amazon Web Services - Simple Email Service - access secret | | AWS_SES_EMAIL_FROM | | Amazon Web Services - Simple Email Service - email from field | -| AWS_REGION | | Amazon Web Services - Account region | +| AWS_REGION | us-east-1 | Amazon Web Services - Account region | | EMAIL_MAX_TXS | | maximum number of transactions to include in the email body | | FUNCTION_LNDHUB | DISABLE | system level switch for using LNDHUB in place of LND | | LNDHUB_URL | | URL for the LNDHUB service | diff --git a/email/email.go b/email/email.go index 223be6b..7b56a88 100644 --- a/email/email.go +++ b/email/email.go @@ -93,9 +93,6 @@ func Send_email(recipient string, subject string, htmlBody string, textBody stri aws_ses_secret := db.Get_setting("AWS_SES_SECRET") sender := db.Get_setting("AWS_SES_EMAIL_FROM") region := db.Get_setting("AWS_REGION") - if region == "" { - region = "us-east-1" - } sess, err := session.NewSession(&aws.Config{ Region: aws.String(region), diff --git a/sql/settings.sql b/sql/settings.sql index 53f2aaa..730ac0e 100644 --- a/sql/settings.sql +++ b/sql/settings.sql @@ -23,7 +23,7 @@ INSERT INTO settings (name, value) VALUES ('FUNCTION_EMAIL', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_ID', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_SECRET', ''); INSERT INTO settings (name, value) VALUES ('AWS_SES_EMAIL_FROM', ''); -INSERT INTO settings (name, value) VALUES ('AWS_REGION', ''); +INSERT INTO settings (name, value) VALUES ('AWS_REGION', 'us-east-1'); INSERT INTO settings (name, value) VALUES ('EMAIL_MAX_TXS', ''); INSERT INTO settings (name, value) VALUES ('FUNCTION_LNDHUB', ''); INSERT INTO settings (name, value) VALUES ('LNDHUB_URL', '');