]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/recipes/rails.rb
Allow writes to CRM temporary files
[chef.git] / cookbooks / web / recipes / rails.rb
index 4cc91d2b44da24b1ce28b013990f7c2ecf5e9d54..b28e19ba7f260d2c762c20bea3ae7fa915f27540 100644 (file)
@@ -147,22 +147,21 @@ rails_port "www.openstreetmap.org" do
   avatar_storage_url "https://openstreetmap-user-avatars.s3.dualstack.eu-west-1.amazonaws.com"
   trace_image_storage_url "https://openstreetmap-gps-images.s3.dualstack.eu-west-1.amazonaws.com"
   overpass_url "https://query.openstreetmap.org/query-features"
+  overpass_credentials true
 end
 
 systemd_service "rails-jobs@" do
   description "Rails job queue runner"
   type "simple"
-  environment "RAILS_ENV" => "production", "QUEUE" => "%I"
+  environment "RAILS_ENV" => "production", "QUEUE" => "%I", "SLEEP_DELAY" => "60"
   user "rails"
   working_directory rails_directory
   exec_start "#{node[:ruby][:bundle]} exec rails jobs:work"
   restart "on-failure"
   nice 10
-  private_tmp true
-  private_devices true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox :enable_network => true
+  memory_deny_write_execute false
+  read_write_paths "/var/log/web"
 end
 
 package "libjson-xs-perl"
@@ -195,12 +194,11 @@ systemd_service "api-statistics" do
   group "adm"
   exec_start "/usr/local/bin/api-statistics"
   nice 10
-  private_tmp true
-  private_devices true
-  private_network true
-  protect_system "full"
-  protect_home true
-  no_new_privileges true
+  sandbox true
+  read_write_paths [
+    "/srv/www.openstreetmap.org/rails/tmp",
+    "/var/lib/prometheus/node-exporter"
+  ]
   restart "on-failure"
 end