Run the rails message delivery script in production mode
authorTom Hughes <tom@compton.nu>
Wed, 17 Jul 2019 23:21:11 +0000 (00:21 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 17 Jul 2019 23:23:13 +0000 (00:23 +0100)
cookbooks/exim/templates/default/exim4.conf.erb
roles/web-frontend.rb

index 7e89a1e..0a4f1d0 100644 (file)
@@ -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
index 741a40b..0435872 100644 (file)
@@ -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"
+        }
       }
     }
   }