diff --git a/environments/production.json b/environments/production.json index 6c44e15..7d15290 100644 --- a/environments/production.json +++ b/environments/production.json @@ -2,6 +2,12 @@ "name": "production", "override_attributes": { "akkounts": { + "smtp": { + "from_address": "accounts ", + "domain": "kosmos.org", + "auth_method": "plain", + "enable_starttls": "auto" + }, "lndhub": { "public_url": "https://lndhub.kosmos.org", "public_key": "024cd3be18617f39cf645851e3ba63f51fc13f0bb09e3bb25e6fd4de556486d946" diff --git a/site-cookbooks/kosmos-akkounts/attributes/default.rb b/site-cookbooks/kosmos-akkounts/attributes/default.rb index 64fde27..cc9cd0c 100644 --- a/site-cookbooks/kosmos-akkounts/attributes/default.rb +++ b/site-cookbooks/kosmos-akkounts/attributes/default.rb @@ -10,4 +10,9 @@ node.default['akkounts']['lndhub']['public_url'] = nil node.default['akkounts']['lndhub']['public_key'] = nil node.default['akkounts']['lndhub']['postgres_db'] = 'lndhub' +node.default['akkounts']['smtp']['from_address'] = 'accounts ' +node.default['akkounts']['smtp']['domain'] = 'kosmos.org' +node.default['akkounts']['smtp']['auth_method'] = 'plain' +node.default['akkounts']['smtp']['enable_starttls'] = 'auto' + node.override["redisio"]["version"] = "6.2.6" diff --git a/site-cookbooks/kosmos-akkounts/recipes/default.rb b/site-cookbooks/kosmos-akkounts/recipes/default.rb index 2daf6bf..24df181 100644 --- a/site-cookbooks/kosmos-akkounts/recipes/default.rb +++ b/site-cookbooks/kosmos-akkounts/recipes/default.rb @@ -4,11 +4,12 @@ # require 'ipaddr' -app_name = "akkounts" -deploy_user = "deploy" -deploy_group = "deploy" -deploy_path = "/opt/#{app_name}" -credentials = Chef::EncryptedDataBagItem.load('credentials', app_name) +app_name = "akkounts" +deploy_user = "deploy" +deploy_group = "deploy" +deploy_path = "/opt/#{app_name}" +credentials = Chef::EncryptedDataBagItem.load('credentials', app_name) +smtp_credentials = Chef::EncryptedDataBagItem.load('credentials', 'smtp') group deploy_group @@ -40,6 +41,16 @@ env = {} env[:rails_serve_static_files] = "true" +smtp_server, smtp_port = smtp_credentials[:relayhost].split(":") +env[:smtp_server] = smtp_server +env[:smtp_port] = smtp_port +env[:smtp_login] = smtp_credentials[:user_name] +env[:smtp_password] = smtp_credentials[:password] +env[:smtp_from_address] = node['akkounts']['smtp']['from_address'] +env[:smtp_domain] = node['akkounts']['smtp']['domain'] +env[:smtp_auth_method] = node['akkounts']['smtp']['auth_method'] +env[:smtp_enable_starttls] = node['akkounts']['smtp']['enable_starttls'] + if webhooks_allowed_ips.length > 0 env[:webhooks_allowed_ips] = webhooks_allowed_ips end