node[:taginfo][:sites].each do |site|
name = site[:name]
directory = site[:directory] || "/srv/#{name}"
+ description = site[:description]
+ icon = site[:icon]
+ contact = site[:contact]
directory directory do
owner "taginfo"
end
settings = edit_file "#{directory}/taginfo/taginfo-config-example.json" do |line|
+ line.gsub!(/^( *)"url": ".*",/, "\\1\"url\": \"http://#{name}/\",")
+ line.gsub!(/^( *)"description": ".*Change this text.*,/, "\\1\"description\": \"#{description}\",")
+ line.gsub!(/^( *)"icon": ".*",/, "\\1\"icon\": \"/img/logo/#{icon}.png\",")
+ line.gsub!(/^( *)"contact": "Anonymous",/, "\\1\"contact\": \"#{contact}\",")
+ line.gsub!(/^( *)"shortname": ".*",/, "\\1\"shortname\": \"Taginfo\",")
+ line.gsub!(/^( *)"contact": "somebody@example.com",/, "\\1\"contact\": \"webmaster@openstreetmap.org\",")
line.gsub!(/^( *)"cxxflags": ".*",/, "\\1\"cxxflags\": \"-I../../osmium/include\",")
line
},
:taginfo => {
:sites => [
- { :name => "taginfo.openstreetmap.org" }
+ {
+ :name => "taginfo.openstreetmap.org",
+ :description => "This is the main taginfo site. It contains OSM data for the whole planet and is updated daily.",
+ :icon => "world",
+ :contact => "Jochen Topf <jochen@remote.org>"
+ }
]
}
)