diff --git a/config/environments/production.rb b/config/environments/production.rb index d4baec140..622e04227 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -66,6 +66,7 @@ config.active_job.queue_adapter = ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq') # config.active_job.queue_name_prefix = "hyku_#{Rails.env}" + config.action_mailer.default_options = { from: ENV.fetch('HYKU_CONTACT_EMAIL', 'changeme@example.com') } if ENV['SMTP_ENABLED'].present? && ENV['SMTP_ENABLED'].to_s == 'true' config.action_mailer.smtp_settings = { user_name: ENV['SMTP_USER_NAME'], @@ -73,7 +74,7 @@ address: ENV['SMTP_ADDRESS'], domain: ENV['SMTP_DOMAIN'], port: ENV['SMTP_PORT'], - enable_starttls_auto: true, + enable_starttls_auto: ActiveModel::Type::Boolean.new.cast(ENV.fetch('SMTP_STARTTLS', true)), authentication: ENV['SMTP_TYPE'] } # ActionMailer Config diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index ed03b96b2..9bf8a0d4b 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -141,20 +141,22 @@ extraEnvVars: &envVars value: hyku-demo.$BASE_URL - name: HYKU_USER_DEFAULT_PASSWORD value: password + - name: SMTP_ADDRESS + value: "maildev-smtp.maildev.svc.cluster.local" + - name: SMTP_DOMAIN + value: "maildev-smtp.maildev.svc.cluster.local" - name: SMTP_ENABLED value: "true" + - name: SMTP_PORT + value: "1025" + - name: SMTP_TYPE + value: "plain" - name: SMTP_USER_NAME - value: $SMTP_USER_NAME + value: "admin" + - name: SMTP_STARTTLS + value: "false" - name: SMTP_PASSWORD value: $SMTP_PASSWORD - - name: SMTP_ADDRESS - value: smtp.mailtrap.io - - name: SMTP_DOMAIN - value: smtp.mailtrap.io - - name: SMTP_PORT - value: "2525" - - name: SMTP_TYPE - value: cram_md5 - name: SOLR_ADMIN_USER value: admin - name: SOLR_ADMIN_PASSWORD diff --git a/ops/staging-deploy.tmpl.yaml b/ops/staging-deploy.tmpl.yaml index 8c506abe8..02b405402 100644 --- a/ops/staging-deploy.tmpl.yaml +++ b/ops/staging-deploy.tmpl.yaml @@ -143,20 +143,22 @@ extraEnvVars: &envVars value: password - name: NEGATIVE_CAPTCHA_SECRET value: $NEGATIVE_CAPTCHA_SECRET + - name: SMTP_ADDRESS + value: "maildev-smtp.maildev.svc.cluster.local" + - name: SMTP_DOMAIN + value: "maildev-smtp.maildev.svc.cluster.local" - name: SMTP_ENABLED value: "true" + - name: SMTP_PORT + value: "1025" + - name: SMTP_TYPE + value: "plain" - name: SMTP_USER_NAME - value: $SMTP_USER_NAME + value: "admin" + - name: SMTP_STARTTLS + value: "false" - name: SMTP_PASSWORD value: $SMTP_PASSWORD - - name: SMTP_ADDRESS - value: smtp.mailtrap.io - - name: SMTP_DOMAIN - value: smtp.mailtrap.io - - name: SMTP_PORT - value: "2525" - - name: SMTP_TYPE - value: cram_md5 - name: SOLR_ADMIN_USER value: admin - name: SOLR_ADMIN_PASSWORD