Configure Google OAuth support`
authorTom Hughes <tom@compton.nu>
Tue, 14 Apr 2015 18:03:46 +0000 (19:03 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 14 Apr 2015 18:03:46 +0000 (19:03 +0100)
cookbooks/web/definitions/rails_port.rb
cookbooks/web/recipes/rails.rb

index 616f4dd..cfa78a2 100644 (file)
@@ -204,6 +204,12 @@ define :rails_port, :action => [:create, :enable] do
       line.gsub!(/^( *)nominatim_url:.*$/, "\\1nominatim_url: \"#{params[:nominatim_url]}\"")
     end
 
+    if params[:google_auth_id]
+      line.gsub!(/^( *)#google_auth_id:.*$/, "\\1google_auth_id: \"#{params[:google_auth_id]}\"")
+      line.gsub!(/^( *)#google_auth_secret:.*$/, "\\1google_auth_secret: \"#{params[:google_auth_secret]}\"")
+      line.gsub!(/^( *)#google_openid_realm:.*$/, "\\1google_openid_realm: \"#{params[:google_openid_realm]}\"")
+    end
+
     line.gsub!(/^( *)require_terms_seen:.*$/, "\\1require_terms_seen: true")
     line.gsub!(/^( *)require_terms_agreed:.*$/, "\\1require_terms_agreed: true")
 
index 98b515d..9b0c549 100644 (file)
@@ -65,6 +65,9 @@ rails_port "www.openstreetmap.org" do
   id_key web_passwords["id_key"]
   oauth_key web_passwords["oauth_key"]
   piwik_configuration piwik_configuration
+  google_auth_id "651529786092-6c5ahcu0tpp95emiec8uibg11asmk34t.apps.googleusercontent.com"
+  google_auth_secret web_passwords["google_auth_secret"]
+  google_openid_realm "https://www.openstreetmap.org"
 end
 
 gem_package "apachelogregex"