From 40836bb2a0d4d9462d746c78d5084e1c9379bae9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 18 Jul 2019 00:21:11 +0100 Subject: [PATCH] Run the rails message delivery script in production mode --- cookbooks/exim/templates/default/exim4.conf.erb | 3 +++ roles/web-frontend.rb | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cookbooks/exim/templates/default/exim4.conf.erb b/cookbooks/exim/templates/default/exim4.conf.erb index 7e89a1e93..0a4f1d04f 100644 --- a/cookbooks/exim/templates/default/exim4.conf.erb +++ b/cookbooks/exim/templates/default/exim4.conf.erb @@ -732,6 +732,9 @@ noreply: command = <%= details[:command] %> home_directory = <%= details[:home_directory] %> path = <%= details[:path] || "/bin:/usr/bin" %> +<% if details[:environment] -%> + environment = <%= details[:environment].map { |k,v| "#{k}=#{v}" }.join(":") %> +<% end -%> return_fail_output <% else -%> driver = appendfile diff --git a/roles/web-frontend.rb b/roles/web-frontend.rb index 741a40b90..0435872dd 100644 --- a/roles/web-frontend.rb +++ b/roles/web-frontend.rb @@ -37,7 +37,10 @@ default_attributes( :user => "rails", :group => "rails", :home_directory => "/srv/www.openstreetmap.org/rails", - :path => "/bin:/usr/bin:/usr/local/bin" + :path => "/bin:/usr/bin:/usr/local/bin", + :environment => { + "RAILS_ENV" => "production" + } } } } -- 2.39.5