diff --git a/Procfile b/Procfile index 54e13c77f06..4d752a6c18c 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ web: bundle exec rails server -p $PORT -sidekiq: bundle exec sidekiq -e $RAILS_ENV \ No newline at end of file +worker: bundle exec sidekiq -e $RAILS_ENV \ No newline at end of file diff --git a/config/environments/production.rb.sample b/config/environments/production.rb.sample index c12b534dd2a..ef934d5e72c 100644 --- a/config/environments/production.rb.sample +++ b/config/environments/production.rb.sample @@ -40,8 +40,27 @@ Discourse::Application.configure do # :authentication => 'plain', # :enable_starttls_auto => true } - config.action_mailer.delivery_method = :sendmail - config.action_mailer.sendmail_settings = {arguments: '-i'} + if ENV.key?('SMTP_URL') + config.action_mailer.smtp_settings = begin + uri = URI.parse(ENV['SMTP_URL']) + params = { + :address => uri.host, + :port => uri.port, + :domain => (uri.path || "").split("/")[1], + :user_name => uri.user, + :password => uri.password, + :authentication => 'plain', + :enable_starttls_auto => true + } + CGI.parse(uri.query || "").each {|k,v| params[k.to_sym] = v.first} + params + rescue + raise "Invalid SMTP_URL" + end + else + config.action_mailer.delivery_method = :sendmail + config.action_mailer.sendmail_settings = {arguments: '-i'} + end # Send deprecation notices to registered listeners config.active_support.deprecation = :notify diff --git a/packaging/debian/setup.sh b/packaging/debian/setup.sh new file mode 100755 index 00000000000..72afe2d6c08 --- /dev/null +++ b/packaging/debian/setup.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# This script installs the required example config files before buildpack compilation. + +set -ex + +cp config/database.yml.production-sample config/database.yml +cp config/redis.yml.sample config/redis.yml +cp config/environments/production.rb.sample config/environments/production.rb