]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/recipes/cgimap.rb
Don't run cgimap in readonly mode when the database is writable
[chef.git] / cookbooks / web / recipes / cgimap.rb
index e8f8171199eb0569700f331ecf96f280ea74e9f6..61d1162b1cab711bade231cd874a0b0198eb2bd1 100644 (file)
@@ -28,7 +28,7 @@ end
 
 if node[:web][:readonly_database_host]
   database_host = node[:web][:readonly_database_host]
-  database_readonly = true
+  database_readonly = node[:web][:readonly_database_host] != node[:web][:database_host]
 else
   database_host = node[:web][:database_host]
   database_readonly = node[:web][:status] == "database_readonly"
@@ -43,8 +43,8 @@ systemd_service "cgimap" do
   type "forking"
   environment_file "CGIMAP_HOST" => database_host,
                    "CGIMAP_DBNAME" => "openstreetmap",
-                   "CGIMAP_USERNAME" => "rails",
-                   "CGIMAP_PASSWORD" => db_passwords["rails"],
+                   "CGIMAP_USERNAME" => "cgimap",
+                   "CGIMAP_PASSWORD" => db_passwords["cgimap"],
                    "CGIMAP_OAUTH_HOST" => node[:web][:database_host],
                    "CGIMAP_PIDFILE" => "#{node[:web][:pid_directory]}/cgimap.pid",
                    "CGIMAP_LOGFILE" => "#{node[:web][:log_directory]}/cgimap.log",