From 962ee1a4d5b25fe9988d74e5ea308b5d96565848 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Thu, 23 Dec 2021 03:59:46 -0500 Subject: [PATCH] Fine adjustments from lots of testing. Former-commit-id: cd98441fd45b8d14b3b757bdc21cbd64347acd4a --- .gitignore | 1 - config/app_config.yml | 20 ++++++++++++++++++++ config/environments/production.rb | 1 + docker-compose.yml | 3 ++- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 config/app_config.yml diff --git a/.gitignore b/.gitignore index afa6f76..5ec5467 100644 --- a/.gitignore +++ b/.gitignore @@ -81,4 +81,3 @@ brakeman.html /config/settings/local.rb /nbproject/private/ /config/database.yml -/config/app_config.yml diff --git a/config/app_config.yml b/config/app_config.yml new file mode 100644 index 0000000..ec9d718 --- /dev/null +++ b/config/app_config.yml @@ -0,0 +1,20 @@ +default: &default + smtp_address: ENV['SMTP_ADDRESS'] + smtp_domain: ENV['SMTP_DOMAIN'] + smtp_port: ENV['SMTP_PORT'] + smtp_user_name: ENV['SMTP_USER_NAME'] + smtp_password: ENV['SMTP_PASSWORD'] + smtp_ssl: ENV['SMTP_SSL'] + default_url: ENV['DEFAULT_URL'] + +development: + <<: *default + +test: + <<: *default + +preview: + <<: *default + +production: + <<: *default diff --git a/config/environments/production.rb b/config/environments/production.rb index ad7945d..39e1646 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -84,6 +84,7 @@ BikeBike::Application.configure do address: config.app_config['smtp_address'], domain: config.app_config['smtp_domain'], port: config.app_config['smtp_port'], + ssl: config.app_config['smtp_ssl'], authentication: :plain, enable_starttls_auto: true, openssl_verify_mode: 'none', diff --git a/docker-compose.yml b/docker-compose.yml index 3324091..719de41 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,13 +50,14 @@ services: # Add your own environment values in .env, or use the default ones environment: - PORT=3000 + - RAILS_ENV=${RAILS_ENV:-production} - DATABASE_URL=${DATABASE_URL:-postgresql://bike_bike:password@db/bike_bike?encoding=unicode&pool=5} - - RAILS_ENV=${RAILS_ENV:-production rails assets:precompile.log} - SMTP_ADDRESS=${SMTP_ADDRESS:-fake-smtp.bikebike.org} - SMTP_DOMAIN=${SMTP_DOMAIN:-bikebike.org} - SMTP_PORT=${SMTP_PORT:-587} - SMTP_USER_NAME=${SMTP_USER_NAME:-info@bikebike.org} - SMTP_PASSWORD=${SMTP_PASSWORD:-fake} + - SMTP_SSL=${SMTP_SSL:-false} - DEFAULT_URL=${DEFAULT_URL:-bikebike.org} volumes: - bikebikebike:/app/BikeBike